2014-03-11 10:45:01 +08:00
|
|
|
<h3><%=l(:label_attachment_new)%></h3>
|
|
|
|
<% versions = project.versions.sort %>
|
2014-05-09 15:45:21 +08:00
|
|
|
<% attachmenttypes = project.attachmenttypes %>
|
2014-03-11 10:45:01 +08:00
|
|
|
<%= error_messages_for 'attachment' %>
|
2014-05-20 11:33:17 +08:00
|
|
|
<%= form_tag(project_files_path(project), :multipart => true,:name=>"upload_form", :class => "tabular") do %>
|
2014-03-11 10:45:01 +08:00
|
|
|
<div class="box">
|
2014-05-16 16:29:01 +08:00
|
|
|
<p>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<% if versions.any? %>
|
|
|
|
<td><p><%= l(:field_version) %></p></td>
|
|
|
|
<td>
|
|
|
|
<%= select_tag "version_id", content_tag('option', '') +
|
|
|
|
options_from_collection_for_select(versions, "id", "name"), {style: 'width:100px'} %>
|
|
|
|
</td>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if attachmenttypes.any? %>
|
|
|
|
<td><%= l(:attachment_type) %></label></td>
|
|
|
|
<td>
|
|
|
|
<%= select_tag "attachment_type",
|
|
|
|
options_from_collection_for_select(attachmenttypes, "id",
|
|
|
|
"typeName", 2), {style: 'width:100px'} %>
|
|
|
|
</td>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
2014-03-11 10:45:01 +08:00
|
|
|
|
2014-05-16 16:29:01 +08:00
|
|
|
</p>
|
2014-05-09 15:45:21 +08:00
|
|
|
|
2014-05-16 16:29:01 +08:00
|
|
|
<p><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
|
2014-03-11 10:45:01 +08:00
|
|
|
</div>
|
|
|
|
<%= submit_tag l(:button_add) %>
|
|
|
|
<% end %>
|
2014-05-20 11:33:17 +08:00
|
|
|
<div class="line_under" style="margin:20px 0px;"></div>
|
|
|
|
|
|
|
|
<script type='text/javascript'>
|
|
|
|
function tagAddClick(id,objId,objTag)
|
|
|
|
{
|
|
|
|
alert("OK");
|
|
|
|
$.ajax({
|
|
|
|
type :"POST",
|
|
|
|
url :'<%= users_tag_saveEx_path%>',
|
|
|
|
data: {
|
|
|
|
tagname: $('tag_name').value,
|
|
|
|
obj_id: encodeURIComponent(objId),
|
|
|
|
obj_flag:encodeURIComponent(objTag)
|
|
|
|
},
|
|
|
|
success: function(data, textStatus){
|
|
|
|
alert("OK");
|
|
|
|
$(id).empty();
|
|
|
|
$(id).html('123');
|
|
|
|
$("#" + id + " #name").val("");
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
</script>
|