index.html.erb 3.36 KB
Newer Older
1
<h2><%= @author.nil? ? l(:label_activity) : l(:label_user_activity, link_to_user(@author)).html_safe %></h2>
2
<p class="subtitle"><%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %></p>
3

4
<div id="activity">
5 6
<% @events_by_day.keys.sort.reverse.each do |day| %>
<h3><%= format_activity_day(day) %></h3>
7
<dl>
8 9
<% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
  <dt class="<%= e.event_type %> <%= "grouped" if in_group %> <%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>">
10
  <%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %>
11
  <span class="time"><%= format_time(e.event_datetime, false) %></span>
jplang's avatar
jplang committed
12
  <%= content_tag('span', e.project, :class => 'project') if @project.nil? || @project != e.project %>
13 14 15
  <%= link_to format_activity_title(e.event_title), e.event_url %>
  </dt>
  <dd class="<%= "grouped" if in_group %>"><span class="description"><%= format_activity_description(e.event_description) %></span>
16
  <span class="author"><%= link_to_user(e.event_author) if e.respond_to?(:event_author) %></span></dd>
17 18 19 20
<% end -%>
</dl>
<% end -%>
</div>
jplang's avatar
jplang committed
21

22
<%= content_tag('p', l(:label_no_data), :class => 'nodata') if @events_by_day.empty? %>
23

24 25
<span class="pagination">
  <ul class="pages">
26
    <li class="previous page">
jplang's avatar
jplang committed
27
<%= link_to("\xc2\xab " + l(:label_previous),
jplang's avatar
jplang committed
28
                   {:params => request.query_parameters.merge(:from => @date_to - @days - 1)},
29 30
                   :title => l(:label_date_from_to, :start => format_date(@date_to - 2*@days), :end => format_date(@date_to - @days - 1)),
                   :accesskey => accesskey(:previous)) %>
31
    </li><% unless @date_to >= User.current.today %><li class="next page">
jplang's avatar
jplang committed
32
<%= link_to(l(:label_next) + " \xc2\xbb",
jplang's avatar
jplang committed
33
                   {:params => request.query_parameters.merge(:from => @date_to + @days - 1)},
34
                   :title => l(:label_date_from_to, :start => format_date(@date_to), :end => format_date(@date_to + @days - 1)),
35
                   :accesskey => accesskey(:next)) %><% end %>
36 37 38
    </li>
  </ul>
</span>
39
&nbsp;
40
<% other_formats_links do |f| %>
jplang's avatar
jplang committed
41
  <%= f.link_to_with_query_parameters 'Atom', 'from' => nil, :key => User.current.rss_key %>
42
<% end %>
jplang's avatar
jplang committed
43 44

<% content_for :header_tags do %>
45
<%= auto_discovery_link_tag(:atom, params.merge(:format => 'atom', :from => nil, :key => User.current.rss_key)) %>
jplang's avatar
jplang committed
46
<% end %>
jplang's avatar
jplang committed
47 48

<% content_for :sidebar do %>
jplang's avatar
jplang committed
49
<%= form_tag({}, :method => :get) do %>
jplang's avatar
jplang committed
50
<h3><%= l(:label_activity) %></h3>
51 52 53 54 55 56 57 58 59 60 61
<ul>
<% @activity.event_types.each do |t| %>
  <li>
    <%= check_box_tag "show_#{t}", 1, @activity.scope.include?(t) %>
    <label for="show_<%=t%>">
      <%= link_to(l("label_#{t.singularize}_plural"),
                  {"show_#{t}" => 1, :user_id => params[:user_id], :from => params[:from]})%>
    </label>
  </li>
<% end %>
</ul>
62
<% if @project && @project.descendants.active.any? %>
jplang's avatar
jplang committed
63
    <%= hidden_field_tag 'with_subprojects', 0, :id => nil %>
jplang's avatar
jplang committed
64 65
    <p><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label></p>
<% end %>
66
<%= hidden_field_tag('user_id', params[:user_id]) unless params[:user_id].blank? %>
67
<%= hidden_field_tag('from', params[:from]) unless params[:from].blank? %>
68
<p><%= submit_tag l(:button_apply), :class => 'button-small', :name => 'submit' %></p>
jplang's avatar
jplang committed
69 70
<% end %>
<% end %>
71

72
<% html_title(l(:label_activity), @author) -%>