Project

General

Profile

Patch #670 » re-show-issue-links-at-bottom2.patch

Jon Moses, 2008-02-25 15:09

View differences:

app/helpers/watchers_helper.rb (working copy)
16 16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 17

  
18 18
module WatchersHelper
19
  def watcher_tag(object, user)
20
    content_tag("span", watcher_link(object, user), :id => 'watcher')
19
  def watcher_tag(object, user, opts = {})
20
    suffix = ( opts[:id_suffix] or '' )
21
    content_tag("span", watcher_link(object, user), :id => "watcher#{suffix}")
21 22
  end
22 23
  
23 24
  def watcher_link(object, user)
......
26 27
    url = {:controller => 'watchers',
27 28
           :action => (watched ? 'remove' : 'add'),
28 29
           :object_type => object.class.to_s.underscore,
29
           :object_id => object.id}           
30
           :object_id => object.id}
30 31
    link_to_remote((watched ? l(:button_unwatch) : l(:button_watch)),
31 32
                   {:url => url},
32 33
                   :href => url_for(url),
app/controllers/watchers_controller.rb (working copy)
24 24
    @watched.add_watcher(user)
25 25
    respond_to do |format|
26 26
      format.html { render :text => 'Watcher added.', :layout => true }
27
      format.js { render(:update) {|page| page.replace_html 'watcher', watcher_link(@watched, user)} }
27
      format.js { render(:update) {|page| page.replace_html 'watcher', watcher_link(@watched, user); page.replace_html 'watcher_bottom', watcher_link(@watched, user)} }
28 28
    end
29 29
  end
30 30
  
......
33 33
    @watched.remove_watcher(user)
34 34
    respond_to do |format|
35 35
      format.html { render :text => 'Watcher removed.', :layout => true }
36
      format.js { render(:update) {|page| page.replace_html 'watcher', watcher_link(@watched, user)} }
36
      format.js { render(:update) {|page| page.replace_html 'watcher', watcher_link(@watched, user); page.replace_html 'watcher_bottom', watcher_link(@watched,user)} }
37 37
    end
38 38
  end
39 39

  
app/views/issues/_links.rhtml (revision 0)
1
<% id_suffix = ( ( defined?(id_suffix) and id_suffix ) ? id_suffix : '' ) %>
2
<%= show_and_goto_link(l(:button_update), 'update', :class => 'icon icon-edit', :accesskey => accesskey(:edit)) if authorize_for('issues', 'edit') %>
3
<%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => issue}, :class => 'icon icon-time' %>
4
<%= watcher_tag(issue, User.current, :id_suffix => id_suffix) %>
5
<%= link_to_if_authorized l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => issue }, :class => 'icon icon-copy' %>
6
<%= link_to_if_authorized l(:button_move), {:controller => 'issues', :action => 'move', :id => issue }, :class => 'icon icon-move' %>
7
<%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => issue}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
app/views/issues/show.rhtml (working copy)
1 1
<div class="contextual">
2
<%= show_and_goto_link(l(:button_update), 'update', :class => 'icon icon-edit', :accesskey => accesskey(:edit)) if authorize_for('issues', 'edit') %>
3
<%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => @issue}, :class => 'icon icon-time' %>
4
<%= watcher_tag(@issue, User.current) %>
5
<%= link_to_if_authorized l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue }, :class => 'icon icon-copy' %>
6
<%= link_to_if_authorized l(:button_move), {:controller => 'issues', :action => 'move', :id => @issue }, :class => 'icon icon-move' %>
7
<%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
2
	<%= render :partial => "links", :locals => {:issue => @issue} %>
8 3
</div>
9 4

  
10 5
<h2><%= @issue.tracker.name %> #<%= @issue.id %></h2>
......
96 91
<% end %>
97 92

  
98 93
<div class="contextual">
94
<%= render :partial => "links", :locals => {:issue => @issue, :id_suffix => "_bottom"} %>
95
|
99 96
<%= l(:label_export_to) %><%= link_to 'PDF', {:format => 'pdf'}, :class => 'icon icon-pdf' %>
100 97
</div>
101 98
&nbsp;
(2-2/2)