Project

General

Profile

« Previous | Next » 

Revision 11:c086fd0f57d4

Added by Haru Iida over 9 years ago

fixes #914 Support multiple scm.

View differences:

app/controllers/commit_relation_editor_controller.rb
1 1
# Redmine Commit Relation Editor plugin for Redmine
2
# Copyright (C) 2011  Haruyuki Iida
2
# Copyright (C) 2011-2012  Haruyuki Iida
3 3
#
4 4
# This program is free software; you can redistribute it and/or
5 5
# modify it under the terms of the GNU General Public License
......
37 37
      end
38 38
    end
39 39

  
40
    redirect_to url_for(:controller => 'repositories', :action => 'revision', :id => @project, :rev => @rev)
40
    options = {:controller => 'repositories', :action => 'revision', :id => @project, :rev => @rev}
41
    options[:repository_id] = params[:repository_id] if params[:repository_id].present?
42
    redirect_to url_for(options)
41 43
  end
42 44

  
43 45
  def destroy
......
58 60
      end
59 61
    end
60 62

  
61
    redirect_to url_for(:controller => 'repositories', :action => 'revision', :id => @project, :rev => @rev)
63
    options = {:controller => 'repositories', :action => 'revision', :id => @project, :rev => @rev}
64
    options[:repository_id] = params[:repository_id] if params[:repository_id].present?
65
    redirect_to url_for(options)
62 66
  end
63 67
  
64 68
  private
app/views/commit_relation_editor/_body_bottom.html.erb
1 1
<%#
2 2
# Commit Relation Editor plugin for Redmine
3
# Copyright (C) 2011  Haruyuki Iida
3
# Copyright (C) 2011-2012  Haruyuki Iida
4 4
#rev
5 5
# This program is free software; you can redistribute it and/or
6 6
# modify it under the terms of the GNU General Public License
......
21 21
  <% if controller.class.name == 'RepositoriesController' and action_name == 'revision'%>
22 22

  
23 23
    <% if authorize_for('commit_relation_editor', 'new') %>
24
      <%
25
      repository_id = @repository.identifier_param if @repository.identifier_param
26
    %>
24 27
      <div style="display: none;">
25 28
        <div id="comit_relation_add">
26 29
          <span class="icon icon-add">
27
          <%= link_to_function(h(l(:add_related_issue_to_commit)), "new Effect.SlideDown('comit_relation_add_form')") %>
30
            <%= link_to_function(h(l(:add_related_issue_to_commit)), "new Effect.SlideDown('comit_relation_add_form')") %>
28 31
          </span>
29 32
          <div id="comit_relation_add_form" style="display: none;">
30 33
            <% form_tag :controller => 'commit_relation_editor', :action => 'new', :id => @project do%>            
31 34
              <%= hidden_field_tag 'changeset_id', @changeset.id %>
35
              <%= hidden_field_tag 'repository_id', repository_id %>
32 36
              <%=h l(:field_issue) -%>: <%= text_field_tag 'issue_id', '', :size => 7 %>
33 37
              <%= submit_tag  h(l(:button_apply)), :id => 'add_relation_submit', :onclick => "return issueIdValidation($('issue_id').value);" %>
34 38
            <% end %>
......
48 52
        <% @changeset.issues.each do |issue| -%>
49 53
          <span id="commit_relation_delete_<%=issue.id -%>">
50 54
            <%= link_to(l(:button_delete), {:controller => 'commit_relation_editor', 
51
                :action => 'destroy', :id => @project, :changeset_id => @changeset.id, :issue_id => issue.id},
55
                :action => 'destroy', :id => @project, :changeset_id => @changeset.id, :issue_id => issue.id, :repository_id => repository_id},
52 56
              :class => 'icon icon-del', :confirm => l(:text_are_you_sure)) -%>
53 57
          <% end -%>
54 58
        </span>
init.rb
22 22
  name 'Redmine Commit Relation Editor plugin'
23 23
  author 'Haruyuki Iida'
24 24
  description 'This is a plugin for Redmine lets you can edit relation between issues and commits.'
25
  version '0.0.3'
25
  version '0.0.4'
26 26
  url 'http://www.r-labs.org/projects/relation-editor'
27 27
  author_url 'http://about.me/haru_iida'
28
  requires_redmine :version_or_higher => '1.2.0'
28
  requires_redmine :version_or_higher => '1.3.0'
29 29
  
30 30
  project_module :commit_relation_editor do
31 31
    permission :edit_commit_relation, {:commit_relation_editor => [:new, :destroy]}, :require => :member

Also available in: Unified diff