Skip to content

feat: add patreon social link #4974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions app/components/forms/admin/content/social-links-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,21 @@ export default Component.extend(FormMixin, {
}
]
},
patreon: {
identifier : 'patreon',
optional : true,
rules : [
{
type : 'containsExactly[patreon.com]',
prompt : this.l10n.t('Please enter a valid Patreon url')
},
{
type : 'regExp',
value : protocolLessValidUrlPattern,
prompt : this.l10n.t('Please enter a valid url')
}
]
},
github: {
identifier : 'github',
optional : true,
Expand Down
2 changes: 2 additions & 0 deletions app/models/setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export default ModelBase.extend({
supportUrl : attr('string'),
facebookUrl : attr('string'),
instagramUrl : attr('string'),
patreonUrl : attr('string'),
youtubeUrl : attr('string'),
androidAppUrl : attr('string'),
frontendUrl : attr('string'),
Expand Down Expand Up @@ -104,6 +105,7 @@ export default ModelBase.extend({
segmentedSupportUrl : computedSegmentedLink.bind(this)('supportUrl'),
segmentedFacebookUrl : computedSegmentedLink.bind(this)('facebookUrl'),
segmentedInstagramUrl : computedSegmentedLink.bind(this)('instagramUrl'),
segmentedPatreonUrl : computedSegmentedLink.bind(this)('patreonUrl'),
segmentedTwitterUrl : computedSegmentedLink.bind(this)('twitterUrl'),
segmentedGoogleUrl : computedSegmentedLink.bind(this)('googleUrl'),
segmentedYoutubeUrl : computedSegmentedLink.bind(this)('youtubeUrl'),
Expand Down
5 changes: 5 additions & 0 deletions app/templates/components/footer-main.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@
<i class="google groups icon"></i> {{t 'Google Groups'}}
</a>
{{/if}}
{{#if this.socialLinks.patreonUrl}}
<a class="item" href="{{this.socialLinks.patreonUrl}}" target="_blank" rel="noopener noreferrer">
<i class="patreon icon"></i> {{t 'Patreon'}}
</a>
{{/if}}
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,11 @@
@segmentedLink={{this.socials.segmentedGithubUrl}}
@inputId="github" />
</div>
<div class="field">
<label>{{t 'Patreon'}}</label>
<Widgets::Forms::LinkInput
@segmentedLink={{this.socials.segmentedPatreonUrl}}
@inputId="patreon" />
</div>
<button class="ui teal button" type="submit">{{t 'Save'}}</button>
</form>