vit.jonas@gmail.com 5016dbde2d * work on Issue 142: Copy Folder option
git-svn-id: http://redmine-dmsf.googlecode.com/svn/trunk/redmine_dmsf@252 5e329b0b-a2ee-ea63-e329-299493fc886d
2011-10-10 12:06:12 +00:00

56 lines
2.1 KiB
Plaintext

<% html_title(l(:dmsf)) %>
<div class="contextual">
</div>
<% path = @file.folder.nil? ? [] : @file.folder.dmsf_path %>
<h2>
<%= render(:partial => "/dmsf/path", :locals => {:path => path}) %>
/
<%= link_to(h(@file.title), {:controller => "dmsf_files", :action => "show", :id=> @file}) %>
<%= 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| %>
<div class="box dmsf_detail">
<p>
<label for="target_project_id"><%=l(:label_target_project)%>:</label>
<%= select_tag("target_project_id",
project_tree_options_for_select(DmsfFile.allowed_target_projects_on_copy, :selected => @target_project),
:onchange => remote_function(:url => { :action => 'new' },
:method => :get,
:update => 'content',
:with => "Form.serialize('copyForm')")) %>
</p>
<p>
<%= label_tag("target_folder_id", l(:label_target_folder) + ":") %>
<%= select_tag("target_folder_id",
options_for_select(DmsfFolder.directory_tree(@target_project),
:selected => (@target_folder.id unless @target_folder.nil?))) %>
</p>
</div>
<%= submit_tag(l(:button_copy)) %>
<% if User.current.allowed_to?(:file_manipulation, @project) %>
<button type="button" id="move_button" title="<%=l(:button_move)%>"><%=l(:button_move)%></button>
<% end %>
<% end %>
<% end %>
<script type="text/javascript">
jQuery("#move_button").click(function(event) {
jQuery("#copyForm").attr("action", "<%= url_for(:action => 'move', :id => @file) %>");
jQuery("#copyForm").submit();
});
</script>
<% content_for :header_tags do %>
<%= stylesheet_link_tag "dmsf", :plugin => "redmine_dmsf" %>
<%= robot_exclusion_tag %>
<%= javascript_include_tag "jquery-1.6.1.min.js", :plugin => "redmine_dmsf" %>
<script type="text/javascript">
jQuery.noConflict();
</script>
<% end %>