changeset 1360:45dbcd39b9e9 live

Merge from branch cannam
author Chris Cannam
date Thu, 18 Jul 2013 12:21:45 +0100
parents 0f5c32bfd33e (current diff) a48be8a8bcba (diff)
children 7c0909052511 2f4c076ed281 ac411172d897
files
diffstat 8 files changed, 85 insertions(+), 58 deletions(-) [+]
line wrap: on
line diff
--- a/app/controllers/projects_controller.rb	Wed Jul 03 09:57:31 2013 +0100
+++ b/app/controllers/projects_controller.rb	Thu Jul 18 12:21:45 2013 +0100
@@ -196,6 +196,7 @@
     @issue_category ||= IssueCategory.new
     @member ||= @project.members.new
     @trackers = Tracker.sorted.all
+    @repository ||= @project.repository
     @wiki ||= @project.wiki
   end
 
--- a/app/models/repository.rb	Wed Jul 03 09:57:31 2013 +0100
+++ b/app/models/repository.rb	Thu Jul 18 12:21:45 2013 +0100
@@ -51,6 +51,8 @@
     'password',
     'path_encoding',
     'log_encoding',
+    'is_external',
+    'external_url',
     'is_default'
 
   safe_attributes 'url',
--- a/app/views/issues/_form.html.erb	Wed Jul 03 09:57:31 2013 +0100
+++ b/app/views/issues/_form.html.erb	Thu Jul 18 12:21:45 2013 +0100
@@ -43,15 +43,3 @@
 
 <%= call_hook(:view_issues_form_details_bottom, { :issue => @issue, :form => f }) %>
 <% end %>
