From b8ded5545085bd0b6b2227bea5250c34b122ac56 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Thu, 7 Feb 2013 13:41:33 -0800 Subject: [PATCH 1/3] a few minor copyedits, 1px adjust --- app/assets/stylesheets/application/topic-post.css.scss | 2 +- config/locales/en.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/application/topic-post.css.scss b/app/assets/stylesheets/application/topic-post.css.scss index af5a71e081..8b5653fe0a 100644 --- a/app/assets/stylesheets/application/topic-post.css.scss +++ b/app/assets/stylesheets/application/topic-post.css.scss @@ -535,7 +535,7 @@ padding-top: 30px; } .post-actions { - padding: 6px 0 0px 15px; + padding: 5px 0 0px 15px; font-size: 12px; img { margin-right: 2px; diff --git a/config/locales/en.yml b/config/locales/en.yml index 88b9d9626a..439c154248 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -517,7 +517,7 @@ en: title: "Receive an email digest of what's new" daily: "daily" weekly: "weekly" - bi_weekly: "bi-weekly" + bi_weekly: "every two weeks" email_direct: "Receive an email when someone talks directly to you" email_private_messages: "Receive an email when someone sends you a private message" @@ -831,7 +831,7 @@ en: reply_as_new_topic: "Reply as new Topic" continue_discussion: "Continuing the discussion from {{postLink}}:" follow_quote: "go to the quoted post" - deleted_by_author: "Post deleted by author." + deleted_by_author: "(post removed by author)" has_replies_below: one: "Reply Below" From 2d064571df75e076f028079fd6944f013d61151f Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 7 Feb 2013 16:40:48 -0500 Subject: [PATCH 2/3] Fixes some minor issues with users deleting their own posts. --- .../discourse/controllers/topic_controller.js.coffee | 8 +++++--- app/serializers/current_user_serializer.rb | 12 +++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/topic_controller.js.coffee b/app/assets/javascripts/discourse/controllers/topic_controller.js.coffee index cd8101f274..43c4a9b23a 100644 --- a/app/assets/javascripts/discourse/controllers/topic_controller.js.coffee +++ b/app/assets/javascripts/discourse/controllers/topic_controller.js.coffee @@ -304,10 +304,12 @@ Discourse.TopicController = Ember.ObjectController.extend Discourse.Presence, post.recover() deletePost: (post) -> - if post.get('user_id') is Discourse.get('currentUser.id') + # Moderators can delete posts. Regular users can only create a deleted at message. + if Discourse.get('currentUser.moderator') + post.set('deleted_at', new Date()) + else post.set('cooked', Discourse.Utilities.cook(Em.String.i18n("post.deleted_by_author"))) post.set('can_delete', false) - else - post.set('deleted_at', new Date()) + post.set('version', post.get('version') + 1) post.delete() diff --git a/app/serializers/current_user_serializer.rb b/app/serializers/current_user_serializer.rb index 7e424c3660..c749658656 100644 --- a/app/serializers/current_user_serializer.rb +++ b/app/serializers/current_user_serializer.rb @@ -1,6 +1,12 @@ class CurrentUserSerializer < BasicUserSerializer - attributes :name, :unread_notifications, :unread_private_messages, :admin, :notification_channel_position, :site_flagged_posts_count + attributes :name, + :unread_notifications, + :unread_private_messages, + :admin?, + :notification_channel_position, + :site_flagged_posts_count, + :moderator? # we probably want to move this into site, but that json is cached so hanging it off current user seems okish @@ -8,6 +14,10 @@ class CurrentUserSerializer < BasicUserSerializer object.admin end + def moderator? + object.has_trust_level?(:moderator) + end + def site_flagged_posts_count PostAction.flagged_posts_count end From 139d44cb33f9b4d7487eee0df571f5cd7308ca81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Thu, 7 Feb 2013 22:46:06 +0100 Subject: [PATCH 3/3] Added travis-ci build status image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that discourse is using travis-ci, why not show the build status right in the README? Note: not sure where to place it... Documentation is over here: http://about.travis-ci.org/docs/user/status-images/ --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a25f8a0b0d..e46e764f32 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ This vision translates to the following functional commitments: ## Contributing +[![Build Status](https://travis-ci.org/discourse/discourse.png)](https://travis-ci.org/discourse/discourse) + Discourse is **100% free** and **open-source**. We encourage and support an active, healthy community that accepts contributions from the public, and we'd like you to be a part of that community.