Skip to content

Commit

Permalink
Change publication ticket color to publication state color
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeFerreiraDeSousa committed Oct 19, 2017
1 parent ab5969a commit 0e72392
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function load(ObjectManager $manager)
$newsitem->setDate(1414242424);
$newsitem->setAuthorClub($this->getReference('club-ki'));
$newsitem->setAuthorUser($this->getReference('user-taquet-c'));
$newsitem->setPublicationState('Draft');
$newsitem->setLikes([$this->getReference('user-taquet-c')]);
$newsitem->setDislikes([$this->getReference('user-trancara')]);
$manager->persist($newsitem);
Expand All @@ -27,6 +28,7 @@ public function load(ObjectManager $manager)
$newsitem->setDate(1418325122);
$newsitem->setAuthorClub($this->getReference('club-ki'));
$newsitem->setAuthorUser($this->getReference('user-trancara'));
$newsitem->setPublicationState('Published');
$newsitem->setImage($this->getReference('image-newsitem-git'));
$manager->persist($newsitem);

Expand All @@ -36,6 +38,7 @@ public function load(ObjectManager $manager)
$newsitem->setDate(1417532897);
$newsitem->setAuthorClub($this->getReference('club-ki'));
$newsitem->setAuthorUser($this->getReference('user-trancara'));
$newsitem->setPublicationState('Scheduled');
$manager->persist($newsitem);

$newsitem = new Newsitem();
Expand All @@ -44,6 +47,7 @@ public function load(ObjectManager $manager)
$newsitem->setDate(1412831521);
$newsitem->setAuthorClub($this->getReference('club-bde'));
$newsitem->setAuthorUser($this->getReference('user-dziris'));
$newsitem->setPublicationState('Emailed');
$newsitem->setDislikes([$this->getReference('user-trancara'), $this->getReference('user-dziris')]);
$newsitem->addComment($this->getReference('comment-genial'));
$newsitem->addComment($this->getReference('comment-rage'));
Expand All @@ -56,6 +60,7 @@ public function load(ObjectManager $manager)
$newsitem->setDate(1414462150);
$newsitem->setAuthorClub($this->getReference('club-pep'));
$newsitem->setAuthorUser($this->getReference('user-guerinh'));
$newsitem->setPublicationState('Draft');
$manager->persist($newsitem);

$newsitem = new Newsitem();
Expand All @@ -65,6 +70,7 @@ public function load(ObjectManager $manager)
$newsitem->setAuthorClub($this->getReference('club-bde'));
$newsitem->setAuthorUser($this->getReference('user-dziris'));
$newsitem->setImage($this->getReference('image-newsitem-pulls'));
$newsitem->setPublicationState('Published');
$manager->persist($newsitem);

// Messages persos
Expand All @@ -81,6 +87,7 @@ public function load(ObjectManager $manager)
$newsitem->setText('[Le rêve de Jeanine]<br>Est ce que vous voyez la pluie tomber sur notre calme Champs sur Marne? Vous êtes vous seulement posés la question, ne serait-ce qu\'une fois, de ce que toute cette eau devenait? Cette nonchalance de votre part est permise seulement par la puissance de nouveaux radars qui mesurent précisément la minute et la rue où va se déverser le prochain orage sur les villes d\'Ile de France.');
$newsitem->setDate(time() - 42*3600);
$newsitem->setAuthorUser($this->getReference('user-dziris'));
$newsitem->setPublicationState('Scheduled');
$manager->persist($newsitem);

$newsitem = new Newsitem();
Expand All @@ -91,6 +98,7 @@ public function load(ObjectManager $manager)
$newsitem->setAuthorClub($this->getReference('club-gcc'));
$newsitem->setLikes([$this->getReference('user-taquet-c')]);
$newsitem->setDislikes([$this->getReference('user-trancara'), $this->getReference('user-dziris')]);
$newsitem->setPublicationState('Emailed');
$newsitem->addComment($this->getReference('comment-rage'));
$newsitem->addComment($this->getReference('comment-arret'));
$manager->persist($newsitem);
Expand Down
11 changes: 6 additions & 5 deletions front/app/css/main/components/ticket.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
line-height: 1.2em;
border: solid 1px @col-ticket-border;

