Conditionally Renders Links Within the COC During Creator Onboarding (#15692)

* Conditionally renders links within the COC via a creator_settings_form? method

* Updates the creator_settings_form? method within application_helper.rb

* Replaces current_user with a custom creator var

* Adds feature flag check to guard clause in application_helper.rb

* Wake up, Travis
This commit is contained in:
Julianna Tetreault 2021-12-09 08:17:53 -07:00 committed by GitHub
parent e8184319b2
commit ac5934e63f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View file

@ -314,4 +314,12 @@ module ApplicationHelper
link_to(label, tag_path(tag), options)
end
def creator_settings_form?
return unless FeatureFlag.enabled?(:creator_onboarding)
return unless User.with_role(:creator).any?
creator = User.with_role(:creator).first
!creator.checked_code_of_conduct && !creator.checked_terms_and_conditions
end
end

View file

@ -1,7 +1,11 @@
<p>All participants of <%= community_name %> are expected to abide by our Code of Conduct, both online and during in-person events that are hosted and/or associated with <%= community_name %>.</p>
<h2>Our Pledge</h2>
<p>In the interest of fostering an open and welcoming environment, we as moderators of
<% if creator_settings_form? %>
<%= community_name %> pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
<% else %>
<a href="<%= app_url %>"><%= community_name %></a> pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
<% end %>
</p>
<h2>Our Standards</h2>
<p>Examples of behavior that contributes to creating a positive environment include:</p>
@ -31,7 +35,11 @@
</ul>
<h2>Enforcement</h2>
<p>Violations of the Code of Conduct may be reported by contacting the team via the
<% if creator_settings_form? %>
abuse report form or by sending an email to <%= email_link %>. All reports will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Further details of specific enforcement policies may be posted separately.
<% else %>
<a href="<%= app_url("/report-abuse") %>">abuse report form</a> or by sending an email to <%= email_link %>. All reports will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Further details of specific enforcement policies may be posted separately.
<% end %>
</p>
<p>Moderators have the right and responsibility to remove comments or other contributions that are not aligned to this Code of Conduct, or to suspend temporarily or permanently any members for other behaviors that they deem inappropriate, threatening, offensive, or harmful.</p>
<h2>Attribution</h2>