Skip to content

Commit

Permalink
Enh: Some low-hanging 0.8 UX improvements 4minitz#168
Browse files Browse the repository at this point in the history
[X] Show user long names at the participants list 
[X] Click on topic/item subject opens topic/item editor, so we can get rid of Pencil Icon.
  • Loading branch information
derwok committed Jan 10, 2017
1 parent c6b30a7 commit ab07e15
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 26 deletions.
13 changes: 12 additions & 1 deletion client/templates/minutes/minutesEditParticipants.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,18 @@ Template.minutesEditParticipants.onCreated(function() {

Template.minutesEditParticipants.helpers({
userNameForId (userId) {
return Meteor.users.findOne(userId).username;
let usr = Meteor.users.findOne(userId);
if (usr) {
let showName = usr.username;
// If we have a long name for the user: prepend it!
if (usr.profile && usr.profile.name && usr.profile.name !== "") {
showName = usr.profile.name + " ("+showName+")";
}
return showName;

} else {
return "Unknown User ("+userId+")";
}
},

isModeratorOfParentSeries (userId) {
Expand Down
8 changes: 4 additions & 4 deletions client/templates/topic/topicElement.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<input type="checkbox" class="checkbox btnToggleState" id="btnToggleState_{{topic._id}}" {{checkedState}} {{disabledState}}>
</label>

<h3 style="display: inline;">
<h3 id="{{classForEdit}}" style="display: inline; cursor: {{cursorForEdit}};">
{{topic.subject}}
{{responsiblesHelper}}
</h3>
Expand All @@ -40,9 +40,9 @@ <h3 style="display: inline;">
</a>
{{/if}}
{{#if isEditable}}
<a id="btnEditTopic" href="#" data-toggle="modal" data-target="#dlgAddTopic" class="panel-link" title="Edit topic">
<span class="glyphicon glyphicon-pencil"></span>
</a>
<!--<a id="btnEditTopic" href="#" data-toggle="modal" data-target="#dlgAddTopic" class="panel-link" title="Edit topic">-->
<!--<span class="glyphicon glyphicon-pencil"></span>-->
<!--</a>-->
<a id="btnDelTopic" href="#" class="panel-link" title="Delete topic">
<span class="glyphicon glyphicon-trash"></span>
</a>
Expand Down
13 changes: 12 additions & 1 deletion client/templates/topic/topicElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ Template.topicElement.helpers({
// we handle this gracefully with this empty exception handler
}
return "";
},


classForEdit() {
return this.isEditable ? "btnEditTopic" : "";
},
cursorForEdit() {
return this.isEditable ? "pointer" : "";
}
});

Expand Down Expand Up @@ -129,8 +137,11 @@ Template.topicElement.events({
if (!this.minutesID) {
return;
}

if (getSelection().toString()) { // don't fire while selection is ongoing
return;
}
Session.set("topicEditTopicId", this.topic._id);
$("#dlgAddTopic").modal("show");
},

'click .addTopicInfoItem'(evt) {
Expand Down
39 changes: 20 additions & 19 deletions client/templates/topic/topicInfoItem.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,23 @@ <h4 class="panel-title">
{{/if}}
</label>

{{#if isActionItem}}
<a role="button" class="panel-link expandDetails" data-toggle="collapse" data-parent="#accordion"
href="#collapse-{{currentCollapseId}}" aria-expanded="true" aria-controls="collapseOne">
{{infoItem.subject}} {{responsiblesHelper}}
{{#if infoItem.priority}}Prio:{{infoItem.priority}}{{/if}}
Due: {{infoItem.duedate}}
</a>
{{else}}
{{infoItem.subject}}
{{/if}}

<span class="labels">
<!-- Labels -->
{{#each getLabels}}
<span class="label" style="background-color: {{color}}; color: {{fontColor}}">{{name}}</span>
{{/each}}
<span id="{{classForEdit}}" style="cursor: {{cursorForEdit}};">
{{#if isActionItem}}
<!--<a role="button" class="panel-link expandDetails" data-toggle="collapse" data-parent="#accordion"-->
<!--href="#collapse-{{currentCollapseId}}" aria-expanded="true" aria-controls="collapseOne">-->
{{infoItem.subject}} {{responsiblesHelper}}
{{#if infoItem.priority}}Prio:{{infoItem.priority}}{{/if}}
Due: {{infoItem.duedate}}
<!--</a>-->
{{else}}
{{infoItem.subject}}
{{/if}}
<span class="labels">
<!-- Labels -->
{{#each getLabels}}
<span class="label" style="background-color: {{color}}; color: {{fontColor}}">{{name}}</span>
{{/each}}
</span>
</span>

<!-- New-Topic-Label -->
Expand All @@ -58,9 +59,9 @@ <h4 class="panel-title">
<span class="glyphicon glyphicon-plus"></span>
</a>

<a id="btnEditInfoItem" href="#" data-toggle="modal" data-target="#dlgAddInfoItem" class="panel-link" title="Edit item">
<span class="glyphicon glyphicon-pencil"></span>
</a>
<!--<a id="btnEditInfoItem" href="#" data-toggle="modal" data-target="#dlgAddInfoItem" class="panel-link" title="Edit item">-->
<!--<span class="glyphicon glyphicon-pencil"></span>-->
<!--</a>-->
<a id="btnDelInfoItem" href="#" class="panel-link" title="Delete item">
<span class="glyphicon glyphicon-trash"></span>
</a>
Expand Down
14 changes: 14 additions & 0 deletions client/templates/topic/topicInfoItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ Template.topicInfoItem.helpers({
}
}
return "";
},

classForEdit() {
return this.isEditable ? "btnEditInfoItem" : "";
},
cursorForEdit() {
return this.isEditable ? "pointer" : "";
}
});

Expand Down Expand Up @@ -191,9 +198,13 @@ Template.topicInfoItem.events({
if (!this.minutesID) {
return;
}
if (getSelection().toString()) { // don't fire while selection is ongoing
return;
}

Session.set("topicInfoItemEditTopicId", this.parentTopicId);
Session.set("topicInfoItemEditInfoItemId", this.infoItem._id);
$("#dlgAddInfoItem").modal("show");
},


Expand All @@ -209,6 +220,9 @@ Template.topicInfoItem.events({
if (!tmpl.data.isEditable) {
return;
}
if (getSelection().toString()) { // don't fire while selection is ongoing
return;
}

let detailId = evt.currentTarget.getAttribute('data-id');
let textEl = tmpl.$('#detailText_' + detailId);
Expand Down
3 changes: 2 additions & 1 deletion server/end2end/end2end-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { MinutesCollection } from './../../imports/collections/minutes_private';
import { TestMailCollection } from '/imports/mail/TestMail'
import { Minutes } from './../../imports/minutes';
import { AttachmentsCollection, calculateAndCreateStoragePath } from '/imports/collections/attachments_private';
import { BroadcastMessageCollection } from '/imports/collections/broadcastmessage_private'

// Security: ensure that these methods only exist in End2End testing mode
if (Meteor.settings.isEnd2EndTest) {
Expand Down Expand Up @@ -35,7 +36,7 @@ if (Meteor.settings.isEnd2EndTest) {
console.log("Count Minutes after reset:"+MinutesCollection.find().count());
TestMailCollection.remove({});
console.log("Count saved test mails after reset:"+TestMailCollection.find().count());

BroadcastMessageCollection.remove({});

if (!skipUsers) {
// Reset users and create our e2e test users
Expand Down

0 comments on commit ab07e15

Please sign in to comment.