Skip to content

Commit

Permalink
Merge pull request #104 from jonaslozys/improvement/event-participant…
Browse files Browse the repository at this point in the history
…s-list-toggle

Improvement/event participants list toggle
  • Loading branch information
Kristupas13 committed Dec 13, 2019
2 parents 159c719 + 2319245 commit b9da22b
Show file tree
Hide file tree
Showing 7 changed files with 313 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,19 @@
function eventParticipantListController() {
/* jshint validthis: true */
var vm = this;
vm.isExpanded = false;

vm.expandCollapseText = 'events.expand';
vm.toggleExpandCollapse = toggleExpandCollapse;

function toggleExpandCollapse() {
if(vm.isExpanded) {
vm.expandCollapseText = 'events.expand';
}
else {
vm.expandCollapseText = 'events.collapse';
}
vm.isExpanded = !vm.isExpanded;
}
}
})();
Original file line number Diff line number Diff line change
@@ -1,20 +1,43 @@
<div>
<ul ng-if="!!vm.participants.length" class="event-participant-list">
<li ng-repeat="participant in vm.participants">
<ace-event-participant participant="participant">
<wave-spinner class="event-participant-spinner" ng-if="participant.isLoading"></wave-spinner>

<span ng-if="!!participant.userId && !participant.isLoading && vm.isDeleteVisible"
class="event-participant-delete-button vismaicon vismaicon-cancel-circle"
ace-confirmation-modal="vm.onLeaveEvent({participant: participant})"
confirmation-modal-message="events.deleteUserConfirmationMessage"
data-test-id="event-participant-delete-user"
title="{{'common.delete' | translate}}" translate-cloak>
</span>
</ace-event-participant>
</li>
</ul>

<div class="hidden-xs hidden-sm">
<ul ng-if="!!vm.participants.length" class="event-participant-list">
<li ng-repeat="participant in vm.participants">
<ace-event-participant participant="participant">
<wave-spinner class="event-participant-spinner" ng-if="participant.isLoading"></wave-spinner>

<span ng-if="!!participant.userId && !participant.isLoading && vm.isDeleteVisible"
class="event-participant-delete-button vismaicon vismaicon-cancel-circle"
ace-confirmation-modal="vm.onLeaveEvent({participant: participant})"
confirmation-modal-message="events.deleteUserConfirmationMessage"
data-test-id="event-participant-delete-user" title="{{'common.delete' | translate}}"
translate-cloak>
</span>
</ace-event-participant>
</li>
</ul>
</div>
<div class="hidden-lg hidden-md">
<ul ng-if="!!vm.participants.length" class="event-participant-list">
<button class="btn btn-info event-participant-list-expand-collapse-button" ng-click="vm.toggleExpandCollapse()"
type="button" ng-model="vm.isExpanded">
<span class="expand-collapse-text">{{vm.expandCollapseText | translate}}</span>
<span class="vismaicon" ng-class="{'collapse-icon':vm.isExpanded, 'expand-icon':!vm.isExpanded}"></span>
</button>
<li ng-repeat="participant in vm.participants" ng-show="vm.isExpanded">
<ace-event-participant participant="participant">
<wave-spinner class="event-participant-spinner" ng-if="participant.isLoading"></wave-spinner>

<span ng-if="!!participant.userId && !participant.isLoading && vm.isDeleteVisible"
class="event-participant-delete-button vismaicon vismaicon-cancel-circle"
ace-confirmation-modal="vm.onLeaveEvent({participant: participant})"
confirmation-modal-message="events.deleteUserConfirmationMessage"
data-test-id="event-participant-delete-user" title="{{'common.delete' | translate}}"
translate-cloak>
</span>
</ace-event-participant>
</li>
</ul>
</div>
<div ng-if="!vm.participants.length"
class="event-no-participants text-center"
translate="events.eventNoParticipants"></div>
Expand Down
115 changes: 115 additions & 0 deletions src/webapp/src/client/images/new-vismaicons/24_arrow_down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 112 additions & 0 deletions src/webapp/src/client/images/new-vismaicons/24_arrow_up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/webapp/src/client/resources/en_US/events.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"eventYes": "Yes",
"firstName": "First name",
"lastName": "Last name",
"expand": "Expand",
"collapse": "Collapse",
"oneTimeEvents": "Onetime events",
"recuringEvents": "Recurring events",
"responsiblePerson": "Responsible person",
Expand Down
2 changes: 2 additions & 0 deletions src/webapp/src/client/resources/lt_LT/events.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
"eventYes": "Taip",
"firstName": "Vardas",
"lastName": "Pavardė",
"expand": "Išskleisti",
"collapse": "Suskleisti",
"oneTimeEvents": "Vienkartiniai renginiai",
"recuringEvents": "Pasikartojantys renginiai",
"responsiblePerson": "Atsakingas asmuo",
Expand Down
29 changes: 29 additions & 0 deletions src/webapp/src/client/styles/style/modules/_events.less
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,35 @@
color: #787878;
}

.event-participant-list-expand-collapse-button {
width: 100%;
margin-top: 10px;
background-color: #337ab7 !important;
padding-top: 8px !important;
outline: none !important;
box-shadow: none;

.expand-collapse-text{
margin-left: 24px;
}
.collapse-icon {
background-image: url(../images/new-vismaicons/24_arrow_up.svg);
background-repeat: no-repeat;
background-size: cover;
background-origin: content-box;
background-position-x: -87px;
float: right;
}
.expand-icon {
background-image: url(../images/new-vismaicons/24_arrow_down.svg);
background-repeat: no-repeat;
background-size: cover;
background-origin: content-box;
background-position-x: -87px;
float: right;
}
}

.event-add-event-button {
margin-right: 20px;
@media (max-width: 991px) {
Expand Down

0 comments on commit b9da22b

Please sign in to comment.