luis@1080
|
1 <h2><%=
|
luis@1080
|
2 if @author.nil?
|
luis@1080
|
3 if @institution_name.blank?
|
luis@1080
|
4 l(:label_activity)
|
luis@1080
|
5 else
|
luis@1080
|
6 l(:label_institution_activity, h(@institution_name))
|
luis@1080
|
7 end
|
luis@1080
|
8 else
|
luis@1385
|
9 l(:label_user_activity, link_to_user(@author)).html_safe
|
luis@1080
|
10 end
|
luis@1080
|
11 %></h2>
|
luis@1080
|
12 <p class="subtitle"><%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %></p>
|
luis@1080
|
13
|
luis@1080
|
14 <div id="activity">
|
luis@1080
|
15 <% @events_by_day.keys.sort.reverse.each do |day| %>
|
luis@1080
|
16 <h3><%= format_activity_day(day) %></h3>
|
luis@1080
|
17 <dl>
|
Chris@1486
|
18 <% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
|
luis@1080
|
19 <%- if e.class != Publication -%>
|
Chris@1486
|
20 <dt class="<%= e.event_type %> <%= "grouped" if in_group %> <%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>">
|
luis@1080
|
21 <%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %>
|
luis@1080
|
22 <span class="time"><%= format_time(e.event_datetime, false) %></span>
|
luis@1080
|
23 <%= content_tag('span', h(e.project), :class => 'project') if @project.nil? || @project != e.project %>
|
luis@1080
|
24 <%= link_to format_activity_title(e.event_title), e.event_url %>
|
luis@1080
|
25 </dt>
|
Chris@1486
|
26 <dd class="<%= "grouped" if in_group %>">
|
luis@1080
|
27 <span class="description"><%= format_activity_description(e.event_description) %></span>
|
luis@1080
|
28 <span class="author"><%= link_to_user(e.event_author) if e.respond_to?(:event_author) %></span>
|
luis@1080
|
29 </dd>
|
luis@1080
|
30 <%- else -%>
|
luis@1080
|
31 <dt class="<%= e.event_type %> <%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>">
|
luis@1080
|
32 <%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %>
|
luis@1080
|
33 <span class="time"><%= format_time(e.event_datetime, false) %></span>
|
luis@1080
|
34 <%= link_to format_activity_title(e.event_title), e.event_url %>
|
luis@1080
|
35 was added to the following
|
luis@1080
|
36 <% if e.projects.count > 1 %>
|
luis@1080
|
37 projects:
|
luis@1080
|
38 <%- else -%>
|
luis@1080
|
39 project:
|
luis@1080
|
40 <%- end -%>
|
luis@1080
|
41 <%= content_tag('span', e.projects.join(', ')) -%>
|
luis@1080
|
42 </dt>
|
luis@1080
|
43 <dd>
|
luis@1080
|
44 <span class="description"><%= e.event_description -%></span>
|
luis@1080
|
45 <span class="author"><%= link_to_user(e.event_author) if e.respond_to?(:event_author) %></span>
|
luis@1080
|
46 </dd>
|
luis@1080
|
47 <% end -%>
|
luis@1080
|
48 <%- end -%>
|
luis@1080
|
49 </dl>
|
luis@1080
|
50 <% end -%>
|
luis@1080
|
51 </div>
|
luis@1080
|
52
|
luis@1080
|
53 <%= content_tag('p', l(:label_no_data), :class => 'nodata') if @events_by_day.empty? %>
|
luis@1080
|
54
|
luis@1080
|
55 <div style="float:left;">
|
luis@1080
|
56 <%= link_to_content_update("\xc2\xab " + l(:label_previous),
|
luis@1080
|
57 params.merge(:from => @date_to - @days - 1),
|
luis@1080
|
58 :title => l(:label_date_from_to, :start => format_date(@date_to - 2*@days), :end => format_date(@date_to - @days - 1))) %>
|
luis@1080
|
59 </div>
|
luis@1080
|
60 <div style="float:right;">
|
luis@1080
|
61 <%= link_to_content_update(l(:label_next) + " \xc2\xbb",
|
luis@1080
|
62 params.merge(:from => @date_to + @days - 1),
|
luis@1080
|
63 :title => l(:label_date_from_to, :start => format_date(@date_to), :end => format_date(@date_to + @days - 1))) unless @date_to >= Date.today %>
|
luis@1080
|
64 </div>
|
luis@1080
|
65
|
luis@1080
|
66 <% other_formats_links do |f| %>
|
luis@1080
|
67 <%= f.link_to 'Atom', :url => params.merge(:from => nil, :key => User.current.rss_key) %>
|
luis@1080
|
68 <% end %>
|
luis@1080
|
69
|
luis@1080
|
70 <% content_for :header_tags do %>
|
luis@1080
|
71 <%= auto_discovery_link_tag(:atom, params.merge(:format => 'atom', :from => nil, :key => User.current.rss_key)) %>
|
luis@1080
|
72 <% end %>
|
luis@1080
|
73
|
luis@1080
|
74 <% content_for :sidebar do %>
|
luis@1080
|
75 <% form_tag({}, :method => :get) do %>
|
luis@1080
|
76 <h3><%= l(:label_activity) %></h3>
|
Chris@1486
|
77
|
Chris@1486
|
78 <ul>
|
Chris@1486
|
79 <% @activity.event_types.each do |t| %>
|
Chris@1486
|
80 <li>
|
Chris@1486
|
81 <%= check_box_tag "show_#{t}", 1, @activity.scope.include?(t) %>
|
Chris@1486
|
82 <label for="show_<%=t%>">
|
Chris@1486
|
83 <%= link_to(l("label_#{t.singularize}_plural"),
|
Chris@1486
|
84 {"show_#{t}" => 1, :user_id => params[:user_id], :from => params[:from]})%>
|
Chris@1486
|
85 </label>
|
Chris@1486
|
86 </li>
|
Chris@1486
|
87 <% end %>
|
Chris@1486
|
88 </ul>
|
Chris@1486
|
89
|
luis@1080
|
90 <% if @project && @project.descendants.active.any? %>
|
luis@1080
|
91 <%= hidden_field_tag 'with_subprojects', 0 %>
|
luis@1080
|
92 <p><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label></p>
|
luis@1080
|
93 <% end %>
|
luis@1080
|
94 <%= hidden_field_tag('user_id', params[:user_id]) unless params[:user_id].blank? %>
|
luis@1080
|
95 <p><%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %></p>
|
luis@1080
|
96 <% end %>
|
luis@1080
|
97 <% end %>
|
luis@1080
|
98
|
luis@1080
|
99 <% html_title(l(:label_activity), @author) -%>
|