-
-<% if @issue.new_record? && User.current.allowed_to?(:add_issue_watchers, @project) -%>
-<p id="watchers_form"><label><%= l(:label_issue_watchers) %></label>
-<% @issue.project.users.sort.each do |user| -%>
-<label class="floating"><%= check_box_tag 'issue[watcher_user_ids][]', user.id, !!(@issue.watched_by?(user) or user == User.current) %> <%=h user %></label>
-<% end -%>
-</p>
-<% end %>
-
-<%= call_hook(:view_issues_form_details_bottom, { :issue => @issue, :form => f }) %>
-
-<%= wikitoolbar_for 'issue_description' %>
--- a/app/views/projects/settings/_repositories.html.erb	Wed Jul 03 09:57:31 2013 +0100
+++ b/app/views/projects/settings/_repositories.html.erb	Thu Jul 18 12:21:45 2013 +0100
@@ -1,41 +1,61 @@
-<% if @project.repositories.any? %>
-<table class="list">
-  <thead>
-    <tr>
-      <th><%= l(:field_identifier) %></th>
-      <th><%= l(:field_repository_is_default) %></th>
-      <th><%= l(:label_scm) %></th>
-      <th><%= l(:label_repository) %></th>
-      <th></th>
-    </tr>
-  </thead>
-  <tbody>
-  <% @project.repositories.sort.each do |repository| %>
-    <tr class="<%= cycle 'odd', 'even' %>">
-      <td>
-      <%= link_to repository.identifier, 
-            {:controller => 'repositories', :action => 'show',:id => @project, :repository_id => repository.identifier_param} if repository.identifier.present? %>
-      </td>
-      <td align="center"><%= checked_image repository.is_default? %></td>
-      <td><%=h repository.scm_name %></td>
-      <td><%=h repository.url %></td>
-      <td class="buttons">
-      <% if User.current.allowed_to?(:manage_repository, @project) %>
-        <%= link_to(l(:label_user_plural), committers_repository_path(repository),
+
+<%= javascript_include_tag 'repository' %>
+
+<% if @repository %>
+
+<%= form_for @repository,
+       :as => :repository,
+       :remote => true,
+       :url => { :controller => 'repositories', :action => 'update', :id => @repository },
+       :method => 'put' do |f| %>
+
+<%= error_messages_for 'repository' %>
+
+<div class="box tabular">
+
+<p>
+   <%= l(:text_settings_repo_explanation).html_safe %></ br>
+   <% if @repository.is_external %>
+     <p><%= l(:text_settings_repo_is_external).html_safe %></ br>
+   <% else %>
+     <p><%= l(:text_settings_repo_is_internal).html_safe %></ br>
+   <% end %>
+</p>
+
+
+<p>
+	<%= label_tag('repository_is_external', l(:label_is_external_repository)) %>
+	<%= check_box :repository, :is_external, :onclick => "toggle_ext_url()" %> 
+	<br/><em><%= l(:setting_external_repository).html_safe %></em>
+</p>
+
+<p>
+	<%= label_tag('repository_external_url', l(:label_repository_external_url)) %>
+	<%= text_field :repository, :external_url, :disabled => !(@repository and @repository.is_external) %> 
+	<br/><em><%= l(:setting_external_repository_url).html_safe %></em>
+</p>
+
+<p><%= l(:text_settings_repo_need_help).html_safe %></p>
+
+</div>
+
+<div class="contextual">
+<% if @repository && !@repository.new_record? %>
+<%= link_to(l(:label_user_plural),
+                {
+                :controller => 'repositories',
+                :action     => 'committers',
+                :id         => @repository
+                },
              :class => 'icon icon-user') %>
-        <%= link_to(l(:button_edit), edit_repository_path(repository),
-             :class => 'icon icon-edit') %>
-        <%= delete_link repository_path(repository) %>
-      <% end %>
-      </td>
-    </tr>
-  <% end %>
-  </tbody>
-</table>
-<% else %>
-<p class="nodata"><%= l(:label_no_data) %></p>
+<% end %>
+</div>
+
+<%= submit_tag(l(:button_save)) %>
+
 <% end %>
 
-<% if User.current.allowed_to?(:manage_repository, @project) %>
-  <p><%= link_to l(:label_repository_new), new_project_repository_path(@project), :class => 'icon icon-add' %></p>
+<% else %>
+   <%= l(:text_settings_repo_creation).html_safe %></ br>
 <% end %>
+
--- a/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb	Wed Jul 03 09:57:31 2013 +0100
+++ b/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb	Thu Jul 18 12:21:45 2013 +0100
@@ -18,6 +18,12 @@
          <%= link_to(l("more_details_link"), {:controller => :publications, :action => :show, :id => publication.id, :project_id => @project.id}) -%>
 
          <%= link_to l(:bibtex_link).html_safe, "javascript:void(0)", :class => "bibtex-link"-%>
+
+        <%- unless publication.external_url.blank? -%>
+            <%= link_to l(:external_url_link), publication.external_url, {:target => "_blank"} -%>
+        <%- end -%>
+
+
        </dd>
        <dd class="bibtex-textarea collapsed" style="display: none;">
          <textarea readonly> <%= print_bibtex_format(publication) -%> </textarea>
--- a/plugins/redmine_bibliography/config/locales/en.yml	Wed Jul 03 09:57:31 2013 +0100
+++ b/plugins/redmine_bibliography/config/locales/en.yml	Thu Jul 18 12:21:45 2013 +0100
@@ -150,4 +150,5 @@
 
   bibtex_link: "[B<small>IB</small>T<sub>E</sub>X]"
   more_details_link: "[More Details]"
+  external_url_link: "[URL (ext.)]"
 
--- a/plugins/redmine_tags/lib/redmine_tags/hooks/views_issues_hook.rb	Wed Jul 03 09:57:31 2013 +0100
+++ b/plugins/redmine_tags/lib/redmine_tags/hooks/views_issues_hook.rb	Thu Jul 18 12:21:45 2013 +0100
@@ -19,10 +19,18 @@
 module RedmineTags
   module Hooks
     class ViewsIssuesHook < Redmine::Hook::ViewListener
-      render_on :view_issues_show_details_bottom, :partial => 'issues/tags'
-      render_on :view_issues_form_details_bottom, :partial => 'issues/tags_form'
-      render_on :view_issues_sidebar_planning_bottom, :partial => 'issues/tags_sidebar'
-      render_on :view_issues_bulk_edit_details_bottom, :partial => 'issues/tags_form'
+
+        # TODO: temporary hack to disable tags on issues
+        ## BEGIN     ~lf 20130712
+
+        # render_on :view_issues_show_details_bottom, :partial => '# issues/tags'
+        # render_on :view_issues_form_details_bottom, :partial => '# issues/tags_form'
+        # render_on :view_issues_sidebar_planning_bottom, :partial => '# issues/tags_sidebar'
+        # render_on :view_issues_bulk_edit_details_bottom, :partial => 'issues/tags_form'
+
+        ## END     ~lf 20130712
+
+
     end
   end
 end
--- a/public/javascripts/repository.js	Wed Jul 03 09:57:31 2013 +0100
+++ b/public/javascripts/repository.js	Thu Jul 18 12:21:45 2013 +0100
@@ -1,7 +1,8 @@
-function toggle_ext_url(){
-	if($('repository_is_external').checked)
-	    $('repository_external_url').enable();
-	else
-	    $('repository_external_url').disable();
+function toggle_ext_url() {
+    if (document.getElementById('repository_is_external').checked) {
+        document.getElementById('repository_external_url').disabled = false;
+    } else {
+	document.getElementById('repository_external_url').disabled = true;
+    }
 }