<%= stylesheet_link_tag "select2/select2" %> <%= javascript_include_tag 'validator' %> <%= javascript_include_tag "select2/select2.min" %> <% content_for :page_specific_css do %> <%= stylesheet_link_tag "lib/main-forms" %> <% end %> <% sub_managers = @module_app.sub_managers sub_managers.delete(nil) all_statuses = [[t('top'),'is_top'],[t('hot'),'is_hot']] tp1 = select_tag("event_ann_setting[event_anns_status_settings][-1][status]",options_for_select(all_statuses)) tp2 = select_tag("event_ann_setting[event_anns_status_settings][-1][role_id]",options_for_select(Role.all.map{|r| [r.title,r.id]})) tp3 = number_field_tag("event_ann_setting[event_anns_status_settings][-1][top_limit]",nil, min: 0,required: true) tp4 = "" all_tp = "
#{tp1}
#{tp2}
#{tp3}
#{tp4}
" %>
<%= t("event_ann.click_on_submit") %>
<%= form_for @setting, url: (@setting.new_record? ? admin_event_ann_createsettings_path : admin_event_ann_updatesettings_path), html: {class: "form-horizontal main-forms"} do |f| %>
<%= f.label :only_manager_can_edit_status, t("event_ann.only_manager_can_edit_status"), :class => "control-label muted" %>
<%= f.check_box :only_manager_can_edit_status %>
<%= f.label :is_display_edit_only, t("event_ann.is_display_edit_only"), :class => "control-label muted" %>
<%= f.check_box :is_display_edit_only %>
<%= f.label :top_limit, t("event_ann.top_limit"), :class => "control-label muted" %>
<%= f.number_field :top_limit, :min => "0" %> <%= t("event_ann.for_unlimited") %>
<%= t('status') %>
<%= t('role') %>
<%= t('event_ann.top_limit') %>
<% (EventAnnSetting.first.event_anns_status_settings rescue []).each_with_index do |v,i| %>
<%= hidden_field_tag("event_ann_setting[event_anns_status_settings][#{i}][_id]",v.id) %>
<%= select_tag("event_ann_setting[event_anns_status_settings][#{i}][status]",options_for_select(all_statuses,:selected => v['status'])) %>
<%= select_tag("event_ann_setting[event_anns_status_settings][#{i}][role_id]",options_for_select(Role.all.map{|r| [r.title,r.id]},:selected => v['role_id'])) %>
<%= number_field_tag("event_ann_setting[event_anns_status_settings][#{i}][top_limit]",v['top_limit'], min: 0,required: true) %>
<% end %>
<% if EventAnnSetting.is_pro? %> <% if !sub_managers.blank? %>
<%= f.label "Approver Setting", :class => "control-label muted" %>
<%= t("event_ann.approvers_list") %> <%= @setting.approvers.count %>
<% else %>
<%= t("event_ann.click_set_sub_manager") %>
<% end %>
<%= f.label "Send emails to", :class => "control-label muted" %>
> <%= t("admin") %> > <%= t("manager") %> > <%= t("event_ann.approver") %>
<% sub_managers.each do |sm| %> <% if @setting.approvers.include?(sm.id.to_s) %> <% end %> <% end %>
<% end %>
<%= f.submit t('submit'), class: 'btn btn-primary' %>
<% end %> <% if EventAnnSetting.is_pro? %> <% end %> <%= fields_for :iframe do |f| %>
<%=t('event_ann.event_ann_setting_for_iframe')%>
<%= f.label :layout_type, t("event_ann.layout_type"), :class => "control-label muted" %>
<% @layout_types = get_layouts(@module_app.key) %> <% if @layout_types.first.kind_of?(Hash) %> <% else %> <%= f.select(:layout, @layout_types) %> <% end %>
<%= f.label :tags, t(:tags), :class => "control-label muted" %>
<% @module_app.tags.each_with_index do |t,index| %> <% end %>
<% @module_app.categories.each_with_index do |c,index| %> <% end %>
<%= f.label :authors, t('event_ann.table.author'), :class => "control-label muted" %>
<%= render partial: 'admin/members/generate_modal_select' , locals: { :@sorted_members => @sorted_members ,:member_form_id => "card-list-members",:member_field_name=>"iframe[member_ids][]" } %>
<%= f.label :show_page, t('event_ann.show_page'), :class => "control-label muted" %>
<%=f.check_box :show_page ,{:checked=>'checked'},'true','false'%>
<%= f.label :data_count, t(:data_count), :class => "control-label muted" %>
<%=f.number_field :data_count, {min: 0,:value=> 10} %>
<% end %>