Skip to content

Commit

Permalink
chore: Include link to Imgur's TOS (#317)
Browse files Browse the repository at this point in the history
* Include link to Imgur's TOS

* Format js
  • Loading branch information
imorland authored May 20, 2022
1 parent cb994e7 commit e66100c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
32 changes: 20 additions & 12 deletions js/src/admin/components/UploadPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import Stream from 'flarum/common/utils/Stream';
import ExtensionPage from 'flarum/admin/components/ExtensionPage';
import ItemList from 'flarum/common/utils/ItemList';
import InspectMimeModal from './InspectMimeModal';
import icon from 'flarum/common/helpers/icon';
import Link from 'flarum/common/components/Link';

/* global m */

Expand Down Expand Up @@ -334,16 +336,20 @@ export default class UploadPage extends ExtensionPage {
if (this.uploadMethodOptions['imgur'] !== undefined) {
items.add(
'imgur',
m('.imgur', [
m('fieldset', [
m('legend', app.translator.trans('fof-upload.admin.labels.imgur.title')),
m('label', app.translator.trans('fof-upload.admin.labels.imgur.client_id')),
m('input.FormControl', {
value: this.values.imgurClientId() || '',
oninput: withAttr('value', this.values.imgurClientId),
}),
]),
])
<div className="imgur">
<fieldset>
<legend>{app.translator.trans('fof-upload.admin.labels.imgur.title')}</legend>
<p>
{icon('fas fa-exclamation-circle')}{' '}
{app.translator.trans('fof-upload.admin.labels.imgur.tos', {
a: <Link href="https://imgur.com/tos" external={true} target="_blank" />,
})}
</p>
<label>{app.translator.trans('fof-upload.admin.labels.imgur.client_id')}</label>
<input className="FormControl" value={this.values.imgurClientId() || ''} oninput={withAttr('value', this.values.imgurClientId)} />
</fieldset>
</div>,
100
);
}

Expand All @@ -369,7 +375,8 @@ export default class UploadPage extends ExtensionPage {
oninput: withAttr('value', this.values.qiniuBucket),
}),
]),
])
]),
80
);
}

Expand Down Expand Up @@ -423,7 +430,8 @@ export default class UploadPage extends ExtensionPage {
}),
m('.helpText', app.translator.trans('fof-upload.admin.help_texts.s3_acl')),
]),
])
]),
60
);
}

Expand Down
6 changes: 6 additions & 0 deletions resources/less/admin.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@
width: 49%;
float: left;
}

.imgur {
.icon {
color: #ffcc00;
}
}
}
1 change: 1 addition & 0 deletions resources/locale/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ fof-upload:
imgur:
client_id: Imgur client ID
title: Imgur image storage settings
tos: It is your responsibility to ensure your forum users adhere to Imgur's <a>Terms of service</a>
local:
cdn_url: Content Delivery URL (prefixes files)
title: Local storage settings
Expand Down

0 comments on commit e66100c

Please sign in to comment.