mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 18:58:10 +00:00
Modal for performing a bulk operation
This commit is contained in:
parent
1696cde2ff
commit
6ee266c7ee
@ -0,0 +1,14 @@
|
||||
/**
|
||||
Modal for performing bulk actions on topics
|
||||
|
||||
@class TopicBulkActionsController
|
||||
@extends Ember.ArrayController
|
||||
@namespace Discourse
|
||||
@uses Discourse.ModalFunctionality
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.TopicBulkActionsController = Ember.ArrayController.extend(Discourse.ModalFunctionality, {
|
||||
onShow: function() {
|
||||
this.set('controllers.modal.modalClass', 'topic-bulk-actions-modal');
|
||||
}
|
||||
});
|
@ -35,6 +35,11 @@ Discourse.DiscoveryRoute = Discourse.Route.extend({
|
||||
draftKey: topicsController.get('draft_key'),
|
||||
draftSequence: topicsController.get('draft_sequence')
|
||||
});
|
||||
},
|
||||
|
||||
showBulkActions: function() {
|
||||
var selected = this.controllerFor('discoveryTopics').get('selected');
|
||||
Discourse.Route.showModal(this, 'topicBulkActions', selected);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -1,3 +1,9 @@
|
||||
{{#if selected}}
|
||||
<div id='bulk-select'>
|
||||
<button class='btn' {{action showBulkActions}}><i class="fa fa-wrench"></i></button>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class='contents'>
|
||||
{{#if showTable}}
|
||||
<table id='topic-list'>
|
||||
|
@ -0,0 +1,7 @@
|
||||
<div class='modal-body'>
|
||||
|
||||
<p>{{{i18n topics.selected count=length}}}</p>
|
||||
|
||||
<button class='btn'>Change Category</button>
|
||||
|
||||
</div>
|
@ -0,0 +1,12 @@
|
||||
/**
|
||||
Handles the view for the topic bulk actions modal
|
||||
|
||||
@class TopicBulkActionsView
|
||||
@extends Discourse.ModalBodyView
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.TopicBulkActionsView = Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/topic_bulk_actions',
|
||||
title: I18n.t('topics.bulk_actions')
|
||||
});
|
@ -247,6 +247,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
.topic-bulk-actions-modal {
|
||||
p {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
.tabbed-modal {
|
||||
.modal-body {
|
||||
position: relative;
|
||||
|
@ -532,8 +532,6 @@ ol.category-breadcrumb {
|
||||
|
||||
text-align: center;
|
||||
margin-right: 20px;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -542,3 +540,12 @@ ol.category-breadcrumb {
|
||||
}
|
||||
}
|
||||
|
||||
#bulk-select {
|
||||
position: fixed;
|
||||
right: 20px;
|
||||
padding: 5px;
|
||||
background-color: white;
|
||||
button {
|
||||
padding: 3px 0 3px 6px;
|
||||
}
|
||||
}
|
||||
|
@ -601,6 +601,10 @@ en:
|
||||
|
||||
topics:
|
||||
toggle_bulk_select: "toggle bulk selection of topics"
|
||||
bulk_actions: "Bulk Actions"
|
||||
selected:
|
||||
one: "You have selected <b>1</b> topic."
|
||||
other: "You have selected <b>{{count}}</b> topics."
|
||||
|
||||
none:
|
||||
starred: "You haven't starred any topics yet. To star a topic, click or tap the star next to the title."
|
||||
|
Loading…
x
Reference in New Issue
Block a user