Mercurial > hg > soundsoftware-site
changeset 694:f098cfb33721 feature_36
Feature #296 - now lists the visible user's publications on its user page.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Fri, 16 Sep 2011 18:36:18 +0100 |
parents | 5163e3ec00b8 |
children | 1710ec37bb6a 614b2d1580d0 |
files | vendor/plugins/redmine_bibliography/app/views/users/show.rhtml vendor/plugins/redmine_bibliography/config/locales/en.yml |
diffstat | 2 files changed, 106 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/plugins/redmine_bibliography/app/views/users/show.rhtml Fri Sep 16 18:36:18 2011 +0100 @@ -0,0 +1,104 @@ +<%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %> + +<div class="contextual"> +<%= link_to(l(:button_edit), edit_user_path(@user), :class => 'icon icon-edit') if User.current.admin? %> +</div> + +<h2><%= avatar @user, :size => "50" %> <%=h @user.name %></h2> + +<div class="splitcontentleft"> +<ul> + <% unless @user.pref.hide_mail %> + <li><%=l(:field_mail)%>: <%= mail_to(h(@user.mail), nil, :encode => 'javascript') %></li> + <% end %> + <% @user.visible_custom_field_values.each do |custom_value| %> + <% if !custom_value.value.blank? %> + <li><%=h custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> + <% end %> + <% end %> + <li><%=l(:label_registered_on)%>: <%= format_date(@user.created_on) %></li> + <% unless @user.last_login_on.nil? %> + <li><%=l(:field_last_login_on)%>: <%= format_date(@user.last_login_on) %></li> + <% end %> +</ul> + +<h3><%=l(:label_ssamr_description)%></h3> +<%= textilizable @description %> + +<h3><%=l(:label_ssamr_institution)%></h3> +<p><%= h @institution_name %></p> + + +<% unless @memberships.empty? %> +<h3><%=l(:label_project_plural)%></h3> +<ul> +<% for membership in @memberships %> + <li><%= link_to_project(membership.project) %> + (<%=h membership.roles.sort.collect(&:to_s).join(', ') %>, <%= format_date(membership.created_on) %>)</li> +<% end %> +</ul> +<% end %> +<%= call_hook :view_account_left_bottom, :user => @user %> +</div> + +<div class="splitcontentright"> + + <div id="bibliography"> + <% @publications = Publication.all(:include => :authors, :conditions => "authors.id = #{@user.author.id}") %> + + <h3><%=l(:publications) %> <%= "(" + @publications.count.to_s + ")" %> </h3> + + <% @publications.each do |publication|%> + <dt> + <%= link_to publication.title, :controller => 'publications', :action => 'show', :id => publication %> + </dt> + + <dd> + <span class="authors"> + <%= publication.authorships.map { |a| h a.name_on_paper }.join(', ') %> + </span> + <% if publication.bibtex_entry.year.to_s != "" %> + <span class="year"> + <%= publication.bibtex_entry.year %> + </span> + <% end %> + </dd> + <% end %> + </div> + + + +<% unless @events_by_day.empty? %> +<h3><%= link_to l(:label_activity), :controller => 'activities', :action => 'index', :id => nil, :user_id => @user, :from => @events_by_day.keys.first %></h3> + +<p> +<%=l(:label_reported_issues)%>: <%= Issue.count(:conditions => ["author_id=?", @user.id]) %> +</p> + +<div id="activity"> +<% @events_by_day.keys.sort.reverse.each do |day| %> +<h4><%= format_activity_day(day) %></h4> +<dl> +<% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%> + <dt class="<%= e.event_type %>"> + <span class="time"><%= format_time(e.event_datetime, false) %></span> + <%= content_tag('span', h(e.project), :class => 'project') %> + <%= link_to format_activity_title(e.event_title), e.event_url %></dt> + <dd><span class="description"><%= format_activity_description(e.event_description) %></span></dd> +<% end -%> +</dl> +<% end -%> +</div> + +<% other_formats_links do |f| %> + <%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => nil, :user_id => @user, :key => User.current.rss_key} %> +<% end %> + +<% content_for :header_tags do %> + <%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'index', :user_id => @user, :format => :atom, :key => User.current.rss_key) %> +<% end %> +<% end %> +<%= call_hook :view_account_right_bottom, :user => @user %> +</div> + +<% html_title @user.name %>
--- a/vendor/plugins/redmine_bibliography/config/locales/en.yml Fri Sep 16 17:52:00 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/config/locales/en.yml Fri Sep 16 18:36:18 2011 +0100 @@ -11,6 +11,8 @@ publications_box: "My Publications" label_my_publications_box: "My Publications" view_all_publications: "View All Project's Publications" + publications: Publications + identify_author_question: Is the right person selected above? identify_author_yes: "Yes"