Remove nil param
This commit is contained in:
@@ -18,7 +18,7 @@ module User::Role
|
||||
admin? || other == self
|
||||
end
|
||||
|
||||
def can_administer?(other = nil)
|
||||
def can_administer?
|
||||
admin? && other != self
|
||||
end
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<div class="flex align-center gap-half">
|
||||
<input type="text" class="input flex-item-grow" value="<%= url %>" readonly>
|
||||
|
||||
<% if Current.user.can_administer? %>
|
||||
<% if Current.user.admin? %>
|
||||
<%= button_to account_join_code_path, method: :delete, class: "btn btn--circle txt-small", data: {
|
||||
turbo_confirm: "Are you sure you want to generate a new link? The previous code will stop working." } do %>
|
||||
<%= icon_tag "refresh" %>
|
||||
@@ -65,7 +65,7 @@
|
||||
This code has been used <%= @join_code.usage_count %>/<%= @join_code.usage_limit %> times
|
||||
(<%= @join_code.active? ? @join_code.usage_limit - @join_code.usage_count : "none" %> remaining)
|
||||
|
||||
<% if Current.user.can_administer? %>
|
||||
<% if Current.user.admin? %>
|
||||
<%= link_to edit_account_join_code_path, class: @join_code.active? ? "txt-link" : "txt-negative txt-underline" do %>
|
||||
<span>Change limit</span>
|
||||
<% end %>
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
<p class="margin-none-block-start">Fizzy doesn’t let stale cards stick around forever. Cards automatically close as “Not Now” without activity for specific period of time. <em>This is the default, global setting — you can override it on each board.</em></p>
|
||||
</header>
|
||||
|
||||
<%= render "entropy/auto_close", model: account.entropy, url: account_entropy_path, disabled: !Current.user.can_administer? %>
|
||||
<%= render "entropy/auto_close", model: account.entropy, url: account_entropy_path, disabled: !Current.user.admin? %>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<%= form_with model: account, url: account_settings_path, method: :put, scope: :account, data: { controller: "form" }, class: "flex gap-half" do |form| %>
|
||||
<strong class="full-width"><%= form.text_field :name, required: true, class: "input input--transparent full-width txt-medium", placeholder: "Account name…", data: { action: "input->form#disableSubmitWhenInvalid" }, readonly: !Current.user.can_administer? %></strong>
|
||||
<strong class="full-width"><%= form.text_field :name, required: true, class: "input input--transparent full-width txt-medium", placeholder: "Account name…", data: { action: "input->form#disableSubmitWhenInvalid" }, readonly: !Current.user.admin? %></strong>
|
||||
|
||||
<% if Current.user.can_administer? %>
|
||||
<% if Current.user.admin? %>
|
||||
<%= form.button class: "btn btn--circle btn--link txt-medium", data: { form_target: "submit" }, disabled: form.object do %>
|
||||
<%= icon_tag "arrow-right" %>
|
||||
<span class="for-screen-reader">Save changes</span>
|
||||
|
||||
Reference in New Issue
Block a user