# HG changeset patch # User luisf # Date 1353355025 0 # Node ID 6f464526403b5ae2c9c3ba17b0416facf8dcff31 # Parent 70fa02f56de76c51433d0e26e899baf3c6680b6a# Parent 5577ef946dc8b2c819f62376c1d1f3eec3c95d9f Merge diff -r 70fa02f56de7 -r 6f464526403b app/controllers/projects_controller.rb --- a/app/controllers/projects_controller.rb Mon Nov 19 19:46:21 2012 +0000 +++ b/app/controllers/projects_controller.rb Mon Nov 19 19:57:05 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 70fa02f56de7 -r 6f464526403b app/views/activities/_busy.html.erb --- a/app/views/activities/_busy.html.erb Mon Nov 19 19:46:21 2012 +0000 +++ b/app/views/activities/_busy.html.erb Mon Nov 19 19:57:05 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 70fa02f56de7 -r 6f464526403b app/views/activities/_busy_institution.html.erb --- a/app/views/activities/_busy_institution.html.erb Mon Nov 19 19:46:21 2012 +0000 +++ b/app/views/activities/_busy_institution.html.erb Mon Nov 19 19:57:05 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 70fa02f56de7 -r 6f464526403b app/views/projects/_form.html.erb --- a/app/views/projects/_form.html.erb Mon Nov 19 19:46:21 2012 +0000 +++ b/app/views/projects/_form.html.erb Mon Nov 19 19:57:05 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 70fa02f56de7 -r 6f464526403b app/views/projects/_members_box.html.erb --- a/app/views/projects/_members_box.html.erb Mon Nov 19 19:46:21 2012 +0000 +++ b/app/views/projects/_members_box.html.erb Mon Nov 19 19:57:05 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 70fa02f56de7 -r 6f464526403b app/views/projects/explore.html.erb --- a/app/views/projects/explore.html.erb Mon Nov 19 19:46:21 2012 +0000 +++ b/app/views/projects/explore.html.erb Mon Nov 19 19:57:05 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 70fa02f56de7 -r 6f464526403b app/views/projects/new.html.erb --- a/app/views/projects/new.html.erb Mon Nov 19 19:46:21 2012 +0000 +++ b/app/views/projects/new.html.erb Mon Nov 19 19:57:05 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 70fa02f56de7 -r 6f464526403b config/locales/en.yml --- a/config/locales/en.yml Mon Nov 19 19:46:21 2012 +0000 +++ b/config/locales/en.yml Mon Nov 19 19:57:05 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 70fa02f56de7 -r 6f464526403b public/stylesheets/application.css --- a/public/stylesheets/application.css Mon Nov 19 19:46:21 2012 +0000 +++ b/public/stylesheets/application.css Mon Nov 19 19:57:05 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 70fa02f56de7 -r 6f464526403b public/themes/soundsoftware/stylesheets/application.css --- a/public/themes/soundsoftware/stylesheets/application.css Mon Nov 19 19:46:21 2012 +0000 +++ b/public/themes/soundsoftware/stylesheets/application.css Mon Nov 19 19:57:05 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 70fa02f56de7 -r 6f464526403b public/themes/soundsoftware/stylesheets/fonts-generic.css --- a/public/themes/soundsoftware/stylesheets/fonts-generic.css Mon Nov 19 19:46:21 2012 +0000 +++ b/public/themes/soundsoftware/stylesheets/fonts-generic.css Mon Nov 19 19:57:05 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 70fa02f56de7 -r 6f464526403b public/themes/soundsoftware/stylesheets/fonts-mac.css --- a/public/themes/soundsoftware/stylesheets/fonts-mac.css Mon Nov 19 19:46:21 2012 +0000 +++ b/public/themes/soundsoftware/stylesheets/fonts-mac.css Mon Nov 19 19:57:05 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 70fa02f56de7 -r 6f464526403b public/themes/soundsoftware/stylesheets/fonts-ms.css --- a/public/themes/soundsoftware/stylesheets/fonts-ms.css Mon Nov 19 19:46:21 2012 +0000 +++ b/public/themes/soundsoftware/stylesheets/fonts-ms.css Mon Nov 19 19:57:05 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 70fa02f56de7 -r 6f464526403b 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 19 19:46:21 2012 +0000 +++ b/vendor/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb Mon Nov 19 19:57:05 2012 +0000 @@ -17,7 +17,7 @@
<%= link_to("[More Details]", {:controller => :publications, :action => :show, :id => publication.id, :project_id => @project.id}) -%> - <%= link_to_function "[Bibtex]", onclick="toggleBibtex(this)" -%> + <%= link_to_function "[BIBTEX]", onclick="toggleBibtex(this)" -%>