&--color1 { border-left: solid 4px @col-aqua; }
&--color2 { border-left: solid 4px @col-yellow; }
&--color3 { border-left: solid 4px @col-red; }
&--color4 { border-left: solid 4px @col-violet; }
&--color5 { border-left: solid 4px @col-pink; }
&--aqua { border-left: solid 4px @col-aqua; }
&--yellow { border-left: solid 4px @col-yellow; }
&--pink { border-left: solid 4px @col-pink; }
&--red { border-left: solid 4px @col-red; }



.up-img-home{
width: 5em;
Expand Down
2 changes: 1 addition & 1 deletion front/app/css/main/components/tour.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
right: 1%;
width: ~"calc(98% - @{asideWidth})";
height: @tourHeight;
z-index: 1;
z-index: 2000;

color: @col-aside;

Expand Down
2 changes: 1 addition & 1 deletion front/app/js/controllers/users/publications/list.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div ng-controller="Publications_List_Ctrl" ng-inject="{events: events, newsItems: newsItems}">
<div infinite-scroll="next()" infinite-scroll-distance="2" infinite-scroll-disabled="$root.infiniteLoading">

<article col class="Ticket Ticket--color{{ publication.slug.length%5+1 }}"
<article col class="Ticket Ticket--{{ pub_info[publication.publication_state].color }}"
ng-repeat="publication in events.data | concat: newsItems.data | orderBy: 'date' | reverse"
ng-if="publication.entry_method != 'Ferie' && ($root.hasClub(publication.author_club.slug) || ['Published', 'Emailed'].includes(publication.publication_state))">
<up-ribbon class="Ribbon--pink" ng-hide="editSlug == publication.slug"
Expand Down
31 changes: 31 additions & 0 deletions front/app/js/controllers/users/publications/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,37 @@ angular.module('upont')
$scope.newsItems = newsItems;
$scope.messages = messages;

$scope.pub_info = {
'Draft': {
description: "Seul les membres du club ont accès aux brouillons dans la liste des publications du club.",
action: "Créer le brouillon",
label: 'Brouillon',
color: 'pink',
number: 1,
},
'Scheduled': {
description: "Cette publication apparaîtra seulement sur le calendrier uPont.",
action: "Planifier",
label: "Planification",
color: 'aqua',
number: 2,
},
'Published': {
description: "Cette publication sera publique sur uPont, vous pourrez envoyer un mail plus tard.",
action: "Publier",
label: "Publication",
color: 'yellow',
number: 3
},
'Emailed': {
description: "La publication sera publiée et envoyée par mail à tous les utilisateurs de uPont qui suivent le club.",
action: "Envoyer par mail",
label: "Email",
color: 'red',
number: 4
}
};

$scope.calendarView = 'day';

$scope.today = function() {
Expand Down
26 changes: 0 additions & 26 deletions front/app/js/controllers/users/publications/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,6 @@ angular.module('upont')
var club = clubDummy;
$scope.display = true;
$scope.isLoading = false;
$scope.pub_info = {
'Draft': {
description: "Seul les membres du club ont accès aux brouillons dans la liste des publications du club.",
action: "Créer le brouillon",
label: 'Brouillon',
number: 1,
},
'Scheduled': {
description: "Cette publication apparaîtra seulement sur le calendrier uPont.",
action: "Planifier",
label: "Planification",
number: 2,
},
'Published': {
description: "Cette publication sera publique sur uPont, vous pourrez envoyer un mail plus tard.",
action: "Publier",
label: "Publication",
number: 3
},
'Emailed': {
description: "La publication sera publiée et envoyée par mail à tous les utilisateurs de uPont qui suivent le club.",
action: "Envoyer par mail",
label: "Email",
number: 4
}
};

// Si on est sur une page d'assos
if ($stateParams.slug !== null && $stateParams.slug !== undefined) {
Expand Down

0 comments on commit 0e72392

Please sign in to comment.