Commit 3b9469307970f866f93a59c6107eeb7cb77fd16f

Authored by Leonardo Merlin
1 parent 300de129

Split abstract field into summary and summaryExtended

src/app/components/article-box/article-box.html
... ... @@ -7,7 +7,7 @@
7 7 <div class="article-box--title">
8 8 <h1>{{::vm.article.title}}</h1>
9 9 </div>
10   - <div class="article-box--abstract" ng-bind-html="vm.article.abstract"></div>
  10 + <div class="article-box--abstract" ng-bind-html="vm.article.summary"></div>
11 11 <div class="button--themed">
12 12 <button class="btn btn-block">
13 13 Participe
... ...
src/app/components/dialoga-service/dialoga.service.js
... ... @@ -316,6 +316,31 @@
316 316 CACHE.programs = data.article.children;
317 317 CACHE.programs_count = data.article.children_count;
318 318 }
  319 +
  320 + _pipeHackPrograms(CACHE.programs);
  321 + }
  322 +
  323 + function _pipeHackPrograms (programs) {
  324 +
  325 + if(!angular.isArray(programs)){
  326 + return;
  327 + }
  328 +
  329 + var program = null;
  330 + var parts = null;
  331 + for (var i = programs.length - 1; i >= 0; i--) {
  332 + program = programs[i];
  333 +
  334 + if(!program.summary){
  335 + parts = program.abstract.split('<hr />');
  336 +
  337 + program.summary = $rootScope.stripHtml(parts[0]).trim();
  338 +
  339 + if(parts.length > 1){
  340 + program.summaryExtended = parts[1].trim();
  341 + }
  342 + }
  343 + }
319 344 }
320 345  
321 346 // Calculate color pallet
... ...
src/app/pages/programas/programa.html
... ... @@ -36,9 +36,10 @@
36 36 <span class="icon" ng-class="'icon-tema-' + pagePrograma.category.slug"></span>
37 37 </div>
38 38 <div class="program-preview--abstract color-theme-fg">
39   - <h2>{{::stripHtml(pagePrograma.article.abstract)}}</h2>
  39 + <h2>{{::stripHtml(pagePrograma.article.summary)}}</h2>
40 40 </div>
41 41 <div class="program-preview--abstract-details">
  42 + <div ng-bind-html="pagePrograma.article.summaryExtended"></div>
42 43 <p>Lorem ipsum dolor sit amet, ea veniam mucius ocurreret vix, ius ex nisl vidisse partiendo. Blandit nominavi cum ei, paulo quaestio his ei, eum minim salutandi in. Civibus albucius in quo, et eam posse facilisis. Debet suavitate sea ut, his ei feugiat fastidii eleifend. Quo ex quando maiestatis voluptatum, mel te perpetua maiestatis, sit ceteros legendos deserunt ea. Enim dolores moderatius eu pro, ad quo ignota aliquid meliore.</p>
43 44 </div>
44 45 <div class="program-preview--share">
... ...