Skip to content

Commit

Permalink
fix: 'attendees' not displayed in details popup (close nhn#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongsik Yoo committed Jan 23, 2019
1 parent 99b1b72 commit ff02073
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
14 changes: 13 additions & 1 deletion examples/js/data/schedules.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ function generateTime(schedule, renderStart, renderEnd) {
}
}

function generateNames() {
var names = [];
var i = 0;
var length = chance.integer({min: 1, max: 10});

for (; i < length; i += 1) {
names.push(chance.name());
}

return names;
}

function generateRandomSchedule(calendar, renderStart, renderEnd) {
var schedule = new ScheduleInfo();

Expand All @@ -107,7 +119,7 @@ function generateRandomSchedule(calendar, renderStart, renderEnd) {

schedule.isPrivate = chance.bool({likelihood: 10});
schedule.location = chance.address();
schedule.attendees = chance.bool({likelihood: 70}) ? ['anyone']: [];
schedule.attendees = chance.bool({likelihood: 70}) ? generateNames() : [];
schedule.recurrenceRule = chance.bool({likelihood: 20}) ? 'repeated events' : '';

schedule.color = calendar.color;
Expand Down
4 changes: 4 additions & 0 deletions src/css/popup.styl
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,10 @@ input[type='checkbox'].{css-prefix}checkbox-round + span
.{css-prefix}popup-detail .{css-prefix}popup-detail-item-separate
margin-top: 4px

.{css-prefix}popup-detail .{css-prefix}popup-detail-item-indent
text-indent: -20px
padding-left: 20px

.{css-prefix}popup-detail .{css-prefix}schedule-title
font-size: 15px
font-weight: bold
Expand Down
4 changes: 2 additions & 2 deletions src/js/view/template/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,9 @@ Handlebars.registerHelper({
return schedule.location;
},
'popupDetailUser-tmpl': function(schedule) {
var creator = util.pick(schedule, 'raw', 'creator', 'name');
var attendees = schedule.attendees || [];

return creator;
return attendees.join(', ');
},
'popupDetailState-tmpl': function(schedule) {
return schedule.state || 'Busy';
Expand Down
2 changes: 1 addition & 1 deletion src/js/view/template/popup/scheduleDetailPopup.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="{{CSS_PREFIX}}section-detail">
{{#if schedule.location}}<div class="{{CSS_PREFIX}}popup-detail-item"><span class="{{CSS_PREFIX}}icon {{CSS_PREFIX}}ic-location-b"></span><span class="{{CSS_PREFIX}}content">{{popupDetailLocation-tmpl schedule}}</span></div>{{/if}}
{{#if schedule.recurrenceRule}}<div class="{{CSS_PREFIX}}popup-detail-item"><span class="{{CSS_PREFIX}}icon {{CSS_PREFIX}}ic-repeat-b"></span><span class="{{CSS_PREFIX}}content">{{popupDetailRepeat-tmpl schedule}}</span></div>{{/if}}
{{#if schedule.attendees}}<div class="{{CSS_PREFIX}}popup-detail-item"><span class="{{CSS_PREFIX}}icon {{CSS_PREFIX}}ic-user-b"></span><span class="{{CSS_PREFIX}}content">{{popupDetailUser-tmpl schedule}}</span></div>{{/if}}
{{#if schedule.attendees}}<div class="{{CSS_PREFIX}}popup-detail-item {{CSS_PREFIX}}popup-detail-item-indent"><span class="{{CSS_PREFIX}}icon {{CSS_PREFIX}}ic-user-b"></span><span class="{{CSS_PREFIX}}content">{{popupDetailUser-tmpl schedule}}</span></div>{{/if}}
{{#if schedule.state}}<div class="{{CSS_PREFIX}}popup-detail-item"><span class="{{CSS_PREFIX}}icon {{CSS_PREFIX}}ic-state-b"></span><span class="{{CSS_PREFIX}}content">{{popupDetailState-tmpl schedule}}</span></div>{{/if}}
{{#if calendar}}
<div class="{{CSS_PREFIX}}popup-detail-item"><span class="{{CSS_PREFIX}}icon {{CSS_PREFIX}}calendar-dot" style="background-color: {{schedule.bgColor}}"></span><span class="{{CSS_PREFIX}}content">{{calendar.name}}</span></div>
Expand Down

0 comments on commit ff02073

Please sign in to comment.