diff --git a/app/assets/javascripts/discourse/models/composer.js b/app/assets/javascripts/discourse/models/composer.js index 197ab4376..50eb2cbc6 100644 --- a/app/assets/javascripts/discourse/models/composer.js +++ b/app/assets/javascripts/discourse/models/composer.js @@ -459,6 +459,14 @@ Discourse.Composer = Discourse.Model.extend({ }); }, + flashDraftStatusForNewUser: function() { + var $draftStatus = $('#draft-status'); + if (Discourse.get('currentUser.trust_level') === 0) { + $draftStatus.toggleClass('flash', true); + setTimeout(function() { $draftStatus.removeClass('flash'); }, 250); + } + }, + updateDraftStatus: function() { var $title = $('#reply-title'), $reply = $('#wmd-input'); @@ -467,6 +475,7 @@ Discourse.Composer = Discourse.Model.extend({ if ($title.is(':focus')) { var titleDiff = this.get('missingTitleCharacters'); if (titleDiff > 0) { + this.flashDraftStatusForNewUser(); return this.set('draftStatus', Em.String.i18n('composer.min_length.need_more_for_title', { n: titleDiff })); } // 'reply' is focused diff --git a/app/assets/javascripts/discourse/templates/composer.js.handlebars b/app/assets/javascripts/discourse/templates/composer.js.handlebars index 0b0e3c204..2e77f1a6e 100644 --- a/app/assets/javascripts/discourse/templates/composer.js.handlebars +++ b/app/assets/javascripts/discourse/templates/composer.js.handlebars @@ -50,7 +50,7 @@ {{#if Discourse.currentUser}} {{{content.toggleText}}} -
+
{{#if view.loadingImage}}
{{i18n image_selector.uploading_image}} {{view.uploadProgress}}% {{i18n cancel}} diff --git a/app/assets/javascripts/discourse/views/composer_view.js b/app/assets/javascripts/discourse/views/composer_view.js index e0f56f329..d4201e510 100644 --- a/app/assets/javascripts/discourse/views/composer_view.js +++ b/app/assets/javascripts/discourse/views/composer_view.js @@ -27,7 +27,7 @@ Discourse.ComposerView = Discourse.View.extend({ }.property('content.composeState'), draftStatus: function() { - this.$('.draft-status').text(this.get('content.draftStatus') || ""); + $('#draft-status').text(this.get('content.draftStatus') || ""); }.observes('content.draftStatus'), // Disable fields when we're loading diff --git a/app/assets/stylesheets/application/compose.css.scss b/app/assets/stylesheets/application/compose.css.scss index 72215d1db..5d816216e 100755 --- a/app/assets/stylesheets/application/compose.css.scss +++ b/app/assets/stylesheets/application/compose.css.scss @@ -96,7 +96,7 @@ .requirements-not-met { background-color: rgba(255, 0, 0, 0.12); } - .toggle-preview, .draft-status, #image-uploading { + .toggle-preview, #draft-status, #image-uploading { position: absolute; bottom: -31px; margin-top: 0px; @@ -110,9 +110,12 @@ font-size: 12px; color: darken($gray, 40); } - .draft-status { + #draft-status { right: 51%; color: lighten($black, 60); + &.flash { + color: lighten($red, 20); + } } @include transition(height 0.4s ease); width: 100%; @@ -219,7 +222,7 @@ margin-right: auto; float: none; } - + // When the post is new (new topic) the sizings are different &.edit-title { &.open { diff --git a/app/serializers/current_user_serializer.rb b/app/serializers/current_user_serializer.rb index 42f32dc32..988525510 100644 --- a/app/serializers/current_user_serializer.rb +++ b/app/serializers/current_user_serializer.rb @@ -9,8 +9,9 @@ class CurrentUserSerializer < BasicUserSerializer :moderator?, :reply_count, :topic_count, - :enable_quoting, - :external_links_in_new_tab + :enable_quoting, + :external_links_in_new_tab, + :trust_level # we probably want to move this into site, but that json is cached so hanging it off current user seems okish