OSDN Git Service

Slight views refactoring
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 27 May 2007 12:38:29 +0000 (12:38 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 27 May 2007 12:38:29 +0000 (12:38 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@548 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/documents/_form.rhtml
app/views/documents/show.rhtml
app/views/issues/edit.rhtml
app/views/messages/_form.rhtml
app/views/news/_form.rhtml
app/views/projects/add_file.rhtml
app/views/projects/add_issue.rhtml

index bd6e6cc..ee7c289 100644 (file)
 <!--[eoform:document]-->
 </div>
 
-<% if Setting.text_formatting == 'textile' %>
-<%= javascript_include_tag 'jstoolbar' %>
-<script type="text/javascript">
-//<![CDATA[
-if (document.getElementById) { 
-       if (document.getElementById('document_description')) { 
-               var commentTb = new jsToolBar(document.getElementById('document_description')); 
-               commentTb.draw(); 
-       }
-}
-//]]>
-</script>
-<% end %>
\ No newline at end of file
+<%= wikitoolbar_for 'document_description' %>
index 9f53053..74b8f34 100644 (file)
@@ -30,9 +30,7 @@
 <% if authorize_for('documents', 'add_attachment') %>
 <p><%= toggle_link l(:label_attachment_new), "add_attachment_form" %></p>
   <% form_tag({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :class => "tabular", :id => "add_attachment_form", :style => "display:none;") do %>
-    <p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%>
-    <%= image_to_function "add.png", "addFileField();return false" %></label>
-    <%= file_field_tag 'attachments[]', :size => 30  %> <em>(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p>
+    <%= render :partial => 'attachments/form' %>
   <%= submit_tag l(:button_add) %>
   <% end %> 
 <% end %>
index 0243012..8551bfa 100644 (file)
 <%= submit_tag l(:button_save) %>
 <% end %>
 
-<% if Setting.text_formatting == 'textile' %>
-<%= javascript_include_tag 'jstoolbar' %>
-<script type="text/javascript">
-//<![CDATA[
-if (document.getElementById) { 
-       if (document.getElementById('issue_description')) { 
-               var commentTb = new jsToolBar(document.getElementById('issue_description')); 
-               commentTb.draw(); 
-       }
-}
-//]]>
-</script>
-<% end %>
+<%= wikitoolbar_for 'issue_description' %>
 
 <% content_for :header_tags do %>
 <%= javascript_include_tag 'calendar/calendar' %>
index 93e4311..0d1ec73 100644 (file)
@@ -5,7 +5,7 @@
 <p><label><%= l(:field_subject) %></label><br />
 <%= f.text_field :subject, :required => true, :size => 80 %></p>
 
-<p><%= f.text_area :content, :required => true, :cols => 80, :rows => 15 %></p>
+<p><%= f.text_area :content, :required => true, :cols => 80, :rows => 15, :class => 'wiki-edit' %></p>
 <%= wikitoolbar_for 'message_content' %>
 <!--[eoform:message]-->
 
index d5fec27..1ea3c6a 100644 (file)
@@ -5,16 +5,4 @@
 <p><%= f.text_area :description, :required => true, :cols => 60, :rows => 15, :class => 'wiki-edit' %></p>
 </div>
 
-<% if Setting.text_formatting == 'textile' %>
-<%= javascript_include_tag 'jstoolbar' %>
-<script type="text/javascript">
-//<![CDATA[
-if (document.getElementById) { 
-       if (document.getElementById('news_description')) { 
-               var commentTb = new jsToolBar(document.getElementById('news_description')); 
-               commentTb.draw(); 
-       }
-}
-//]]>
-</script>
-<% end %>
\ No newline at end of file
+<%= wikitoolbar_for 'news_description' %>
index f39018c..8392753 100644 (file)
@@ -7,9 +7,7 @@
 <p><label for="version_id"><%=l(:field_version)%> <span class="required">*</span></label>
 <%= select_tag "version_id", options_from_collection_for_select(@versions, "id", "name") %></p>
 
-<p id="attachments_p"><label for="attachment_file"><%=l(:label_attachment)%>
-<%= image_to_function "add.png", "addFileField();return false" %></label>
-<%= file_field_tag 'attachments[]', :size => 30  %> <em>(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p>
+<%= render :partial => 'attachments/form' %>
 </div>
 <%= submit_tag l(:button_add) %>
 <% end %> 
\ No newline at end of file
index 36c6d58..3f1815e 100644 (file)
 <%= submit_tag l(:button_create) %>
 <% end %>
 
-<% if Setting.text_formatting == 'textile' %>
-<%= javascript_include_tag 'jstoolbar' %>
-<script type="text/javascript">
-//<![CDATA[
-if (document.getElementById) { 
-       if (document.getElementById('issue_description')) { 
-               var commentTb = new jsToolBar(document.getElementById('issue_description')); 
-               commentTb.draw(); 
-       }
-}
-//]]>
-</script>
-<% end %>
+<%= wikitoolbar_for 'issue_description' %>
 
 <% content_for :header_tags do %>
 <%= javascript_include_tag 'calendar/calendar' %>