下拉文件菜单

This commit is contained in:
yanxd 2014-03-11 10:45:01 +08:00
parent bc6950fbb0
commit 62ea2b3849
4 changed files with 45 additions and 21 deletions

View File

@ -0,0 +1,17 @@
<h3><%=l(:label_attachment_new)%></h3>
<% versions = project.versions.sort %>
<%= error_messages_for 'attachment' %>
<%= form_tag(project_files_path(project), :multipart => true, :class => "tabular") do %>
<div class="box">
<% if versions.any? %>
<p><label for="version_id"><%=l(:field_version)%></label>
<%= select_tag "version_id", content_tag('option', '') +
options_from_collection_for_select(versions, "id", "name") %></p>
<% end %>
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
</div>
<%= submit_tag l(:button_add) %>
<% end %>
<div class="line_under" style="margin:20px 0px;"></div>

View File

@ -102,10 +102,10 @@ div.pagination{
border: 1px solid #15bccf; border: 1px solid #15bccf;
box-shadow: 3px 3px 3px #666666; box-shadow: 3px 3px 3px #666666;
} }
#relation_file_div{ .relation_file_div{
margin: 0px 25px; margin: 0px 25px;
} }
#relation_file_div fieldset{ .relation_file_div fieldset{
margin: 0px 25px; margin: 0px 25px;
border-radius: 5px; border-radius: 5px;
} }
@ -118,10 +118,13 @@ div.pagination{
<%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %> <%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
<div class="clearfix"></div> <div class="clearfix"></div>
<div id="file_buttons" class="nhidden"> <div id="file_buttons" class="nhidden">
<%= link_to('上传文件', new_project_file_path(@project), :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %> <%#= link_to('上传文件', new_project_file_path(@project), :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %>
<%= link_to('上传文件', 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @project) %>
<%= link_to('关联已有文件', 'javascript:void(0);', :onclick => "$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %> <%= link_to('关联已有文件', 'javascript:void(0);', :onclick => "$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %>
<div id="upload_file_div" class="relation_file_div hidden" >
<div id="relation_file_div" class="hidden" > <%= render :partial => 'new', locals: {project: @project}%>
</div>
<div id="relation_file_div" class="relation_file_div hidden" >
<fieldset> <fieldset>
<legend>搜索</legend> <legend>搜索</legend>
<%= form_tag( <%= form_tag(

View File

@ -1,16 +1,16 @@
<h3><%=l(:label_attachment_new)%></h3> <h3><%=l(:label_attachment_new)%></h3>
<%= error_messages_for 'attachment' %> <%= error_messages_for 'attachment' %>
<%= form_tag(project_files_path(@project), :multipart => true, :class => "tabular") do %> <%= form_tag(project_files_path(@project), :multipart => true, :class => "tabular") do %>
<div class="box"> <div class="box">
<% if @versions.any? %> <% if @versions.any? %>
<p><label for="version_id"><%=l(:field_version)%></label> <p><label for="version_id"><%=l(:field_version)%></label>
<%= select_tag "version_id", content_tag('option', '') + <%= select_tag "version_id", content_tag('option', '') +
options_from_collection_for_select(@versions, "id", "name") %></p> options_from_collection_for_select(@versions, "id", "name") %></p>
<% end %> <% end %>
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p> <p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
</div> </div>
<%= submit_tag l(:button_add) %> <%= submit_tag l(:button_add) %>
<% end %> <% end %>

View File

@ -51,4 +51,8 @@
$(document).ready(function () { $(document).ready(function () {
addSlipMenu(); addSlipMenu();
}); });
jQuery(document).ready(function($) {
$('.sub_menu').find("a").attr('target', '_blank');
});
</script> </script>