Remove the last of the `ModalBodyView` uses

This commit is contained in:
Robin Ward 2016-11-18 12:13:21 -05:00
parent c9af4b839e
commit 06254d3163
20 changed files with 35 additions and 51 deletions

View File

@ -59,7 +59,6 @@
//= require ./discourse/models/user-badge //= require ./discourse/models/user-badge
//= require ./discourse/controllers/discovery-sortable //= require ./discourse/controllers/discovery-sortable
//= require ./discourse/controllers/navigation/default //= require ./discourse/controllers/navigation/default
//= require ./discourse/views/modal-body
//= require ./discourse/components/edit-category-panel //= require ./discourse/components/edit-category-panel
//= require ./discourse/components/dropdown-button //= require ./discourse/components/dropdown-button
//= require ./discourse/components/notifications-button //= require ./discourse/components/notifications-button

View File

@ -22,8 +22,6 @@ export default Ember.Component.extend({
} }
} }
this.appEvents.trigger('modal:body-shown', { this.appEvents.trigger('modal:body-shown', this.getProperties('title'));
title: this.get('title')
});
} }
}); });

View File

@ -18,7 +18,7 @@ export default function(name, opts) {
} else { } else {
const templateName = opts.templateName || Ember.String.dasherize(name); const templateName = opts.templateName || Ember.String.dasherize(name);
const renderArgs = { into: 'modal', outlet: 'modalBody', view: 'modal-body'}; const renderArgs = { into: 'modal', outlet: 'modalBody'};
if (controller) { renderArgs.controller = controllerName; } if (controller) { renderArgs.controller = controllerName; }
const modalName = `modal/${templateName}`; const modalName = `modal/${templateName}`;

View File

@ -127,12 +127,12 @@ const ApplicationRoute = Discourse.Route.extend(OpenComposer, {
}, },
editCategory(category) { editCategory(category) {
Category.reloadById(category.get('id')).then((atts) => { Category.reloadById(category.get('id')).then(atts => {
const model = this.store.createRecord('category', atts.category); const model = this.store.createRecord('category', atts.category);
model.setupGroupsAndPermissions(); model.setupGroupsAndPermissions();
this.site.updateCategory(model); this.site.updateCategory(model);
showModal('editCategory', { model }); showModal('edit-category', { model });
this.controllerFor('editCategory').set('selectedTab', 'general'); this.controllerFor('edit-category').set('selectedTab', 'general');
}); });
}, },

View File

@ -117,8 +117,8 @@ const DiscoveryCategoriesRoute = Discourse.Route.extend(OpenComposer, {
allow_badges: true allow_badges: true
}); });
showModal("editCategory", { model }); showModal("edit-category", { model });
this.controllerFor("editCategory").set("selectedTab", "general"); this.controllerFor("edit-category").set("selectedTab", "general");
}, },
reorderCategories() { reorderCategories() {

View File

@ -1,4 +1,4 @@
<div class="modal-body"> {{#d-modal-body}}
{{{i18n 'topic.change_owner.instructions' count=selectedPostsCount old_user=selectedPostsUsername}}} {{{i18n 'topic.change_owner.instructions' count=selectedPostsCount old_user=selectedPostsUsername}}}
<p> <p>
{{{i18n 'topic.change_owner.instructions_warn'}}} {{{i18n 'topic.change_owner.instructions_warn'}}}
@ -8,8 +8,7 @@
<label>{{i18n 'topic.change_owner.label'}}</label> <label>{{i18n 'topic.change_owner.label'}}</label>
{{user-selector single="true" usernames=new_user placeholderKey="topic.change_owner.placeholder"}} {{user-selector single="true" usernames=new_user placeholderKey="topic.change_owner.placeholder"}}
</form> </form>
{{/d-modal-body}}
</div>
<div class="modal-footer"> <div class="modal-footer">
<button class='btn btn-primary' disabled={{buttonDisabled}} {{action "changeOwnershipOfPosts"}}>{{buttonTitle}}</button> <button class='btn btn-primary' disabled={{buttonDisabled}} {{action "changeOwnershipOfPosts"}}>{{buttonTitle}}</button>

View File

@ -1,4 +1,4 @@
<div class="modal-body change-timestamp"> {{#d-modal-body class="change-timestamp"}}
<p> <p>
{{i18n 'topic.change_timestamp.instructions'}} {{i18n 'topic.change_timestamp.instructions'}}
</p> </p>
@ -13,7 +13,7 @@
</form> </form>
<div id="date-container" /> <div id="date-container" />
</div> {{/d-modal-body}}
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-primary" disabled={{buttonDisabled}} {{action "changeTimestamp"}}>{{buttonTitle}}</button> <button class="btn btn-primary" disabled={{buttonDisabled}} {{action "changeTimestamp"}}>{{buttonTitle}}</button>

View File

@ -1,8 +1,8 @@
<div class="modal-body"> {{#d-modal-body}}
<p> <p>
{{preference-checkbox labelKey="topics.bulk.also_dismiss_topics" checked=dismissTopics}} {{preference-checkbox labelKey="topics.bulk.also_dismiss_topics" checked=dismissTopics}}
</p> </p>
</div> {{/d-modal-body}}
<div class="modal-footer"> <div class="modal-footer">
<button class='btn btn-primary' {{action "dismissReadTopics" dismissTopics}}><i class="fa fa-check"></i> {{i18n 'topics.bulk.dismiss'}}</button> <button class='btn btn-primary' {{action "dismissReadTopics" dismissTopics}}><i class="fa fa-check"></i> {{i18n 'topics.bulk.dismiss'}}</button>

View File

@ -12,11 +12,11 @@
{{/if}} {{/if}}
</ul> </ul>
<div class="modal-body"> {{#d-modal-body}}
{{#each panels as |tab|}} {{#each panels as |tab|}}
{{component tab selectedTab=selectedTab category=model}} {{component tab selectedTab=selectedTab category=model}}
{{/each}} {{/each}}
</div> {{/d-modal-body}}
<div class="modal-footer"> <div class="modal-footer">
{{d-button id="save-category" class="btn-primary" disabled=disabled action="saveCategory" label=saveLabel}} {{d-button id="save-category" class="btn-primary" disabled=disabled action="saveCategory" label=saveLabel}}

View File

@ -1,4 +1,4 @@
<div class="modal-body feature-topic"> {{#d-modal-body class="feature-topic"}}
{{#if model.pinned_at}} {{#if model.pinned_at}}
<div class="feature-section"> <div class="feature-section">
<div class="desc"> <div class="desc">
@ -105,7 +105,7 @@
</p> </p>
</div> </div>
</div> </div>
</div> {{/d-modal-body}}
<div class="modal-footer"> <div class="modal-footer">
<a class="pull-right" {{action "closeModal"}}>{{i18n "cancel"}}</a> <a class="pull-right" {{action "closeModal"}}>{{i18n "cancel"}}</a>
</div> </div>

View File

@ -1,4 +1,4 @@
<div id="keyboard-shortcuts-help" class="modal-body"> {{#d-modal-body id="keyboard-shortcuts-help"}}
<div class="row"> <div class="row">
<div class="span6"> <div class="span6">
<h4>{{i18n 'keyboard_shortcuts_help.jump_to.title'}}</h4> <h4>{{i18n 'keyboard_shortcuts_help.jump_to.title'}}</h4>
@ -60,4 +60,4 @@
</ul> </ul>
</div> </div>
</div> </div>
</div> {{/d-modal-body}}

View File

@ -1,10 +1,10 @@
<div id='move-selected' class="modal-body"> {{#d-modal-body id='move-selected'}}
<p>{{{i18n 'topic.merge_topic.instructions' count=selectedPostsCount}}}</p> <p>{{{i18n 'topic.merge_topic.instructions' count=selectedPostsCount}}}</p>
<form> <form>
{{choose-topic currentTopicId=model.id selectedTopicId=selectedTopicId}} {{choose-topic currentTopicId=model.id selectedTopicId=selectedTopicId}}
</form> </form>
</div> {{/d-modal-body}}
<div class="modal-footer"> <div class="modal-footer">
{{#d-button class="btn-primary" disabled=buttonDisabled action="movePostsToExistingTopic"}} {{#d-button class="btn-primary" disabled=buttonDisabled action="movePostsToExistingTopic"}}

View File

@ -1,11 +1,12 @@
<div class="modal-body"> {{#d-modal-body}}
{{#if emailSent}} {{#if emailSent}}
{{{i18n 'login.sent_activation_email_again' currentEmail=currentEmail}}} {{{i18n 'login.sent_activation_email_again' currentEmail=currentEmail}}}
{{else}} {{else}}
{{{i18n 'login.not_activated' sentTo=sentTo}}} {{{i18n 'login.not_activated' sentTo=sentTo}}}
<a href {{action "sendActivationEmail"}} class="resend-link">{{i18n 'login.resend_activation_email'}}</a> <a href {{action "sendActivationEmail"}} class="resend-link">{{i18n 'login.resend_activation_email'}}</a>
{{/if}} {{/if}}
</div> {{/d-modal-body}}
<div class="modal-footer"> <div class="modal-footer">
<button class='btn btn-primary' {{action "closeModal"}}>{{i18n 'close'}}</button> <button class='btn btn-primary' {{action "closeModal"}}>{{i18n 'close'}}</button>
</div> </div>

View File

@ -1,6 +0,0 @@
<label>
{{input type="checkbox" checked=checked}}
{{title}}
</label>
{{description}}

View File

@ -1,8 +1,8 @@
<div class="modal-body"> {{#d-modal-body}}
<p>{{{description}}}</p> <p>{{{description}}}</p>
<p>{{{i18n "queue.approval.pending_posts" count=model.pending_count}}}</p> <p>{{{i18n "queue.approval.pending_posts" count=model.pending_count}}}</p>
</div> {{/d-modal-body}}
<div class="modal-footer"> <div class="modal-footer">
{{d-button action="closeModal" class="btn-primary" label="queue.approval.ok"}} {{d-button action="closeModal" class="btn-primary" label="queue.approval.ok"}}
</div> </div>

View File

@ -1,6 +1,6 @@
<div id="search-help" class="modal-body"> {{#d-modal-body id="search-help"}}
{{{model}}} {{{model}}}
{{#if showGoogleSearch}} {{#if showGoogleSearch}}
{{{i18n 'google_search'}}} {{{i18n 'google_search'}}}
{{/if}} {{/if}}
</div> {{/d-modal-body}}

View File

@ -1,7 +1,4 @@
<div class='modal-body'> {{#d-modal-body}}
<p>{{{i18n 'topics.bulk.selected' count=model.length}}}</p> <p>{{{i18n 'topics.bulk.selected' count=model.length}}}</p>
{{outlet "bulkOutlet"}} {{outlet "bulkOutlet"}}
{{/d-modal-body}}
</div>

View File

@ -18,7 +18,9 @@ export default Ember.View.extend({
}); });
this.appEvents.on('modal:body-shown', data => { this.appEvents.on('modal:body-shown', data => {
this.set('controller.title', I18n.t(data.title)); if (data.title) {
this.set('controller.title', I18n.t(data.title));
}
}); });
}, },

View File

@ -1,4 +1,4 @@
<div class="modal-body poll-ui-builder"> {{#d-modal-body title="poll.ui_builder.title" class="poll-ui-builder"}}
<form class="poll-ui-builder-form form-horizontal"> <form class="poll-ui-builder-form form-horizontal">
<div class="input-group"> <div class="input-group">
<label class="input-group-label">{{i18n 'poll.ui_builder.poll_type.label'}}</label> <label class="input-group-label">{{i18n 'poll.ui_builder.poll_type.label'}}</label>
@ -52,7 +52,7 @@
</div> </div>
{{/unless}} {{/unless}}
</form> </form>
</div> {{/d-modal-body}}
<div class="modal-footer"> <div class="modal-footer">
{{d-button action="insertPoll" icon="bar-chart-o" class='btn-primary' label='poll.ui_builder.insert' disabled=disableInsert}} {{d-button action="insertPoll" icon="bar-chart-o" class='btn-primary' label='poll.ui_builder.insert' disabled=disableInsert}}

View File

@ -1,6 +0,0 @@
import ModalBodyView from "discourse/views/modal-body";
export default ModalBodyView.extend({
templateName: 'modals/poll-ui-builder',
title: I18n.t("poll.ui_builder.title")
});