diff --git a/app/helpers/dmsf_upload.rb b/app/helpers/dmsf_upload.rb index 2ae9999c..85ec1dc3 100644 --- a/app/helpers/dmsf_upload.rb +++ b/app/helpers/dmsf_upload.rb @@ -30,6 +30,8 @@ class DmsfUpload attr_accessor :minor_version attr_accessor :locked + attr_accessor :workflow + def disk_file "#{DmsfHelper.temp_dir}/#{self.disk_filename}" end @@ -63,12 +65,14 @@ class DmsfUpload @description = nil @major_version = 0 @minor_version = 0 + @workflow = nil else last_revision = dmsf_file.last_revision @title = last_revision.title @description = last_revision.description @major_version = last_revision.major_version @minor_version = last_revision.minor_version + @workflow = last_revision.workflow end @locked = !dmsf_file.nil? && dmsf_file.locked_for_user? diff --git a/app/views/dmsf_detail/_upload_file.html.erb b/app/views/dmsf_detail/_upload_file.html.erb index 35afb078..e498a923 100644 --- a/app/views/dmsf_detail/_upload_file.html.erb +++ b/app/views/dmsf_detail/_upload_file.html.erb @@ -1,38 +1,77 @@ -
+<% +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 +%> +
<%= hidden_field_tag("commited_files[#{i}][disk_filename]", upload.disk_filename) %> -
- <%= h(upload.name) %> - <%= hidden_field_tag("commited_files[#{i}][name]", upload.name) %> +

- <%= 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") %>

-

- <%= label_tag("commited_files[#{i}][description]", "Description:") %> - <%= text_area_tag("commited_files[#{i}][description]", upload.description, :rows=> "6") %> -

-

- <%= label_tag("commited_files[#{i}][version]_minor", "Version:") %> - <%= radio_button_tag("commited_files[#{i}][version]", "minor", true) %> - <%= upload.major_version %>.<%= upload.minor_version + 1 %>
- <%= radio_button_tag("commited_files[#{i}][version]", "major") %> - <%= upload.major_version + 1 %>.0
-

- <%= label_tag("commited_files[#{i}][comment]", "Comment:") %> - <%= text_area_tag("commited_files[#{i}][comment]", upload.comment, :rows=> "2") %> -

-

- <%= label_tag("", "Mime:") %> - <%= h(upload.mime_type) %> -

-

- <%= label_tag("", "Size:") %> - <%= number_to_human_size(upload.size) %> + <%= label_tag("", l(:label_filename) + ":") %> + <%= h(upload.name) %> + <%= hidden_field_tag("commited_files[#{i}][name]", upload.name) %>

-
-
\ No newline at end of file +
+

+ <%= label_tag("commited_files[#{i}][description]", l(:label_description) + ":") %> +

+
+ <%= text_area_tag("commited_files[#{i}][description]", upload.description, :rows=> "6", :class => "wiki-edit") %> +
+
+

+ <%= label_tag("commited_files[#{i}][version]_minor", l(:label_version) + ":") %> +

+
+ <%= radio_button_tag("commited_files[#{i}][version]", "minor", true) %> + <%= upload.major_version %>.<%= upload.minor_version + 1 %> <%= l(:option_version_minor) %>
+ <%= radio_button_tag("commited_files[#{i}][version]", "major") %> + <%= upload.major_version + 1 %>.0 <%= l(:option_version_major) %>
+
+

+ <%= 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)) %> +

+
+
+

+ <%= label_tag("", l(:label_mime) + ":") %> + <%= h(upload.mime_type) %> +

+

+ <%= label_tag("", l(:label_size) + ":") %> + <%= number_to_human_size(upload.size) %> +

+
+
+

+ <%= label_tag("commited_files[#{i}][comment]", l(:label_comment) + ":") %> +

+ <%= text_area_tag("commited_files[#{i}][comment]", upload.comment, :rows=> "2", :style => "width: 99%;") %> +
+

+ + +<%= wikitoolbar_for "commited_files_#{i}_description" %> diff --git a/app/views/dmsf_detail/upload_files.html.erb b/app/views/dmsf_detail/upload_files.html.erb index 242b86c2..ecf834b9 100644 --- a/app/views/dmsf_detail/upload_files.html.erb +++ b/app/views/dmsf_detail/upload_files.html.erb @@ -16,7 +16,7 @@ <% i = 1 form_tag({:action => "commit_files", :id => @project, :folder_id => @folder}, - :method=>:post, :class => "tabular") do + :method=>:post) do %> <% @uploads.each do |upload| %> <% if upload.locked %> diff --git a/config/locales/es.yml b/config/locales/es.yml index 7914bd66..0bb07430 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -23,7 +23,7 @@ es: :error_file_is_locked: "Archivo bloqueado" :notice_file_deleted: "Archivo borrado" :error_at_least_one_revision_must_be_present: "al menos una revisión debe estar presente" - :notice_revision_deleted: "Revision eliminada correctamente " + :notice_revision_deleted: "Revision eliminada correctamente" :warning_one_of_files_locked: "Uno de los archivos está bloqueado" :notice_file_unlocked: "Archivo desbloqueado" :notice_file_revision_created: "Revision de archivos creada correctamente" @@ -34,7 +34,7 @@ es: :notice_folder_notifications_deactivated: "Notificaciones de carpeta desactivadas" :warning_file_notifications_already_activated: "Las notificaciones del archivo seleccionado ya estaban activadas previamente" :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" # Not translated