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. 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/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/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 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"