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