socialforge/app/views/files/_course_new.html.erb

66 lines
2.3 KiB
Plaintext

<h3>
<%=l(:label_attachment_new)%>
</h3>
<% attachmenttypes = course.attachmenttypes %>
<%= error_messages_for 'attachment' %>
<div id="network_issue" style="color: red; display: none;">上传出现错误,请您检查您的网络环境,并刷新页面重新上传。</div>
<%= form_tag(course_files_path(course), :multipart => true,:remote => true,:method => :post,:name=>"upload_form", :class => "tabular") do %>
<div class="box">
<p>
<% if attachmenttypes.any? %>
<%= l(:attachment_type) %></label>
<%= select_tag "attachment_type",
options_from_collection_for_select(attachmenttypes, "id","typeName", 2), {style: 'width:100px'} %>
<% end %>
</p>
<p><%=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>
<fieldset>
<legend><%=l(:label_attachment_new)%></legend>
<% attachmenttypes = course.attachmenttypes %>
<%= error_messages_for 'attachment' %>
<%= form_tag(course_files_path(course), :multipart => true,:remote => true,:method => :post,:name=>"upload_form", :class => "tabular") do %>
<p>
<% if attachmenttypes.any? %>
<%= l(:attachment_type) %></label>
<%= select_tag "attachment_type",
options_from_collection_for_select(attachmenttypes, "id",
"typeName", 2), {style: 'width:100px'} %>
<% end %>
</p>
<p><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
<%= submit_tag l(:button_add) %>
<% end %>
</fieldset>
<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>