SiteSetting, admin passtrough, CSS, hide on mobile
This commit is contained in:
parent
804019647e
commit
acc70cc3de
|
@ -7,6 +7,7 @@ export default ContainerView.extend({
|
|||
@on('init')
|
||||
createButtons() {
|
||||
const mobileView = this.site.mobileView;
|
||||
const { siteSettings } = this;
|
||||
|
||||
const topic = this.get('topic');
|
||||
|
||||
|
@ -32,7 +33,9 @@ export default ContainerView.extend({
|
|||
this.attachViewClass('invite-reply-button');
|
||||
}
|
||||
|
||||
this.attachViewClass('print-button');
|
||||
if (!mobileView && siteSettings.allow_print_page) {
|
||||
this.attachViewClass('print-button');
|
||||
}
|
||||
|
||||
if (topic.get('isPrivateMessage')) {
|
||||
this.attachViewClass('archive-button');
|
||||
|
|
|
@ -70,8 +70,9 @@ class TopicsController < ApplicationController
|
|||
end
|
||||
|
||||
if opts[:print]
|
||||
raise Discourse::InvalidAccess unless SiteSetting.allow_print_page
|
||||
begin
|
||||
RateLimiter.new(current_user, "print-topic-per-hour", 10, 1.hour).performed!
|
||||
RateLimiter.new(current_user, "print-topic-per-hour", 10, 1.hour).performed! unless current_user.admin?
|
||||
rescue RateLimiter::LimitExceeded
|
||||
render_json_error(I18n.t("rate_limiter.slow_down"))
|
||||
end
|
||||
|
|
|
@ -43,6 +43,11 @@
|
|||
.topic-list > div {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
body img.emoji {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
|
|
@ -1312,6 +1312,8 @@ en:
|
|||
|
||||
topic_page_title_includes_category: "Topic page title includes the category name."
|
||||
|
||||
allow_print_page: "Enable a special topic page for printing"
|
||||
|
||||
full_name_required: "Full name is a required field of a user's profile."
|
||||
enable_names: "Show the user's full name on their profile, user card, and emails. Disable to hide full name everywhere."
|
||||
display_name_on_posts: "Show a user's full name on their posts in addition to their @username."
|
||||
|
|
|
@ -1220,6 +1220,10 @@ uncategorized:
|
|||
|
||||
topic_page_title_includes_category: true
|
||||
|
||||
allow_print_page:
|
||||
default: true
|
||||
client: true
|
||||
|
||||
user_preferences:
|
||||
default_email_digest_frequency:
|
||||
enum: 'DigestEmailSiteSetting'
|
||||
|
|
Loading…
Reference in New Issue