favgroups: make private favgroups a Gold-only option.

Make private favgroups a Gold-only option. This is for consistency with
private favorites and upvotes being Gold-only options.

Existing Members with private favgroups are allowed to keep them, as
long as they don't disable privacy. If they disable it, then they can't
re-enable it again without upgrading to Gold first.
This commit is contained in:
evazion
2021-11-17 20:11:06 -06:00
parent bc96eb864b
commit a9997d0d2b
8 changed files with 56 additions and 19 deletions

View File

@@ -0,0 +1,12 @@
<%= edit_form_for(@favorite_group) do |f| %>
<%= f.input :name, as: :string, required: true, input_html: { value: @favorite_group.pretty_name } %>
<%= f.input :post_ids_string, label: "Posts", as: :text %>
<% if policy(@favorite_group).can_enable_privacy? %>
<%= f.input :is_private, label: "Private", as: :boolean, hint: "Don't allow others to view this favgroup." %>
<% elsif @favorite_group.is_private? %>
<%= f.input :is_private, label: "Private", as: :boolean, hint: "Don't allow others to view this favgroup. Warning: if you disable this, you can't re-enable it without ".html_safe + link_to("upgrading to Danbooru Gold", new_user_upgrade_path) + ". (".html_safe + link_to_wiki("learn more", "help:privacy_mode") + ")".html_safe %>
<% else %>
<%= f.input :is_private, label: "Private", as: :boolean, hint: link_to("Upgrade to Danbooru Gold to enable private favgroups", new_user_upgrade_path), input_html: { disabled: true } %>
<% end %>
<%= f.submit "Submit" %>
<% end %>

View File

@@ -2,12 +2,7 @@
<div id="a-edit">
<h1>Edit Favorite Group: <%= @favorite_group.pretty_name %></h1>
<%= edit_form_for(@favorite_group) do |f| %>
<%= f.input :name, :as => :string, :input_html => { :value => @favorite_group.pretty_name } %>
<%= f.input :post_ids_string, label: "Posts", as: :text %>
<%= f.input :is_public %>
<%= f.button :submit, "Submit" %>
<% end %>
<%= render "form" %>
</div>
</div>

View File

@@ -2,12 +2,7 @@
<div id="a-new">
<h1>New Favorite Group</h1>
<%= edit_form_for(@favorite_group) do |f| %>
<%= f.input :name, as: :string, required: true %>
<%= f.input :post_ids_string, label: "Posts", as: :text %>
<%= f.input :is_public, label: "Public" %>
<%= f.submit "Submit" %>
<% end %>
<%= render "form" %>
</div>
</div>