redmine_dmsf/app/views/dmsf_detail/file_detail.html.erb
vit.jonas@gmail.com c7051d82ec * redesigned file detail revision list
git-svn-id: http://redmine-dmsf.googlecode.com/svn/trunk/redmine_dmsf@42 5e329b0b-a2ee-ea63-e329-299493fc886d
2011-05-15 15:23:12 +00:00

126 lines
3.6 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}) %>
/
<%= h(@file.last_revision.title) %> <div style="float: right"><%= h(@file.name) %></div>
<% if @file.notification %>
<%= image_tag("notify.png", :plugin => "redmine_dmsf", :alt => "Not. act.",
:title => "Notifications active") %>
<% end %>
</h2>
<% if User.current.allowed_to?(:file_manipulation, @file.project) %>
<% if @file.locked_for_user? %>
<%= render(:partial => 'file_locked') %>
<% else %>
<%= render(:partial => 'file_new_revision') %>
<% end %>
<% end %>
<h3>Revisions</h3>
<% @file.revisions.each do |revision| %>
<div class="box dmsf_detail">
<fieldset>
<legend>
<%= revision.source_revision.nil? ? "Created:" : "Changed:" %>
<%= revision.updated_at.strftime("%Y-%m-%d %H:%M:%S") %>
by
<%= h(revision.user) %>
</legend>
<div class="clear">
<div class="splitcontentleft">
<p>
<%= label_tag("", "Title:") %>
<%= h(revision.title) %>
</p>
</div>
<div class="splitcontentright">
<p>
<%= label_tag("", "Filename:") %>
<%= h(revision.name) %>
</p>
</div>
</div>
<p class="no-ident">
<%= label_tag("", "Description:") %><br class="clear" />
</p>
<div class="wiki">
<%= textilizable(revision.description) %>
</div>
<div class="splitcontentleft">
<p>
<%= label_tag("", "Version:") %>
<%= revision.major_version %>.<%= revision.minor_version %>
</p>
<p>
<%= label_tag("", "Workflow:") %>
<%= case revision.workflow
when 1 then "Waiting for approval"
when 2 then "Approved"
else "None"
end %>
</p>
</div>
<div class="splitcontentright clear">
<p>
<%= label_tag("", "Mime:") %>
<%= h(revision.mime_type) %>
</p>
<p>
<%= label_tag("", "Size:") %>
<%= number_to_human_size(revision.size) %>
</p>
</div>
<p class="clear">
<%= label_tag("", "Comment:") %>
<%= h(revision.comment) %>
</p>
<div>
<%= link_to("Download",
{:controller=>"dmsf", :action => "download_revision", :id => @project, :revision_id => revision}) %>
<% if User.current.allowed_to?(:file_approval, @project) %>
| <%= link_to("Delete",
{:action => "delete_revision", :id => @project, :revision_id => revision},
:class => "delete-link", :title => "Delete revision") %>
<% end %>
</div>
</fieldset>
</div>
<% end %>
<% content_for :header_tags do %>
<%= stylesheet_link_tag "dmsf", :plugin => "redmine_dmsf" %>
<%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js" %>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery("a.delete-link").click(function(event) {
if(!window.confirm("<%= l(:question_do_you_really_want_to_delete_this_revision) %>")) event.preventDefault();
})
jQuery("#fileFileUpload").change(function() {
if(jQuery("input[name=\"file[version]\"]:checked").val() == "same") {
jQuery("#fileMinorVersionRadio").prop("checked", true);
}
jQuery("#fileSameVersionRadio").prop("disabled", true);
});
jQuery("#newRevisionFormContentToggle").toggle(function() {
jQuery("#newRevisionFormContentToggle").text("[-]");
jQuery("#newRevisionFormContent").show();
}, function() {
jQuery("#newRevisionFormContentToggle").text("[+]");
jQuery("#newRevisionFormContent").hide();
});
jQuery("#newRevisionFormContentToggle").text("[+]");
jQuery("#newRevisionFormContent").hide();
});
</script>
<% end %>