Make unassign less confusing
This commit is contained in:
parent
05d00802ff
commit
4341211df3
|
@ -1,5 +1,13 @@
|
|||
{{#if topic.assigned_to_user.username}}
|
||||
{{d-button class="assign"
|
||||
icon="user-times"
|
||||
action="unassign"
|
||||
label="discourse_assign.unassign.title"
|
||||
title="discourse_assign.unassign.help"}}
|
||||
{{else}}
|
||||
{{d-button class="assign"
|
||||
icon="user-plus"
|
||||
action="assign"
|
||||
label="discourse_assign.assign.title"
|
||||
title="discourse_assign.assign.help"}}
|
||||
{{/if}}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import showModal from 'discourse/lib/show-modal';
|
||||
import { ajax } from 'discourse/lib/ajax';
|
||||
|
||||
export default {
|
||||
shouldRender(args, component) {
|
||||
|
@ -7,6 +8,15 @@ export default {
|
|||
},
|
||||
|
||||
actions: {
|
||||
unassign(){
|
||||
|
||||
this.set('topic.assigned_to_user', null);
|
||||
|
||||
return ajax("/assign/unassign", {
|
||||
type: 'PUT',
|
||||
data: { topic_id: this.get('topic.id')}
|
||||
});
|
||||
},
|
||||
assign(){
|
||||
showModal("assign-user", {
|
||||
model: {
|
||||
|
|
|
@ -6,6 +6,9 @@ en:
|
|||
assigned: "Assigned"
|
||||
assign_html: "<p class='assigned-to'><i class='fa-user-plus fa'></i> Assigned to {{userLink}}</p>"
|
||||
assign_notification: "<i title='assigned' class='fa fa-user-plus'></i><p><span>{{username}}</span> {{description}}</p>"
|
||||
unassign:
|
||||
title: "Unassign"
|
||||
help: "Unassign Topic"
|
||||
assign:
|
||||
title: "Assign"
|
||||
help: "Assign Topic to User"
|
||||
|
|
Loading…
Reference in New Issue