Move edit password manually view to a component
We're restructuring the CSS of the admin stylesheet, and there was a rule that is only applied to this component.
This commit is contained in:
@@ -244,10 +244,6 @@ $table-header: #ecf1f6;
|
|||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.no-margin-bottom {
|
|
||||||
margin-bottom: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enabled {
|
.enabled {
|
||||||
color: $color-success;
|
color: $color-success;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
.no-margin-bottom {
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<h2 class="not-print"><%= t("management.account.menu.reset_password_manually") %></h2>
|
||||||
|
|
||||||
|
<%= form_for user, url: change_password_management_account_path do |f| %>
|
||||||
|
<%= f.label :password %>
|
||||||
|
<p class="help-text"><%= t("management.account.edit.password.print_help") %></p>
|
||||||
|
<div class="small-12 medium-6">
|
||||||
|
|
||||||
|
<div class="input-group">
|
||||||
|
<%= f.password_field :password, class: "input-group-field no-margin-bottom", label: false, value: nil %>
|
||||||
|
<span class="input-group-label">
|
||||||
|
<a href="#" class="show-password"><span class="icon-eye"></span></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%= link_to t("management.account.edit.password.random"),
|
||||||
|
"#",
|
||||||
|
class: "generate-random-value float-right",
|
||||||
|
data: { "password-complexity": User.password_complexity } %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%= f.submit t("management.account.edit.password.save"), class: "button success" %>
|
||||||
|
<% end %>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
class Management::Account::EditPasswordManuallyComponent < ApplicationComponent
|
||||||
|
attr_reader :user
|
||||||
|
|
||||||
|
def initialize(user)
|
||||||
|
@user = user
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,22 +1 @@
|
|||||||
<h2 class="not-print"><%= t("management.account.menu.reset_password_manually") %></h2>
|
<%= render Management::Account::EditPasswordManuallyComponent.new(managed_user) %>
|
||||||
|
|
||||||
<%= form_for managed_user, url: change_password_management_account_path do |f| %>
|
|
||||||
<%= f.label :password %>
|
|
||||||
<p class="help-text"><%= t("management.account.edit.password.print_help") %></p>
|
|
||||||
<div class="small-12 medium-6">
|
|
||||||
|
|
||||||
<div class="input-group">
|
|
||||||
<%= f.password_field :password, class: "input-group-field no-margin-bottom", label: false, value: nil %>
|
|
||||||
<span class="input-group-label">
|
|
||||||
<a href="#" class="show-password"><span class="icon-eye"></span></a>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= link_to t("management.account.edit.password.random"),
|
|
||||||
"#",
|
|
||||||
class: "generate-random-value float-right",
|
|
||||||
data: { "password-complexity": User.password_complexity } %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= f.submit t("management.account.edit.password.save"), class: "button success" %>
|
|
||||||
<% end %>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user