# HG changeset patch
# User luisf
# Date 1353951591 0
# Node ID 3d387b121e85521a1f7b943325a282db5df60586
# Parent cde00909adc80b88a5a6f3f4cb8e4d36dc9e9c20# Parent b9a9efe859073e65894fe1c7181d4557d59dfb6c
Merge
diff -r cde00909adc8 -r 3d387b121e85 app/controllers/projects_controller.rb
--- a/app/controllers/projects_controller.rb Mon Nov 26 17:36:31 2012 +0000
+++ b/app/controllers/projects_controller.rb Mon Nov 26 17:39:51 2012 +0000
@@ -111,8 +111,7 @@
end
# end of code to be removed
-
- if validate_parent_id && @project.save
+ if validate_is_public_key && validate_parent_id && @project.save
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
# Add current user as a project member if he is not admin
unless User.current.admin?
@@ -300,6 +299,19 @@
render_404
end
+ def validate_is_public_key
+ # Although is_public isn't mandatory in the project model (it gets
+ # defaulted), it must be present in params -- it can be true or
+ # false, but it must be there. This permits us to make forms in
+ # which the user _has_ to select public or private (rather than
+ # defaulting it) if we want to
+ if params.nil? || params[:project].nil? || !params[:project].has_key?(:is_public)
+ @project.errors.add :is_public, :public_or_private
+ return false
+ end
+ true
+ end
+
# Validates parent_id param according to user's permissions
# TODO: move it to Project model in a validation that depends on User.current
def validate_parent_id
diff -r cde00909adc8 -r 3d387b121e85 app/views/activities/_busy.html.erb
--- a/app/views/activities/_busy.html.erb Mon Nov 26 17:36:31 2012 +0000
+++ b/app/views/activities/_busy.html.erb Mon Nov 26 17:39:51 2012 +0000
@@ -1,6 +1,6 @@
<% events = @events_by_day %>
<% if (events.nil?)
- activity = Redmine::Activity::Fetcher.new(User.current)
+ activity = Redmine::Activity::Fetcher.new(User.anonymous)
events = activity.events(Date.today - 14, Date.today + 1)
end
%>
diff -r cde00909adc8 -r 3d387b121e85 app/views/activities/_busy_institution.html.erb
--- a/app/views/activities/_busy_institution.html.erb Mon Nov 26 17:36:31 2012 +0000
+++ b/app/views/activities/_busy_institution.html.erb Mon Nov 26 17:39:51 2012 +0000
@@ -1,7 +1,8 @@
<% events = @events_by_day %>
<% if (events.nil?)
- activity = Redmine::Activity::Fetcher.new(User.current)
- events = activity.events(Date.today - 14, Date.today + 1)
+ activity = Redmine::Activity::Fetcher.new(User.anonymous)
+ days = Setting.activity_days_default.to_i
+ events = activity.events(Date.today - days, Date.today + 1)
end
%>
@@ -24,3 +25,4 @@
<% end %>
<% end %>
+
diff -r cde00909adc8 -r 3d387b121e85 app/views/projects/_form.html.erb
--- a/app/views/projects/_form.html.erb Mon Nov 26 17:36:31 2012 +0000
+++ b/app/views/projects/_form.html.erb Mon Nov 26 17:39:51 2012 +0000
@@ -21,9 +21,20 @@
<%= l(:text_project_homepage_info) %>
-<%= f.check_box :is_public %>
+
+<%= label(:project, :is_public_1, l(:field_public_or_private) + content_tag("span", " *", :class => "required")) %>
+<%
+ # if the project hasn't been created fully yet, then we don't
+ # want to set either public or private (make the user decide)
+ initialised = !@project.id.nil?
+%>
+ <%= f.radio_button :is_public, 1, :checked => (initialised && @project.is_public?) %>
+ <%= l(:text_project_public_info) %>
- <%= l(:text_project_visibility_info) %>
+ <%= f.radio_button :is_public, 0, :checked => (initialised && !@project.is_public?) %>
+ <%= l(:text_project_private_info) %>
+
+ <%= l(:text_project_visibility_info) %>
<%= wikitoolbar_for 'project_description' %>
diff -r cde00909adc8 -r 3d387b121e85 app/views/projects/_members_box.html.erb
--- a/app/views/projects/_members_box.html.erb Mon Nov 26 17:36:31 2012 +0000
+++ b/app/views/projects/_members_box.html.erb Mon Nov 26 17:39:51 2012 +0000
@@ -1,8 +1,8 @@
<% if @users_by_role.any? %>
-
+
<%=l(:label_member_plural)%>
<% @users_by_role.keys.sort.each do |role| %>
<%=h role %>: <%= @users_by_role[role].sort.collect{|u| link_to_user u}.join(", ") %>
<% end %>
-
+
<% end %>
diff -r cde00909adc8 -r 3d387b121e85 app/views/projects/explore.html.erb
--- a/app/views/projects/explore.html.erb Mon Nov 26 17:36:31 2012 +0000
+++ b/app/views/projects/explore.html.erb Mon Nov 26 17:39:51 2012 +0000
@@ -1,23 +1,32 @@
+<% content_for :header_tags do %>
+ <%= stylesheet_link_tag 'redmine_tags', :plugin => 'redmine_tags' %>
+<% end %>
+<% cache(:action => 'explore', :action_suffix => 'tags', :expires_in => 1.hour) do %>
<%= l(:label_explore_projects) %>
-
<%=l(:label_project_tags_all)%>
<%= render :partial => 'projects/tagcloud' %>
+<% end %>
+
+ <% cache(:action => 'explore', :action_suffix => 'busy_institutions', :expires_in => 1.hour) do %>
<%=l(:label_institutions_busy)%>
<%= render :partial => 'activities/busy_institution' %>
+ <% end %>
<%=l(:label_project_latest)%>
<%= render :partial => 'projects/latest' %>
+ <% cache(:action => 'explore', :action_suffix => 'busy_projects', :expires_in => 1.hour) do %>
<%=l(:label_projects_busy)%>
<%= render :partial => 'activities/busy' %>
+ <% end %>
diff -r cde00909adc8 -r 3d387b121e85 app/views/projects/new.html.erb
--- a/app/views/projects/new.html.erb Mon Nov 26 17:36:31 2012 +0000
+++ b/app/views/projects/new.html.erb Mon Nov 26 17:39:51 2012 +0000
@@ -3,6 +3,5 @@
<% labelled_tabular_form_for @project do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
-<%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
<%= javascript_tag "Form.Element.focus('project_name');" %>
<% end %>
diff -r cde00909adc8 -r 3d387b121e85 config/locales/en.yml
--- a/config/locales/en.yml Mon Nov 26 17:36:31 2012 +0000
+++ b/config/locales/en.yml Mon Nov 26 17:39:51 2012 +0000
@@ -130,6 +130,7 @@
circular_dependency: "This relation would create a circular dependency"
cant_link_an_issue_with_a_descendant: "An issue cannot be linked to one of its subtasks"
must_accept_terms_and_conditions: "You must accept the Terms and Conditions"
+ public_or_private: "You must select either public or private"
actionview_instancetag_blank_option: Please select
@@ -328,6 +329,7 @@
field_root_directory: Root directory
field_cvsroot: CVSROOT
field_cvs_module: Module
+ field_public_or_private: "Public or Private?"
setting_external_repository: "Select this if the project's main repository is hosted somewhere else"
setting_external_repository_url: "The URL of the existing external repository. Must be publicly accessible without a password"
@@ -546,7 +548,7 @@
label_home: Home
label_home_heading: Welcome!
label_my_page: My page
- label_my_account: My account
+ label_my_account: Account
label_my_projects: My projects
label_my_page_block: My page block
label_administration: Administration
@@ -891,7 +893,7 @@
button_expand_all: Expand all
button_delete: Delete
button_create: Create
- button_create_and_continue: Create and continue
+ button_create_and_continue: Create and Add Another
button_test: Test
button_edit: Edit
button_edit_associated_wikipage: "Edit associated Wiki page: %{page_title}"
@@ -966,7 +968,9 @@
text_caracters_minimum: "Must be at least %{count} characters long."
text_length_between: "Length between %{min} and %{max} characters."
text_project_name_info: "This will be the name of your project as it appears throughout this site. You can change it at any time, in the project's settings."
- text_project_visibility_info: "If your project is not public, it will be visible only to you and to users that you have added as project members. You can change this later if you wish."
+ text_project_public_info: "Public: visible to anybody browsing the site."
+ text_project_private_info: "Private: visible only to you, and to users you have added as project members."
+ text_project_visibility_info: "You can change whether your project is public or private later if you wish."
text_user_ssamr_description_info: 'Please describe your current research or development interests. This information will be used at registration to determine that you are a real person – so please be descriptive, or your application may be delayed or rejected. After registration, the description is publicly visible in your profile and you can edit it at any time.'
text_issue_parent_issue_info: 'If this is a subtask, please insert its parent task number or write the main task name.'
diff -r cde00909adc8 -r 3d387b121e85 public/stylesheets/application.css
--- a/public/stylesheets/application.css Mon Nov 26 17:36:31 2012 +0000
+++ b/public/stylesheets/application.css Mon Nov 26 17:39:51 2012 +0000
@@ -256,17 +256,17 @@
.highlight.token-3 { background-color: #aaf;}
.box{
-padding:6px;
-margin-bottom: 10px;
-background-color:#f6f6f6;
-color:#505050;
-line-height:1.5em;
-border: 1px solid #e4e4e4;
+ padding:6px;
+ margin-bottom: 10px;
+ background-color:#f6f6f6;
+ color:#505050;
+ line-height:1.5em;
+ border: 1px solid #e4e4e4;
}
.box h4 {
-margin-top: 0;
-padding-top: 0;
+ margin-top: 0;
+ padding-top: 0;
}
div.square {
@@ -344,6 +344,25 @@
div#members dt .email { color: #777; font-size: 80%; }
div#members dd .roles { font-style: italic; }
+div#memberbox h3 {
+ background: url(../images/group.png) no-repeat 0% 50%;
+ padding-left: 20px;
+}
+div#memberbox p {
+ padding-left: 20px;
+ margin-left: 0;
+}
+
+div.issues ul {
+ padding-left: 20px;
+ margin-left: 0;
+ list-style-type: none;
+}
+div.issues p {
+ padding-left: 20px;
+ margin-left: 0;
+}
+
.projects .latest .title { margin-right: 0.5em; }
.tipoftheday .tip { margin-left: 2em; margin-top: 0.5em; }
diff -r cde00909adc8 -r 3d387b121e85 public/themes/soundsoftware/stylesheets/application.css
--- a/public/themes/soundsoftware/stylesheets/application.css Mon Nov 26 17:36:31 2012 +0000
+++ b/public/themes/soundsoftware/stylesheets/application.css Mon Nov 26 17:39:51 2012 +0000
@@ -147,7 +147,9 @@
*/
/* h4 { border-bottom: dotted 1px #c0c0c0; } */
-.wiki p { margin-left: 3em; margin-right: 3em; }
+.wiki p, .wiki li { margin-left: 30px; margin-right: 3em; }
+
+.repository-info .wiki p { margin-left: 0 }
div.issue { background: #fdfaf0; border: 1px solid #a9b680; border-left: 4px solid #a9b680; }
diff -r cde00909adc8 -r 3d387b121e85 public/themes/soundsoftware/stylesheets/fonts-generic.css
--- a/public/themes/soundsoftware/stylesheets/fonts-generic.css Mon Nov 26 17:36:31 2012 +0000
+++ b/public/themes/soundsoftware/stylesheets/fonts-generic.css Mon Nov 26 17:39:51 2012 +0000
@@ -1,4 +1,4 @@
-@import url(fonts.css);
+@import url(fonts.css?2);
h1, #project-ancestors-title, #top-menu a {
font-family: Insider, 'Gill Sans', Tahoma, sans-serif;
diff -r cde00909adc8 -r 3d387b121e85 public/themes/soundsoftware/stylesheets/fonts-mac.css
--- a/public/themes/soundsoftware/stylesheets/fonts-mac.css Mon Nov 26 17:36:31 2012 +0000
+++ b/public/themes/soundsoftware/stylesheets/fonts-mac.css Mon Nov 26 17:39:51 2012 +0000
@@ -1,4 +1,4 @@
-@import url(fonts.css);
+@import url(fonts.css?2);
h1, #project-ancestors-title, #top-menu a {
font-family: Insider, "Lucida Grande", sans-serif;
diff -r cde00909adc8 -r 3d387b121e85 public/themes/soundsoftware/stylesheets/fonts-ms.css
--- a/public/themes/soundsoftware/stylesheets/fonts-ms.css Mon Nov 26 17:36:31 2012 +0000
+++ b/public/themes/soundsoftware/stylesheets/fonts-ms.css Mon Nov 26 17:39:51 2012 +0000
@@ -1,4 +1,4 @@
-@import url(fonts.css);
+@import url(fonts.css?2);
/* IE likes us to separate out normal & bold into different fonts
rather than use the selectors on the same font */
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb
--- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Mon Nov 26 17:36:31 2012 +0000
+++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Mon Nov 26 17:39:51 2012 +0000
@@ -48,10 +48,8 @@
@bibtex_parsed_authors = bib[0].authors
logger.error { "Authors: #{@bibtex_parsed_authors}" }
end
-
format.js
-
end
end
@@ -171,12 +169,15 @@
def update
@publication = Publication.find(params[:id])
-
@author_options = []
if @publication.update_attributes(params[:publication])
flash[:notice] = "Successfully Updated Publication."
+ # expires the previosly cached entries
+ Rails.cache.delete "publication-#{@publication.id}-ieee"
+ Rails.cache.delete "publication-#{@publication.id}-bibtex"
+
if !params[:project_id].nil?
redirect_to :action => :show, :id => @publication, :project_id => params[:project_id]
else
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb
--- a/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Mon Nov 26 17:36:31 2012 +0000
+++ b/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Mon Nov 26 17:39:51 2012 +0000
@@ -121,14 +121,17 @@
s
end
- def show_cite_proc_entry(publication)
- # code that should be moved either to the model or to the controller?
+ def print_ieee_format(publication)
+ Rails.cache.fetch("publication-#{publication.id}-ieee") do
- publication.print_entry(:ieee)
+ publication.print_entry(:ieee)
+ end
end
- def print_bibtex_entry(publication)
- publication.print_entry(:bibtex)
+ def print_bibtex_format(publication)
+ Rails.cache.fetch("publication-#{publication.id}-bibtex") do
+ publication.print_entry(:bibtex)
+ end
end
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_bibliography/app/models/publication.rb
--- a/vendor/plugins/redmine_bibliography/app/models/publication.rb Mon Nov 26 17:36:31 2012 +0000
+++ b/vendor/plugins/redmine_bibliography/app/models/publication.rb Mon Nov 26 17:39:51 2012 +0000
@@ -2,10 +2,10 @@
class Publication < ActiveRecord::Base
unloadable
-
+
has_many :authorships, :dependent => :destroy, :order => "auth_order ASC"
has_many :authors, :through => :authorships, :uniq => true
-
+
has_one :bibtex_entry, :dependent => :destroy
validates_presence_of :title
@@ -14,11 +14,30 @@
accepts_nested_attributes_for :authorships
accepts_nested_attributes_for :authors, :allow_destroy => true
accepts_nested_attributes_for :bibtex_entry, :allow_destroy => true
-
+
has_and_belongs_to_many :projects, :uniq => true
-
+
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!
@@ -30,62 +49,62 @@
end
end
- def notify_authors_publication_added(project)
+ def notify_authors_publication_added(project)
self.authors.each do |author|
Rails.logger.debug { "Sending mail to \"#{self.title}\" publication authors." }
Mailer.deliver_publication_added(author.user, self, project) unless author.user.nil?
end
end
-
- def notify_authors_publication_updated(project)
+
+ def notify_authors_publication_updated(project)
self.authors.each do |author|
Rails.logger.debug { "Sending mail to \"#{self.title}\" publication authors." }
Mailer.deliver_publication_updated(author.user, self, project) unless author.user.nil?
end
end
-
-
+
+
def set_initial_author_order
authorships = self.authorships
-
+
logger.debug { "Publication \"#{self.title}\" has #{authorships.size} authors." }
-
+
authorships.each_with_index do |authorship, index|
if authorship.auth_order.nil?
authorship.auth_order = index
end
- end
+ end
end
-
+
def print_bibtex_author_names
- # this authors are correctly sorted because the authorships model
+ # this authors are correctly sorted because the authorships model
# already outputs the author names ASC by auth_order
self.authorships.map{|a| a.name_on_paper}.join(' and ')
- end
-
+ end
+
def print_entry(style)
bib = BibTeX::Entry.new
bib.author = self.print_bibtex_author_names
bib.title = self.title
- self.bibtex_entry.attributes.keys.sort.each do |key|
+ self.bibtex_entry.attributes.keys.sort.each do |key|
value = self.bibtex_entry.attributes[key].to_s
next if key == 'id' or key == 'publication_id' or value == ""
- if key == "entry_type"
+ if key == "entry_type"
bib.type = BibtexEntryType.find(self.bibtex_entry.entry_type).name
else
bib[key.to_sym] = value
- end
+ end
end
-
+
if style == :ieee
- CiteProc.process bib.to_citeproc, :style => :ieee, :format => :html
- else
+ CiteProc.process bib.to_citeproc, :style => :ieee, :format => :html
+ else
bibtex = bib.to_s :include => :meta_content
bibtex.strip!
logger.error { bibtex }
- end
+ end
end
end
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_bibliography/app/views/activities/_recent.html.erb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/activities/_recent.html.erb Mon Nov 26 17:39:51 2012 +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
+%>
+
+
+
+<% if @project.nil? %>
+ <%= content_tag('h3', l(:label_activity_my_recent)) %>
+
+<% end %>
+
+<% if events.empty? %>
+
+ <% if @project.nil? %>
+
<%= l(:label_activity_my_recent_none) %>
+ <% end %>
+
+<% else %>
+
+ <% if !@project.nil? %>
+
+ <%= content_tag('h3', l(:label_activity_recent)) %>
+ <% end %>
+
+
+ <% events.sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%>
+ <%- if e.class != Publication -%>
+
+ <%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %>
+ <%= format_time(e.event_datetime) %>
+ <%= content_tag('span', link_to_project(e.project), :class => 'project') if @project.nil? || @project != e.project %>
+ <% if e.respond_to?(:event_author) %>
+ <%= e.event_author %>
+ <% end %>
+
+ <%= link_to format_activity_title(e.event_title), e.event_url %>
+ <%= format_activity_description(e.event_description) %>
+
+ <% else -%>
+
+ <%= format_time(e.event_datetime) %>
+ <%= 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) %>
+ <%= e.event_author %>
+ <% end %>
+
+ <%= link_to format_activity_title(e.event_title), e.event_url %>
+ <%= format_activity_description(e.event_description) %>
+
+ <% end -%>
+ <% end -%>
+
+
+
+
+<% end %>
+
+<% if events.empty? and @project.nil? %>
<% end %>
+
+
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_bibliography/app/views/activities/index.html.erb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/activities/index.html.erb Mon Nov 26 17:39:51 2012 +0000
@@ -0,0 +1,91 @@
+<%=
+ 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
+ %>
+<%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %>
+
+
+<% @events_by_day.keys.sort.reverse.each do |day| %>
+
<%= format_activity_day(day) %>
+
+<% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%>
+ <%- if e.class != Publication -%>
+
+ <%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %>
+ <%= format_time(e.event_datetime, false) %>
+ <%= 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 %>
+
+
+ <%= format_activity_description(e.event_description) %>
+ <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
+
+ <%- else -%>
+
+ <%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %>
+ <%= format_time(e.event_datetime, false) %>
+ <%= 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(', ')) -%>
+
+
+ <%= e.event_description -%>
+ <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
+
+ <% end -%>
+<%- end -%>
+
+<% end -%>
+
+
+<%= content_tag('p', l(:label_no_data), :class => 'nodata') if @events_by_day.empty? %>
+
+
+<%= 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))) %>
+
+
+<%= 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 %>
+
+
+<% 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 %>
+<%= l(:label_activity) %>
+<% @activity.event_types.each do |t| %>
+<%= check_box_tag "show_#{t}", 1, @activity.scope.include?(t) %>
+<%= link_to(l("label_#{t.singularize}_plural"), {"show_#{t}" => 1, :user_id => params[:user_id]})%>
+
+<% end %>
+<% if @project && @project.descendants.active.any? %>
+ <%= hidden_field_tag 'with_subprojects', 0 %>
+ <%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%>
+<% end %>
+<%= hidden_field_tag('user_id', params[:user_id]) unless params[:user_id].blank? %>
+<%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %>
+<% end %>
+<% end %>
+
+<% html_title(l(:label_activity), @author) -%>
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb
--- a/vendor/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb Mon Nov 26 17:36:31 2012 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb Mon Nov 26 17:39:51 2012 +0000
@@ -9,18 +9,18 @@
<%=l(:label_related_publication_plural)%>
-
- <% @project.publications.each do |publication| %>
+
+ <% @project.publications.each do |publication| %>
- <%= publication.print_entry(:ieee) -%>
+ <%= print_ieee_format(publication) %>
- <%= link_to("[More Details]", {:controller => :publications, :action => :show, :id => publication.id, :project_id => @project.id}) -%>
-
- <%= link_to_function "[Bibtex]", onclick="toggleBibtex(this)" -%>
+ <%= link_to("[More Details]", {:controller => :publications, :action => :show, :id => publication.id, :project_id => @project.id}) -%>
+
+ <%= link_to_function "[BIB TE X]", onclick="toggleBibtex(this)" -%>
-
+
<% end -%>
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb Mon Nov 26 17:36:31 2012 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb Mon Nov 26 17:39:51 2012 +0000
@@ -14,6 +14,11 @@
<%= l(:text_external_url) %>
+
+ <%= f.text_field :doi, :size => 70 %>
+
+ <%= l(:text_doi) %>
+
<%= l(:authors) %>
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb
--- a/vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb Mon Nov 26 17:36:31 2012 +0000
+++ b/vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb Mon Nov 26 17:39:51 2012 +0000
@@ -4,10 +4,10 @@
Publication Info
- <%= show_cite_proc_entry(@publication)%>
-
-
Bibtex Format
- <%=h print_bibtex_entry(@publication) %>
+
<%= print_ieee_format(@publication)%>
+
+
BIB TE X Format
+
<%=h print_bibtex_format(@publication) %>
@@ -16,7 +16,7 @@
<% for authorship in @publication.authorships.find(:all, :order => :auth_order) %>
<% content_tag_for :li, authorship do %>
- <%- if User.current.allowed_to?(:edit_publication, @project) && @publication.authorships.length > 1 -%>
+ <%- if User.current.allowed_to?(:edit_publication, @project) && @publication.authorships.length > 1 -%>
[drag to reorder]
<%- end -%>
<%= link_to_authorship authorship %> <%= h authorship.institution %>
@@ -32,17 +32,21 @@
<%= show_bibtex_fields(@publication.bibtex_entry) %>
<%- end -%>
-<% unless @publication.external_url.blank? %>
-
- <%= l(:field_external_url) %>
-
+<%- unless @publication.external_url.blank? -%>
- <%= link_to h(@publication.external_url), @publication.external_url, {:target => "_blank"} %>
+ <%= l(:field_external_url) %>: <%= link_to h(@publication.external_url), @publication.external_url, {:target => "_blank"} -%>
+
+<%- end -%>
+
+
+<% unless @publication.doi.blank? %>
+
+ <%= l(:field_doi)-%>: <%= link_to h(@publication.doi), "http://dx.doi.org/#{@publication.doi}", {:target => "_blank"} -%>
<% end %>
- <% if User.current.allowed_to?(:add_publication, @project) %>
+ <% if User.current.allowed_to?(:add_publication, @project) %>
<%= link_to l(:label_publication_edit), { :controller => "publications", :action => "edit", :id => @publication, :project_id => @project } %> |
<%= link_to "Delete", {:controller => 'publications', :action => 'destroy', :id => @publication, :project_id => @project },
:confirm => l(:text_are_you_sure), :method => :delete, :title => l(:button_delete) %> |
@@ -51,15 +55,15 @@
<% projects = Project.active.find(:all, :limit => 100, :order => 'name ASC') - @publication.projects %>
-
+
<% content_for :sidebar do %>
<%=l(:label_publication_project_index)%>
<%= render :partial => 'list_projects' %>
-
+
<%- if User.current.allowed_to?(:edit_publication, @project) -%>
- <%= render :partial => 'add_project_form' %>
+ <%= render :partial => 'add_project_form' %>
<%- end -%>
<% end %>
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_bibliography/assets/stylesheets/bibliography.css
--- a/vendor/plugins/redmine_bibliography/assets/stylesheets/bibliography.css Mon Nov 26 17:36:31 2012 +0000
+++ b/vendor/plugins/redmine_bibliography/assets/stylesheets/bibliography.css Mon Nov 26 17:39:51 2012 +0000
@@ -33,18 +33,20 @@
}
-div#bibliography dd { margin-bottom: 1em; padding-left: 18px; font-size: 0.9em; }
+div#bibliography dd { margin-bottom: 1em; font-size: 0.9em; }
div#bibliography dd .authors { font-style: italic; }
div#bibliography dd span.authors { color: #808080; }
div#bibliography dd span.year { padding-left: 0.6em; }
div#bibliography .box dt {
- background: url(../../../images/document.png) no-repeat 0% 50%; padding-left: 20px;
- margin-left: 2em;
+ background: url(../../../images/document.png) no-repeat 0% 4px;
+ padding-left: 20px;
+ margin-left: 0;
}
div#bibliography .box dd {
- margin-left: 25px;
+ padding-left: 20px;
+ margin-left: 0;
}
div#bibliography h3 {
@@ -58,4 +60,4 @@
font: normal 8px;
padding: 2px 10px;
border: solid 1px #ddd;
-}
\ No newline at end of file
+}
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_bibliography/config/locales/en.yml
--- a/vendor/plugins/redmine_bibliography/config/locales/en.yml Mon Nov 26 17:36:31 2012 +0000
+++ b/vendor/plugins/redmine_bibliography/config/locales/en.yml Mon Nov 26 17:39:51 2012 +0000
@@ -12,8 +12,7 @@
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"
identify_author_correct: "Yes, but I need to correct some details below"
@@ -25,24 +24,25 @@
label_all_publications_for_project: Publications associated with %{project}
label_authors_show: "Authorships associated with this author"
label_authors_index: "List of authors"
-
+
field_authorship_publication_title: "Publication"
field_authorship_name: "Name on Paper"
field_authorship_email: "Email"
field_authorship_institution: "Institution"
-
+
field_external_url: "External URL"
+ field_doi: "DOI"
field_publication_title: Title
field_publication_authors: Authors
field_publication_projects: "Associated projects"
field_author_name: Author
field_author_user: User Name
field_author_username: "Associated user"
- field_author_publications: "Publications by this Author"
+ field_author_publications: "Publications by this Author"
field_identify_author_yes: "Yes"
field_identify_author_correct: "Corrections"
field_identify_author_no: "No"
-
+
label_author_is_me: "(I am this author)"
label_add_me_as_author: "Add me as an author"
label_add_an_author: "Add an author"
@@ -54,7 +54,7 @@
label_author_information: "Author Information"
remove_author: "Remove this author"
-
+
label_publication_plural: "Publications"
label_related_publication_plural: "Related publications"
label_publication_new: "Create New Publication"
@@ -67,22 +67,23 @@
label_publication_project_index: "Projects associated with this publication"
label_publication_index: "View all publications"
label_publication_other_details: "Details"
-
+
text_external_url: "Link to the publication or to an external page about it."
+ text_doi: "DOI (Digital Object Identifier)."
text_author_name_on_paper: "Author's name as it appears on the paper."
text_author_institution: "Author's institution as on the paper."
text_author_email: "Author's email address as on the paper."
-
+
text_author_search: "Search existing authors"
-
+
# authorships model
field_institution: "Institution"
- field_name_on_paper: "Name"
+ field_name_on_paper: "Name"
field_email: "Email Address"
-
+
# bibtex_entries model
field_entry_type: "Publication Type"
- field_id: "id"
+ field_id: "id"
field_publication_id: "Publication_id"
field_address: "Address"
field_annote: "Annote"
@@ -122,7 +123,7 @@
field_bibtex_proceedings: Conference proceedings
field_bibtex_techreport: Technical report
field_bibtex_unpublished: Unpublished
-
+
label_author_1: First author
label_author_2: Second author
label_author_3: Third author
@@ -146,6 +147,6 @@
mail_subject_publication_added: "You have been added as an author to a new publication"
mail_body_publication_added: "A new publication (%{publication}) has been added to the project '%{project}.'"
-
-
-
+
+
+
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_bibliography/init.rb
--- a/vendor/plugins/redmine_bibliography/init.rb Mon Nov 26 17:36:31 2012 +0000
+++ b/vendor/plugins/redmine_bibliography/init.rb Mon Nov 26 17:39:51 2012 +0000
@@ -4,9 +4,6 @@
require 'bibtex'
require 'citeproc'
-
-RAILS_DEFAULT_LOGGER.info 'Starting Bibliography Plugin for RedMine'
-
# Patches to the Redmine core.
Dispatcher.to_prepare :redmine_model_dependencies do
require_dependency 'project'
@@ -25,7 +22,9 @@
Mailer.send(:include, Bibliography::MailerPatch)
end
-
+ unless ProjectsHelper.included_modules.include?(Bibliography::ProjectsHelperPatch)
+ ProjectsHelper.send(:include, Bibliography::ProjectsHelperPatch)
+ end
end
@@ -41,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
+
+
+
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_bibliography/lib/bibliography/projects_helper_patch.rb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/plugins/redmine_bibliography/lib/bibliography/projects_helper_patch.rb Mon Nov 26 17:39:51 2012 +0000
@@ -0,0 +1,17 @@
+module Bibliography
+ module ProjectsHelperPatch
+
+ def self.included(base) # :nodoc:
+ base.send(:include, InstanceMethods)
+ base.send(:include, PublicationsHelper)
+
+ base.class_eval do
+ unloadable
+ end
+ end
+
+ module InstanceMethods
+ end
+ end
+end
+
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb
--- a/vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb Mon Nov 26 17:36:31 2012 +0000
+++ b/vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb Mon Nov 26 17:39:51 2012 +0000
@@ -1,16 +1,16 @@
require_dependency 'user'
module Bibliography
- module UserAuthorPatch
+ module UserAuthorPatch
def self.included(base)
- base.send(:include, InstanceMethods)
- extend ClassMethods
-
+ base.send(:include, InstanceMethods)
+ extend ClassMethods
+
end #self.included
-
+
module ClassMethods
- end
-
+ end
+
module InstanceMethods
def institution
@@ -18,28 +18,28 @@
institution_name = self.ssamr_user_detail.institution_name
else
institution_name = "No Institution Set"
- end
- return institution_name
+ end
+ return institution_name
end
def get_author_info
# TODO: DELETE THIS METHOD??
- info = {
+ info = {
:name_on_paper => self.name,
:email => self.mail,
:institution => "",
:author_user_id => self.id,
- :is_user => "1"
+ :is_user => "1"
}
if not self.ssamr_user_detail.nil?
info[:institution] = self.ssamr_user_detail.institution_name
end
- return info
+ return info
end
-
+
end #InstanceMethods
-
+
end #UserPublicationsPatch
end #RedmineBibliography
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_tags/app/controllers/tags_controller.rb
--- a/vendor/plugins/redmine_tags/app/controllers/tags_controller.rb Mon Nov 26 17:36:31 2012 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-class TagsController < ApplicationController
-
- def index
- respond_to do |format|
- format.html {
- render :template => 'tags/index.html.erb', :layout => !request.xhr?
- }
- format.api {
- }
- format.atom {
- }
- end
- end
-
-end
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_tags/app/views/projects/_filter_search_tags.html.erb
--- a/vendor/plugins/redmine_tags/app/views/projects/_filter_search_tags.html.erb Mon Nov 26 17:36:31 2012 +0000
+++ b/vendor/plugins/redmine_tags/app/views/projects/_filter_search_tags.html.erb Mon Nov 26 17:39:51 2012 +0000
@@ -6,7 +6,7 @@
<%= javascript_include_tag 'tags_input', :plugin => 'redmine_tags' -%>
- <%= javascript_tag "observeProjectTagsField('#{url_for(:controller => 'auto_completes', :action => 'project_search_tags', :project_id => Project.first.id)}', true)" -%>
+ <%= javascript_tag "observeProjectTagsField('#{url_for(:controller => 'auto_completes', :action => 'project_search_tags')}', true)" -%>
<%- end -%>
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_tags/app/views/projects/_filter_tags.html.erb
--- a/vendor/plugins/redmine_tags/app/views/projects/_filter_tags.html.erb Mon Nov 26 17:36:31 2012 +0000
+++ b/vendor/plugins/redmine_tags/app/views/projects/_filter_tags.html.erb Mon Nov 26 17:39:51 2012 +0000
@@ -7,7 +7,7 @@
<%= javascript_include_tag 'tags_input', :plugin => 'redmine_tags' %>
- <%= javascript_tag "observeProjectTagsField('#{url_for(:controller => 'auto_completes', :action => 'project_tags', :project_id => Project.first.id)}')" %>
+ <%= javascript_tag "observeProjectTagsField('#{url_for(:controller => 'auto_completes', :action => 'project_tags')}')" %>
<% end -%>
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_tags/app/views/projects/_tagcloud.html.erb
--- a/vendor/plugins/redmine_tags/app/views/projects/_tagcloud.html.erb Mon Nov 26 17:36:31 2012 +0000
+++ b/vendor/plugins/redmine_tags/app/views/projects/_tagcloud.html.erb Mon Nov 26 17:39:51 2012 +0000
@@ -1,6 +1,3 @@
-<% content_for :header_tags do %>
- <%= stylesheet_link_tag 'redmine_tags', :plugin => 'redmine_tags' %>
-<% end %>
<% end -%>
\ No newline at end of file
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_tags/app/views/tags/index.html.erb
--- a/vendor/plugins/redmine_tags/app/views/tags/index.html.erb Mon Nov 26 17:36:31 2012 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<% content_for :header_tags do %>
- <%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %>
- <%= stylesheet_link_tag 'redmine_tags', :plugin => 'redmine_tags' %>
-<% end %>
-
-
-
-
- <%= l("label_project_tags_all") %>
-
-
-<%= render_tags_list(Project.available_tags, :style => :cloud) %>
-
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_tags/lib/redmine_tags/patches/project_patch.rb
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/patches/project_patch.rb Mon Nov 26 17:36:31 2012 +0000
+++ b/vendor/plugins/redmine_tags/lib/redmine_tags/patches/project_patch.rb Mon Nov 26 17:39:51 2012 +0000
@@ -13,38 +13,12 @@
unloadable
attr_accessor :tag_list
-
acts_as_taggable
end
end
- def before_save_with_save_tags()
-# debugger
- logger.error { "GONNA SAVE TAG LIST" }
-
-
-# params[:tag_list]
-
-
- # logger.error { @project.name }
-
- # if params && params[:project] && !params[:project][:tag_list].nil?
- # old_tags = context[:project].tag_list.to_s
- # context[:project].tag_list = params[:project][:tag_list]
- # new_tags = context[:project].tag_list.to_s
- #
- # unless (old_tags == new_tags || context[:project].current_journal.blank?)
- # context[:project].current_journal.details << JournalDetail.new(:property => 'attr',
- # :prop_key => 'tag_list',
- # :old_value => old_tags,
- # :value => new_tags)
- # end
- # end
- end
-
module InstanceMethods
-
end
module ClassMethods
@@ -64,7 +38,7 @@
name_like = options[:name_like]
options = {}
visible = ARCondition.new
-
+
visible << ["#{Project.table_name}.is_public = '1'"]
if name_like
@@ -73,7 +47,7 @@
options[:conditions] = visible.conditions
- self.all_tag_counts(options)
+ self.all_tag_counts(options)
end
end
end
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb Mon Nov 26 17:36:31 2012 +0000
+++ b/vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb Mon Nov 26 17:39:51 2012 +0000
@@ -3,11 +3,11 @@
module RedmineTags
module Patches
- module ProjectsControllerPatch
+ module ProjectsControllerPatch
def self.included(base)
base.send(:include, InstanceMethods)
- base.class_eval do
- unloadable
+ base.class_eval do
+ unloadable
skip_before_filter :authorize, :only => [:set_fieldset_status]
skip_before_filter :find_project, :only => [:set_fieldset_status]
before_filter :add_tags_to_project, :only => [:save, :update]
@@ -17,7 +17,7 @@
end
module InstanceMethods
-
+
def add_tags_to_project
if params && params[:project] && !params[:project][:tag_list].nil?
@@ -57,17 +57,17 @@
else
@myproj_status = session[:my_projects_fieldset_status]
end
-
+
if session[:filters_fieldset_status].nil?
@filter_status = "false"
else
@filter_status = session[:filters_fieldset_status]
end
-
+
if params && params[:project] && !params[:project][:tag_list].nil?
@filter_status = "true"
end
-
+
end
# Lists visible projects. Paginator is for top-level projects only
@@ -78,17 +78,17 @@
get_fieldset_statuses
respond_to do |format|
- format.html {
+ format.html {
paginate_projects
-
- @projects = Project.visible_roots.find(@projects, :offset => @offset, :limit => @limit, :order => sort_clause)
+
+ @projects = Project.visible_roots.find(@projects, :offset => @offset, :limit => @limit, :order => sort_clause)
if User.current.logged?
# seems sort_by gives us case-sensitive ordering, which we don't want
# @user_projects = User.current.projects.sort_by(&:name)
@user_projects = User.current.projects.all(:order => :name)
end
-
+
render :template => 'projects/index.html.erb', :layout => !request.xhr?
}
format.api {
@@ -112,8 +112,8 @@
private
- def filter_projects
- @question = (params[:q] || "").strip
+ def filter_projects
+ @question = (params[:q] || "").strip
if params.has_key?(:project)
@tag_list = (params[:project][:tag_list] || "").strip.split(",")
@@ -126,7 +126,7 @@
else
@projects = Project.visible_roots.find(Project.visible.search_by_question(@question))
end
-
+
unless @tag_list.empty?
@tagged_projects_ids = Project.visible.tagged_with(@tag_list).collect{ |project| Project.find(project.id).root }
@projects = @projects & @tagged_projects_ids
diff -r cde00909adc8 -r 3d387b121e85 vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_helper_patch.rb
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_helper_patch.rb Mon Nov 26 17:36:31 2012 +0000
+++ b/vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_helper_patch.rb Mon Nov 26 17:39:51 2012 +0000
@@ -5,12 +5,13 @@
def self.included(base) # :nodoc:
base.send(:include, InstanceMethods)
base.send(:include, TagsHelper)
+
base.class_eval do
unloadable
end
end
- module InstanceMethods
+ module InstanceMethods
# Renders a tree of projects that the current user does not belong
# to, or of all projects if the current user is not logged in. The
# given collection may be a subset of the whole project tree
@@ -19,30 +20,30 @@
# description, manager(s), creation date, last activity date,
# general activity level, whether there is anything actually hosted
# here for the project, etc.
- def render_project_table_with_filtering(projects, question)
+ def render_project_table_with_filtering(projects, question)
custom_fields = ""
s = ""
if projects.any?
tokens = RedmineProjectFiltering.calculate_tokens(question, custom_fields)
-
+
s << "