##// END OF EJS Templates
Added toggle_link helper....
Jean-Philippe Lang -
r429:30734ba8e8f0
parent child
Show More
@@ -54,6 +54,13 module ApplicationHelper
54 link_to "#{issue.tracker.name} ##{issue.id}", :controller => "issues", :action => "show", :id => issue
54 link_to "#{issue.tracker.name} ##{issue.id}", :controller => "issues", :action => "show", :id => issue
55 end
55 end
56
56
57 def toggle_link(name, id, options={})
58 onclick = "Element.toggle('#{id}'); "
59 onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ")
60 onclick << "return false;"
61 link_to(name, "#", :onclick => onclick)
62 end
63
57 def image_to_function(name, function, html_options = {})
64 def image_to_function(name, function, html_options = {})
58 html_options.symbolize_keys!
65 html_options.symbolize_keys!
59 tag(:input, html_options.merge({
66 tag(:input, html_options.merge({
@@ -24,10 +24,9
24 </div>
24 </div>
25
25
26 <% if authorize_for 'news', 'add_comment' %>
26 <% if authorize_for 'news', 'add_comment' %>
27 <% form_tag({:action => 'add_comment', :id => @news}) do %>
27 <p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comment" %></p>
28 <%= error_messages_for 'comment' %>
28 <% form_tag({:action => 'add_comment', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
29 <p><label for="comment_comment"><%= l(:label_comment_add) %></label><br />
29 <%= text_area 'comment', 'comment', :cols => 60, :rows => 6 %>
30 <%= text_area 'comment', 'comment', :cols => 60, :rows => 6 %></p>
30 <p><%= submit_tag l(:button_add) %></p>
31 <%= submit_tag l(:button_add) %>
32 <% end %>
31 <% end %>
33 <% end %> No newline at end of file
32 <% end %>
@@ -15,7 +15,7
15 <%= submit_tag l(:button_submit), :class => "button-small" %>
15 <%= submit_tag l(:button_submit), :class => "button-small" %>
16 </td>
16 </td>
17 <td align="left" style="width:15%">
17 <td align="left" style="width:15%">
18 <a href="#" onclick="Element.toggle('trackerselect')"><%= l(:label_options) %></a>
18 <%= toggle_link l(:label_options), "trackerselect" %>
19 <div id="trackerselect" class="rightbox overlay" style="width:140px; display:none;">
19 <div id="trackerselect" class="rightbox overlay" style="width:140px; display:none;">
20 <p><strong><%=l(:label_tracker_plural)%></strong></p>
20 <p><strong><%=l(:label_tracker_plural)%></strong></p>
21 <% @trackers.each do |tracker| %>
21 <% @trackers.each do |tracker| %>
@@ -17,7 +17,7
17 <%= submit_tag l(:button_submit), :class => "button-small" %>
17 <%= submit_tag l(:button_submit), :class => "button-small" %>
18 </td>
18 </td>
19 <td>
19 <td>
20 <a href="#" onclick="Element.toggle('trackerselect')"><%= l(:label_options) %></a>
20 <%= toggle_link l(:label_options), "trackerselect" %>
21 <div id="trackerselect" class="rightbox overlay" style="width:140px; display: none;">
21 <div id="trackerselect" class="rightbox overlay" style="width:140px; display: none;">
22 <p><strong><%=l(:label_tracker_plural)%></strong></p>
22 <p><strong><%=l(:label_tracker_plural)%></strong></p>
23 <% @trackers.each do |tracker| %>
23 <% @trackers.each do |tracker| %>
General Comments 0
You need to be logged in to leave comments. Login now