Mercurial > hg > soundsoftware-site
changeset 1167:54a92921cf09 cannam
Merge from live branch
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Mon, 21 Jan 2013 14:18:00 +0000 |
parents | eb0175fc12ba (diff) 579587187b77 (current diff) |
children | 4d1a31b30987 |
files | |
diffstat | 11 files changed, 237 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/app/controllers/my_controller.rb Wed Jan 09 17:40:37 2013 +0000 +++ b/app/controllers/my_controller.rb Mon Jan 21 14:18:00 2013 +0000 @@ -21,6 +21,7 @@ helper :issues helper :users helper :custom_fields + helper :projects BLOCKS = { 'issuesassignedtome' => :label_assigned_to_me_issues, 'issuesreportedbyme' => :label_reported_issues, @@ -30,11 +31,12 @@ 'tipoftheday' => :label_tipoftheday, 'calendar' => :label_calendar, 'documents' => :label_document_plural, - 'timelog' => :label_spent_time + 'timelog' => :label_spent_time, + 'myprojects' => :label_my_projects }.merge(Redmine::Views::MyPage::Block.additional_blocks).freeze - DEFAULT_LAYOUT = { 'left' => ['tipoftheday', 'activitymyprojects'], - 'right' => ['issueswatched'] + DEFAULT_LAYOUT = { 'left' => ['myprojects', 'activitymyprojects'], + 'right' => ['tipoftheday', 'issueswatched'] }.freeze verify :xhr => true,
--- a/app/views/activities/_busy.html.erb Wed Jan 09 17:40:37 2013 +0000 +++ b/app/views/activities/_busy.html.erb Mon Jan 21 14:18:00 2013 +0000 @@ -1,7 +1,7 @@ <% events = @events_by_day %> <% if (events.nil?) activity = Redmine::Activity::Fetcher.new(User.anonymous) - events = activity.events(Date.today - 14, Date.today + 1) + events = activity.events(Date.today - 140, Date.today + 1) end %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/views/my/blocks/_myprojects.html.erb Mon Jan 21 14:18:00 2013 +0000 @@ -0,0 +1,16 @@ +<% @user_projects = User.current.projects.all(:order => :name) %> + +<% if @user_projects.empty? %> +<h3><%=l(:label_my_projects)%></h3> +<div class="box"> + <p><%= l(:label_have_no_projects)%> <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}) if User.current.allowed_to?(:add_project, nil, :global => true) %></p> +</div> +<% else %> +<h3><%=l(:label_my_projects)%> (<%= @user_projects.count %>)</h3> +<div class="box"> +<%= + render :partial => 'projects/my', :locals => { :user => User.current } + %> +</div> +<% end %> +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/views/projects/_my.html.erb Mon Jan 21 14:18:00 2013 +0000 @@ -0,0 +1,1 @@ +<%= render_my_project_hierarchy(@user_projects) %>
--- a/config/locales/en.yml Wed Jan 09 17:40:37 2013 +0000 +++ b/config/locales/en.yml Mon Jan 21 14:18:00 2013 +0000 @@ -485,6 +485,7 @@ label_project_plural: Projects label_my_project_plural: My Projects label_other_project_plural: Other Projects + label_have_no_projects: Not a member of any projects. label_x_projects: zero: no projects one: 1 project
--- a/public/stylesheets/application.css Wed Jan 09 17:40:37 2013 +0000 +++ b/public/stylesheets/application.css Mon Jan 21 14:18:00 2013 +0000 @@ -414,10 +414,10 @@ ul.projects { margin: 0; padding-left: 1em; } ul.projects.root { margin: 0; padding: 0; } -ul.projects ul.projects { border-left: 3px solid #e0e0e0; } +/*ul.projects ul.projects { border-left: 3px solid #e0e0e0; } */ ul.projects li.root { list-style-type:none; margin-bottom: 1em; } -ul.projects li.child { list-style-type:none; margin-top: 1em;} -ul.projects div.root a.project { font-weight: bold; font-size: 16px; margin: 0 0 10px 0; } +ul.projects li.child { list-style-type:none; } +ul.projects div.root a.project { font-weight: bold; } li.latest { margin-bottom: 0.5em; }
--- a/public/themes/soundsoftware/stylesheets/application.css Wed Jan 09 17:40:37 2013 +0000 +++ b/public/themes/soundsoftware/stylesheets/application.css Mon Jan 21 14:18:00 2013 +0000 @@ -96,7 +96,7 @@ table.projects .level2 .firstcol { padding-left: 2em; } table.projects .level3 .firstcol { padding-left: 3em; } -ul.projects .public, ul.projects .private { padding-left: 0.5em; color: #3e442c; font-size: 0.95em } +ul.projects .public, ul.projects .private { padding-left: 0.5em; color: #3e442c; font-size: 0.9em } table.files tr.active td { padding-top: 0.5em; padding-bottom: 0.5em; } table.files .file .active { font-weight: bold; }
--- a/vendor/plugins/redmine_bibliography/app/models/publication.rb Wed Jan 09 17:40:37 2013 +0000 +++ b/vendor/plugins/redmine_bibliography/app/models/publication.rb Mon Jan 21 14:18:00 2013 +0000 @@ -19,6 +19,25 @@ before_save :set_initial_author_order + named_scope :visible, lambda {|*args| { :include => :projects, + :conditions => Project.allowed_to_condition(args.shift || User.current, :view_publication, *args) } } + + acts_as_activity_provider :type => 'publication', + :timestamp => "#{Publication.table_name}.created_at", + :find_options => { + :include => :projects, + :conditions => "#{Project.table_name}.id = projects_publications.project_id" + } + + acts_as_event :title => Proc.new {|o| o.title }, + :datetime => :created_at, + :type => 'publications', + :author => nil, + #todo - need too move the cache from the helper to the model + :description => Proc.new {|o| o.print_entry(:ieee)}, + :url => Proc.new {|o| {:controller => 'publications', :action => 'show', :id => o.id }} + + # Ensure error message uses proper text instead of # bibtex_entry.entry_type (#268). There has to be a better way to # do this!
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/plugins/redmine_bibliography/app/views/activities/_recent.html.erb Mon Jan 21 14:18:00 2013 +0000 @@ -0,0 +1,92 @@ +<% events = @events_by_day %> +<% max = 5 %> +<% if (events.nil?) + activity = Redmine::Activity::Fetcher.new(User.current, :project => @project) + + if @project + # Don't show news (duplicated with News box) or wiki edits (too + # tedious) in project front page + activity.scope = [ "changesets", "files", "issues", "documents" ] + end + + events = activity.events(Date.today - 28, Date.today + 1) + + if defined? user + events = events.select { |e| + + if e.class != Publication + user.member_of? e.project + else + e.projects.map {|p| user.member_of? p } + end + } + + end + + events = events.first(max) + + end +%> + +<div id="activity"> + +<% if @project.nil? %> + <%= content_tag('h3', l(:label_activity_my_recent)) %> + <div class="activity box"> +<% end %> + +<% if events.empty? %> + + <% if @project.nil? %> + <p><%= l(:label_activity_my_recent_none) %></p> + <% end %> + +<% else %> + + <% if !@project.nil? %> + <div class="activity box"> + <%= content_tag('h3', l(:label_activity_recent)) %> + <% end %> + + <dl> + <% events.sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%> + <%- if e.class != Publication -%> + <dt class="<%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>"> + <%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %> + <span class="time"><%= format_time(e.event_datetime) %></span> + <%= content_tag('span', link_to_project(e.project), :class => 'project') if @project.nil? || @project != e.project %> + <% if e.respond_to?(:event_author) %> + <span class="author"><%= e.event_author %></span> + <% end %> + </dt> + <dd><%= link_to format_activity_title(e.event_title), e.event_url %> + <span class="description"><%= format_activity_description(e.event_description) %></span> + </dd> + <% else -%> + <dt class="<%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>"> + <span class="time"><%= format_time(e.event_datetime) %></span> + <%= link_to format_activity_title(e.event_title), e.event_url %> + was added to the following + <% if e.projects.count > 1 %> + projects: + <%- else -%> + project: + <%- end -%> + <%= content_tag('span', e.projects.join(', ')) -%> <% if e.respond_to?(:event_author) %> + <span class="author"><%= e.event_author %></span> + <% end %> + </dt> + <dd><%= link_to format_activity_title(e.event_title), e.event_url %> + <span class="description"><%= format_activity_description(e.event_description) %></span> + </dd> + <% end -%> + <% end -%> + </dl> + + </div> + +<% end %> + +<% if events.empty? and @project.nil? %></div><% end %> + +</div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/plugins/redmine_bibliography/app/views/activities/index.html.erb Mon Jan 21 14:18:00 2013 +0000 @@ -0,0 +1,91 @@ +<h2><%= + if @author.nil? + if @institution_name.blank? + l(:label_activity) + else + l(:label_institution_activity, h(@institution_name)) + end + else + l(:label_user_activity, link_to_user(@author)) + end + %></h2> +<p class="subtitle"><%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %></p> + +<div id="activity"> +<% @events_by_day.keys.sort.reverse.each do |day| %> +<h3><%= format_activity_day(day) %></h3> +<dl> +<% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%> + <%- if e.class != Publication -%> + <dt class="<%= e.event_type %> <%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>"> + <%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %> + <span class="time"><%= format_time(e.event_datetime, false) %></span> + <%= content_tag('span', h(e.project), :class => 'project') if @project.nil? || @project != e.project %> + <%= link_to format_activity_title(e.event_title), e.event_url %> + </dt> + <dd> + <span class="description"><%= format_activity_description(e.event_description) %></span> + <span class="author"><%= link_to_user(e.event_author) if e.respond_to?(:event_author) %></span> + </dd> + <%- else -%> + <dt class="<%= e.event_type %> <%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>"> + <%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %> + <span class="time"><%= format_time(e.event_datetime, false) %></span> + <%= link_to format_activity_title(e.event_title), e.event_url %> + was added to the following + <% if e.projects.count > 1 %> + projects: + <%- else -%> + project: + <%- end -%> + <%= content_tag('span', e.projects.join(', ')) -%> + </dt> + <dd> + <span class="description"><%= e.event_description -%></span> + <span class="author"><%= link_to_user(e.event_author) if e.respond_to?(:event_author) %></span> + </dd> + <% end -%> +<%- end -%> +</dl> +<% end -%> +</div> + +<%= content_tag('p', l(:label_no_data), :class => 'nodata') if @events_by_day.empty? %> + +<div style="float:left;"> +<%= link_to_content_update("\xc2\xab " + l(:label_previous), + params.merge(:from => @date_to - @days - 1), + :title => l(:label_date_from_to, :start => format_date(@date_to - 2*@days), :end => format_date(@date_to - @days - 1))) %> +</div> +<div style="float:right;"> +<%= link_to_content_update(l(:label_next) + " \xc2\xbb", + params.merge(:from => @date_to + @days - 1), + :title => l(:label_date_from_to, :start => format_date(@date_to), :end => format_date(@date_to + @days - 1))) unless @date_to >= Date.today %> +</div> + +<% other_formats_links do |f| %> + <%= f.link_to 'Atom', :url => params.merge(:from => nil, :key => User.current.rss_key) %> +<% end %> + +<% content_for :header_tags do %> +<%= auto_discovery_link_tag(:atom, params.merge(:format => 'atom', :from => nil, :key => User.current.rss_key)) %> +<% end %> + +<% content_for :sidebar do %> +<% form_tag({}, :method => :get) do %> +<h3><%= l(:label_activity) %></h3> +<p><% @activity.event_types.each do |t| %> +<%= 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]})%></label> +<br /> +<% end %></p> +<% if @project && @project.descendants.active.any? %> + <%= hidden_field_tag 'with_subprojects', 0 %> + <p><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label></p> +<% end %> +<%= hidden_field_tag('user_id', params[:user_id]) unless params[:user_id].blank? %> +<p><%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %></p> +<% end %> +<% end %> + +<% html_title(l(:label_activity), @author) -%>
--- a/vendor/plugins/redmine_bibliography/init.rb Wed Jan 09 17:40:37 2013 +0000 +++ b/vendor/plugins/redmine_bibliography/init.rb Mon Jan 21 14:18:00 2013 +0000 @@ -40,15 +40,22 @@ settings :default => { 'menu' => 'Publications' }, :partial => 'settings/bibliography' project_module :redmine_bibliography do + permission :view_publication, {:publications => :show}, :public => :true permission :publications, { :publications => :index }, :public => true permission :edit_publication, {:publications => [:edit, :update]} permission :add_publication, {:publications => [:new, :create]} permission :delete_publication, {:publications => :destroy} + end # extending the Project Menu menu :project_menu, :publications, { :controller => 'publications', :action => 'index', :path => nil }, :after => :activity, :param => :project_id, :caption => Proc.new { Setting.plugin_redmine_bibliography['menu'] }, :if => Proc.new { !Setting.plugin_redmine_bibliography['menu'].blank? } + activity_provider :publication, :class_name => 'Publication', :default => true + end + + +