* fixed Issue 8: Allow to enter workflow in upload/commit form
* improved UI for commiting uploads git-svn-id: http://redmine-dmsf.googlecode.com/svn/trunk/redmine_dmsf@52 5e329b0b-a2ee-ea63-e329-299493fc886d
This commit is contained in:
parent
d9d35247a1
commit
8defbe5833
@ -30,6 +30,8 @@ class DmsfUpload
|
|||||||
attr_accessor :minor_version
|
attr_accessor :minor_version
|
||||||
attr_accessor :locked
|
attr_accessor :locked
|
||||||
|
|
||||||
|
attr_accessor :workflow
|
||||||
|
|
||||||
def disk_file
|
def disk_file
|
||||||
"#{DmsfHelper.temp_dir}/#{self.disk_filename}"
|
"#{DmsfHelper.temp_dir}/#{self.disk_filename}"
|
||||||
end
|
end
|
||||||
@ -63,12 +65,14 @@ class DmsfUpload
|
|||||||
@description = nil
|
@description = nil
|
||||||
@major_version = 0
|
@major_version = 0
|
||||||
@minor_version = 0
|
@minor_version = 0
|
||||||
|
@workflow = nil
|
||||||
else
|
else
|
||||||
last_revision = dmsf_file.last_revision
|
last_revision = dmsf_file.last_revision
|
||||||
@title = last_revision.title
|
@title = last_revision.title
|
||||||
@description = last_revision.description
|
@description = last_revision.description
|
||||||
@major_version = last_revision.major_version
|
@major_version = last_revision.major_version
|
||||||
@minor_version = last_revision.minor_version
|
@minor_version = last_revision.minor_version
|
||||||
|
@workflow = last_revision.workflow
|
||||||
end
|
end
|
||||||
|
|
||||||
@locked = !dmsf_file.nil? && dmsf_file.locked_for_user?
|
@locked = !dmsf_file.nil? && dmsf_file.locked_for_user?
|
||||||
|
|||||||
@ -1,38 +1,77 @@
|
|||||||
<div class="box dmsf_upload">
|
<%
|
||||||
|
disabled_workflow = []
|
||||||
|
selected_workflow = nil
|
||||||
|
unless User.current.allowed_to?(:file_approval, @project)
|
||||||
|
disabled_workflow << 2
|
||||||
|
current_workflow = upload.workflow
|
||||||
|
if current_workflow == 1 || current_workflow == 2
|
||||||
|
disabled_workflow << nil
|
||||||
|
selected_workflow = 1
|
||||||
|
end
|
||||||
|
else
|
||||||
|
selected_workflow = upload.workflow
|
||||||
|
end
|
||||||
|
%>
|
||||||
|
<div class="box dmsf_detail">
|
||||||
<%= hidden_field_tag("commited_files[#{i}][disk_filename]", upload.disk_filename) %>
|
<%= hidden_field_tag("commited_files[#{i}][disk_filename]", upload.disk_filename) %>
|
||||||
<fieldset class="tabular">
|
<div class="clear">
|
||||||
<legend><%= h(upload.name) %></legend>
|
|
||||||
<%= hidden_field_tag("commited_files[#{i}][name]", upload.name) %>
|
|
||||||
<div class="splitcontentleft">
|
<div class="splitcontentleft">
|
||||||
<p>
|
<p>
|
||||||
<%= label_tag("commited_files[#{i}][title]", "Title:") %>
|
<%= label_tag("commited_files[#{i}][title]", l(:label_title) + ":") %>
|
||||||
<%= text_field_tag("commited_files[#{i}][title]", upload.title, :size => "32") %>
|
<%= text_field_tag("commited_files[#{i}][title]", upload.title, :size => "32") %>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
|
||||||
<%= label_tag("commited_files[#{i}][description]", "Description:") %>
|
|
||||||
<%= text_area_tag("commited_files[#{i}][description]", upload.description, :rows=> "6") %>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<%= label_tag("commited_files[#{i}][version]_minor", "Version:") %>
|
|
||||||
<%= radio_button_tag("commited_files[#{i}][version]", "minor", true) %>
|
|
||||||
<%= upload.major_version %>.<%= upload.minor_version + 1 %><br />
|
|
||||||
<%= radio_button_tag("commited_files[#{i}][version]", "major") %>
|
|
||||||
<%= upload.major_version + 1 %>.0<br />
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="splitcontentright">
|
<div class="splitcontentright">
|
||||||
<p>
|
<p>
|
||||||
<%= label_tag("commited_files[#{i}][comment]", "Comment:") %>
|
<%= label_tag("", l(:label_filename) + ":") %>
|
||||||
<%= text_area_tag("commited_files[#{i}][comment]", upload.comment, :rows=> "2") %>
|
<%= h(upload.name) %>
|
||||||
|
<%= hidden_field_tag("commited_files[#{i}][name]", upload.name) %>
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p class="no-ident">
|
||||||
|
<%= label_tag("commited_files[#{i}][description]", l(:label_description) + ":") %>
|
||||||
|
</p>
|
||||||
|
<div class="wiki data clear">
|
||||||
|
<%= text_area_tag("commited_files[#{i}][description]", upload.description, :rows=> "6", :class => "wiki-edit") %>
|
||||||
|
</div>
|
||||||
|
<div class="splitcontentleft">
|
||||||
<p>
|
<p>
|
||||||
<%= label_tag("", "Mime:") %>
|
<%= label_tag("commited_files[#{i}][version]_minor", l(:label_version) + ":") %>
|
||||||
|
</p>
|
||||||
|
<div class="data clear">
|
||||||
|
<%= radio_button_tag("commited_files[#{i}][version]", "minor", true) %>
|
||||||
|
<%= upload.major_version %>.<%= upload.minor_version + 1 %> <%= l(:option_version_minor) %><br />
|
||||||
|
<%= radio_button_tag("commited_files[#{i}][version]", "major") %>
|
||||||
|
<%= upload.major_version + 1 %>.0 <%= l(:option_version_major) %><br />
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
<%= label_tag("commited_files[#{i}][workflow]", l(:label_workflow) + ":") %>
|
||||||
|
<%= select_tag("commited_files[#{i}][workflow]",
|
||||||
|
options_for_select([
|
||||||
|
[l(:option_workflow_none), nil],
|
||||||
|
[l(:option_workflow_waiting_for_approval), 1],
|
||||||
|
[l(:option_workflow_approved), 2]],
|
||||||
|
:selected => selected_workflow, :disabled => disabled_workflow)) %>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="splitcontentright clear">
|
||||||
|
<p>
|
||||||
|
<%= label_tag("", l(:label_mime) + ":") %>
|
||||||
<%= h(upload.mime_type) %>
|
<%= h(upload.mime_type) %>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<%= label_tag("", "Size:") %>
|
<%= label_tag("", l(:label_size) + ":") %>
|
||||||
<%= number_to_human_size(upload.size) %>
|
<%= number_to_human_size(upload.size) %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
<br style="clear: both"/>
|
||||||
|
<p>
|
||||||
|
<%= label_tag("commited_files[#{i}][comment]", l(:label_comment) + ":") %>
|
||||||
|
<div class="data">
|
||||||
|
<%= text_area_tag("commited_files[#{i}][comment]", upload.comment, :rows=> "2", :style => "width: 99%;") %>
|
||||||
</div>
|
</div>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%= wikitoolbar_for "commited_files_#{i}_description" %>
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
<%
|
<%
|
||||||
i = 1
|
i = 1
|
||||||
form_tag({:action => "commit_files", :id => @project, :folder_id => @folder},
|
form_tag({:action => "commit_files", :id => @project, :folder_id => @folder},
|
||||||
:method=>:post, :class => "tabular") do
|
:method=>:post) do
|
||||||
%>
|
%>
|
||||||
<% @uploads.each do |upload| %>
|
<% @uploads.each do |upload| %>
|
||||||
<% if upload.locked %>
|
<% if upload.locked %>
|
||||||
|
|||||||
@ -34,7 +34,7 @@ es:
|
|||||||
:notice_folder_notifications_deactivated: "Notificaciones de carpeta desactivadas"
|
:notice_folder_notifications_deactivated: "Notificaciones de carpeta desactivadas"
|
||||||
:warning_file_notifications_already_activated: "Las notificaciones del archivo seleccionado ya estaban activadas previamente"
|
:warning_file_notifications_already_activated: "Las notificaciones del archivo seleccionado ya estaban activadas previamente"
|
||||||
:notice_file_notifications_activated: "Notificación de archivo activado"
|
:notice_file_notifications_activated: "Notificación de archivo activado"
|
||||||
:warning_file_notifications_already_deactivated: "Las notificaciones del archivo seleccionado ya estaban desactivadas previamente""
|
:warning_file_notifications_already_deactivated: "Las notificaciones del archivo seleccionado ya estaban desactivadas previamente"
|
||||||
:notice_file_notifications_deactivated: "Notificación de archivo desactivada"
|
:notice_file_notifications_deactivated: "Notificación de archivo desactivada"
|
||||||
|
|
||||||
# Not translated
|
# Not translated
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user