Skip to content

Commit

Permalink
Merge pull request #611 from socialappslab/feature#527
Browse files Browse the repository at this point in the history
Feature#527
  • Loading branch information
cdparra authored Apr 30, 2017
2 parents 1c72480 + cc3cf59 commit acaefe3
Show file tree
Hide file tree
Showing 16 changed files with 90 additions and 54 deletions.
12 changes: 8 additions & 4 deletions app/v2/controllers/working-group/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
$scope.pageSize = 16;
$scope.type = 'proposal';
$scope.showPagination = false;
$scope.isTopicGroup = false;
$scope.sorting = 'date_desc';
// if the param is uuid then it is an anonymous user
$scope.isAnonymous = false;
Expand Down Expand Up @@ -86,10 +87,7 @@

function verifyMembership() {
$scope.userIsMember = Memberships.isMember('group', $scope.groupID);

if ($scope.userIsMember) {
loadWorkingGroup();
}
loadWorkingGroup();
}

function loadWorkingGroup() {
Expand All @@ -106,6 +104,12 @@
$scope.wg.rsID = data.resourcesResourceSpaceId;
$scope.wg.rsUUID = data.resourcesResourceSpaceUUId;
$scope.wg.frsUUID = data.forumResourceSpaceUUId;
$scope.isTopicGroup = data.isTopic;

if ($scope.isTopicGroup) {
// if group is topic, then is OPEN to every assembly member.
$scope.userIsMember = true;
}
loadMembers(data);
loadProposals(data);
loadIdeas(data);
Expand Down
3 changes: 2 additions & 1 deletion app/v2/directives/contribution-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
components: '=',
isAnonymous: '=',
showIdeaBody: '@',
isCoordinator: '='
isCoordinator: '=',
isTopicGroup: '='
},
templateUrl: '/app/v2/partials/directives/contribution-card.html',
link: function postLink(scope, element, attrs) {
Expand Down
13 changes: 9 additions & 4 deletions app/v2/directives/contribution-contextual-items.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
} else {
scope.userCanEdit = scope.userIsAuthor = verifyAuthorshipUser(scope.contribution, scope.user);
}
// if the group type is topic, allow authors edition
if (scope.isTopicGroup) {
scope.userCanEdit = scope.userIsAuthor;
}
}

function setContributionType(scope) {
Expand Down Expand Up @@ -56,7 +60,8 @@
scope: {
contribution: '=',
isProposalIdeaStage: '=',
isHover: '='
isHover: '=',
isTopicGroup: '='
},
templateUrl: '/app/v2/partials/directives/contribution-contextual-items.html',
link: function(scope, element, attrs) {
Expand All @@ -80,7 +85,7 @@
scope.closeModal = closeModal.bind(scope);
scope.onEditContributionSuccess = onEditContributionSuccess.bind(scope);
scope.contributionStatus = scope.contribution.status;

setContributionType(scope);

if (!scope.isIdea) {
Expand Down Expand Up @@ -173,7 +178,7 @@

scope.myObject.seeHistory = function() {
scope.vexInstance = vex.open({
className:"vex-theme-plain",
className: "vex-theme-plain",
unsafeContent: $compile(document.querySelector('.history-modal').innerHTML)(scope)[0]
});
}
Expand Down Expand Up @@ -207,4 +212,4 @@
$window.location.reload();
}
}
}());
}());
3 changes: 2 additions & 1 deletion app/v2/directives/pagination-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
type: '=',
isAnonymous: '=',
isCoordinator: '=',
sorting: '='
sorting: '=',
isTopicGroup: '='
},
templateUrl: '/app/v2/partials/directives/pagination-widget.html',
link: function postLink(scope) {
Expand Down
5 changes: 2 additions & 3 deletions app/v2/partials/directives/contribution-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h1 class="heading--headline">
style="top: 1em; left: auto; right: 0px;">
<div class="content">
<contribution-contextual-items contribution="contribution" is-proposal-idea-stage="isProposalIdeaStage"
is-hover="cm.isHover"></contribution-contextual-items>
is-hover="cm.isHover" is-topic-group="isTopicGroup"></contribution-contextual-items>
</div>
</div>
</div>
Expand Down Expand Up @@ -154,10 +154,9 @@ <h1 class="heading--headline">
</a>
</li>
</ul>

<div class="contextual_menu" ng-class="{active: cm.isHover}" ng-mouseleave="cm.isHover = false" style="top: 1em; left: auto; right: 0px;">
<div class="content">
<contribution-contextual-items contribution="contribution" is-hover="cm.isHover"></contribution-contextual-items>
<contribution-contextual-items contribution="contribution" is-hover="cm.isHover" is-topic-group="isTopicGroup"></contribution-contextual-items>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@

<script id="contributionEditModal" type="text/ng-template">
<contribution-form contribution="contribution" on-success="onEditContributionSuccess()" mode="edit"></contribution-form>
</script>
</script>
4 changes: 2 additions & 2 deletions app/v2/partials/directives/pagination-widget.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<div class="clearfix" data-eq-pts="small: 768, medium: 1024, large: 1500">
<contribution-card class="card__proposal" dir-paginate="proposal in contributions | itemsPerPage: pageSize"
total-items="totalContributions" current-page="pagination.current" contribution="proposal" show-voting-buttons="false"
on-finish-render="eqResize" is-coordinator="isCoordinator" is-anonymous="isAnonymous"></contribution-card>
on-finish-render="eqResize" is-coordinator="isCoordinator" is-anonymous="isAnonymous" is-topic-group="isTopicGroup"></contribution-card>
<p ng-if="contributions.length === 0" class="card">{{ 'pagination.widget.no' | translate }} {{ type }}s {{ 'pagination.widget.description' | translate}}</p>
</div>
</section>
Expand All @@ -103,7 +103,7 @@
<div class="list__cards container__ideas" data-eq-pts="small: 768, medium: 1024, large: 1500">
<contribution-card class="card__proposal" show-idea-body="true" dir-paginate="idea in contributions | itemsPerPage: pageSize"
total-items="totalContributions" current-page="pagination.current" contribution="idea" show-voting-buttons="false"
on-finish-render="eqResize" is-coordinator="isCoordinator" is-anonymous="isAnonymous"></contribution-card>
on-finish-render="eqResize" is-coordinator="isCoordinator" is-anonymous="isAnonymous" is-topic-group="isTopicGroup"></contribution-card>
<p ng-if="contributions.length === 0" class="card">{{ 'pagination.widget.no' | translate }} {{ type }}s {{ 'pagination.widget.description' | translate}}</p>
</div>
</section>
Expand Down
43 changes: 24 additions & 19 deletions app/v2/partials/directives/proposals-ideas-searchbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,58 @@
color: #fff;
background-color: #11493b;
}

