seminar2/app/views/admin/seminars/seminar_submission_field.ht...

66 lines
2.1 KiB
Plaintext
Raw Permalink Normal View History

<% content_for :page_specific_css do -%>
2024-02-28 02:17:14 +00:00
<%= stylesheet_link_tag "lib/wrap-nav.css" %>
<%= stylesheet_link_tag "lib/pageslide.css" %>
<%= stylesheet_link_tag "lib/main-forms.css" %>
<%= stylesheet_link_tag "lib/togglebox.css" %>
<% end -%>
<% content_for :page_specific_javascript do -%>
2024-02-28 02:17:14 +00:00
<%= javascript_include_tag "lib/jquery.tmpl.min.js" %>
<%= javascript_include_tag "seminar-field-forms-submission.js" %>
<% end -%>
2024-02-28 02:17:14 +00:00
<%= form_for @attribute, url: admin_seminar_path(@attribute) , html: { class: "form-horizontal main-forms" } do |f| %>
<% if flash.now[:notice].present? %>
<%= flash.now[:notice]%>
<% end %>
<h3><%= @attribute.title %></h3>
<fieldset>
2023-04-12 03:33:32 +00:00
<div id="attributes-area" class="input-area sortable">
<%= render partial: "attribute_submission_field",collection: @attribute.seminar_submission_fields.asc(:sort_number, :_id)%>
</div>
<div class="form-actions">
<button type="button" class="btn btn-success add-attributes"><%= t(:add_attribute_field) %></button>
<%= hidden_field_tag 'id', params[:id] if !params[:id].blank? %>
<%= f.submit t(:submit),:class=>"btn btn-primary"%>
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
</div>
</fieldset>
<% end %>
<% content_for :page_specific_javascript do -%>
<%= render 'support_member_form_js' %>
2023-04-12 03:33:32 +00:00
<% end -%>
<style type="text/css">
#attributes-area h4:before {
content: "\e096";
font-family: 'entypo';
cursor: pointer;
}
</style>
<script>
function update_key(ele){
var ui_child=$(ele).parents('.sortable.ui-sortable').find('.attributes');
for (var i=0;i<ui_child.length;i++){
var now_ele = ui_child.eq(i);
var new_i = i + 1;
now_ele.find('.sort_number').val(i);
now_ele.find('h4 span').text(new_i);
}
}
$('.sortable').ready(function(){
$( ".sortable" ).sortable({
axis: "y",
revert: true,
placeholder: "sortable-placeholder",
handle: ".attributes-header",
update: function(event, ui) {
update_key(ui.item)
}
});
$('.sortable').disableSelection();
})
</script>