<%= t('author_wrote', author: link_to(post.user.name, userpage_url(post.user))).html_safe %>
Date: Thu, 19 Dec 2013 10:50:15 -0500
Subject: [PATCH 04/15] respect newlines in About Me on profile page
---
.../javascripts/discourse/templates/user/user.js.handlebars | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/assets/javascripts/discourse/templates/user/user.js.handlebars b/app/assets/javascripts/discourse/templates/user/user.js.handlebars
index 2181c36a811..7cc6818c731 100644
--- a/app/assets/javascripts/discourse/templates/user/user.js.handlebars
+++ b/app/assets/javascripts/discourse/templates/user/user.js.handlebars
@@ -41,7 +41,7 @@
{{username}} {{{statusIcon}}}
{{name}}
- {{{bio_excerpt}}}
+ {{{bio_cooked}}}
{{#if isSuspended}}
From 8dad928557fd52192392143d7a12612ceecb8997 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9gis=20Hanol?=
Date: Thu, 19 Dec 2013 17:01:22 +0100
Subject: [PATCH 05/15] Add setupTopicController event
---
app/assets/javascripts/discourse/routes/topic_route.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/assets/javascripts/discourse/routes/topic_route.js b/app/assets/javascripts/discourse/routes/topic_route.js
index 5e922405387..8c5b68e0ce5 100644
--- a/app/assets/javascripts/discourse/routes/topic_route.js
+++ b/app/assets/javascripts/discourse/routes/topic_route.js
@@ -128,10 +128,13 @@ Discourse.TopicRoute = Discourse.Route.extend({
editingTopic: false
});
+ Discourse.TopicRoute.trigger('setupTopicController', this);
+
this.controllerFor('header').setProperties({
topic: model,
showExtraInfo: false
});
+
this.controllerFor('composer').set('topic', model);
Discourse.TopicTrackingState.current().trackIncoming('all');
controller.subscribe();
@@ -142,4 +145,4 @@ Discourse.TopicRoute = Discourse.Route.extend({
});
-
+RSVP.EventTarget.mixin(Discourse.TopicRoute);
From c35af5d7557311db9de80ef600bb0148787bb2f5 Mon Sep 17 00:00:00 2001
From: Neil Lalonde
Date: Thu, 19 Dec 2013 11:24:21 -0500
Subject: [PATCH 06/15] FIX: When re-opening a topic that auto-closed, make
sure it won't auto-close again
---
app/models/topic_status_update.rb | 2 +-
spec/integration/topic_auto_close_spec.rb | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/app/models/topic_status_update.rb b/app/models/topic_status_update.rb
index f5113b2a93a..e166a46e56b 100644
--- a/app/models/topic_status_update.rb
+++ b/app/models/topic_status_update.rb
@@ -22,7 +22,7 @@ TopicStatusUpdate = Struct.new(:topic, :user) do
topic.update_column status.name, status.enabled?
end
- if status.manually_closing_topic? && topic.auto_close_at
+ if topic.auto_close_at && (status.reopening_topic? || status.manually_closing_topic?)
topic.reload.set_auto_close(nil).save
end
diff --git a/spec/integration/topic_auto_close_spec.rb b/spec/integration/topic_auto_close_spec.rb
index 9743363924a..7f6c90aaf28 100644
--- a/spec/integration/topic_auto_close_spec.rb
+++ b/spec/integration/topic_auto_close_spec.rb
@@ -87,6 +87,14 @@ describe Topic do
Then { scheduled_jobs_for(:close_topic).should have(2).jobs }
end
end
+
+ context 'a topic that has been auto-closed' do
+ Given(:admin) { Fabricate(:admin) }
+ Given!(:auto_closed_topic) { Fabricate(:topic, user: admin, closed: true, auto_close_at: 1.day.ago, auto_close_user_id: admin.id, auto_close_started_at: 6.days.ago) }
+ When { auto_closed_topic.update_status('closed', false, admin) }
+ Then { auto_closed_topic.reload.auto_close_at.should be_nil }
+ And { auto_closed_topic.auto_close_started_at.should be_nil }
+ end
end
end
end
From 39e711783da73472217bda4574cbb20d90352595 Mon Sep 17 00:00:00 2001
From: Neil Lalonde
Date: Thu, 19 Dec 2013 11:45:42 -0500
Subject: [PATCH 07/15] FIX: alignment of avatars and category badge on mobile
---
app/assets/stylesheets/mobile/topic-list.scss | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/app/assets/stylesheets/mobile/topic-list.scss b/app/assets/stylesheets/mobile/topic-list.scss
index bd8a687b6e3..b17f9d9472d 100644
--- a/app/assets/stylesheets/mobile/topic-list.scss
+++ b/app/assets/stylesheets/mobile/topic-list.scss
@@ -163,6 +163,10 @@
// --------------------------------------------------
#topic-list.categories {
+ .badge-category {
+ display: inline-block;
+ margin-top: 1px;
+ }
.featured-users {
@include portrait {
margin-bottom: 10px;
From 1cac9fa257331decc33f53cdff1b43fa9467e27a Mon Sep 17 00:00:00 2001
From: Robin Ward
Date: Thu, 19 Dec 2013 13:45:55 -0500
Subject: [PATCH 08/15] New users can only post `newuser_max_replies_per_topic`
times per topic.
---
app/assets/stylesheets/desktop/compose.scss | 6 +++++-
app/models/user.rb | 5 +++++
config/locales/server.en.yml | 10 ++++++++++
config/site_settings.yml | 1 +
lib/composer_messages_finder.rb | 7 +++++++
lib/validators/post_validator.rb | 7 +++++++
.../composer_messages_finder_spec.rb | 19 +++++++++++++++++++
.../validators/post_validator_spec.rb | 14 ++++++++++++++
8 files changed, 68 insertions(+), 1 deletion(-)
diff --git a/app/assets/stylesheets/desktop/compose.scss b/app/assets/stylesheets/desktop/compose.scss
index c4b46c50104..30a63b3fad4 100644
--- a/app/assets/stylesheets/desktop/compose.scss
+++ b/app/assets/stylesheets/desktop/compose.scss
@@ -18,8 +18,12 @@
@include box-shadow(3px 3px 3px rgba($black, 0.14));
+ h3 {
+ margin-bottom: 10px;
+ }
+
p {
- margin: 0 0 10px 0;
+ margin-bottom: 10px;
}
a.close {
diff --git a/app/models/user.rb b/app/models/user.rb
index f175dfd03ef..4e4831c3554 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -143,6 +143,7 @@ class User < ActiveRecord::Base
where(username_lower: username.downcase).first
end
+
def enqueue_welcome_message(message_type)
return unless SiteSetting.send_welcome_message?
Jobs.enqueue(:send_system_message, user_id: id, message_type: message_type)
@@ -340,6 +341,10 @@ class User < ActiveRecord::Base
topics_allowed.where(archetype: Archetype.private_message).count
end
+ def posted_too_much_in_topic?(topic_id)
+ trust_level == TrustLevel.levels[:newuser] && (Post.where(topic_id: topic_id, user_id: id).count >= SiteSetting.newuser_max_replies_per_topic)
+ end
+
def bio_excerpt
excerpt = PrettyText.excerpt(bio_cooked, 350)
return excerpt if excerpt.blank? || has_trust_level?(:basic)
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index de9d54678a0..1c54ddbf0a2 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -27,6 +27,8 @@ en:
site_under_maintenance: 'Site is currently undergoing maintenance.'
operation_already_running: "An %{operation} is currently running. Can't start a new %{operation} job right now."
+ too_many_replies: "Sorry you can't reply any more times in that topic."
+
too_many_mentions:
zero: "Sorry, you can't mention other users."
one: "Sorry, you can only mention one other user in a post."
@@ -132,6 +134,13 @@ en:
Are you sure you're providing adequate time for other people to share their points of view, too?
+ too_many_replies: |
+ ### You've replied too many times to this topic
+
+ Sorry, but new users are limited to %{newuser_max_replies_per_topic} replies in a topic.
+
+ You should consider editing one of your previous replies instead of a new reply.
+
activerecord:
attributes:
category:
@@ -667,6 +676,7 @@ en:
newuser_max_images: "How many images a new user can add to a post"
newuser_max_attachments: "How many attachments a new user can add to a post"
newuser_max_mentions_per_post: "Maximum number of @name notifications a new user can use in a post"
+ newuser_max_replies_per_topic: "Maximum number of replies a new user can make in a single topic"
max_mentions_per_post: "Maximum number of @name notifications you can use in a post"
create_thumbnails: "Create thumbnails for lightboxed images"
diff --git a/config/site_settings.yml b/config/site_settings.yml
index 4b1bbe40cb4..286d6e57526 100644
--- a/config/site_settings.yml
+++ b/config/site_settings.yml
@@ -177,6 +177,7 @@ posting:
default: true
post_undo_action_window_mins: 10
max_mentions_per_post: 10
+ newuser_max_replies_per_topic: 3
newuser_max_mentions_per_post: 2
onebox_max_chars: 5000
title_min_entropy: 10
diff --git a/lib/composer_messages_finder.rb b/lib/composer_messages_finder.rb
index c39731d820e..c7f27bcba05 100644
--- a/lib/composer_messages_finder.rb
+++ b/lib/composer_messages_finder.rb
@@ -7,6 +7,7 @@ class ComposerMessagesFinder
def find
check_education_message ||
+ check_new_user_many_replies ||
check_avatar_notification ||
check_sequential_replies ||
check_dominating_topic
@@ -32,6 +33,12 @@ class ComposerMessagesFinder
nil
end
+ # New users have a limited number of replies in a topic
+ def check_new_user_many_replies
+ return unless replying? && @user.posted_too_much_in_topic?(@details[:topic_id])
+ {templateName: 'composer/education', body: PrettyText.cook(I18n.t('education.too_many_replies', newuser_max_replies_per_topic: SiteSetting.newuser_max_replies_per_topic)) }
+ end
+
# Should a user be contacted to update their avatar?
def check_avatar_notification
diff --git a/lib/validators/post_validator.rb b/lib/validators/post_validator.rb
index 124d55058ec..5c5dab1efb0 100644
--- a/lib/validators/post_validator.rb
+++ b/lib/validators/post_validator.rb
@@ -5,6 +5,7 @@ class Validators::PostValidator < ActiveModel::Validator
presence(record)
stripped_length(record)
raw_quality(record)
+ max_posts_validator(record)
max_mention_validator(record)
max_images_validator(record)
max_attachments_validator(record)
@@ -40,6 +41,12 @@ class Validators::PostValidator < ActiveModel::Validator
end
end
+ def max_posts_validator(post)
+ if post.acting_user.present? && post.acting_user.posted_too_much_in_topic?(post.topic_id)
+ post.errors.add(:base, I18n.t(:too_many_replies))
+ end
+ end
+
# Ensure new users can not put too many images in a post
def max_images_validator(post)
add_error_if_count_exceeded(post, :too_many_images, post.image_count, SiteSetting.newuser_max_images) unless acting_user_is_trusted?(post)
diff --git a/spec/components/composer_messages_finder_spec.rb b/spec/components/composer_messages_finder_spec.rb
index df26e9be682..f211157a1fb 100644
--- a/spec/components/composer_messages_finder_spec.rb
+++ b/spec/components/composer_messages_finder_spec.rb
@@ -10,6 +10,7 @@ describe ComposerMessagesFinder do
it "calls all the message finders" do
finder.expects(:check_education_message).once
+ finder.expects(:check_new_user_many_replies).once
finder.expects(:check_avatar_notification).once
finder.expects(:check_sequential_replies).once
finder.expects(:check_dominating_topic).once
@@ -56,6 +57,24 @@ describe ComposerMessagesFinder do
finder.check_education_message.should be_blank
end
end
+ end
+
+ context '.check_new_user_many_replies' do
+ let(:user) { Fabricate.build(:user) }
+
+ context 'replying' do
+ let(:finder) { ComposerMessagesFinder.new(user, composerAction: 'reply') }
+
+ it "has no message when `posted_too_much_in_topic?` is false" do
+ user.expects(:posted_too_much_in_topic?).returns(false)
+ finder.check_new_user_many_replies.should be_blank
+ end
+
+ it "has a message when a user has posted too much" do
+ user.expects(:posted_too_much_in_topic?).returns(true)
+ finder.check_new_user_many_replies.should be_present
+ end
+ end
end
diff --git a/spec/components/validators/post_validator_spec.rb b/spec/components/validators/post_validator_spec.rb
index 76865503d9e..e1a5ed725ea 100644
--- a/spec/components/validators/post_validator_spec.rb
+++ b/spec/components/validators/post_validator_spec.rb
@@ -24,6 +24,20 @@ describe Validators::PostValidator do
end
end
+ context "too_many_posts" do
+ it "should be invalid when the user has posted too much" do
+ post.user.expects(:posted_too_much_in_topic?).returns(true)
+ validator.max_posts_validator(post)
+ expect(post.errors.count).to be > 0
+ end
+
+ it "should be valid when the user hasn't posted too much" do
+ post.user.expects(:posted_too_much_in_topic?).returns(false)
+ validator.max_posts_validator(post)
+ expect(post.errors.count).to be(0)
+ end
+ end
+
context "invalid post" do
it "should be invalid" do
validator.validate(post)
From 4f7d440fa46f85c187f0572480edd8c674899059 Mon Sep 17 00:00:00 2001
From: Robin Ward
Date: Thu, 19 Dec 2013 14:43:36 -0500
Subject: [PATCH 09/15] Remove unused hook.
---
app/assets/javascripts/discourse/dialects/dialect.js | 1 -
1 file changed, 1 deletion(-)
diff --git a/app/assets/javascripts/discourse/dialects/dialect.js b/app/assets/javascripts/discourse/dialects/dialect.js
index ebf09e3d3fb..f7c53f1a66a 100644
--- a/app/assets/javascripts/discourse/dialects/dialect.js
+++ b/app/assets/javascripts/discourse/dialects/dialect.js
@@ -17,7 +17,6 @@ var parser = window.BetterMarkdown,
@method initializeDialects
**/
function initializeDialects() {
- Discourse.Dialect.trigger('register', {dialect: dialect, MD: MD});
MD.buildBlockOrder(dialect.block);
MD.buildInlinePatterns(dialect.inline);
initialized = true;
From 33c6997ded3f3553f79dca10483a4d3955b6cb85 Mon Sep 17 00:00:00 2001
From: Neil Lalonde
Date: Thu, 19 Dec 2013 15:12:03 -0500
Subject: [PATCH 10/15] Move password validation into PasswordValidator
---
app/models/user.rb | 18 +++++---
lib/validators/password_validator.rb | 12 +++++
.../validators/password_validator_spec.rb | 46 +++++++++++++++++++
3 files changed, 70 insertions(+), 6 deletions(-)
create mode 100644 lib/validators/password_validator.rb
create mode 100644 spec/components/validators/password_validator_spec.rb
diff --git a/app/models/user.rb b/app/models/user.rb
index 4e4831c3554..44ff39d55e0 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -246,11 +246,23 @@ class User < ActiveRecord::Base
@raw_password = password unless password.blank?
end
+ def password
+ '' # so that validator doesn't complain that a password attribute doesn't exist
+ end
+
# Indicate that this is NOT a passwordless account for the purposes of validation
def password_required!
@password_required = true
end
+ def password_required?
+ !!@password_required
+ end
+
+ def password_validator
+ PasswordValidator.new(attributes: :password).validate_each(self, :password, @raw_password)
+ end
+
def confirm_password?(password)
return false unless password_hash && salt
self.password_hash == hash_password(password, salt)
@@ -561,12 +573,6 @@ class User < ActiveRecord::Base
end
end
- def password_validator
- if (@raw_password && @raw_password.length < 6) || (@password_required && !@raw_password)
- errors.add(:password, "must be 6 letters or longer")
- end
- end
-
def send_approval_email
Jobs.enqueue(:user_email,
type: :signup_after_approval,
diff --git a/lib/validators/password_validator.rb b/lib/validators/password_validator.rb
new file mode 100644
index 00000000000..9f87fdecd68
--- /dev/null
+++ b/lib/validators/password_validator.rb
@@ -0,0 +1,12 @@
+class PasswordValidator < ActiveModel::EachValidator
+
+ def validate_each(record, attribute, value)
+ return unless record.password_required?
+ if value.nil?
+ record.errors.add(attribute, :blank)
+ elsif value.length < 6
+ record.errors.add(attribute, :too_short, count: 6)
+ end
+ end
+
+end
diff --git a/spec/components/validators/password_validator_spec.rb b/spec/components/validators/password_validator_spec.rb
new file mode 100644
index 00000000000..cdaa6a38d0e
--- /dev/null
+++ b/spec/components/validators/password_validator_spec.rb
@@ -0,0 +1,46 @@
+require 'spec_helper'
+
+describe PasswordValidator do
+
+ let(:validator) { described_class.new({attributes: :password}) }
+ subject(:validate) { validator.validate_each(record,:password,@password) }
+
+ context "password required" do
+ let(:record) { u = Fabricate.build(:user, password: @password); u.password_required!; u }
+
+ it "doesn't add an error when password is good" do
+ @password = "weron235alsfn234"
+ validate
+ record.errors[:password].should_not be_present
+ end
+
+ it "adds an error when password is too short" do
+ @password = "p"
+ validate
+ record.errors[:password].should be_present
+ end
+
+ it "adds an error when password is blank" do
+ @password = ''
+ validate
+ record.errors[:password].should be_present
+ end
+
+ it "adds an error when password is nil" do
+ @password = nil
+ validate
+ record.errors[:password].should be_present
+ end
+ end
+
+ context "password not required" do
+ let(:record) { Fabricate.build(:user, password: @password) }
+
+ it "doesn't add an error if password is not required" do
+ @password = nil
+ validate
+ record.errors[:password].should_not be_present
+ end
+ end
+
+end
From 854d9c8fc6f94f6c3c5bdcd17ab09ce2324411a4 Mon Sep 17 00:00:00 2001
From: Neil Lalonde
Date: Thu, 19 Dec 2013 16:15:36 -0500
Subject: [PATCH 11/15] Minimum password length is configurable with the
min_password_length site setting. FIX: reset password needs to validate
password length.
---
.../controllers/create_account_controller.js | 4 +-
app/controllers/users_controller.rb | 1 +
config/locales/server.en.yml | 1 +
config/site_settings.yml | 3 ++
lib/validators/password_validator.rb | 4 +-
.../validators/password_validator_spec.rb | 52 ++++++++++++-------
.../fixtures/site_settings_fixtures.js | 2 +-
7 files changed, 43 insertions(+), 24 deletions(-)
diff --git a/app/assets/javascripts/discourse/controllers/create_account_controller.js b/app/assets/javascripts/discourse/controllers/create_account_controller.js
index d409757d621..6babd49d80a 100644
--- a/app/assets/javascripts/discourse/controllers/create_account_controller.js
+++ b/app/assets/javascripts/discourse/controllers/create_account_controller.js
@@ -31,7 +31,7 @@ Discourse.CreateAccountController = Discourse.Controller.extend(Discourse.ModalF
}.property('authOptions.auth_provider'),
passwordInstructions: function() {
- return I18n.t('user.password.instructions', {count: 6}); // TODO: soon to be configurable
+ return I18n.t('user.password.instructions', {count: Discourse.SiteSettings.min_password_length});
}.property(),
// Validate the name
@@ -273,7 +273,7 @@ Discourse.CreateAccountController = Discourse.Controller.extend(Discourse.ModalF
}
// If too short
- if (password.length < 6) {
+ if (password.length < Discourse.SiteSettings.min_password_length) {
return Discourse.InputValidation.create({
failed: true,
reason: I18n.t('user.password.too_short')
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 29591269ca0..6174652d2d7 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -172,6 +172,7 @@ class UsersController < ApplicationController
elsif request.put?
raise Discourse::InvalidParameters.new(:password) unless params[:password].present?
@user.password = params[:password]
+ @user.password_required!
logon_after_password_reset if @user.save
end
render layout: 'no_js'
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 1c54ddbf0a2..da14b65a514 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -603,6 +603,7 @@ en:
login_required: "Require authentication to read posts"
+ min_password_length: "Minimum password length."
enable_local_logins: "Enable traditional, local username and password authentication"
enable_local_account_create: "Enable creating new local accounts"
enable_google_logins: "Enable Google authentication"
diff --git a/config/site_settings.yml b/config/site_settings.yml
index 286d6e57526..280879454b3 100644
--- a/config/site_settings.yml
+++ b/config/site_settings.yml
@@ -76,6 +76,9 @@ users:
must_approve_users:
client: true
default: false
+ min_password_length:
+ client: true
+ default: 8
enable_google_logins:
client: true
default: true
diff --git a/lib/validators/password_validator.rb b/lib/validators/password_validator.rb
index 9f87fdecd68..b396cdf3f77 100644
--- a/lib/validators/password_validator.rb
+++ b/lib/validators/password_validator.rb
@@ -4,8 +4,8 @@ class PasswordValidator < ActiveModel::EachValidator
return unless record.password_required?
if value.nil?
record.errors.add(attribute, :blank)
- elsif value.length < 6
- record.errors.add(attribute, :too_short, count: 6)
+ elsif value.length < SiteSetting.min_password_length
+ record.errors.add(attribute, :too_short, count: SiteSetting.min_password_length)
end
end
diff --git a/spec/components/validators/password_validator_spec.rb b/spec/components/validators/password_validator_spec.rb
index cdaa6a38d0e..6d23ce1be9a 100644
--- a/spec/components/validators/password_validator_spec.rb
+++ b/spec/components/validators/password_validator_spec.rb
@@ -8,28 +8,42 @@ describe PasswordValidator do
context "password required" do
let(:record) { u = Fabricate.build(:user, password: @password); u.password_required!; u }
- it "doesn't add an error when password is good" do
- @password = "weron235alsfn234"
- validate
- record.errors[:password].should_not be_present
+ context "min password length is 8" do
+ before { SiteSetting.stubs(:min_password_length).returns(8) }
+
+ it "doesn't add an error when password is good" do
+ @password = "weron235alsfn234"
+ validate
+ record.errors[:password].should_not be_present
+ end
+
+ it "adds an error when password is too short" do
+ @password = "p"
+ validate
+ record.errors[:password].should be_present
+ end
+
+ it "adds an error when password is blank" do
+ @password = ''
+ validate
+ record.errors[:password].should be_present
+ end
+
+ it "adds an error when password is nil" do
+ @password = nil
+ validate
+ record.errors[:password].should be_present
+ end
end
- it "adds an error when password is too short" do
- @password = "p"
- validate
- record.errors[:password].should be_present
- end
+ context "min password length is 12" do
+ before { SiteSetting.stubs(:min_password_length).returns(12) }
- it "adds an error when password is blank" do
- @password = ''
- validate
- record.errors[:password].should be_present
- end
-
- it "adds an error when password is nil" do
- @password = nil
- validate
- record.errors[:password].should be_present
+ it "adds an error when password length is 11" do
+ @password = "gt38sdt92bv"
+ validate
+ record.errors[:password].should be_present
+ end
end
end
diff --git a/test/javascripts/fixtures/site_settings_fixtures.js b/test/javascripts/fixtures/site_settings_fixtures.js
index 718c65dafb5..d32a26ba707 100644
--- a/test/javascripts/fixtures/site_settings_fixtures.js
+++ b/test/javascripts/fixtures/site_settings_fixtures.js
@@ -1,3 +1,3 @@
/*jshint maxlen:10000000 */
-Discourse.SiteSettingsOriginal = {"title":"Discourse Meta","logo_url":"/assets/logo.png","logo_small_url":"/assets/logo-single.png","traditional_markdown_linebreaks":false,"top_menu":"latest|new|unread|read|favorited|categories","post_menu":"like|edit|flag|delete|share|bookmark|reply","share_links":"twitter|facebook|google+|email","track_external_right_clicks":false,"must_approve_users":false,"ga_tracking_code":"UA-33736483-2","ga_domain_name":"","enable_long_polling":true,"polling_interval":3000,"anon_polling_interval":30000,"min_post_length":20,"max_post_length":16000,"min_topic_title_length":15,"max_topic_title_length":255,"min_private_message_title_length":2,"allow_uncategorized_topics":true,"min_search_term_length":3,"flush_timings_secs":5,"suppress_reply_directly_below":true,"email_domains_blacklist":"mailinator.com","email_domains_whitelist":null,"version_checks":true,"min_title_similar_length":10,"min_body_similar_length":15,"category_colors":"BF1E2E|F1592A|F7941D|9EB83B|3AB54A|12A89D|25AAE2|0E76BD|652D90|92278F|ED207B|8C6238|231F20|808281|B3B5B4|283890","max_upload_size_kb":1024,"category_featured_topics":6,"favicon_url":"/assets/favicon.ico","dynamic_favicon":false,"uncategorized_name":"uncategorized","uncategorized_color":"AB9364","uncategorized_text_color":"FFFFFF","invite_only":false,"login_required":false,"enable_local_logins":true,"enable_local_account_create":true,"enable_google_logins":true,"enable_yahoo_logins":true,"enable_twitter_logins":true,"enable_facebook_logins":true,"enable_cas_logins":false,"enable_github_logins":true,"enable_persona_logins":true,"educate_until_posts":2,"topic_views_heat_low":1000,"topic_views_heat_medium":2000,"topic_views_heat_high":5000,"min_private_message_post_length":5,"faq_url":"","tos_url":"","privacy_policy_url":"","authorized_extensions":".jpg|.jpeg|.png|.gif|.txt","relative_date_duration":14,"delete_removed_posts_after":24,"delete_user_max_age":7, "default_code_lang": "lang-auto"};
+Discourse.SiteSettingsOriginal = {"title":"Discourse Meta","logo_url":"/assets/logo.png","logo_small_url":"/assets/logo-single.png","traditional_markdown_linebreaks":false,"top_menu":"latest|new|unread|read|favorited|categories","post_menu":"like|edit|flag|delete|share|bookmark|reply","share_links":"twitter|facebook|google+|email","track_external_right_clicks":false,"must_approve_users":false,"ga_tracking_code":"UA-33736483-2","ga_domain_name":"","enable_long_polling":true,"polling_interval":3000,"anon_polling_interval":30000,"min_post_length":20,"max_post_length":16000,"min_topic_title_length":15,"max_topic_title_length":255,"min_private_message_title_length":2,"allow_uncategorized_topics":true,"min_search_term_length":3,"flush_timings_secs":5,"suppress_reply_directly_below":true,"email_domains_blacklist":"mailinator.com","email_domains_whitelist":null,"version_checks":true,"min_title_similar_length":10,"min_body_similar_length":15,"category_colors":"BF1E2E|F1592A|F7941D|9EB83B|3AB54A|12A89D|25AAE2|0E76BD|652D90|92278F|ED207B|8C6238|231F20|808281|B3B5B4|283890","max_upload_size_kb":1024,"category_featured_topics":6,"favicon_url":"/assets/favicon.ico","dynamic_favicon":false,"uncategorized_name":"uncategorized","uncategorized_color":"AB9364","uncategorized_text_color":"FFFFFF","invite_only":false,"login_required":false,"min_password_length":8,"enable_local_logins":true,"enable_local_account_create":true,"enable_google_logins":true,"enable_yahoo_logins":true,"enable_twitter_logins":true,"enable_facebook_logins":true,"enable_cas_logins":false,"enable_github_logins":true,"enable_persona_logins":true,"educate_until_posts":2,"topic_views_heat_low":1000,"topic_views_heat_medium":2000,"topic_views_heat_high":5000,"min_private_message_post_length":5,"faq_url":"","tos_url":"","privacy_policy_url":"","authorized_extensions":".jpg|.jpeg|.png|.gif|.txt","relative_date_duration":14,"delete_removed_posts_after":24,"delete_user_max_age":7, "default_code_lang": "lang-auto"};
Discourse.SiteSettings = jQuery.extend(true, {}, Discourse.SiteSettingsOriginal);
From 66616c9574f3d64efe90e669b2f8bfc115fa419c Mon Sep 17 00:00:00 2001
From: Neil Lalonde
Date: Thu, 19 Dec 2013 16:51:18 -0500
Subject: [PATCH 12/15] Categories page is even better on Nexus 7 (and probably
iPad mini)
---
.../stylesheets/common/foundation/mixins.scss | 16 +++-------
app/assets/stylesheets/mobile/topic-list.scss | 31 +++++++++++++++----
2 files changed, 30 insertions(+), 17 deletions(-)
diff --git a/app/assets/stylesheets/common/foundation/mixins.scss b/app/assets/stylesheets/common/foundation/mixins.scss
index 54cdef40066..c075e15e3df 100644
--- a/app/assets/stylesheets/common/foundation/mixins.scss
+++ b/app/assets/stylesheets/common/foundation/mixins.scss
@@ -41,17 +41,11 @@
}
}
-@mixin portrait {
- @media only screen and (max-width : 320px) {
- @content;
- }
-}
-
-@mixin landscape {
- @media only screen and (min-width : 321px) {
- @content;
- }
-}
+@mixin mobile-portrait { @media only screen and (max-width : 320px) { @content; } }
+@mixin not-mobile-portrait { @media only screen and (min-width : 321px) { @content; } }
+@mixin mobile-landscape { @media only screen and (min-width : 321px) and (max-width : 959px) { @content; } }
+@mixin not-tablet-landscape { @media only screen and (max-width : 959px) { @content; } }
+@mixin tablet-landscape { @media only screen and (min-width : 960px) { @content; } }
// CSS3 properties
// --------------------------------------------------
diff --git a/app/assets/stylesheets/mobile/topic-list.scss b/app/assets/stylesheets/mobile/topic-list.scss
index b17f9d9472d..7229d221be9 100644
--- a/app/assets/stylesheets/mobile/topic-list.scss
+++ b/app/assets/stylesheets/mobile/topic-list.scss
@@ -50,7 +50,7 @@
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
- tbody tr {
+ > tbody > tr {
background-color: $white;
&:nth-child(even) {
background-color: darken($white, 4%);
@@ -167,19 +167,23 @@
display: inline-block;
margin-top: 1px;
}
+ .category-description {
+ margin-top: 8px;
+ }
.featured-users {
- @include portrait {
+ @include mobile-portrait {
margin-bottom: 10px;
padding-top: 8px;
clear: left;
}
- @include landscape {
+ @include not-mobile-portrait {
float: right;
}
}
.latest {
- @include portrait { width: 150px; }
- @include landscape { width: 270px; }
+ @include mobile-portrait { width: 150px; }
+ @include mobile-landscape { width: 270px; }
+ @include tablet-landscape { width: 450px; }
.featured-topic {
margin: 8px 0;
a.last-posted-at, a.last-posted-at:visited {
@@ -188,7 +192,22 @@
}
}
.stats {
- display: none;
+ @include not-tablet-landscape { display: none; }
+ @include tablet-landscape { min-width: 80px; }
+ }
+ td.stats {
+ .unit {
+ font-size: 11px;
+ }
+ }
+ table.categoryStats {
+ td {
+ padding: 2px;
+ vertical-align: bottom;
+ line-height: 17px;
+ &.value { text-align: right; }
+ &.unit { text-align: left; }
+ }
}
}
From 452232096f3672907053766dda383936b90d1040 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9gis=20Hanol?=
Date: Fri, 20 Dec 2013 00:32:39 +0100
Subject: [PATCH 13/15] smaller images in oneboxes
---
app/assets/stylesheets/desktop/onebox.scss | 17 +++++++----------
app/assets/stylesheets/mobile/onebox.scss | 15 ++++++---------
2 files changed, 13 insertions(+), 19 deletions(-)
diff --git a/app/assets/stylesheets/desktop/onebox.scss b/app/assets/stylesheets/desktop/onebox.scss
index 74498136eff..55a6544684e 100644
--- a/app/assets/stylesheets/desktop/onebox.scss
+++ b/app/assets/stylesheets/desktop/onebox.scss
@@ -16,7 +16,7 @@ a.loading-onebox {
.onebox-result {
margin-top: 15px;
- padding: 12px 25px 12px 12px;
+ padding: 12px 25px 12px 12px;
border-left: 5px solid #bebebe;
background: #eee;
font-size: 14px;
@@ -43,7 +43,10 @@ a.loading-onebox {
.onebox-result-body {
padding-top: 5px;
img {
- max-width:200px;
+ max-width: 100px;
+ max-height: 80%;
+ float: left;
+ margin-right: 10px;
}
h3, h4 {
margin: 0px !important;
@@ -55,12 +58,6 @@ a.loading-onebox {
code {
max-height: 400px;
}
- img {
- max-width: 30%;
- max-height: 80%;
- float: left;
- margin-right: 10px;
- }
.metrics {
clear: both;
padding-bottom: 25px;
@@ -76,8 +73,8 @@ a.loading-onebox {
// RottenTomatoes Onebox
.onebox-result {
.onebox-result-body {
- img.verdict {
- float: none;
+ img.verdict {
+ float: none;
margin-right: 7px;
}
img.popcorn {
diff --git a/app/assets/stylesheets/mobile/onebox.scss b/app/assets/stylesheets/mobile/onebox.scss
index a0fb25e1e5e..f0a31864357 100644
--- a/app/assets/stylesheets/mobile/onebox.scss
+++ b/app/assets/stylesheets/mobile/onebox.scss
@@ -39,7 +39,10 @@ a.loading-onebox {
padding-top: 5px;
font-family: Georgia, Times, "Times New Roman", serif;
img {
- max-width:200px;
+ max-width: 100px;
+ max-height: 80%;
+ float: left;
+ margin-right: 10px;
}
h3, h4 {
margin: 0px !important;
@@ -51,12 +54,6 @@ a.loading-onebox {
code {
max-height: 400px;
}
- img {
- max-width: 30%;
- max-height: 80%;
- float: left;
- margin-right: 10px;
- }
.metrics {
clear: both;
padding-bottom: 25px;
@@ -72,8 +69,8 @@ a.loading-onebox {
// RottenTomatoes Onebox
.onebox-result {
.onebox-result-body {
- img.verdict {
- float: none;
+ img.verdict {
+ float: none;
margin-right: 7px;
}
img.popcorn {
From e6e04ca0e948348424159315dd9fb8652eb4d2c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9gis=20Hanol?=
Date: Fri, 20 Dec 2013 00:58:48 +0100
Subject: [PATCH 14/15] FIX: new user username color
---
app/assets/stylesheets/desktop/poster_expansion.scss | 8 ++++----
app/assets/stylesheets/desktop/topic-post.scss | 4 ++++
app/assets/stylesheets/mobile/topic-post.scss | 2 +-
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/app/assets/stylesheets/desktop/poster_expansion.scss b/app/assets/stylesheets/desktop/poster_expansion.scss
index 36d239e8fa7..20d650c0875 100644
--- a/app/assets/stylesheets/desktop/poster_expansion.scss
+++ b/app/assets/stylesheets/desktop/poster_expansion.scss
@@ -13,10 +13,6 @@
padding: 12px 12px 5px 12px;
max-width: 350px;
- h1.new-user a {
- color: $dark_gray;
- }
-
h1 {
font-size: 30px;
line-height: 33px;
@@ -67,4 +63,8 @@
.btn {
margin: 0 0 7px 0;
}
+
+ .new-user a {
+ color: $dark_gray;
+ }
}
diff --git a/app/assets/stylesheets/desktop/topic-post.scss b/app/assets/stylesheets/desktop/topic-post.scss
index 5550ffa3d59..506e8153681 100644
--- a/app/assets/stylesheets/desktop/topic-post.scss
+++ b/app/assets/stylesheets/desktop/topic-post.scss
@@ -572,6 +572,10 @@ iframe {
font-size: 36px;
}
+.new-user a {
+ color: $dark_gray;
+}
+
.staff a {
padding: 4px;
margin: -4px 0 0 0;
diff --git a/app/assets/stylesheets/mobile/topic-post.scss b/app/assets/stylesheets/mobile/topic-post.scss
index 936590ffff2..a834af759c8 100644
--- a/app/assets/stylesheets/mobile/topic-post.scss
+++ b/app/assets/stylesheets/mobile/topic-post.scss
@@ -433,7 +433,7 @@ iframe {
background-color: lighten(yellow, 35%);
}
-h3.new-user a[href] {
+.new-user a {
color: $dark_gray;
}
From 2ac9ad6d517e1443954b5b1473d9d5f4ac63046b Mon Sep 17 00:00:00 2001
From: Jeff Atwood
Date: Thu, 19 Dec 2013 16:05:12 -0800
Subject: [PATCH 15/15] edit copy on new user topic reply limit
---
config/locales/server.en.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index da14b65a514..97350bcf521 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -135,11 +135,11 @@ en:
Are you sure you're providing adequate time for other people to share their points of view, too?
too_many_replies: |
- ### You've replied too many times to this topic
+ ### You have reached the reply limit
- Sorry, but new users are limited to %{newuser_max_replies_per_topic} replies in a topic.
+ We're sorry, but new users are temporarily limited to %{newuser_max_replies_per_topic} replies in a single topic.
- You should consider editing one of your previous replies instead of a new reply.
+ Instead of adding another reply, please consider editing your previous replies.
activerecord:
attributes: