forked from External/greenlight
Change permissions from columns to table entries (#762)
This commit is contained in:
committed by
farhatahmad
parent
01b8dbbd0e
commit
666231db6c
@ -33,7 +33,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9 <%="form-disable" if edit_disabled %>">
|
||||
<%= form_for(@selected_role, url: admin_update_role_path(@selected_role.id), method: :post) do |f| %>
|
||||
<%= form_with model: @selected_role, url: admin_update_role_path(@selected_role.id), method: :post do |f| %>
|
||||
<%= f.label t('administrator.roles.name'), class: "form-label" %>
|
||||
<%= f.text_field :name, class: 'form-control mb-3', value: translated_role_name(@selected_role), readonly: edit_disabled || @selected_role.name == "user" || @selected_role.name == "admin", required: true %>
|
||||
|
||||
@ -48,34 +48,34 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block <%="form-disable" if !current_role.can_create_rooms %>">
|
||||
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block <%="form-disable" if !current_role.get_permission("can_create_rooms") %>">
|
||||
<span class="ml-0 custom-switch-description"><%= t("administrator.roles.can_create_rooms")%></span>
|
||||
<%= f.check_box :can_create_rooms, class: "custom-switch-input", disabled: edit_disabled || !current_role.can_create_rooms %>
|
||||
<%= f.check_box :can_create_rooms, checked: @selected_role.get_permission("can_create_rooms"), class: "custom-switch-input", disabled: edit_disabled || !current_role.get_permission("can_create_rooms") %>
|
||||
<span class="custom-switch-indicator float-right"></span>
|
||||
</label>
|
||||
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block <%="form-disable" if !current_role.send_promoted_email %>">
|
||||
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block <%="form-disable" if !current_role.get_permission("send_promoted_email") %>">
|
||||
<span class="ml-0 custom-switch-description"><%= t("administrator.roles.promote_email")%></span>
|
||||
<%= f.check_box :send_promoted_email, class: "custom-switch-input", disabled: edit_disabled || !current_role.send_promoted_email %>
|
||||
<%= f.check_box :send_promoted_email, checked: @selected_role.get_permission("send_promoted_email"), class: "custom-switch-input", disabled: edit_disabled || !current_role.get_permission("send_promoted_email") %>
|
||||
<span class="custom-switch-indicator float-right"></span>
|
||||
</label>
|
||||
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block <%="form-disable" if !current_role.send_demoted_email %>">
|
||||
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block <%="form-disable" if !current_role.get_permission("send_demoted_email") %>">
|
||||
<span class="ml-0 custom-switch-description"><%= t("administrator.roles.demote_email")%></span>
|
||||
<%= f.check_box :send_demoted_email, class: "custom-switch-input", disabled: edit_disabled || !current_role.send_demoted_email %>
|
||||
<%= f.check_box :send_demoted_email, checked: @selected_role.get_permission("send_demoted_email"), class: "custom-switch-input", disabled: edit_disabled || !current_role.get_permission("send_demoted_email") %>
|
||||
<span class="custom-switch-indicator float-right"></span>
|
||||
</label>
|
||||
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block <%="form-disable" if !current_role.can_edit_site_settings %>">
|
||||
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block <%="form-disable" if !current_role.get_permission("can_edit_site_settings") %>">
|
||||
<span class="ml-0 custom-switch-description"><%= t("administrator.roles.edit_site_settings")%></span>
|
||||
<%= f.check_box :can_edit_site_settings, class: "custom-switch-input", disabled: edit_disabled || !current_role.can_edit_site_settings %>
|
||||
<%= f.check_box :can_edit_site_settings, checked: @selected_role.get_permission("can_edit_site_settings"), class: "custom-switch-input", disabled: edit_disabled || !current_role.get_permission("can_edit_site_settings") %>
|
||||
<span class="custom-switch-indicator float-right"></span>
|
||||
</label>
|
||||
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block <%="form-disable" if !current_role.can_edit_roles %>">
|
||||
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block <%="form-disable" if !current_role.get_permission("can_edit_roles") %>">
|
||||
<span class="ml-0 custom-switch-description"><%= t("administrator.roles.edit_roles")%></span>
|
||||
<%= f.check_box :can_edit_roles, class: "custom-switch-input", disabled: edit_disabled || !current_role.can_edit_roles %>
|
||||
<%= f.check_box :can_edit_roles, checked: @selected_role.get_permission("can_edit_roles"), class: "custom-switch-input", disabled: edit_disabled || !current_role.get_permission("can_edit_roles") %>
|
||||
<span class="custom-switch-indicator float-right"></span>
|
||||
</label>
|
||||
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block <%="form-disable" if !current_role.can_manage_users %>">
|
||||
<label class="custom-switch pl-0 mt-3 mb-3 w-100 text-left d-inline-block <%="form-disable" if !current_role.get_permission("can_manage_users") %>">
|
||||
<span class="ml-0 custom-switch-description"><%= t("administrator.roles.manage_users")%></span>
|
||||
<%= f.check_box :can_manage_users, class: "custom-switch-input", disabled: edit_disabled || !current_role.can_manage_users %>
|
||||
<%= f.check_box :can_manage_users, checked: @selected_role.get_permission("can_manage_users"), class: "custom-switch-input", disabled: edit_disabled || !current_role.get_permission("can_manage_users") %>
|
||||
<span class="custom-switch-indicator float-right"></span>
|
||||
</label>
|
||||
|
||||
|
Reference in New Issue
Block a user