Skip to content

Commit

Permalink
Box title editable from admin dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
justoverclockl committed Jul 11, 2021
1 parent 2bcceb1 commit dd7a31f
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 5 deletions.
3 changes: 3 additions & 0 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@

(new Extend\ApiSerializer(ForumSerializer::class))
->attributes(Api\FeedbackSettings::class),

(new Extend\Settings)
->serializeToForum('boxTitle', 'justoverclock-feedback.boxTitle'),
];
2 changes: 1 addition & 1 deletion js/dist/admin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/admin.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/forum.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/forum.js.map

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions js/src/admin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,12 @@ app.initializers.add('justoverclock/flarum-ext-feedback', () => {
type: 'string',
label: app.translator.trans('justoverclock-feedback.admin.font-color'),
help: app.translator.trans('justoverclock-feedback.admin.font-color-help'),
})
.registerSetting({
setting: 'justoverclock-feedback.boxTitle',
name: 'boxTitle',
type: 'text',
label: app.translator.trans('justoverclock-feedback.admin.box-title'),
help: app.translator.trans('justoverclock-feedback.admin.box-title-help'),
});
});
2 changes: 1 addition & 1 deletion js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ app.initializers.add('justoverclock/flarum-ext-feedback', () => {
events: true,
emailField: opts.email, // show email input field, default: false
btnTitle: app.translator.trans('justoverclock-feedback.forum.button-title'), // title of button
title: app.translator.trans('justoverclock-feedback.forum.feedback-widget.title'), // text at the top
title: app.forum.attribute('boxTitle') || "Flarum Feedback", // text at the top
inputPlaceholder: app.translator.trans('justoverclock-feedback.forum.feedback-widget.placeholder'),
submitText: app.translator.trans('justoverclock-feedback.forum.feedback-widget.submit'), //'Submit', // text for submit button
backText: app.translator.trans('justoverclock-feedback.forum.feedback-widget.back'), //'Back', // text for back button
Expand Down
3 changes: 3 additions & 0 deletions locale/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ justoverclock-feedback:
background-color-help: Provide a hex color code to use as the background color, ie '#fff'
font-color: Widget font color
font-color-help: Provide a hex color code to use as the font color, ie '#000'
box-title: Box Title
box-title-help: Set the title of the popup feedback widget (old "Flarum feedback")
api:
validation_error: You cannot send empty feedback
forum:
Expand All @@ -26,6 +28,7 @@ justoverclock-feedback:
success: Thanks!👊
failed-title: Oops, an error ocurred
failed-message: Please try again. If this keeps happening, try to send an email instead.
email-field-placeholder: Email (optional field)
types:
general: General feedback
idea: I have an idea
Expand Down

0 comments on commit dd7a31f

Please sign in to comment.