* improved file detail available actions
* replaced action links with icons * fixed Issue 7: Include lock state info in file detail git-svn-id: http://redmine-dmsf.googlecode.com/svn/trunk/redmine_dmsf@48 5e329b0b-a2ee-ea63-e329-299493fc886d
This commit is contained in:
parent
4b4c74f2b3
commit
d0fa6cebc1
@ -187,7 +187,7 @@ class DmsfController < ApplicationController
|
||||
|
||||
def send_revision
|
||||
send_file(@revision.disk_file,
|
||||
:filename => filename_for_content_disposition(@revision.file.name),
|
||||
:filename => filename_for_content_disposition(@revision.name),
|
||||
:type => @revision.detect_content_type,
|
||||
:disposition => "attachment")
|
||||
end
|
||||
|
||||
@ -31,7 +31,8 @@ class DmsfStateController < ApplicationController
|
||||
@file.lock
|
||||
flash[:notice] = l(:notice_file_locked)
|
||||
end
|
||||
redirect_to :controller => "dmsf", :action => "index", :id => @project, :folder_id => @file.folder
|
||||
redirect_to params[:current] ? params[:current] :
|
||||
{:controller => "dmsf", :action => "index", :id => @project, :folder_id => @file.folder}
|
||||
end
|
||||
|
||||
def unlock_file
|
||||
@ -45,7 +46,8 @@ class DmsfStateController < ApplicationController
|
||||
flash[:error] = l(:error_only_user_that_locked_file_can_unlock_it)
|
||||
end
|
||||
end
|
||||
redirect_to :controller => "dmsf", :action => "index", :id => @project, :folder_id => @file.folder
|
||||
redirect_to params[:current] ? params[:current] :
|
||||
{:controller => "dmsf", :action => "index", :id => @project, :folder_id => @file.folder}
|
||||
end
|
||||
|
||||
def user_pref
|
||||
@ -66,7 +68,8 @@ class DmsfStateController < ApplicationController
|
||||
@folder.notify_activate
|
||||
flash[:notice] = l(:notice_folder_notifications_activated)
|
||||
end
|
||||
redirect_to :controller => "dmsf", :action => "index", :id => @project, :folder_id => @folder.folder
|
||||
redirect_to params[:current] ? params[:current] :
|
||||
{:controller => "dmsf", :action => "index", :id => @project, :folder_id => @folder.folder}
|
||||
end
|
||||
|
||||
def folder_notify_deactivate
|
||||
@ -76,7 +79,8 @@ class DmsfStateController < ApplicationController
|
||||
@folder.notify_deactivate
|
||||
flash[:notice] = l(:notice_folder_notifications_deactivated)
|
||||
end
|
||||
redirect_to :controller => "dmsf", :action => "index", :id => @project, :folder_id => @folder.folder
|
||||
redirect_to params[:current] ? params[:current] :
|
||||
{:controller => "dmsf", :action => "index", :id => @project, :folder_id => @folder.folder}
|
||||
end
|
||||
|
||||
def file_notify_activate
|
||||
@ -86,7 +90,8 @@ class DmsfStateController < ApplicationController
|
||||
@file.notify_activate
|
||||
flash[:notice] = l(:notice_file_notifications_activated)
|
||||
end
|
||||
redirect_to :controller => "dmsf", :action => "index", :id => @project, :folder_id => @file.folder
|
||||
redirect_to params[:current] ? params[:current] :
|
||||
{:controller => "dmsf", :action => "index", :id => @project, :folder_id => @file.folder}
|
||||
end
|
||||
|
||||
def file_notify_deactivate
|
||||
@ -96,7 +101,8 @@ class DmsfStateController < ApplicationController
|
||||
@file.notify_deactivate
|
||||
flash[:notice] = l(:notice_file_notifications_deactivated)
|
||||
end
|
||||
redirect_to :controller => "dmsf", :action => "index", :id => @project, :folder_id => @file.folder
|
||||
redirect_to params[:current] ? params[:current] :
|
||||
{:controller => "dmsf", :action => "index", :id => @project, :folder_id => @file.folder}
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@ -141,7 +141,7 @@ form_tag({:action => "entries_operation", :id => @project, :folder_id => @folder
|
||||
{:controller => "dmsf_detail", :action => "file_detail", :id => @project, :file_id => file },
|
||||
:title => l(:link_details, :title =>h(file.last_revision.title))) %>
|
||||
</div>
|
||||
<div style="float: right">
|
||||
<div style="float: right; width: 44px;">
|
||||
<% unless file.locked_for_user? && !User.current.allowed_to?(:force_file_unlock, @project)%>
|
||||
<% if file.locked? %>
|
||||
<%= link_to(image_tag("unlock.png", :plugin => "redmine_dmsf"),
|
||||
@ -154,7 +154,7 @@ form_tag({:action => "entries_operation", :id => @project, :folder_id => @folder
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
<% if User.current.allowed_to?(:file_manipulation, @project) %>
|
||||
<% if User.current.allowed_to?(:file_manipulation, @project) && !file.locked_for_user? %>
|
||||
<%= link_to(image_tag("delete.png", :plugin => "redmine_dmsf"),
|
||||
{:controller => "dmsf_detail", :action => "delete_file", :id => @project,
|
||||
:file_id => file}, :class => "delete-link", :title => l(:title_delete)) %>
|
||||
|
||||
@ -1,13 +1,46 @@
|
||||
<% html_title(l(:dmsf)) %>
|
||||
|
||||
<div class="contextual">
|
||||
<% if User.current.allowed_to?(:file_manipulation, @project) %>
|
||||
<% unless @file.locked_for_user? && !User.current.allowed_to?(:force_file_unlock, @project)%>
|
||||
<% if @file.locked? %>
|
||||
<%= link_to(image_tag("unlock.png", :plugin => "redmine_dmsf"),
|
||||
{:controller => "dmsf_state", :action => "unlock_file", :id => @project, :file_id => @file,
|
||||
:current => request.url },
|
||||
:title => l(:title_unlock_file)) %>
|
||||
<% else %>
|
||||
<%= link_to(image_tag("lock.png", :plugin => "redmine_dmsf"),
|
||||
{:controller => "dmsf_state", :action => "lock_file", :id => @project, :file_id => @file,
|
||||
:current => request.url },
|
||||
:title => l(:title_lock_file)) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if User.current.allowed_to?(:file_manipulation, @project) && !@file.locked_for_user? %>
|
||||
|
||||
<%= link_to(image_tag("delete.png", :plugin => "redmine_dmsf"),
|
||||
{:controller => "dmsf_detail", :action => "delete_file", :id => @project,
|
||||
:file_id => @file}, :class => "delete-entry", :title => l(:title_delete)) %>
|
||||
<% end %>
|
||||
<% if User.current.allowed_to?(:file_approval, @project) %>
|
||||
|
||||
<% if @file.notification %>
|
||||
<%= link_to(image_tag("notify.png", :plugin => "redmine_dmsf"),
|
||||
{:controller => "dmsf_state", :action => "file_notify_deactivate", :id => @project,
|
||||
:file_id => @file, :current => request.url }, :title => l(:title_notifications_active_deactivate)) %>
|
||||
<% else %>
|
||||
<%= link_to(image_tag("notifynot.png", :plugin => "redmine_dmsf"),
|
||||
{:controller => "dmsf_state", :action => "file_notify_activate", :id => @project,
|
||||
:file_id => @file, :current => request.url}, :title => l(:title_notifications_not_active_activate)) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% path = @file.folder.nil? ? [] : @file.folder.dmsf_path %>
|
||||
<h2>
|
||||
<%= render(:partial => "/dmsf/path", :locals => {:path => path}) %>
|
||||
/
|
||||
<%= h(@file.last_revision.title) %> <div style="float: right"><%= h(@file.name) %></div>
|
||||
<%= h(@file.last_revision.title) %>
|
||||
<% if @file.notification %>
|
||||
<%= image_tag("notify.png", :plugin => "redmine_dmsf",
|
||||
:title => l(:title_notifications_active)) %>
|
||||
@ -22,12 +55,14 @@
|
||||
<% @file.revisions.each do |revision| %>
|
||||
<div class="box dmsf_detail">
|
||||
<div style="float:right">
|
||||
<%= link_to(l(:title_download),
|
||||
{:controller=>"dmsf", :action => "download_revision", :id => @project, :revision_id => revision}) %>
|
||||
<%= link_to(image_tag("download.png", :plugin => "redmine_dmsf"),
|
||||
{:controller=>"dmsf", :action => "download_revision", :id => @project, :revision_id => revision},
|
||||
:title => l(:title_title_version_version_download, :title => h(revision.title), :version => revision.version)) %>
|
||||
<% if User.current.allowed_to?(:file_approval, @project) %>
|
||||
| <%= link_to(l(:title_delete),
|
||||
|
||||
<%= link_to(image_tag("delete.png", :plugin => "redmine_dmsf"),
|
||||
{:action => "delete_revision", :id => @project, :revision_id => revision},
|
||||
:class => "delete-link", :title => l(:title_delete_revision)) %>
|
||||
:class => "delete-revision", :title => l(:title_delete_revision)) %>
|
||||
<% end %>
|
||||
</div>
|
||||
<p class="no-ident">
|
||||
@ -94,10 +129,14 @@
|
||||
jQuery.noConflict();
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("a.delete-link").click(function(event) {
|
||||
jQuery("a.delete-revision").click(function(event) {
|
||||
if(!window.confirm("<%= l(:question_do_you_really_want_to_delete_this_revision) %>")) event.preventDefault();
|
||||
})
|
||||
|
||||
jQuery("a.delete-entry").click(function(event) {
|
||||
if(!window.confirm("<%= l(:question_do_you_really_want_to_delete_this_entry) %>")) event.preventDefault();
|
||||
})
|
||||
|
||||
jQuery("#fileFileUpload").change(function() {
|
||||
if(jQuery("input[name=\"file[version]\"]:checked").val() == "same") {
|
||||
jQuery("#fileMinorVersionRadio").prop("checked", true);
|
||||
|
||||
BIN
assets/images/download.png
Normal file
BIN
assets/images/download.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
@ -107,3 +107,4 @@ en:
|
||||
:option_version_major: "Major"
|
||||
:label_new_content: "New content"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user