* Add display_announcements boolean to Users table * Adds a boolean with a default of true to Users * Add display_announcements to #user_data and user_policy.rb * Adds display_announcements to #user_data in AsyncInfoController * Adds display_announcements to PERMITTED_ATTRIBUTES * Add display_announcements to _misc.html.erb * Adjust submit data request button and adjust Announcements heading * Adjusts submit data request button to follow button capitalization * Adjusts announcements heading to read Announcements not Sponsors * Add copy to _misc.html.erb to add context around Announcement toggle * Add request and system specs around Announcements * Adds a test for announcements to user_settings_spec.rb * Adds a system spec for updating announcements * Add user_updates_announcements_spec file and remove old spec from users_settings_spec * Fix spec weirdness * Add tests around misc tab and Announcement toggle to user_settings_spec.rb * Tests that misc tab renders properly * Tests that display_announcements toggle updates a users settings properly * Removes user_updates_announcements_spec.rb * Adjusts Export Content capitalization in _misc.html.erb * Resolve DB conflicts
85 lines
3.9 KiB
Text
85 lines
3.9 KiB
Text
<div class="crayons-card grid gap-6 p-6 mb-6">
|
|
<h3>Connect</h3>
|
|
<%= form_for(@user, html: { id: nil, class: "grid gap-6" }) do |f| %>
|
|
<div class="crayons-field">
|
|
<%= f.label :inbox_type, "Inbox type", class: "crayons-field__label" %>
|
|
<p class="crayons-field__description">Open your inbox to messages from people you don't follow or keep your inbox private to mutual follows.</p>
|
|
<%= f.select :inbox_type, [%w[Open open], %w[Private private]], {}, { class: "crayons-select" } %>
|
|
</div>
|
|
|
|
<div class="crayons-field">
|
|
<%= f.label :inbox_guidelines, "Open inbox guidelines/instructions", class: "crayons-field__label" %>
|
|
<%= f.text_area :inbox_guidelines, maxlength: 200, class: "crayons-textfield", rows: 5, placeholder: "For example:
|
|
- Only contact me about consulting opportunities.
|
|
- I'm happy to help beginners with CSS.
|
|
- Allow for a few days to respond.
|
|
- etc.
|
|
" %>
|
|
<p class="crayons-field__description">(optional)</p>
|
|
</div>
|
|
|
|
<div><button type="submit" class="crayons-btn">Save Connect Settings</button></div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<%= render "language_settings" %>
|
|
|
|
<div class="crayons-card grid gap-6 p-6 mb-6">
|
|
<header>
|
|
<h3 class="mb-2">Sponsors</h3>
|
|
<p>You have the option to remove sponsor messaging (where it is practical to do so). Our wonderful sponsors help sustain the platform and improve your experience, and we strive to make their presence constructive to the community, but feel free to use this setting if you wish.</p>
|
|
</header>
|
|
|
|
<%= form_for(@user, html: { id: nil, class: "grid gap-4" }) do |f| %>
|
|
<div class="crayons-field crayons-field--checkbox">
|
|
<%= f.check_box :display_sponsors, class: "crayons-checkbox" %>
|
|
<%= f.label :display_sponsors, "Display Sponsors (When browsing)", class: "crayons-field__label" %>
|
|
</div>
|
|
|
|
<div class="crayons-field crayons-field--checkbox">
|
|
<%= f.check_box :permit_adjacent_sponsors, class: "crayons-checkbox" %>
|
|
<%= f.label :permit_adjacent_sponsors, "Permit Nearby Sponsors (When publishing)", class: "crayons-field__label" %>
|
|
</div>
|
|
|
|
<%= f.hidden_field :tab, value: @tab, id: nil %>
|
|
<div><button type="submit" class="crayons-btn">Save Sponsors Settings</button></div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="crayons-card grid gap-6 p-6 mb-6">
|
|
<header>
|
|
<h3 class="mb-2">Announcements</h3>
|
|
<p>You have the option to dismiss announcements. Announcements are used to inform you on important site-wide information, like updates and events.</p>
|
|
</header>
|
|
|
|
<%= form_for(@user, html: { id: nil, class: "grid gap-4" }) do |f| %>
|
|
<div class="crayons-field crayons-field--checkbox">
|
|
<%= f.check_box :display_announcements, class: "crayons-checkbox" %>
|
|
<%= f.label :display_announcements, "Display Announcements (When browsing)", class: "crayons-field__label" %>
|
|
</div>
|
|
|
|
<%= f.hidden_field :tab, value: @tab, id: nil %>
|
|
<div><button type="submit" class="crayons-btn">Save Announcements Settings</button></div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="crayons-card grid gap-4 p-6 mb-6">
|
|
<h3>Export Content</h3>
|
|
|
|
<% if @user.export_requested? %>
|
|
<div class="crayons-notice crayons-notice--warning">
|
|
<p>You have recently requested an export of your content. Please check your email.</p>
|
|
</div>
|
|
<% else %>
|
|
<p class="-mt-2">You can request an export of all your content. Currently we only support the export of your posts and comments. They will be emailed to your inbox.</p>
|
|
|
|
<%= form_for(@user, html: { id: nil }) do |f| %>
|
|
<div class="crayons-field crayons-field--checkbox mb-6">
|
|
<%= f.check_box :export_requested, class: "crayons-checkbox" %>
|
|
<%= f.label :export_requested, "Request an export of your content", class: "crayons-field__label" %>
|
|
</div>
|
|
<%= f.hidden_field :tab, value: @tab, id: nil %>
|
|
<div><button type="submit" class="crayons-btn">Submit Data Request</button></div>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|