Revision 912:5e80956cc792 app/views/documents
| app/views/documents/_document.html.erb | ||
|---|---|---|
| 1 |
<h4><%= link_to h(document.title), :controller => 'documents', :action => 'show', :id => document %></h4> |
|
| 2 |
<p><em><%= format_time(document.updated_on) %></em></p> |
|
| 3 |
|
|
| 4 |
<div class="wiki"> |
|
| 5 |
<%= textilizable(truncate_lines(document.description), :object => document) %> |
|
| 6 |
</div> |
|
| app/views/documents/_document.rhtml | ||
|---|---|---|
| 1 |
<h4><%= link_to h(document.title), :controller => 'documents', :action => 'show', :id => document %></h4> |
|
| 2 |
<p><em><%= format_time(document.updated_on) %></em></p> |
|
| 3 |
|
|
| 4 |
<div class="wiki"> |
|
| 5 |
<%= textilizable(truncate_lines(document.description)) %> |
|
| 6 |
</div> |
|
| app/views/documents/_form.html.erb | ||
|---|---|---|
| 1 |
<%= error_messages_for 'document' %> |
|
| 2 |
<div class="box"> |
|
| 3 |
<!--[form:document]--> |
|
| 4 |
<p><label for="document_category_id"><%=l(:field_category)%></label> |
|
| 5 |
<%= select('document', 'category_id', DocumentCategory.active.collect {|c| [c.name, c.id]}) %></p>
|
|
| 6 |
|
|
| 7 |
<p><label for="document_title"><%=l(:field_title)%> <span class="required">*</span></label> |
|
| 8 |
<%= text_field 'document', 'title', :size => 60 %></p> |
|
| 9 |
|
|
| 10 |
<p><label for="document_description"><%=l(:field_description)%></label> |
|
| 11 |
<%= text_area 'document', 'description', :cols => 60, :rows => 15, :class => 'wiki-edit' %></p> |
|
| 12 |
<!--[eoform:document]--> |
|
| 13 |
</div> |
|
| 14 |
|
|
| 15 |
<%= wikitoolbar_for 'document_description' %> |
|
| app/views/documents/_form.rhtml | ||
|---|---|---|
| 1 |
<%= error_messages_for 'document' %> |
|
| 2 |
<div class="box"> |
|
| 3 |
<!--[form:document]--> |
|
| 4 |
<p><label for="document_category_id"><%=l(:field_category)%></label> |
|
| 5 |
<%= select('document', 'category_id', DocumentCategory.all.collect {|c| [c.name, c.id]}) %></p>
|
|
| 6 |
|
|
| 7 |
<p><label for="document_title"><%=l(:field_title)%> <span class="required">*</span></label> |
|
| 8 |
<%= text_field 'document', 'title', :size => 60 %></p> |
|
| 9 |
|
|
| 10 |
<p><label for="document_description"><%=l(:field_description)%></label> |
|
| 11 |
<%= text_area 'document', 'description', :cols => 60, :rows => 15, :class => 'wiki-edit' %></p> |
|
| 12 |
<!--[eoform:document]--> |
|
| 13 |
</div> |
|
| 14 |
|
|
| 15 |
<%= wikitoolbar_for 'document_description' %> |
|
| app/views/documents/edit.html.erb | ||
|---|---|---|
| 1 |
<h2><%=l(:label_document)%></h2> |
|
| 2 |
|
|
| 3 |
<% form_tag({:action => 'edit', :id => @document}, :class => "tabular") do %>
|
|
| 4 |
<%= render :partial => 'form' %> |
|
| 5 |
<%= submit_tag l(:button_save) %> |
|
| 6 |
<% end %> |
|
| 7 |
|
|
| 8 |
|
|
| app/views/documents/edit.rhtml | ||
|---|---|---|
| 1 |
<h2><%=l(:label_document)%></h2> |
|
| 2 |
|
|
| 3 |
<% form_tag({:action => 'edit', :id => @document}, :class => "tabular") do %>
|
|
| 4 |
<%= render :partial => 'form' %> |
|
| 5 |
<%= submit_tag l(:button_save) %> |
|
| 6 |
<% end %> |
|
| 7 |
|
|
| 8 |
|
|
| app/views/documents/index.html.erb | ||
|---|---|---|
| 1 |
<div class="contextual"> |
|
| 2 |
<%= link_to_if_authorized l(:label_document_new), |
|
| 3 |
{:controller => 'documents', :action => 'new', :project_id => @project},
|
|
| 4 |
:class => 'icon icon-add', |
|
| 5 |
:onclick => 'Element.show("add-document"); Form.Element.focus("document_title"); return false;' %>
|
|
| 6 |
</div> |
|
| 7 |
|
|
| 8 |
<div id="add-document" style="display:none;"> |
|
| 9 |
<h2><%=l(:label_document_new)%></h2> |
|
| 10 |
<% form_tag({:controller => 'documents', :action => 'new', :project_id => @project}, :class => "tabular", :multipart => true) do %>
|
|
| 11 |
<%= render :partial => 'documents/form' %> |
|
| 12 |
<div class="box"> |
|
| 13 |
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p> |
|
| 14 |
</div> |
|
| 15 |
<%= submit_tag l(:button_create) %> |
|
| 16 |
<%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-document")' %>
|
|
| 17 |
<% end %> |
|
| 18 |
</div> |
|
| 19 |
|
|
| 20 |
<h2><%=l(:label_document_plural)%></h2> |
|
| 21 |
|
|
| 22 |
<% if @grouped.empty? %><p class="nodata"><%= l(:label_no_data) %></p><% end %> |
|
| 23 |
|
|
| 24 |
<% @grouped.keys.sort.each do |group| %> |
|
| 25 |
<h3><%= group %></h3> |
|
| 26 |
<%= render :partial => 'documents/document', :collection => @grouped[group] %> |
|
| 27 |
<% end %> |
|
| 28 |
|
|
| 29 |
<% content_for :sidebar do %> |
|
| 30 |
<h3><%= l(:label_sort_by, '') %></h3> |
|
| 31 |
<% form_tag({}, :method => :get) do %>
|
|
| 32 |
<label><%= radio_button_tag 'sort_by', 'category', (@sort_by == 'category'), :onclick => 'this.form.submit();' %> <%= l(:field_category) %></label><br /> |
|
| 33 |
<label><%= radio_button_tag 'sort_by', 'date', (@sort_by == 'date'), :onclick => 'this.form.submit();' %> <%= l(:label_date) %></label><br /> |
|
| 34 |
<label><%= radio_button_tag 'sort_by', 'title', (@sort_by == 'title'), :onclick => 'this.form.submit();' %> <%= l(:field_title) %></label><br /> |
|
| 35 |
<label><%= radio_button_tag 'sort_by', 'author', (@sort_by == 'author'), :onclick => 'this.form.submit();' %> <%= l(:field_author) %></label> |
|
| 36 |
<% end %> |
|
| 37 |
<% end %> |
|
| 38 |
|
|
| 39 |
<% html_title(l(:label_document_plural)) -%> |
|
| app/views/documents/index.rhtml | ||
|---|---|---|
| 1 |
<div class="contextual"> |
|
| 2 |
<%= link_to_if_authorized l(:label_document_new), |
|
| 3 |
{:controller => 'documents', :action => 'new', :project_id => @project},
|
|
| 4 |
:class => 'icon icon-add', |
|
| 5 |
:onclick => 'Element.show("add-document"); Form.Element.focus("document_title"); return false;' %>
|
|
| 6 |
</div> |
|
| 7 |
|
|
| 8 |
<div id="add-document" style="display:none;"> |
|
| 9 |
<h2><%=l(:label_document_new)%></h2> |
|
| 10 |
<% form_tag({:controller => 'documents', :action => 'new', :project_id => @project}, :class => "tabular", :multipart => true) do %>
|
|
| 11 |
<%= render :partial => 'documents/form' %> |
|
| 12 |
<div class="box"> |
|
| 13 |
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p> |
|
| 14 |
</div> |
|
| 15 |
<%= submit_tag l(:button_create) %> |
|
| 16 |
<%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-document")' %>
|
|
| 17 |
<% end %> |
|
| 18 |
</div> |
|
| 19 |
|
|
| 20 |
<h2><%=l(:label_document_plural)%></h2> |
|
| 21 |
|
|
| 22 |
<% if @grouped.empty? %><p class="nodata"><%= l(:label_no_data) %></p><% end %> |
|
| 23 |
|
|
| 24 |
<% @grouped.keys.sort.each do |group| %> |
|
| 25 |
<h3><%= group %></h3> |
|
| 26 |
<%= render :partial => 'documents/document', :collection => @grouped[group] %> |
|
| 27 |
<% end %> |
|
| 28 |
|
|
| 29 |
<% content_for :sidebar do %> |
|
| 30 |
<h3><%= l(:label_sort_by, '') %></h3> |
|
| 31 |
<% form_tag({}, :method => :get) do %>
|
|
| 32 |
<label><%= radio_button_tag 'sort_by', 'category', (@sort_by == 'category'), :onclick => 'this.form.submit();' %> <%= l(:field_category) %></label><br /> |
|
| 33 |
<label><%= radio_button_tag 'sort_by', 'date', (@sort_by == 'date'), :onclick => 'this.form.submit();' %> <%= l(:label_date) %></label><br /> |
|
| 34 |
<label><%= radio_button_tag 'sort_by', 'title', (@sort_by == 'title'), :onclick => 'this.form.submit();' %> <%= l(:field_title) %></label><br /> |
|
| 35 |
<label><%= radio_button_tag 'sort_by', 'author', (@sort_by == 'author'), :onclick => 'this.form.submit();' %> <%= l(:field_author) %></label> |
|
| 36 |
<% end %> |
|
| 37 |
<% end %> |
|
| 38 |
|
|
| 39 |
<% html_title(l(:label_document_plural)) -%> |
|
| app/views/documents/new.html.erb | ||
|---|---|---|
| 1 |
<h2><%=l(:label_document_new)%></h2> |
|
| 2 |
|
|
| 3 |
<% form_tag({:controller => 'documents', :action => 'new', :project_id => @project}, :class => "tabular", :multipart => true) do %>
|
|
| 4 |
<%= render :partial => 'documents/form' %> |
|
| 5 |
|
|
| 6 |
<div class="box"> |
|
| 7 |
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p> |
|
| 8 |
</div> |
|
| 9 |
|
|
| 10 |
<%= submit_tag l(:button_create) %> |
|
| 11 |
<% end %> |
|
| 12 |
|
|
| 13 |
|
|
| app/views/documents/new.rhtml | ||
|---|---|---|
| 1 |
<h2><%=l(:label_document_new)%></h2> |
|
| 2 |
|
|
| 3 |
<% form_tag({:controller => 'documents', :action => 'new', :project_id => @project}, :class => "tabular", :multipart => true) do %>
|
|
| 4 |
<%= render :partial => 'documents/form' %> |
|
| 5 |
|
|
| 6 |
<div class="box"> |
|
| 7 |
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p> |
|
| 8 |
</div> |
|
| 9 |
|
|
| 10 |
<%= submit_tag l(:button_create) %> |
|
| 11 |
<% end %> |
|
| 12 |
|
|
| 13 |
|
|
| app/views/documents/show.html.erb | ||
|---|---|---|
| 1 |
<div class="contextual"> |
|
| 2 |
<%= link_to_if_authorized l(:button_edit), {:controller => 'documents', :action => 'edit', :id => @document}, :class => 'icon icon-edit', :accesskey => accesskey(:edit) %>
|
|
| 3 |
<%= link_to_if_authorized l(:button_delete), {:controller => 'documents', :action => 'destroy', :id => @document}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
|
|
| 4 |
</div> |
|
| 5 |
|
|
| 6 |
<h2><%=h @document.title %></h2> |
|
| 7 |
|
|
| 8 |
<p><em><%=h @document.category.name %><br /> |
|
| 9 |
<%= format_date @document.created_on %></em></p> |
|
| 10 |
<div class="wiki"> |
|
| 11 |
<%= textilizable @document.description, :attachments => @document.attachments %> |
|
| 12 |
</div> |
|
| 13 |
|
|
| 14 |
<h3><%= l(:label_attachment_plural) %></h3> |
|
| 15 |
<%= link_to_attachments @document %> |
|
| 16 |
|
|
| 17 |
<% if authorize_for('documents', 'add_attachment') %>
|
|
| 18 |
<p><%= link_to l(:label_attachment_new), {}, :onclick => "Element.show('add_attachment_form'); Element.hide(this); Element.scrollTo('add_attachment_form'); return false;",
|
|
| 19 |
:id => 'attach_files_link' %></p> |
|
| 20 |
<% form_tag({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :id => "add_attachment_form", :style => "display:none;") do %>
|
|
| 21 |
<div class="box"> |
|
| 22 |
<p><%= render :partial => 'attachments/form' %></p> |
|
| 23 |
</div> |
|
| 24 |
<%= submit_tag l(:button_add) %> |
|
| 25 |
<% end %> |
|
| 26 |
<% end %> |
|
| 27 |
|
|
| 28 |
<% html_title @document.title -%> |
|
| 29 |
|
|
| 30 |
<% content_for :header_tags do %> |
|
| 31 |
<%= stylesheet_link_tag 'scm' %> |
|
| 32 |
<% end %> |
|
| app/views/documents/show.rhtml | ||
|---|---|---|
| 1 |
<div class="contextual"> |
|
| 2 |
<%= link_to_if_authorized l(:button_edit), {:controller => 'documents', :action => 'edit', :id => @document}, :class => 'icon icon-edit', :accesskey => accesskey(:edit) %>
|
|
| 3 |
<%= link_to_if_authorized l(:button_delete), {:controller => 'documents', :action => 'destroy', :id => @document}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
|
|
| 4 |
</div> |
|
| 5 |
|
|
| 6 |
<h2><%=h @document.title %></h2> |
|
| 7 |
|
|
| 8 |
<p><em><%=h @document.category.name %><br /> |
|
| 9 |
<%= format_date @document.created_on %></em></p> |
|
| 10 |
<div class="wiki"> |
|
| 11 |
<%= textilizable @document.description, :attachments => @document.attachments %> |
|
| 12 |
</div> |
|
| 13 |
|
|
| 14 |
<h3><%= l(:label_attachment_plural) %></h3> |
|
| 15 |
<%= link_to_attachments @document %> |
|
| 16 |
|
|
| 17 |
<% if authorize_for('documents', 'add_attachment') %>
|
|
| 18 |
<p><%= link_to l(:label_attachment_new), {}, :onclick => "Element.show('add_attachment_form'); Element.hide(this); Element.scrollTo('add_attachment_form'); return false;",
|
|
| 19 |
:id => 'attach_files_link' %></p> |
|
| 20 |
<% form_tag({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :id => "add_attachment_form", :style => "display:none;") do %>
|
|
| 21 |
<div class="box"> |
|
| 22 |
<p><%= render :partial => 'attachments/form' %></p> |
|
| 23 |
</div> |
|
| 24 |
<%= submit_tag l(:button_add) %> |
|
| 25 |
<% end %> |
|
| 26 |
<% end %> |
|
| 27 |
|
|
| 28 |
<% html_title @document.title -%> |
|
| 29 |
|
|
| 30 |
<% content_for :header_tags do %> |
|
| 31 |
<%= stylesheet_link_tag 'scm' %> |
|
| 32 |
<% end %> |
|
Also available in: Unified diff