diff --git a/app/assets/javascripts/discourse/templates/composer.hbs b/app/assets/javascripts/discourse/templates/composer.hbs index 43af40a5274..7cd5c8f42af 100644 --- a/app/assets/javascripts/discourse/templates/composer.hbs +++ b/app/assets/javascripts/discourse/templates/composer.hbs @@ -6,136 +6,136 @@ save=(action "save")}}
{{#if visible}} - {{composer-messages composer=model - messageCount=messageCount - addLinkLookup=(action "addLinkLookup")}} - {{#if model.viewOpenOrFullscreen}} -
-
- {{plugin-outlet name="composer-open" args=(hash model=model)}} -
- {{#unless model.viewFullscreen}} -
- {{composer-action-title - model=model - openComposer=(action "openComposer") - closeComposer=(action "closeComposer") - canWhisper=canWhisper - tabindex=8}} - {{plugin-outlet name="composer-action-after" noTags=true args=(hash model=model)}} - - {{#unless site.mobileView}} - {{#if isWhispering}} - {{d-icon "far-eye-slash"}} - {{/if}} - {{#if model.unlistTopic}} - ({{i18n 'composer.unlist'}}) - {{/if}} - {{#if model.noBump}} - {{d-icon "anchor"}} - {{/if}} - {{/unless}} - - {{#if canEdit}} - {{#link-to-input onClick=(action "displayEditReason") showInput=showEditReason icon="info-circle" class="display-edit-reason"}} - {{text-field value=editReason tabindex="7" id="edit-reason" maxlength="255" placeholderKey="composer.edit_reason_placeholder"}} - {{/link-to-input}} - {{/if}} -
- {{/unless}} - {{composer-toggles composeState=model.composeState - toggleComposer=(action "toggle") - toggleToolbar=(action "toggleToolbar") - toggleFullscreen=(action "fullscreenComposer")}} -
+ {{composer-messages composer=model + messageCount=messageCount + addLinkLookup=(action "addLinkLookup")}} + {{#if model.viewOpenOrFullscreen}} +
+
+ {{plugin-outlet name="composer-open" args=(hash model=model)}} +
{{#unless model.viewFullscreen}} - {{#if model.canEditTitle}} - {{#if model.creatingPrivateMessage}} -
- {{composer-user-selector topicId=topicModel.id - usernames=model.targetRecipients - hasGroups=model.hasTargetGroups - focusTarget=focusTarget - class="users-input"}} - {{#if showWarning}} - - {{/if}} -
- {{/if}} +
+ {{composer-action-title + model=model + openComposer=(action "openComposer") + closeComposer=(action "closeComposer") + canWhisper=canWhisper + tabindex=8}} + {{plugin-outlet name="composer-action-after" noTags=true args=(hash model=model)}} -
- - {{composer-title composer=model lastValidatedAt=lastValidatedAt focusTarget=focusTarget}} - - {{#if model.showCategoryChooser}} -
- {{category-chooser - value=model.categoryId - tabindex="3" - onChange=(action (mut model.categoryId)) - isDisabled=disableCategoryChooser - options=(hash - scopedCategoryId=scopedCategoryId - ) - }} - {{popup-input-tip validation=categoryValidation}} -
+ {{#unless site.mobileView}} + {{#if isWhispering}} + {{d-icon "far-eye-slash"}} {{/if}} - {{#if canEditTags}} - {{mini-tag-chooser - value=model.tags - tabindex=4 - isDisabled=disableTagsChooser - onChange=(action (mut model.tags)) - options=(hash - categoryId=model.categoryId - minimum=model.minimumRequiredTags - ) - }} - {{popup-input-tip validation=tagValidation}} + {{#if model.unlistTopic}} + ({{i18n 'composer.unlist'}}) + {{/if}} + {{#if model.noBump}} + {{d-icon "anchor"}} + {{/if}} + {{/unless}} + + {{#if canEdit}} + {{#link-to-input onClick=(action "displayEditReason") showInput=showEditReason icon="info-circle" class="display-edit-reason"}} + {{text-field value=editReason tabindex="7" id="edit-reason" maxlength="255" placeholderKey="composer.edit_reason_placeholder"}} + {{/link-to-input}} + {{/if}} +
+ {{/unless}} + {{composer-toggles composeState=model.composeState + toggleComposer=(action "toggle") + toggleToolbar=(action "toggleToolbar") + toggleFullscreen=(action "fullscreenComposer")}} +
+ {{#unless model.viewFullscreen}} + {{#if model.canEditTitle}} + {{#if model.creatingPrivateMessage}} +
+ {{composer-user-selector topicId=topicModel.id + usernames=model.targetRecipients + hasGroups=model.hasTargetGroups + focusTarget=focusTarget + class="users-input"}} + {{#if showWarning}} + {{/if}}
{{/if}} - {{plugin-outlet name="composer-fields" args=(hash model=model)}} - {{/unless}} +
-
+ {{composer-title composer=model lastValidatedAt=lastValidatedAt focusTarget=focusTarget}} - {{composer-editor topic=topic - composer=model - lastValidatedAt=lastValidatedAt - canWhisper=canWhisper - storeToolbarState=(action "storeToolbarState") - onPopupMenuAction=(action "onPopupMenuAction") - showUploadModal=(route-action "showUploadSelector") - popupMenuOptions=popupMenuOptions - draftStatus=model.draftStatus - isUploading=isUploading - allowUpload=allowUpload - uploadIcon=uploadIcon - isCancellable=isCancellable - uploadProgress=uploadProgress - groupsMentioned=(action "groupsMentioned") - cannotSeeMention=(action "cannotSeeMention") - importQuote=(action "importQuote") - togglePreview=(action "togglePreview") - showToolbar=showToolbar - afterRefresh=(action "afterRefresh") - focusTarget=focusTarget}} + {{#if model.showCategoryChooser}} +
+ {{category-chooser + value=model.categoryId + tabindex="3" + onChange=(action (mut model.categoryId)) + isDisabled=disableCategoryChooser + options=(hash + scopedCategoryId=scopedCategoryId + ) + }} + {{popup-input-tip validation=categoryValidation}} +
+ {{/if}} + {{#if canEditTags}} + {{mini-tag-chooser + value=model.tags + tabindex=4 + isDisabled=disableTagsChooser + onChange=(action (mut model.tags)) + options=(hash + categoryId=model.categoryId + minimum=model.minimumRequiredTags + ) + }} + {{popup-input-tip validation=tagValidation}} + {{/if}} +
+ {{/if}} -
- {{plugin-outlet name="composer-fields-below" args=(hash model=model)}} + {{plugin-outlet name="composer-fields" args=(hash model=model)}} + {{/unless}} -
- {{#unless model.viewFullscreen}} - {{composer-save-button action=(action "save") - icon=saveIcon - label=saveLabel - disableSubmit=disableSubmit}} +
+ + {{composer-editor topic=topic + composer=model + lastValidatedAt=lastValidatedAt + canWhisper=canWhisper + storeToolbarState=(action "storeToolbarState") + onPopupMenuAction=(action "onPopupMenuAction") + showUploadModal=(route-action "showUploadSelector") + popupMenuOptions=popupMenuOptions + draftStatus=model.draftStatus + isUploading=isUploading + allowUpload=allowUpload + uploadIcon=uploadIcon + isCancellable=isCancellable + uploadProgress=uploadProgress + groupsMentioned=(action "groupsMentioned") + cannotSeeMention=(action "cannotSeeMention") + importQuote=(action "importQuote") + togglePreview=(action "togglePreview") + showToolbar=showToolbar + afterRefresh=(action "afterRefresh") + focusTarget=focusTarget}} + +
+ {{plugin-outlet name="composer-fields-below" args=(hash model=model)}} + +
+ {{#unless model.viewFullscreen}} + {{composer-save-button action=(action "save") + icon=saveIcon + label=saveLabel + disableSubmit=disableSubmit}} {{#if site.mobileView}} @@ -150,89 +150,87 @@ {{/if}} {{/unless}} - - {{#if site.mobileView}} - {{#if whisperOrUnlistTopic}} - - {{d-icon "far-eye-slash"}} - - {{/if}} - {{#if model.noBump}} - {{d-icon "anchor"}} - {{/if}} + {{#if site.mobileView}} + {{#if whisperOrUnlistTopic}} + + {{d-icon "far-eye-slash"}} + {{/if}} - - - {{#if isUploading}} - + {{#if model.noBump}} + {{d-icon "anchor"}} {{/if}} -
- {{#if model.draftSaving}}
{{/if}} - {{#if model.draftSaved}}{{d-icon 'check' class='save-animation'}}{{/if}} - {{#if model.draftStatus}} - - {{#if model.draftConflictUser}} - {{avatar model.draftConflictUser imageSize="small"}} {{d-icon 'user-edit'}} - {{else}} - {{d-icon 'sync-alt'}} - {{/if}} - {{#unless site.mobileView}} - {{model.draftStatus}} - {{/unless}} - + {{/if}} + + {{#if isUploading}} +
+ {{loading-spinner size="small"}}{{i18n 'upload_selector.uploading'}} {{uploadProgress}}% + {{#if isCancellable}} + {{d-icon "times"}} {{/if}}
-
- - {{#if site.mobileView}} - {{#if allowUpload}} - - {{d-icon uploadIcon}} - - {{/if}} - - - {{d-icon "desktop"}} - - - {{#if showPreview}} - {{d-button action=(action "togglePreview") class="hide-preview" label="composer.hide_preview"}} - {{/if}} - {{else}} - {{html-safe toggleText}} + {{/if}} +
+ {{#if model.draftSaving}}
{{/if}} + {{#if model.draftSaved}}{{d-icon 'check' class='save-animation'}}{{/if}} + {{#if model.draftStatus}} + + {{#if model.draftConflictUser}} + {{avatar model.draftConflictUser imageSize="small"}} {{d-icon 'user-edit'}} + {{else}} + {{d-icon 'sync-alt'}} + {{/if}} + {{#unless site.mobileView}} + {{model.draftStatus}} + {{/unless}} + {{/if}} - +
-
- {{else}} -
- {{#if model.createdPost}} - {{i18n 'composer.saved'}} + {{#if site.mobileView}} + {{#if allowUpload}} + + {{d-icon uploadIcon}} + + {{/if}} + + + {{d-icon "desktop"}} + + + {{#if showPreview}} + {{d-button action=(action "togglePreview") class="hide-preview" label="composer.hide_preview"}} + {{/if}} {{else}} - {{i18n 'composer.saving'}} {{loading-spinner size="small"}} + {{html-safe toggleText}} {{/if}} +
+
-
- {{#if model.topic}} - {{d-icon "share"}} {{html-safe draftTitle}} - {{else}} - {{i18n "composer.saved_draft"}} - {{/if}} -
+ {{else}} +
+ {{#if model.createdPost}} + {{i18n 'composer.saved'}} + {{else}} + {{i18n 'composer.saving'}} {{loading-spinner size="small"}} + {{/if}} +
- {{composer-toggles composeState=model.composeState - toggleFullscreen=(action "openIfDraft") - toggleComposer=(action "toggle") - toggleToolbar=(action "toggleToolbar")}} +
+ {{#if model.topic}} + {{d-icon "share"}} {{html-safe draftTitle}} + {{else}} + {{i18n "composer.saved_draft"}} + {{/if}} +
- {{/if}} + {{composer-toggles composeState=model.composeState + toggleFullscreen=(action "openIfDraft") + toggleComposer=(action "toggle") + toggleToolbar=(action "toggleToolbar")}} + + {{/if}} {{/if}}