mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
for some reason people seem to not understand why you can not submit close to empty posts, fix that
This commit is contained in:
parent
e94b6e7796
commit
6132373fab
2 changed files with 20 additions and 7 deletions
|
@ -335,14 +335,16 @@ window.Discourse.Composer = Discourse.Model.extend
|
|||
|
||||
saveDraft: ->
|
||||
|
||||
return if @disableDrafts
|
||||
return if @get('disableDrafts')
|
||||
return unless @get('reply')
|
||||
return if @get('reply').length < Discourse.SiteSettings.min_post_length
|
||||
|
||||
data =
|
||||
reply: @get("reply"),
|
||||
action: @get("action"),
|
||||
title: @get("title"),
|
||||
categoryName: @get("categoryName"),
|
||||
postId: @get("post.id"),
|
||||
reply: @get('reply'),
|
||||
action: @get('action'),
|
||||
title: @get('title'),
|
||||
categoryName: @get('categoryName'),
|
||||
postId: @get('post.id'),
|
||||
archetypeId: @get('archetypeId')
|
||||
metaData: @get('metaData')
|
||||
usernames: @get('targetUsernames')
|
||||
|
@ -356,7 +358,14 @@ window.Discourse.Composer = Discourse.Model.extend
|
|||
)
|
||||
|
||||
resetDraftStatus: (->
|
||||
@set('draftStatus', null)
|
||||
reply = @get('reply')
|
||||
len = Discourse.SiteSettings.min_post_length
|
||||
if !reply
|
||||
@set('draftStatus', Em.String.i18n('composer.min_length.at_least', n: len))
|
||||
else if reply.length < len
|
||||
@set('draftStatus', Em.String.i18n('composer.min_length.more', n: len - reply.length))
|
||||
else
|
||||
@set('draftStatus', null)
|
||||
).observes('reply','title')
|
||||
|
||||
|
||||
|
|
|
@ -244,6 +244,10 @@ en:
|
|||
saved_draft_tip: "saved"
|
||||
saved_local_draft_tip: "saved locally"
|
||||
|
||||
min_length:
|
||||
at_least: "enter at least {{n}} characters"
|
||||
more: "{{n}} to go..."
|
||||
|
||||
save_edit: "Save Edit"
|
||||
reply: "Reply"
|
||||
create_topic: "Create Topic"
|
||||
|
|
Loading…
Reference in a new issue