ruling_timer/app/views/admin/ruling_timers/settings.html.erb

26 lines
1.1 KiB
Plaintext

<%= render :partial => "role_select_modal",:locals=>{:@users=>@users,:@selected_role_ids=>@setting.role_ids,:@target=>"#role_append_area",:@role_params_name=>"#{@setting.class.to_s.underscore}[role_ids][]"} %>
<%= form_for @setting, url: update_setting_admin_ruling_timers_path(@ruling_weather_setting), html: {class: "form-horizontal main-forms previewable"} do |f| %>
<fieldset>
<div class="control-group">
<label class="control-label muted" for="authorized_user_role"><%= t("ruling_timer.authorized_user_role") %></label>
<div class="controls">
<div id="role_append_area" class="checkbox-card">
<%= @selected_roles.join("\n").html_safe %>
</div>
<div class="clearfix"></div>
<button id="add_role_btn" type="button" class="btn btn-primary"><%=t("ruling_timer.add_role")%></button>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">
<%= f.submit t('ruling_timer.save'), class: 'btn btn-primary' %>
</div>
</fieldset>
<% end %>
<script>
$(document).ready(function(){
$("#add_role_btn").click(function(){
$("#role_modal").modal("show");
})
})
</script>