* localized file details

git-svn-id: http://redmine-dmsf.googlecode.com/svn/trunk/redmine_dmsf@45 5e329b0b-a2ee-ea63-e329-299493fc886d
This commit is contained in:
vit.jonas@gmail.com 2011-05-16 08:12:47 +00:00
parent ca25cfa255
commit c52ea77b9a
12 changed files with 199 additions and 42 deletions

View File

@ -82,7 +82,6 @@ class DmsfDetailController < ApplicationController
def file_detail def file_detail
@revision = @file.last_revision.clone @revision = @file.last_revision.clone
@revision.comment = ""
end end
#TODO: separate control for approval #TODO: separate control for approval

View File

@ -1,5 +1,5 @@
<div class="box dmsf_detail dmsf_revision"> <div class="box dmsf_detail">
<strong>New Revision <a href="#" id="newRevisionFormContentToggle">[-]</a></strong> <strong><%= l(:heading_new_revision) %> <a href="#" id="newRevisionFormContentToggle">[-]</a></strong>
<div id="newRevisionFormContent"> <div id="newRevisionFormContent">
<% if @file.locked_for_user? %> <% if @file.locked_for_user? %>
<p class="warning"><%= l(:info_file_locked) %></p> <p class="warning"><%= l(:info_file_locked) %></p>
@ -24,47 +24,50 @@ form_for(:dmsf_file_revision, @revision, :url => {:action => "save_file", :id =>
<div class="clear"> <div class="clear">
<div class="splitcontentleft"> <div class="splitcontentleft">
<p> <p>
<%= label_tag("dmsf_file_revision_title", "Title:") %> <%= label_tag("dmsf_file_revision_title", l(:label_title) + ":") %>
<%= f.text_field(:title, :size => "32") %> <%= f.text_field(:title, :size => "32") %>
</p> </p>
</div> </div>
<div class="splitcontentright"> <div class="splitcontentright">
<p> <p>
<%= label_tag("", "Filename:") %> <%= label_tag("", l(:label_filename) + ":") %>
<%= h(@revision.name) %> <%= h(@revision.name) %>
</p> </p>
</div> </div>
</div> </div>
<p class="no-ident"> <p class="no-ident">
<%= label_tag("dmsf_file_revision_description", "Description:") %> <%= label_tag("dmsf_file_revision_description", l(:label_description) + ":") %>
</p> </p>
<div class="wiki data clear"> <div class="wiki data clear">
<%= f.text_area(:description, :rows=> "6", :class => "wiki-edit") %> <%= f.text_area(:description, :rows=> "6", :class => "wiki-edit") %>
</div> </div>
<div class="splitcontentleft"> <div class="splitcontentleft">
<p> <p>
<%= label_tag("fileMinorVersionRadio", "Version:") %> <%= label_tag("fileMinorVersionRadio", l(:label_version) + ":") %>
</p> </p>
<div class="data clear"> <div class="data clear">
<%= radio_button_tag("dmsf_file_revision[version]", "same", @revision.version == @file.last_revision.version, :id => "fileSameVersionRadio") %> <%= radio_button_tag("dmsf_file_revision[version]", "same", @revision.version == @file.last_revision.version, :id => "fileSameVersionRadio") %>
<%= @file.last_revision.major_version %>.<%= @file.last_revision.minor_version %> Same<br /> <%= @file.last_revision.major_version %>.<%= @file.last_revision.minor_version %> <%= l(:option_version_same) %><br />
<%= radio_button_tag("dmsf_file_revision[version]", "minor", <%= radio_button_tag("dmsf_file_revision[version]", "minor",
@revision.major_version == @file.last_revision.major_version && @revision.minor_version != @file.last_revision.minor_version, @revision.major_version == @file.last_revision.major_version && @revision.minor_version != @file.last_revision.minor_version,
:id => "fileMinorVersionRadio") %> :id => "fileMinorVersionRadio") %>
<%= @file.last_revision.major_version %>.<%= @file.last_revision.minor_version + 1 %> Minor<br /> <%= @file.last_revision.major_version %>.<%= @file.last_revision.minor_version + 1 %> <%= l(:option_version_minor) %><br />
<%= radio_button_tag("dmsf_file_revision[version]", "major", @revision.major_version != @file.last_revision.major_version) %> <%= radio_button_tag("dmsf_file_revision[version]", "major", @revision.major_version != @file.last_revision.major_version) %>
<%= @file.last_revision.major_version + 1 %>.0 Major<br /> <%= @file.last_revision.major_version + 1 %>.0 <%= l(:option_version_major) %><br />
</div> </div>
<p> <p>
<%= label_tag("dmsf_file_revision_workflow", "Workflow:") %> <%= label_tag("dmsf_file_revision_workflow", l(:label_workflow) + ":") %>
<%= f.select(:workflow, <%= f.select(:workflow,
options_for_select([["None", nil], ["Waiting for approval", 1], ["Approved", 2]], 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)) %> :selected => selected_workflow, :disabled => disabled_workflow)) %>
</p> </p>
</div> </div>
<div class="splitcontentright clear"> <div class="splitcontentright clear">
<p> <p>
<%= label_tag("fileFileUpload", "New content:") %> <%= label_tag("fileFileUpload", l(:label_new_content) + ":") %>
<div class="data"> <div class="data">
<%= file_field_tag("dmsf_file_revision[file]", :size => 30, :id => "fileFileUpload") %> <%= file_field_tag("dmsf_file_revision[file]", :size => 30, :id => "fileFileUpload") %>
<br /> <br />
@ -76,13 +79,13 @@ form_for(:dmsf_file_revision, @revision, :url => {:action => "save_file", :id =>
</div> </div>
<br style="clear: both"/> <br style="clear: both"/>
<p> <p>
<%= label_tag("dmsf_file_revision_comment", "Comment:") %> <%= label_tag("dmsf_file_revision_comment", l(:label_comment) + ":") %>
<div class="data"> <div class="data">
<%= f.text_area(:comment, :rows=> "2", :style => "width: 99%;") %> <%= f.text_area(:comment, :rows=> "2", :style => "width: 99%;") %>
</div> </div>
</p> </p>
<br /> <br />
<%= submit_tag("Create") %> <%= submit_tag(l(:submit_create)) %>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>

View File

@ -9,8 +9,8 @@
/ /
<%= h(@file.last_revision.title) %> <div style="float: right"><%= h(@file.name) %></div> <%= h(@file.last_revision.title) %> <div style="float: right"><%= h(@file.name) %></div>
<% if @file.notification %> <% if @file.notification %>
<%= image_tag("notify.png", :plugin => "redmine_dmsf", :alt => "Not. act.", <%= image_tag("notify.png", :plugin => "redmine_dmsf",
:title => "Notifications active") %> :title => l(:title_notifications_active)) %>
<% end %> <% end %>
</h2> </h2>
@ -18,38 +18,38 @@
<%= render(:partial => 'file_new_revision') %> <%= render(:partial => 'file_new_revision') %>
<% end %> <% end %>
<h3>Revisions</h3> <h3><%= l(:heading_revisions) %></h3>
<% @file.revisions.each do |revision| %> <% @file.revisions.each do |revision| %>
<div class="box dmsf_detail dmsf_revision"> <div class="box dmsf_detail">
<div style="float:right"> <div style="float:right">
<%= link_to("Download", <%= link_to(l(:title_download),
{:controller=>"dmsf", :action => "download_revision", :id => @project, :revision_id => revision}) %> {:controller=>"dmsf", :action => "download_revision", :id => @project, :revision_id => revision}) %>
<% if User.current.allowed_to?(:file_approval, @project) %> <% if User.current.allowed_to?(:file_approval, @project) %>
| <%= link_to("Delete", | <%= link_to(l(:title_delete),
{:action => "delete_revision", :id => @project, :revision_id => revision}, {:action => "delete_revision", :id => @project, :revision_id => revision},
:class => "delete-link", :title => "Delete revision") %> :class => "delete-link", :title => l(:title_delete_revision)) %>
<% end %> <% end %>
</div> </div>
<p class="no-ident"> <p class="no-ident">
<%= label_tag("", revision.source_revision.nil? ? "Created:" : "Changed:") %> <%= label_tag("", (revision.source_revision.nil? ? l(:label_created) : l(:label_changed)) + ":") %>
<%= revision.updated_at.strftime("%Y-%m-%d %H:%M:%S") %> by <%= h(revision.user) %> <%= l(:info_changed_by_user, :changed => revision.updated_at.strftime("%Y-%m-%d %H:%M:%S"), :user => h(revision.user)) %>
</p> </p>
<div class="clear"> <div class="clear">
<div class="splitcontentleft"> <div class="splitcontentleft">
<p> <p>
<%= label_tag("", "Title:") %> <%= label_tag("", l(:label_title) + ":") %>
<%= h(revision.title) %> <%= h(revision.title) %>
</p> </p>
</div> </div>
<div class="splitcontentright"> <div class="splitcontentright">
<p> <p>
<%= label_tag("", "Filename:") %> <%= label_tag("", l(:label_filename) + ":") %>
<%= h(revision.name) %> <%= h(revision.name) %>
</p> </p>
</div> </div>
</div> </div>
<p class="no-ident"> <p class="no-ident">
<%= label_tag("", "Description:") %> <%= label_tag("", l(:label_description) + ":") %>
</p> </p>
<div class="wiki clear" style="margin-left: 110px"> <div class="wiki clear" style="margin-left: 110px">
<%= textilizable(revision.description) %> <%= textilizable(revision.description) %>
@ -57,31 +57,31 @@
<div class="splitcontentleft"> <div class="splitcontentleft">
<p> <p>
<%= label_tag("", "Version:") %> <%= label_tag("", l(:label_version) + ":") %>
<%= revision.major_version %>.<%= revision.minor_version %> <%= revision.major_version %>.<%= revision.minor_version %>
</p> </p>
<p> <p>
<%= label_tag("", "Workflow:") %> <%= label_tag("", l(:label_workflow) + ":") %>
<%= case revision.workflow <%= case revision.workflow
when 1 then "Waiting for approval" when 1 then l(:option_workflow_waiting_for_approval)
when 2 then "Approved" when 2 then l(:option_workflow_approved)
else "None" else l(:option_workflow_none)
end %> end %>
</p> </p>
</div> </div>
<div class="splitcontentright clear"> <div class="splitcontentright clear">
<p> <p>
<%= label_tag("", "Mime:") %> <%= label_tag("", l(:label_mime) + ":") %>
<%= h(revision.mime_type) %>&nbsp; <%= h(revision.mime_type) %>&nbsp;
</p> </p>
<p> <p>
<%= label_tag("", "Size:") %> <%= label_tag("", l(:label_size) + ":") %>
<%= number_to_human_size(revision.size) %> <%= number_to_human_size(revision.size) %>
</p> </p>
</div> </div>
<br style="clear: both"/> <br style="clear: both"/>
<p class="no-ident clear"> <p class="no-ident clear">
<%= label_tag("", "Comment:") %> <%= label_tag("", l(:label_comment) + ":") %>
<%= h(revision.comment) %> <%= h(revision.comment) %>
</p> </p>
</div> </div>

View File

@ -113,7 +113,7 @@ div.right_icon_box img.detail_icon {
margin-left: 110px; margin-left: 110px;
} }
.dmsf_revision label { .dmsf_detail label {
font-weight: bold; font-weight: bold;
width: 100px; width: 100px;
float: left; float: left;

View File

@ -86,4 +86,25 @@ cs:
:select_option_deactivated: "Deactivated" :select_option_deactivated: "Deactivated"
:select_option_activated: "Activated" :select_option_activated: "Activated"
:title_save_preferences: "Save preferences" :title_save_preferences: "Save preferences"
:heading_revisions: "Revisions"
:title_download: "Download"
:title_delete_revision: "Delete revision"
:label_created: "Created"
:label_changed: "Changed"
:info_changed_by_user: "%{changed} by %{user}"
:label_filename: "Filename"
:label_version: "Version"
:label_workflow: "Workflow"
:option_workflow_waiting_for_approval: "Waiting for approval"
:option_workflow_approved: "Approved"
:option_workflow_none: "None"
:label_mime: "Mime"
:label_size: "Size"
:label_comment: "Comment"
:heading_new_revision: "New Revision"
:option_version_same: "Same"
:option_version_minor: "Minor"
:option_version_major: "Major"
:label_new_content: "New content"

View File

@ -82,6 +82,25 @@ de:
:select_option_deactivated: "Deactivated" :select_option_deactivated: "Deactivated"
:select_option_activated: "Activated" :select_option_activated: "Activated"
:title_save_preferences: "Save preferences" :title_save_preferences: "Save preferences"
:heading_revisions: "Revisions"
:title_download: "Download"
:title_delete_revision: "Delete revision"
:label_created: "Created"
:label_changed: "Changed"
:info_changed_by_user: "%{changed} by %{user}"
:label_filename: "Filename"
:label_version: "Version"
:label_workflow: "Workflow"
:option_workflow_waiting_for_approval: "Waiting for approval"
:option_workflow_approved: "Approved"
:option_workflow_none: "None"
:label_mime: "Mime"
:label_size: "Size"
:label_comment: "Comment"
:heading_new_revision: "New Revision"
:option_version_same: "Same"
:option_version_minor: "Minor"
:option_version_major: "Major"
:label_new_content: "New content"

View File

@ -82,5 +82,24 @@ en-GB:
:select_option_deactivated: "Deactivated" :select_option_deactivated: "Deactivated"
:select_option_activated: "Activated" :select_option_activated: "Activated"
:title_save_preferences: "Save preferences" :title_save_preferences: "Save preferences"
:heading_revisions: "Revisions"
:title_download: "Download"
:title_delete_revision: "Delete revision"
:label_created: "Created"
:label_changed: "Changed"
:info_changed_by_user: "%{changed} by %{user}"
:label_filename: "Filename"
:label_version: "Version"
:label_workflow: "Workflow"
:option_workflow_waiting_for_approval: "Waiting for approval"
:option_workflow_approved: "Approved"
:option_workflow_none: "None"
:label_mime: "Mime"
:label_size: "Size"
:label_comment: "Comment"
:heading_new_revision: "New Revision"
:option_version_same: "Same"
:option_version_minor: "Minor"
:option_version_major: "Major"
:label_new_content: "New content"

View File

@ -86,6 +86,24 @@ en:
:select_option_deactivated: "Deactivated" :select_option_deactivated: "Deactivated"
:select_option_activated: "Activated" :select_option_activated: "Activated"
:title_save_preferences: "Save preferences" :title_save_preferences: "Save preferences"
:heading_revisions: "Revisions"
:title_download: "Download"
:title_delete_revision: "Delete revision"
:label_created: "Created"
:label_changed: "Changed"
:info_changed_by_user: "%{changed} by %{user}"
:label_filename: "Filename"
:label_version: "Version"
:label_workflow: "Workflow"
:option_workflow_waiting_for_approval: "Waiting for approval"
:option_workflow_approved: "Approved"
:option_workflow_none: "None"
:label_mime: "Mime"
:label_size: "Size"
:label_comment: "Comment"
:heading_new_revision: "New Revision"
:option_version_same: "Same"
:option_version_minor: "Minor"
:option_version_major: "Major"
:label_new_content: "New content"

View File

@ -82,4 +82,24 @@ es:
:select_option_deactivated: "Deactivated" :select_option_deactivated: "Deactivated"
:select_option_activated: "Activated" :select_option_activated: "Activated"
:title_save_preferences: "Save preferences" :title_save_preferences: "Save preferences"
:heading_revisions: "Revisions"
:title_download: "Download"
:title_delete_revision: "Delete revision"
:label_created: "Created"
:label_changed: "Changed"
:info_changed_by_user: "%{changed} by %{user}"
:label_filename: "Filename"
:label_version: "Version"
:label_workflow: "Workflow"
:option_workflow_waiting_for_approval: "Waiting for approval"
:option_workflow_approved: "Approved"
:option_workflow_none: "None"
:label_mime: "Mime"
:label_size: "Size"
:label_comment: "Comment"
:heading_new_revision: "New Revision"
:option_version_same: "Same"
:option_version_minor: "Minor"
:option_version_major: "Major"
:label_new_content: "New content"

View File

@ -82,4 +82,24 @@ fr:
:select_option_deactivated: "Deactivated" :select_option_deactivated: "Deactivated"
:select_option_activated: "Activated" :select_option_activated: "Activated"
:title_save_preferences: "Save preferences" :title_save_preferences: "Save preferences"
:heading_revisions: "Revisions"
:title_download: "Download"
:title_delete_revision: "Delete revision"
:label_created: "Created"
:label_changed: "Changed"
:info_changed_by_user: "%{changed} by %{user}"
:label_filename: "Filename"
:label_version: "Version"
:label_workflow: "Workflow"
:option_workflow_waiting_for_approval: "Waiting for approval"
:option_workflow_approved: "Approved"
:option_workflow_none: "None"
:label_mime: "Mime"
:label_size: "Size"
:label_comment: "Comment"
:heading_new_revision: "New Revision"
:option_version_same: "Same"
:option_version_minor: "Minor"
:option_version_major: "Major"
:label_new_content: "New content"

View File

@ -86,6 +86,25 @@ en:
:select_option_deactivated: "Deactivated" :select_option_deactivated: "Deactivated"
:select_option_activated: "Activated" :select_option_activated: "Activated"
:title_save_preferences: "Save preferences" :title_save_preferences: "Save preferences"
:heading_revisions: "Revisions"
:title_download: "Download"
:title_delete_revision: "Delete revision"
:label_created: "Created"
:label_changed: "Changed"
:info_changed_by_user: "%{changed} by %{user}"
:label_filename: "Filename"
:label_version: "Version"
:label_workflow: "Workflow"
:option_workflow_waiting_for_approval: "Waiting for approval"
:option_workflow_approved: "Approved"
:option_workflow_none: "None"
:label_mime: "Mime"
:label_size: "Size"
:label_comment: "Comment"
:heading_new_revision: "New Revision"
:option_version_same: "Same"
:option_version_minor: "Minor"
:option_version_major: "Major"
:label_new_content: "New content"

View File

@ -82,5 +82,24 @@ ru:
:select_option_deactivated: "Deactivated" :select_option_deactivated: "Deactivated"
:select_option_activated: "Activated" :select_option_activated: "Activated"
:title_save_preferences: "Save preferences" :title_save_preferences: "Save preferences"
:heading_revisions: "Revisions"
:title_download: "Download"
:title_delete_revision: "Delete revision"
:label_created: "Created"
:label_changed: "Changed"
:info_changed_by_user: "%{changed} by %{user}"
:label_filename: "Filename"
:label_version: "Version"
:label_workflow: "Workflow"
:option_workflow_waiting_for_approval: "Waiting for approval"
:option_workflow_approved: "Approved"
:option_workflow_none: "None"
:label_mime: "Mime"
:label_size: "Size"
:label_comment: "Comment"
:heading_new_revision: "New Revision"
:option_version_same: "Same"
:option_version_minor: "Minor"
:option_version_major: "Major"
:label_new_content: "New content"