summaryrefslogtreecommitdiffstats
path: root/app/views/documents
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-12-18 18:50:41 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-12-18 18:50:41 +0000
commit8e00f57a886ae529ae308a17bfc9a363056754bf (patch)
treec6b14ccef81ea31948c3ce87d1176593ca56b152 /app/views/documents
parent524cd689cf8743c389aab6a767a09383891dc5c6 (diff)
downloadredmine-8e00f57a886ae529ae308a17bfc9a363056754bf.tar.gz
redmine-8e00f57a886ae529ae308a17bfc9a363056754bf.zip
Moved ProjectsController#list_documents and add_document to DocumentsController#index and new.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1011 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/documents')
-rw-r--r--app/views/documents/index.rhtml39
-rw-r--r--app/views/documents/new.rhtml13
2 files changed, 52 insertions, 0 deletions
diff --git a/app/views/documents/index.rhtml b/app/views/documents/index.rhtml
new file mode 100644
index 000000000..a7cefb733
--- /dev/null
+++ b/app/views/documents/index.rhtml
@@ -0,0 +1,39 @@
+<div class="contextual">
+<%= link_to_if_authorized l(:label_document_new),
+ {:controller => 'documents', :action => 'new', :project_id => @project},
+ :class => 'icon icon-add',
+ :onclick => 'Element.show("add-document"); return false;' %>
+</div>
+
+<div id="add-document" style="display:none;">
+<h2><%=l(:label_document_new)%></h2>
+<% form_tag({:controller => 'documents', :action => 'new', :project_id => @project}, :class => "tabular", :multipart => true) do %>
+<%= render :partial => 'documents/form' %>
+<div class="box">
+<%= render :partial => 'common/attachments_form'%>
+</div>
+<%= submit_tag l(:button_create) %>
+<%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-document")' %>
+<% end %>
+</div>
+
+<h2><%=l(:label_document_plural)%></h2>
+
+<% if @grouped.empty? %><p class="nodata"><%= l(:label_no_data) %></p><% end %>
+
+<% @grouped.keys.sort.each do |group| %>
+ <h3><%= group %></h3>
+ <%= render :partial => 'documents/document', :collection => @grouped[group] %>
+<% end %>
+
+<% content_for :sidebar do %>
+ <h3><%= l(:label_sort_by, '') %></h3>
+ <% form_tag({}, :method => :get) do %>
+ <label><%= radio_button_tag 'sort_by', 'category', (@sort_by == 'category'), :onclick => 'this.form.submit();' %> <%= l(:field_category) %></label><br />
+ <label><%= radio_button_tag 'sort_by', 'date', (@sort_by == 'date'), :onclick => 'this.form.submit();' %> <%= l(:label_date) %></label><br />
+ <label><%= radio_button_tag 'sort_by', 'title', (@sort_by == 'title'), :onclick => 'this.form.submit();' %> <%= l(:field_title) %></label><br />
+ <label><%= radio_button_tag 'sort_by', 'author', (@sort_by == 'author'), :onclick => 'this.form.submit();' %> <%= l(:field_author) %></label>
+ <% end %>
+<% end %>
+
+<% set_html_title l(:label_document_plural) -%>
diff --git a/app/views/documents/new.rhtml b/app/views/documents/new.rhtml
new file mode 100644
index 000000000..4f728da79
--- /dev/null
+++ b/app/views/documents/new.rhtml
@@ -0,0 +1,13 @@
+<h2><%=l(:label_document_new)%></h2>
+
+<% form_tag({:controller => 'documents', :action => 'new', :project_id => @project}, :class => "tabular", :multipart => true) do %>
+<%= render :partial => 'documents/form' %>
+
+<div class="box">
+<%= render :partial => 'common/attachments_form'%>
+</div>
+
+<%= submit_tag l(:button_create) %>
+<% end %>
+
+