Add settings for member statuses
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
53
app/views/admin/settings/membership/show.html.erb
Normal file
53
app/views/admin/settings/membership/show.html.erb
Normal file
@@ -0,0 +1,53 @@
|
||||
<%= render HeaderComponent.new(title: "Settings") %>
|
||||
|
||||
<%= render MainWithSidenavComponent.new(sidenav_partial: 'shared/admin_sidenav_settings') do %>
|
||||
<%= form_for(Setting.new, url: admin_settings_membership_path, method: :put) do |f| %>
|
||||
<section>
|
||||
<h3>Membership</h3>
|
||||
|
||||
<% if @errors && @errors.any? %>
|
||||
<%= render partial: "admin/settings/errors", locals: { errors: @errors } %>
|
||||
<% end %>
|
||||
|
||||
<ul role="list">
|
||||
<%= render FormElements::FieldsetResettableSettingComponent.new(
|
||||
key: :member_status_contributor,
|
||||
title: "Status name for contributing users",
|
||||
description: "A contributing member of your organization/group"
|
||||
) %>
|
||||
<%= render FormElements::FieldsetResettableSettingComponent.new(
|
||||
key: :member_status_sustainer,
|
||||
title: "Status name for paying users",
|
||||
description: "A paying/donating member or customer"
|
||||
) %>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3>Admin panel</h3>
|
||||
|
||||
<ul role="list">
|
||||
<%= render FormElements::FieldsetToggleComponent.new(
|
||||
form: f,
|
||||
attribute: :user_index_show_contributors,
|
||||
enabled: Setting.user_index_show_contributors?,
|
||||
title: "Show #{Setting.member_status_contributor.downcase} status in user list",
|
||||
description: "Can slow down page rendering with large user base"
|
||||
) %>
|
||||
<%= render FormElements::FieldsetToggleComponent.new(
|
||||
form: f,
|
||||
attribute: :user_index_show_sustainers,
|
||||
enabled: Setting.user_index_show_sustainers?,
|
||||
title: "Show #{Setting.member_status_sustainer.downcase} status in user list",
|
||||
description: "Can slow down page rendering with large user base"
|
||||
) %>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<p class="pt-6 border-t border-gray-200 text-right">
|
||||
<%= f.submit 'Save', class: "btn-md btn-blue w-full md:w-auto" %>
|
||||
</p>
|
||||
</section>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -13,16 +13,20 @@
|
||||
title: 'Pending',
|
||||
value: @stats[:users_pending],
|
||||
) %>
|
||||
<% if @show_contributors %>
|
||||
<%= render QuickstatsItemComponent.new(
|
||||
type: :number,
|
||||
title: 'Contributors',
|
||||
title: Setting.member_status_contributor.pluralize,
|
||||
value: @stats[:users_contributing],
|
||||
) %>
|
||||
<% end %>
|
||||
<% if @show_sustainers %>
|
||||
<%= render QuickstatsItemComponent.new(
|
||||
type: :number,
|
||||
title: 'Sustainers',
|
||||
title: Setting.member_status_sustainer.pluralize,
|
||||
value: @stats[:users_paying],
|
||||
) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</section>
|
||||
|
||||
@@ -41,8 +45,8 @@
|
||||
<td><%= link_to(user.cn, admin_user_path(user.cn), class: 'ks-text-link') %></td>
|
||||
<td>
|
||||
<%= user.confirmed_at.nil? ? badge("pending", :yellow) : "" %>
|
||||
<%= @contributors.include?(user.cn) ? badge("contributor", :green) : "" %>
|
||||
<%= @sustainers.include?(user.cn) ? badge("sustainer", :green) : "" %>
|
||||
<% if @show_contributors %><%= @contributors.include?(user.cn) ? badge("contributor", :green) : "" %><% end %>
|
||||
<% if @show_sustainers %><%= @sustainers.include?(user.cn) ? badge("sustainer", :green) : "" %><% end %>
|
||||
</td>
|
||||
<td><%= @admins.include?(user.cn) ? badge("admin", :red) : "" %></td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user