Updating routes to integrate with projects (more appropriately), dmsf_state and settings html updated

This commit is contained in:
Daniel Munn 2012-06-03 12:37:50 +01:00
parent 5de5804f0d
commit 6c09656467
5 changed files with 23 additions and 22 deletions

View File

@ -24,7 +24,7 @@ class DmsfStateController < ApplicationController
before_filter :find_project
before_filter :authorize
verify :method => :post, :only => [:user_pref_save], :render => { :nothing => true, :status => :method_not_allowed }
# verify :method => :post, :only => [:user_pref_save], :render => { :nothing => true, :status => :method_not_allowed }
helper :all

View File

@ -11,8 +11,8 @@
<%= image_tag("notify.png", :plugin => "redmine_dmsf", :title => l(:title_notifications_active)) if @file.notification %>
</h2>
<% unless DmsfFile.allowed_target_projects_on_copy.blank?
form_tag({:action => "create", :id => @file}, :id => "copyForm") do |f| %>
<% unless DmsfFile.allowed_target_projects_on_copy.blank? %>
<%= form_tag({:action => "create", :id => @file}, :id => "copyForm") do |f| %>
<div class="box dmsf_detail">
<p>
<label for="target_project_id"><%=l(:label_target_project)%>:</label>

View File

@ -16,7 +16,7 @@
</div>
<% end %>
<% form_for :project, @project, :url => project_path(@project), :html => {:method=>:post} do %>
<%= form_for @project, :url => project_path(@project), :html => {:method=>:post} do %>
<% custom_fields = DmsfFileRevisionCustomField.find(:all) %>
<% unless custom_fields.empty? %>
<fieldset id="project_issue_custom_fields"><legend><%=l(:label_custom_field_plural)%></legend>

View File

@ -26,10 +26,10 @@
<%=content_tag(:label, l(:label_file_storage_directory) + ":") %>
<%
storage_dir = @settings["dmsf_storage_directory"].strip
storage_dir = "#{RAILS_ROOT}/files/dmsf" if storage_dir.blank?
storage_dir = "#{Rails.root}/files/dmsf" if storage_dir.blank?
%>
<%=text_field_tag "settings[dmsf_storage_directory]", storage_dir, :size=>50 %><br/>
(<%=l(:label_default)%>: <%="#{RAILS_ROOT}/files/dmsf"%>)
(<%=l(:label_default)%>: <%="#{Rails.root}/files/dmsf"%>)
</p>
<% unless File.exists?(storage_dir)
begin
@ -93,7 +93,7 @@
<p>
<%=content_tag(:label, l(:label_index_database) + ":") %>
<%=text_field_tag 'settings[dmsf_index_database]', @settings['dmsf_index_database'], :disabled => xapian_disabled, :size=>50 %><br/>
(<%=l(:label_default)%>: <%="#{RAILS_ROOT}/files/dmsf_index"%>)
(<%=l(:label_default)%>: <%="#{Rails.root}/files/dmsf_index"%>)
</p>
<p>

View File

@ -16,16 +16,18 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ActionController::Routing::Routes.draw do |map|
RedmineApp::Application.routes.draw do
# map.resources :dmsf
# map.resources :dmsf_files
resources :dmsf
# resources :dmsf_files
post '/dmsf/:id/upload/files', :controller => 'dmsf_upload', :action => 'upload_files'
post '/dmsf/:id/upload/file', :controller => 'dmsf_upload', :action => 'upload_file'
post '/dmsf/:id/upload/commit', :controller => 'dmsf_upload', :action => 'commit_files'
#/projects/<project>/dmsf/state - dmsf_state controller
post '/projects/:id/dmsf/state', :controller => 'dmsf_state', :action => 'user_pref_save'
#/projects/<project>/dmsf/upload - dmsf_upload controller
post '/projects/:id/dmsf/upload/files', :controller => 'dmsf_upload', :action => 'upload_files'
post '/projects/:id/dmsf/upload/file', :controller => 'dmsf_upload', :action => 'upload_file'
post '/projects/:id/dmsf/upload/commit', :controller => 'dmsf_upload', :action => 'commit_files'
#/dmsf/files - dmsf_files controller
post '/dmsf/files/:id/notify/activate', :controller => 'dmsf_files', :action => 'notify_activate'
@ -34,18 +36,17 @@ RedmineApp::Application.routes.draw do
post '/dmsf/files/:id/unlock', :controller => 'dmsf_files', :action => 'unlock'
post '/dmsf/files/:id/delete', :controller => 'dmsf_files', :action => 'delete'
post '/dmsf/files/:id/revision/create', :controller => 'dmsf_files', :action => 'create_revision'
post '/dmsf/files/revision/:id/delete', :controller => 'dmsf_files', :action => 'delete_revision'
post '/dmsf/files/:id/revision/delete', :controller => 'dmsf_files', :action => 'delete_revision'
get '/dmsf/files/:id/download', :controller => 'dmsf_files', :action => 'show', :download => ''
get '/dmsf/files/:id/revision/:download/download', :controller => 'dmsf_files', :action => 'show', :download => /\d*/
get '/dmsf/files/:id/download', :controller => 'dmsf_files', :action => 'show'
get '/dmsf/files/:id', :controller => 'dmsf_files', :action => 'show'
# post '/dmsf/files/:id/revision/delete'
#
# files_copy controller
##
##### POST :create, :move
post '/dmsf/files/:id/copy/create', :controller => 'dmsf_files_copy', :action => 'create'
post '/dmsf/files/:id/copy/move', :controller => 'dmsf_files_copy', :action => 'move'
get '/dmsf/files/:id/copy', :controller => 'dmsf_files_copy', :action => 'new'
end