.campaign__filters .filters .tags li:hover::after {
content: "";
}

.campaign__filters .button__add_filter {
color: #11493b;
margin-left: 0;
}

.hide {
margin-left: -10000px;
}

div.filters ul.tags li a {
position: relative;
}

div.filters ul.tags li a i {
position: absolute;
right: 5px;
top: 5px;
}

ul.sort_modes li.active i {
color: #fff;
}

ul.sort_modes li i {
color: #11493b;
padding-right: 5px;
margin-top: 6px;
}

.filters .tags__group .tags {
float: none;
}

.filters .tags__group {
margin-bottom: 5px;
}

.label {
proposal-ideas-searchbox .label {
color: #11493b;
padding: 0;
}

.tags p {
margin-bottom: 0.2em;
color: #11493b;
}

.vex.vex-theme-plain .vex-content .modal-body {
padding: 2em;
}
Expand Down Expand Up @@ -127,25 +127,29 @@ <h4 class="widget__label">
<i ng-if="sortingIs('popularity_asc')" class="fa fa-sort-up"></i>
<!--<i ng-if="!sortingIs('popularity_asc') && !sortingIs('popularity_desc')" class="fa fa-sort-up"></i>-->
</li>
<li ng-if="isAnonymous" class="sarch_mode__most_commented_public" ng-click="setSorting('most_commented_public')" ng-class="{active: sortingIs('most_commented_public')}">
<li ng-if="isAnonymous" class="sarch_mode__most_commented_public" ng-click="setSorting('most_commented_public')"
ng-class="{active: sortingIs('most_commented_public')}">
<a href="">{{'Most commented' | translate}}</a>
<i ng-if="sortingIs('most_commented_public_desc')" class="fa fa-sort-down"></i>
<i ng-if="sortingIs('most_commented_public_asc')" class="fa fa-sort-up"></i>
<!--<i ng-if="!sortingIs('most_commented_public_asc') && !sortingIs('most_commented_public_desc')" class="fa fa-sort-up"></i>-->
</li>
<li ng-if="!isAnonymous && campaignConfig['appcivist.campaign.disable-public-site']==='FALSE'" class="sarch_mode__most_commented" ng-click="setSorting('most_commented')" ng-class="{active: sortingIs('most_commented')}">
<li ng-if="!isAnonymous && campaignConfig['appcivist.campaign.disable-public-site']==='FALSE'" class="sarch_mode__most_commented"
ng-click="setSorting('most_commented')" ng-class="{active: sortingIs('most_commented')}">
<a href="">{{'Most commented' | translate}}</a>
<i ng-if="sortingIs('most_commented_desc')" class="fa fa-sort-down"></i>
<i ng-if="sortingIs('most_commented_asc')" class="fa fa-sort-up"></i>
<!--<i ng-if="!sortingIs('most_commented_asc') && !sortingIs('most_commented_desc')" class="fa fa-sort-up"></i>-->
</li>
<li ng-if="!isAnonymous && campaignConfig['appcivist.campaign.disable-public-site']==='TRUE'" class="sarch_mode__most_commented_members" ng-click="setSorting('most_commented_members')" ng-class="{active: sortingIs('most_commented_members')}">
<li ng-if="!isAnonymous && campaignConfig['appcivist.campaign.disable-public-site']==='TRUE'" class="sarch_mode__most_commented_members"
ng-click="setSorting('most_commented_members')" ng-class="{active: sortingIs('most_commented_members')}">
<a href="">{{'Most commented' | translate}}</a>
<i ng-if="sortingIs('most_commented_members_desc')" class="fa fa-sort-down"></i>
<i ng-if="sortingIs('most_commented_members_asc')" class="fa fa-sort-up"></i>
<!--<i ng-if="!sortingIs('most_commented_members_asc') && !sortingIs('most_commented_members_desc')" class="fa fa-sort-up"></i>-->
</li>
<li ng-if="!isAnonymous && !campaignConfig['appcivist.campaign.disable-public-site']" class="sarch_mode__most_commented_members" ng-click="setSorting('most_commented_members')" ng-class="{active: sortingIs('most_commented_members')}">
<li ng-if="!isAnonymous && !campaignConfig['appcivist.campaign.disable-public-site']" class="sarch_mode__most_commented_members"
ng-click="setSorting('most_commented_members')" ng-class="{active: sortingIs('most_commented_members')}">
<a href="">{{'Most commented' | translate}}</a>
<i ng-if="sortingIs('most_commented_members_desc')" class="fa fa-sort-down"></i>
<i ng-if="sortingIs('most_commented_members_asc')" class="fa fa-sort-up"></i>
Expand All @@ -168,12 +172,13 @@ <h2 class="modal__title">{{'Select filters to add' | translate}}</h2>
<label class="label">{{'Themes' | translate}}</label>
<tags-field load-items="loadThemes({query: query})" options="themesOptions" selected="vm.selectedThemes"></tags-field>
<label class="label" ng-if="vm.canFilterByGroup">{{'Working Groups' | translate}}</label>
<tags-field ng-if="vm.canFilterByGroup" load-items="loadGroups({query: query})" options="groupsOptions" selected="vm.selectedGroups"></tags-field>
<tags-field ng-if="vm.canFilterByGroup" load-items="loadGroups({query: query})" options="groupsOptions"
selected="vm.selectedGroups"></tags-field>
<br />
<fieldset class="actions">
<a href="" class="button__modal_submit" ng-click="addSelected()">{{'Apply Filters' | translate}}</a>
</fieldset>
</div>
<div class="vex-close" ng-click="toggleModal('categoriesModal')"></div>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions app/v2/partials/proposal/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ <h1 class="heading--title">{{proposal.title}}</h1>
</div>
<div ng-if="userIsAuthor" class="attribution campaign__filters">
<ul class="search_modes">
<li class="sarch_mode__full_text" ng-class="{active: $parent.currentAdd.context === 'AUTHORS'}">
<li class="search_mode__full_text" ng-class="{active: $parent.currentAdd.context === 'AUTHORS'}">
<a ng-click="$parent.setAddContext('AUTHORS')" class="btn-sm">{{ 'Authors'| translate }}</a>
</li>
<li class="sarch_mode__full_text" ng-class="{active: $parent.currentAdd.context === 'THEMES'}">
<li class="search_mode__full_text" ng-class="{active: $parent.currentAdd.context === 'THEMES'}">
<a ng-click="$parent.setAddContext('THEMES')" class="btn-sm">{{ 'Themes' | translate }}</a>
</li>
</ul>
Expand Down
24 changes: 17 additions & 7 deletions app/v2/partials/working-group/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,27 @@
header.proposals__header>h2 {
float: none !important;
}

article.working_group .label-success {
font-weight: initial;
display: inline-block;
line-height: 20px;
height: 23px;
}
</style>
<main class="appmain" ng-class="{anonymous: isAnonymous}" resize>
<article class="working_group">
<header class="page__header">
<!--<div class="type"><i class="fa fa-users"></i>&nbsp;&nbsp;{{'WorkingGroup' | translate}}</div>-->
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="hidden-xs type"><i class="fa fa-users"></i>&nbsp;&nbsp;{{'WorkingGroup' | translate}}</div>
<div class="hidden-xs type">
<i class="fa" ng-class="{'fa-users' : !isTopicGroup, 'fa-tags': isTopicGroup}"></i>
&nbsp;&nbsp;{{isTopicGroup ? 'Topic' : 'WorkingGroup' | translate}}
<span class="label label-success" ng-if="((wg && isTopicGroup)
|| (wg && wg.profile && wg.profile.supportedMembership === 'OPEN'))">{{'Open' | translate}}</span>
</div>
<div class="hidden-lg hidden-md hidden-sm type">
<img src="{{wg.profile.icon}}" height="16" width="16" style="border-radius: 50%"> &nbsp;&nbsp;{{'WorkingGroup'
| translate}}
<img src="{{wg.profile.icon}}" height="16" width="16" style="border-radius: 50%"> &nbsp;&nbsp;{{'WorkingGroup' | translate}}
</div>
</div>
</div>
Expand Down Expand Up @@ -192,7 +202,7 @@ <h1 class="heading--title"> {{wg.name}}</h1>
</div>
</div>
</header>
<div class="page__contents" ng-if="!isAnonymous">
<div class="page__contents" ng-if=" wg && !isTopicGroup && !isAnonymous">
<section class="panel activity-and-members">
<section class="latest-activity">
<div class="panel-heading panel-heading-relative">
Expand Down Expand Up @@ -256,7 +266,7 @@ <h2 class="heading--header">{{'Proposals' | translate}}</h2>
</header>
<div class="list__cards container__proposals" data-eq-pts="small: 768, medium: 1024, large: 1500" ng-if="showPagination">
<pagination-widget page-size="pageSize" space="spaceID" resource="contribution" type="type" is-anonymous="isAnonymous"
is-coordinator="isCoordinator" sorting="sorting"></pagination-widget>
is-coordinator="isCoordinator" sorting="sorting" is-topic-group="isTopicGroup"></pagination-widget>
</div>
</section>
<section class="list--ideas" ng-class="{hide: !ideasSectionExpanded}" ng-if="contributionTypeIsSupported ('IDEA')">
Expand All @@ -268,7 +278,7 @@ <h2 class="heading--header">{{ 'Ideas' | translate }}</h2>
</header>
<div class="list__cards container__ideas">
<contribution-card ng-repeat="idea in ideas track by $index" class="card__idea" contribution="idea" campaign="campaign"
is-anonymous="isAnonymous" show-voting-buttons="false" is-coordinator="isCoordinator"></contribution-card>
is-anonymous="isAnonymous" show-voting-buttons="false" is-coordinator="isCoordinator" is-topic-group="isTopicGroup"></contribution-card>
<p ng-if="!ideas || ideas.length === 0" class="card">{{'no.idea.message' | translate}}</p>
</div>
</section>
Expand Down
6 changes: 4 additions & 2 deletions assets/i18n/locale-de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -1044,5 +1044,7 @@
"Restore password": "Restore password",
"Operation succeeded. Please check your email.": "Operation succeeded. Please check your email.",
"Type your email": "Type your email",
"Type your password": "Type your password"
}
"Type your password": "Type your password",
"Other Working Groups": "Andere Arbeitsgruppen",
"Topic" : "Thematik"
}
3 changes: 2 additions & 1 deletion assets/i18n/locale-en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1049,5 +1049,6 @@
"The form is invalid: you must fill all required values": "The form is invalid: you must fill all required values",
"Type your email": "Type your email",
"Type your password": "Type your password",
"Other Working Groups": "Other Working Groups"
"Other Working Groups": "Other Working Groups",
"Topic" : "Topic"
}
6 changes: 4 additions & 2 deletions assets/i18n/locale-es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -1045,5 +1045,7 @@
"Operation succeeded. Please check your email.": "Operation succeeded. Please check your email.",
"The form is invalid: you must fill all required values": "El formulario es inválido: por favor, lleno todos los campos obligatorios",
"Type your email": "Ingresa tu correo electrónico",
"Type your password": "Ingresa tu contraseña"
}
"Type your password": "Ingresa tu contraseña",
"Other Working Groups": "Otros Grupos de Trabajo",
"Topic" : "Tópico"
}
4 changes: 3 additions & 1 deletion assets/i18n/locale-fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1045,5 +1045,7 @@
"Operation succeeded. Please check your email.": "Operation succeeded. Please check your email.",
"The form is invalid: you must fill all required values": "Le formulaire est invalide: vous devez remplir toutes les valeurs requises",
"Type your email": "Type your email",
"Type your password": "Type your password"
"Type your password": "Type your password",
"Other Working Groups": "Autres Groupes de Travail",
"Topic" : "Topique"
}
6 changes: 4 additions & 2 deletions assets/i18n/locale-it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1045,5 +1045,7 @@
"Operation succeeded. Please check your email.": "Operation succeeded. Please check your email.",
"The form is invalid: you must fill all required values": "The form is invalid: you must fill all required values",
"Type your email": "Type your email",
"Type your password": "Type your password"
}
"Type your password": "Type your password",
"Other Working Groups": "Altri Gruppi di Lavoro",
"Topic" : "Tema"
}
Loading

0 comments on commit acaefe3

Please sign in to comment.