Commit e1378aeaa849181675b4895f9d5e05ccb872cd07
1 parent
6243452f
Exists in
master
and in
8 other branches
Refact: 'partials' are now 'pages'. Everything that is used to handle the page b…
…ehaviour (and is not a component).
Showing
41 changed files
with
1018 additions
and
1018 deletions
Show diff stats
src/app/index.route.js
... | ... | @@ -12,74 +12,74 @@ |
12 | 12 | url: '/?limite&tema', |
13 | 13 | reloadOnSearch: false, |
14 | 14 | views: { |
15 | - 'header': { templateUrl: 'app/partials/header/header.html' }, | |
15 | + 'header': { templateUrl: 'app/pages/header/header.html' }, | |
16 | 16 | 'main': { |
17 | - templateUrl: 'app/partials/inicio/inicio.html', | |
18 | - controller: 'InicioController', | |
19 | - controllerAs: 'inicio' | |
17 | + templateUrl: 'app/pages/inicio/inicio.html', | |
18 | + controller: 'InicioPageController', | |
19 | + controllerAs: 'pageInicio' | |
20 | 20 | }, |
21 | - 'footer': { templateUrl: 'app/partials/footer/footer.html' } | |
21 | + 'footer': { templateUrl: 'app/pages/footer/footer.html' } | |
22 | 22 | } |
23 | 23 | }) |
24 | 24 | .state('entrar', { |
25 | 25 | url: '/entrar', |
26 | 26 | views: { |
27 | - 'header': { templateUrl: 'app/partials/header/header.html' }, | |
27 | + 'header': { templateUrl: 'app/pages/header/header.html' }, | |
28 | 28 | 'main': { |
29 | - templateUrl: 'app/partials/auth/signin.html', | |
30 | - controller: 'AuthController', | |
31 | - controllerAs: 'signin' | |
29 | + templateUrl: 'app/pages/auth/signin.html', | |
30 | + controller: 'AuthPageController', | |
31 | + controllerAs: 'pageSignin' | |
32 | 32 | }, |
33 | - 'footer': { templateUrl: 'app/partials/footer/footer.html' } | |
33 | + 'footer': { templateUrl: 'app/pages/footer/footer.html' } | |
34 | 34 | } |
35 | 35 | }) |
36 | 36 | .state('cadastrar', { |
37 | 37 | url: '/cadastrar', |
38 | 38 | views: { |
39 | - 'header': { templateUrl: 'app/partials/header/header.html' }, | |
39 | + 'header': { templateUrl: 'app/pages/header/header.html' }, | |
40 | 40 | 'main': { |
41 | - templateUrl: 'app/partials/auth/signup.html', | |
42 | - controller: 'AuthController', | |
43 | - controllerAs: 'signup' | |
41 | + templateUrl: 'app/pages/auth/signup.html', | |
42 | + controller: 'AuthPageController', | |
43 | + controllerAs: 'pageSignup' | |
44 | 44 | }, |
45 | - 'footer': { templateUrl: 'app/partials/footer/footer.html' } | |
45 | + 'footer': { templateUrl: 'app/pages/footer/footer.html' } | |
46 | 46 | } |
47 | 47 | }) |
48 | 48 | .state('programa', { |
49 | 49 | url: '/programa/:slug', |
50 | 50 | views: { |
51 | - 'header': { templateUrl: 'app/partials/header/header.html' }, | |
51 | + 'header': { templateUrl: 'app/pages/header/header.html' }, | |
52 | 52 | 'main': { |
53 | - templateUrl: 'app/partials/programas/programa.html', | |
54 | - controller: 'ProgramaController', | |
55 | - controllerAs: 'programa' | |
53 | + templateUrl: 'app/pages/programas/programa.html', | |
54 | + controller: 'ProgramaPageController', | |
55 | + controllerAs: 'pagePrograma' | |
56 | 56 | }, |
57 | - 'footer': { templateUrl: 'app/partials/footer/footer.html' } | |
57 | + 'footer': { templateUrl: 'app/pages/footer/footer.html' } | |
58 | 58 | } |
59 | 59 | }) |
60 | 60 | .state('sobre', { |
61 | 61 | url: '/sobre', |
62 | 62 | views: { |
63 | - 'header': { templateUrl: 'app/partials/header/header.html' }, | |
63 | + 'header': { templateUrl: 'app/pages/header/header.html' }, | |
64 | 64 | 'main': { |
65 | - templateUrl: 'app/partials/article/article.html', | |
66 | - controller: 'ArticleController', | |
67 | - controllerAs: 'article' | |
65 | + templateUrl: 'app/pages/article/article.html', | |
66 | + controller: 'ArticlePageController', | |
67 | + controllerAs: 'pageArticle' | |
68 | 68 | }, |
69 | - 'footer': { templateUrl: 'app/partials/footer/footer.html' } | |
69 | + 'footer': { templateUrl: 'app/pages/footer/footer.html' } | |
70 | 70 | } |
71 | 71 | }) |
72 | 72 | .state('termos-de-uso', { |
73 | 73 | url: '/termos-de-uso', |
74 | - controller: 'ArticleController', | |
74 | + controller: 'ArticlePageController', | |
75 | 75 | views: { |
76 | - 'header': { templateUrl: 'app/partials/header/header.html' }, | |
76 | + 'header': { templateUrl: 'app/pages/header/header.html' }, | |
77 | 77 | 'main': { |
78 | - templateUrl: 'app/partials/article/article.html', | |
79 | - controller: 'ArticleController', | |
80 | - controllerAs: 'article' | |
78 | + templateUrl: 'app/pages/article/article.html', | |
79 | + controller: 'ArticlePageController', | |
80 | + controllerAs: 'pageArticle' | |
81 | 81 | }, |
82 | - 'footer': { templateUrl: 'app/partials/footer/footer.html' } | |
82 | + 'footer': { templateUrl: 'app/pages/footer/footer.html' } | |
83 | 83 | } |
84 | 84 | }) |
85 | 85 | ; | ... | ... |
... | ... | @@ -0,0 +1,50 @@ |
1 | +(function() { | |
2 | + 'use strict'; | |
3 | + | |
4 | + angular | |
5 | + .module('dialoga') | |
6 | + .controller('ArticlePageController', ArticlePageController); | |
7 | + | |
8 | + /** @ngInject */ | |
9 | + function ArticlePageController(ArticleService, $state, $sce, $log) { | |
10 | + $log.debug('ArticlePageController'); | |
11 | + | |
12 | + var vm = this; | |
13 | + vm.ArticleService = ArticleService; | |
14 | + vm.$state = $state; | |
15 | + vm.$sce = $sce; | |
16 | + vm.$log = $log; | |
17 | + | |
18 | + vm.init(); | |
19 | + } | |
20 | + | |
21 | + ArticlePageController.prototype.init = function() { | |
22 | + var vm = this; | |
23 | + | |
24 | + vm.page = vm.$state.current.name; | |
25 | + vm.article = null; | |
26 | + vm.loading = true; | |
27 | + switch (vm.page){ | |
28 | + case 'sobre': | |
29 | + vm.ArticleService.getAbout(handleSuccess, handleError); | |
30 | + break; | |
31 | + case 'termos-de-uso': | |
32 | + vm.ArticleService.getTerms(handleSuccess, handleError); | |
33 | + break; | |
34 | + default: | |
35 | + vm.$log.warn('Page not handled:', vm.page); | |
36 | + break; | |
37 | + } | |
38 | + | |
39 | + function handleSuccess (data) { | |
40 | + vm.loading = false; | |
41 | + vm.article = data.article; | |
42 | + // vm.article.body = vm.$sce.trustAsHtml(vm.article.body); | |
43 | + } | |
44 | + | |
45 | + function handleError (error) { | |
46 | + vm.loading = false; | |
47 | + vm.error = error; | |
48 | + } | |
49 | + }; | |
50 | +})(); | ... | ... |
... | ... | @@ -0,0 +1,15 @@ |
1 | +(function() { | |
2 | + 'use strict'; | |
3 | + | |
4 | + describe('controllers', function(){ | |
5 | + | |
6 | + beforeEach(module('dialoga')); | |
7 | + | |
8 | + // it('should define more than 5 awesome things', inject(function($controller) { | |
9 | + // var vm = $controller('SobreController'); | |
10 | + | |
11 | + // // expect(angular.isArray(vm.awesomeThings)).toBeTruthy(); | |
12 | + // // expect(vm.awesomeThings.length > 5).toBeTruthy(); | |
13 | + // })); | |
14 | + }); | |
15 | +})(); | ... | ... |
... | ... | @@ -0,0 +1,24 @@ |
1 | +<div class="container" role="main"> | |
2 | + <span class="hide">{{::pageArticle.page}}</span> | |
3 | + | |
4 | + <div ng-if="pageArticle.loading"> | |
5 | + <div class="alert alert-info"> | |
6 | + Carregando conteúdo... | |
7 | + </div> | |
8 | + </div> | |
9 | + | |
10 | + <div ng-if="pageArticle.error"> | |
11 | + <div class="alert alert-info"> | |
12 | + Erro ao carregar conteúdo. | |
13 | + </div> | |
14 | + </div> | |
15 | + | |
16 | + <div ng-if="pageArticle.article"> | |
17 | + <article> | |
18 | + <header> | |
19 | + <h1>{{::pageArticle.pageArticle.title}}</h1> | |
20 | + </header> | |
21 | + <section ng-bind-html="pageArticle.pageArticle.body"></section> | |
22 | + </article> | |
23 | + </div> | |
24 | +</div> | ... | ... |
... | ... | @@ -0,0 +1,129 @@ |
1 | +(function() { | |
2 | + 'use strict'; | |
3 | + | |
4 | + angular | |
5 | + .module('dialoga') | |
6 | + .factory('ArticleService', ArticleService); | |
7 | + | |
8 | + /** @ngInject */ | |
9 | + function ArticleService($http, $q, $rootScope, UtilService, Slug, $log) { | |
10 | + $log.debug('ArticleService'); | |
11 | + | |
12 | + var idArticleHome = '103358'; | |
13 | + var idArticleAbout = '108073'; | |
14 | + var idArticleTerms = '107880'; | |
15 | + | |
16 | + var _savedAbstract = null; | |
17 | + | |
18 | + var service = { | |
19 | + apiArticles: $rootScope.basePath + '/api/v1/articles/', | |
20 | + getHome: getHome, | |
21 | + getAbout: getAbout, | |
22 | + getTerms: getTerms, | |
23 | + getArticleById: getArticleById, | |
24 | + getArticleBySlug: getArticleBySlug, | |
25 | + setHomeAbstract: setHomeAbstract, | |
26 | + getHomeAbstract: getHomeAbstract | |
27 | + }; | |
28 | + | |
29 | + var CACHE = {}; // cache by article id | |
30 | + | |
31 | + return service; | |
32 | + | |
33 | + function loadArticleById (articleId, params, cbSuccess, cbError) { | |
34 | + | |
35 | + var url = service.apiArticles + articleId; | |
36 | + var paramsExtended = angular.extend({}, params); | |
37 | + | |
38 | + UtilService.get(url, {params: paramsExtended}).then(function(data){ | |
39 | + CACHE[articleId] = data; | |
40 | + cbSuccess(data); | |
41 | + }, function(error){ | |
42 | + cbError(error); | |
43 | + }); | |
44 | + } | |
45 | + | |
46 | + function getArticleById (articleId, params, cbSuccess, cbError) { | |
47 | + var cachedArticle = CACHE[articleId]; | |
48 | + | |
49 | + if(cachedArticle){ | |
50 | + cbSuccess(cachedArticle); | |
51 | + }else{ | |
52 | + loadArticleById(articleId, params, cbSuccess, cbError); | |
53 | + } | |
54 | + } | |
55 | + | |
56 | + function getArticleBySlug (slug, cbSuccess, cbError) { | |
57 | + var vm = this; | |
58 | + | |
59 | + /** | |
60 | + * XXX: get from home article util we have a endpoint to do-it. | |
61 | + */ | |
62 | + vm.getHome(function (data) { | |
63 | + var mainArticle = data.article; | |
64 | + var programList = mainArticle.children; | |
65 | + var result = null; | |
66 | + | |
67 | + for (var i = programList.length - 1; i >= 0; i--) { | |
68 | + var program = programList[i]; | |
69 | + | |
70 | + if(!program.slug){ | |
71 | + program.slug = Slug.slugify(program.title); | |
72 | + } | |
73 | + | |
74 | + if(program.slug === slug){ | |
75 | + result = program; | |
76 | + break; | |
77 | + } | |
78 | + } | |
79 | + | |
80 | + if(result){ | |
81 | + cbSuccess(result); | |
82 | + }else{ | |
83 | + cbError('None program with slug "' + slug + '"" was found.'); | |
84 | + } | |
85 | + }, cbError); | |
86 | + } | |
87 | + | |
88 | + function getHome (cbSuccess, cbError) { | |
89 | + return getArticleById(idArticleHome, { | |
90 | + fields: 'id,children,categories,abstract,title,image,url,setting,position', | |
91 | + private_token: 'null' | |
92 | + }, _handleCategoryColors(cbSuccess), cbError); | |
93 | + } | |
94 | + | |
95 | + function getAbout (cbSuccess, cbError) { | |
96 | + return getArticleById(idArticleAbout, {}, cbSuccess, cbError); | |
97 | + } | |
98 | + | |
99 | + function getTerms (cbSuccess, cbError) { | |
100 | + return getArticleById(idArticleTerms, {}, cbSuccess, cbError); | |
101 | + } | |
102 | + | |
103 | + function _handleCategoryColors (cbSuccess) { | |
104 | + // var darkFactor = 0.15; | |
105 | + | |
106 | + return function (data) { | |
107 | + // if(data.article.categories){ | |
108 | + // var categories = data.article.categories; | |
109 | + | |
110 | + // for (var i = categories.length - 1; i >= 0; i--) { | |
111 | + // var category = categories[i]; | |
112 | + // if(category.color && !category.bgColor){ | |
113 | + // category.colorDarker = $window.ColorLuminance(category.color, 0.15); | |
114 | + // } | |
115 | + // }; | |
116 | + // } | |
117 | + cbSuccess(data); | |
118 | + }; | |
119 | + } | |
120 | + | |
121 | + function setHomeAbstract (newAbstract) { | |
122 | + _savedAbstract = newAbstract; | |
123 | + } | |
124 | + | |
125 | + function getHomeAbstract () { | |
126 | + return _savedAbstract; | |
127 | + } | |
128 | + } | |
129 | +})(); | ... | ... |
... | ... | @@ -0,0 +1,68 @@ |
1 | +(function() { | |
2 | + 'use strict'; | |
3 | + | |
4 | + describe('article services', function() { | |
5 | + var ArticleService, httpBackend; | |
6 | + | |
7 | + beforeEach(module('dialoga')); | |
8 | + | |
9 | + beforeEach(inject(function(_ArticleService_, $httpBackend) { | |
10 | + ArticleService = _ArticleService_; | |
11 | + httpBackend = $httpBackend; | |
12 | + })); | |
13 | + | |
14 | + it('should return the main article', function() { | |
15 | + var url = 'http://login.dialoga.gov.br/api/v1/articles/103358?fields=id,children,categories,abstract,title,image,url,setting,position&private_token=null'; | |
16 | + httpBackend.whenGET(url).respond({ | |
17 | + 'article':{'id':103358,'abstract':'\u003Cp style=\"text-align: center;\"\u003E\u003Ciframe src=\"https://www.youtube.com/embed/kpAdrO-emV0?rel=0\u0026amp;showinfo=0\u0026amp;iv_load_policy=3\u0026amp;controls=1\" style=\"max-width: 1000px; left: 5%;\" width=\"275\" height=\"200\"\u003E\u003C/iframe\u003E\u003C/p\u003E','title':'Dialoga Brasil','categories':[{'name':'Sa\u00fade','id':180,'slug':'saude','image':null},{'name':'Seguran\u00e7a P\u00fablica','id':182,'slug':'seguranca-publica','image':null},{'name':'Educa\u00e7\u00e3o','id':181,'slug':'educacao','image':null},{'name':'Redu\u00e7\u00e3o da Pobreza','id':183,'slug':'reducao-da-pobreza','image':null}],'image':null,'setting':{'custom_body_label':'Corpo','phase':'proposals','allow_topics':true,'moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Leandro Nunes dos Santos','moderate_proposals':true,'allow_members_to_edit':false},'position':null,'children':[{'id':103644,'abstract':'\u003Cp\u003EUm caminho de oportunidades com o Enem: Sisu, Prouni, Fies, Ci\u00eancia sem Fronteiras\u003C/p\u003E','title':'Ensino Superior','categories':[{'name':'Educa\u00e7\u00e3o','id':181,'slug':'educacao','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0128/enem.jpg'},'setting':{'color':'#cfe2f3','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':9},{'id':103673,'abstract':'\u003Cp\u003EA melhor escolha \u00e9 se informar.\u003C/p\u003E','title':'Incentivo ao Parto Normal','categories':[{'name':'Sa\u00fade','id':180,'slug':'saude','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0092/parto-normal.jpg'},'setting':{'color':'#ff0000','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':6},{'id':103397,'abstract':'\u003Cp\u003ERenda, inclus\u00e3o produtiva e acesso a servi\u00e7os.\u003C/p\u003E','title':'Brasil Sem Mis\u00e9ria','categories':[{'name':'Redu\u00e7\u00e3o da Pobreza','id':183,'slug':'reducao-da-pobreza','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0116/bsm_redim.jpg'},'setting':{'color':'','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':18},{'id':103379,'abstract':'\u003Cp\u003EResgate e atendimento 24 horas, sete dias da semana.\u003C/p\u003E','title':'SAMU 192 e UPAs','categories':[{'name':'Sa\u00fade','id':180,'slug':'saude','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0060/SAMU.jpg'},'setting':{'color':'#45818e','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':4},{'id':103521,'abstract':'\u003Cp\u003EMais atendimento nos munic\u00edpios, mais sa\u00fade para quem mais precisa.\u003C/p\u003E','title':'Mais M\u00e9dicos','categories':[{'name':'Sa\u00fade','id':180,'slug':'saude','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0025/Mais_M_dicos.jpg'},'setting':{'color':'#ffe599','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':1},{'id':103390,'abstract':'\u003Cp\u003EPreven\u00e7\u00e3o, tratamento e enfrentamento ao tr\u00e1fico.\u003C/p\u003E','title':'Crack, \u00e9 poss\u00edvel vencer!','categories':[{'name':'Seguran\u00e7a P\u00fablica','id':182,'slug':'seguranca-publica','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0104/crack.jpg'},'setting':{'color':'#00ff00','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':14},{'id':103592,'abstract':'\u003Cp\u003EGarantir acesso \u00e0 prote\u00e7\u00e3o social.\u003C/p\u003E','title':'Assist\u00eancia Social','categories':[{'name':'Redu\u00e7\u00e3o da Pobreza','id':183,'slug':'reducao-da-pobreza','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0122/assistencia_social.jpg'},'setting':{'color':'#a61c00','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':19},{'id':103426,'abstract':'\u003Cp\u003EDa sa\u00fade se cuida todos os dias.\u003C/p\u003E','title':'Vida saud\u00e1vel','categories':[{'name':'Sa\u00fade','id':180,'slug':'saude','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0046/vida_saudavel.jpg'},'setting':{'color':'#d9d2e9','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':7},{'id':103695,'abstract':'\u003Cp\u003ENovo modelo de atua\u00e7\u00e3o em Seguran\u00e7a P\u00fablica.\u003C/p\u003E','title':'Seguran\u00e7a P\u00fablica Integrada','categories':[{'name':'Seguran\u00e7a P\u00fablica','id':182,'slug':'seguranca-publica','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0152/policiaintegrada.jpg'},'setting':{'color':'#ff00ff','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':13},{'id':103663,'abstract':'\u003Cp\u003EMais educa\u00e7\u00e3o profissional e tecnol\u00f3gica, mais desenvolvimento\u003C/p\u003E','title':'Ensino T\u00e9cnico','categories':[{'name':'Educa\u00e7\u00e3o','id':181,'slug':'educacao','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0134/Ensino_tecnico.jpg'},'setting':{'color':'#d0e0e3','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':10},{'id':103472,'abstract':'\u003Cp\u003EPol\u00edcia Federal, Pol\u00edcia Rodovi\u00e1ria Federal e For\u00e7a Nacional de Seguran\u00e7a P\u00fablica.\u003C/p\u003E','title':'For\u00e7as Federais de Seguran\u00e7a','categories':[{'name':'Seguran\u00e7a P\u00fablica','id':182,'slug':'seguranca-publica','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0031/federais2.png'},'setting':{'color':'','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':16},{'id':103612,'abstract':'\u003Cp\u003EGarantir \u00e1gua para beber e produzir.\u003C/p\u003E','title':'Cisternas','categories':[{'name':'Redu\u00e7\u00e3o da Pobreza','id':183,'slug':'reducao-da-pobreza','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0039/cisterna_redim.jpg'},'setting':{'color':'#0000ff','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':20},{'id':103442,'abstract':'\u003Cp\u003EComplemento \u00e0 renda e acompanhamento em educa\u00e7\u00e3o e sa\u00fade.\u003C/p\u003E','title':'Bolsa Fam\u00edlia','categories':[{'name':'Redu\u00e7\u00e3o da Pobreza','id':183,'slug':'reducao-da-pobreza','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0013/bolsa_familia_redim.jpg'},'setting':{'color':'#ff9900','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':17},{'id':103507,'abstract':'\u003Cp\u003ETecnologia a servi\u00e7o da seguran\u00e7a do cidad\u00e3o.\u003C/p\u003E','title':'Sinesp','categories':[{'name':'Seguran\u00e7a P\u00fablica','id':182,'slug':'seguranca-publica','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0098/sinesp.png'},'setting':{'color':'#00ff00','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':12},{'id':103683,'abstract':'\u003Cp\u003ESa\u00fade n\u00e3o tem pre\u00e7o.\u003C/p\u003E','title':'Aqui tem Farm\u00e1cia Popular','categories':[{'name':'Sa\u00fade','id':180,'slug':'saude','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0019/saude_nao_tem_preco.jpg'},'setting':{'color':'#e69138','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':5},{'id':103457,'abstract':'\u003Cp\u003EA\u00e7\u00e3o conjunta e coopera\u00e7\u00e3o transfronteiri\u00e7a.\u003C/p\u003E','title':'Prote\u00e7\u00e3o das Fronteiras','categories':[{'name':'Seguran\u00e7a P\u00fablica','id':182,'slug':'seguranca-publica','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0110/fronteira_redim.jpg'},'setting':{'color':'#a64d79','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':15},{'id':103494,'abstract':'\u003Cp\u003EDa Educa\u00e7\u00e3o Infantil ao Ensino M\u00e9dio.\u003C/p\u003E','title':'Educa\u00e7\u00e3o B\u00e1sica','categories':[{'name':'Educa\u00e7\u00e3o','id':181,'slug':'educacao','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0076/Educa__o_B_sica.jpg'},'setting':{'color':'#fce5cd','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':8},{'id':103359,'abstract':'\u003Cp\u003EAcesso a exames e consultas com especialistas.\u003C/p\u003E','title':'Mais Especialidades','categories':[{'name':'Sa\u00fade','id':180,'slug':'saude','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0083/mais_especialidades1.png'},'setting':{'color':'#ea9999','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':2},{'id':103485,'abstract':'\u003Cp\u003ECaminho para uma educa\u00e7\u00e3o de qualidade.\u003C/p\u003E','title':'Valoriza\u00e7\u00e3o dos Professores','categories':[{'name':'Educa\u00e7\u00e3o','id':181,'slug':'educacao','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0140/valorizacao_professor.jpg'},'setting':{'color':'#ffff00','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':11},{'id':103416,'abstract':'\u003Cp\u003EEstrutura adequada para atender melhor a popula\u00e7\u00e3o na aten\u00e7\u00e3o b\u00e1sica.\u003C/p\u003E','title':'Melhorar os Postos de Sa\u00fade','categories':[{'name':'Sa\u00fade','id':180,'slug':'saude','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0053/requalif_redim.jpg'},'setting':{'color':'#cc4125','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':3}]}}); | |
18 | + | |
19 | + ArticleService.getHome().then(function(result) { | |
20 | + | |
21 | + expect(result.article).toBeDefined(); | |
22 | + expect(result.article.title).toEqual('Dialoga Brasil'); | |
23 | + | |
24 | + }); | |
25 | + | |
26 | + httpBackend.flush(); | |
27 | + }); | |
28 | + | |
29 | + // it('should return a list of articles', function() { | |
30 | + | |
31 | + // httpBackend.whenGET('http://login.dialoga.gov.br/api/v1/articles').respond({ | |
32 | + // "articles": [ | |
33 | + // { | |
34 | + // abstract: "Que exista educação continuada permanente dos profissionais!!", | |
35 | + // author: null, | |
36 | + // body: "", | |
37 | + // categories: [], | |
38 | + // children: [], | |
39 | + // created_at: "2015/08/04 16:36:13", | |
40 | + // end_date: null, | |
41 | + // hits: 0, | |
42 | + // id: 120568, | |
43 | + // image: null, | |
44 | + // parent: {id: 103379,…}, | |
45 | + // position: null, | |
46 | + // profile: {identifier: "dialoga", name: "dialoga", id: 19195, created_at: "2015/04/15 09:38:36", image: null}, | |
47 | + // setting: {comment_paragraph_plugin_activate: false, author_name: "estacio"}, | |
48 | + // start_date: null, | |
49 | + // tag_list: [], | |
50 | + // title: "article_f4f4601c-0f36-e90e-d01a-9871f0bd126b", | |
51 | + // votes_against: 0, | |
52 | + // votes_for: 0, | |
53 | + // } | |
54 | + // ] | |
55 | + // }); | |
56 | + | |
57 | + // ArticleService.getList().then(function(result) { | |
58 | + // console.log('result', result); | |
59 | + | |
60 | + // expect(result.data.article).toBeDefined(); | |
61 | + // expect(result.data.article.title).toEqual('Dialoga Brasil'); | |
62 | + | |
63 | + // }); | |
64 | + | |
65 | + // httpBackend.flush(); | |
66 | + // }); | |
67 | + }); | |
68 | +})(); | ... | ... |
... | ... | @@ -0,0 +1,44 @@ |
1 | +(function () { | |
2 | + 'use strict'; | |
3 | + | |
4 | + angular | |
5 | + .module('dialoga') | |
6 | + .controller('AuthPageController', AuthPageController); | |
7 | + | |
8 | + /** @ngInject */ | |
9 | + function AuthPageController($rootScope, AUTH_EVENTS, AuthService, Session, $log) { | |
10 | + $log.debug('AuthPageController'); | |
11 | + | |
12 | + var vm = this; | |
13 | + | |
14 | + vm.$rootScope = $rootScope; | |
15 | + vm.AUTH_EVENTS = AUTH_EVENTS; | |
16 | + vm.AuthService = AuthService; | |
17 | + vm.Session = Session; | |
18 | + vm.$log = $log; | |
19 | + | |
20 | + vm.init(); | |
21 | + } | |
22 | + | |
23 | + AuthPageController.prototype.init = function() { | |
24 | + var vm = this; | |
25 | + | |
26 | + // init variables | |
27 | + vm.credentials = {}; | |
28 | + | |
29 | + // attach events | |
30 | + | |
31 | + // ... | |
32 | + }; | |
33 | + | |
34 | + AuthPageController.prototype.login = function(credentials) { | |
35 | + var vm = this; | |
36 | + | |
37 | + vm.AuthService.login(credentials).then(function(/*user*/) { | |
38 | + // handle view | |
39 | + }, function() { | |
40 | + // handle view | |
41 | + }); | |
42 | + }; | |
43 | + | |
44 | +})(); | ... | ... |
... | ... | @@ -0,0 +1,63 @@ |
1 | +.auth-content{ | |
2 | + | |
3 | + .btn-social { | |
4 | + color: #fff; | |
5 | + font-weight: bold; | |
6 | + | |
7 | + &:hover, | |
8 | + &:focus {color: #fff;} | |
9 | + | |
10 | + &.btn-facebook { | |
11 | + background-color: #33477a; | |
12 | + &:hover, | |
13 | + &:focus {background-color: #304373; } | |
14 | + &:active {background-color: #33477a; } | |
15 | + } | |
16 | + &.btn-google-plus { | |
17 | + background-color: #b92d25; | |
18 | + &:hover, | |
19 | + &:focus {background-color: #b12b23; } | |
20 | + &:active {background-color: #b92d25; } | |
21 | + } | |
22 | + } | |
23 | + | |
24 | + .btn { | |
25 | + .contraste & { | |
26 | + color: #fff; | |
27 | + } | |
28 | + } | |
29 | + .btn-primary { | |
30 | + .contraste & { | |
31 | + background-color: #262626; | |
32 | + border-color: #666; | |
33 | + } | |
34 | + } | |
35 | + | |
36 | + .glyphicon { | |
37 | + &.icon-white { | |
38 | + fill: white; | |
39 | + } | |
40 | + } | |
41 | + | |
42 | + .separator-or { | |
43 | + border-top: 2px solid #d8d8d8; | |
44 | + text-align: center; | |
45 | + font-weight: bold; | |
46 | + | |
47 | + &:after { | |
48 | + content: "ou"; | |
49 | + position: absolute; | |
50 | + top: 4px; | |
51 | + left: 50%; | |
52 | + margin-left: -26px; | |
53 | + font-size: 30px; | |
54 | + line-height: 30px; | |
55 | + padding: 0 0.25em; | |
56 | + background: $gray; | |
57 | + | |
58 | + .contraste & { | |
59 | + background: #000; | |
60 | + } | |
61 | + } | |
62 | + } | |
63 | +} | ... | ... |
... | ... | @@ -0,0 +1,38 @@ |
1 | +<section role="main" class="section-gray auth-content"> | |
2 | + <div class="container"> | |
3 | + <div class="row"> | |
4 | + <div class="col-sm-8 col-sm-offset-2"> | |
5 | + <h2>Identifique-se</h2> | |
6 | + <form name="loginForm" ng-submit="pageSignin.login(pageSignin.credentials)"> | |
7 | + <div class="form-group"> | |
8 | + <label for="inputUsername" class="sr-only">E-mail:</label> | |
9 | + <div class="input-group"> | |
10 | + <div class="input-group-addon"><span class="glyphicon glyphicon-user"></span></div> | |
11 | + <input type="text" id="inputUsername" class="form-control" placeholder="E-mail" required="" autofocus="" ng-model="pageSignin.credentials.username"> | |
12 | + </div> | |
13 | + </div> | |
14 | + <div class="form-group"> | |
15 | + <label for="inputPassword" class="sr-only">Senha:</label> | |
16 | + <div class="input-group"> | |
17 | + <div class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></div> | |
18 | + <input type="password" id="inputPassword" class="form-control" placeholder="Senha" required="" ng-model="pageSignin.credentials.password"> | |
19 | + </div> | |
20 | + </div> | |
21 | + <div class="form-group"> | |
22 | + <button class="btn btn-lg btn-primary btn-block" type="submit">Entrar</button> | |
23 | + </div> | |
24 | + </form> | |
25 | + </div> | |
26 | + </div> | |
27 | + <div class="row"> | |
28 | + <div class="col-sm-8 col-sm-offset-2"> | |
29 | + <hr class="separator-or"></hr> | |
30 | + </div> | |
31 | + </div> | |
32 | + <div class="row"> | |
33 | + <div class="col-sm-8 col-sm-offset-2"> | |
34 | + <button class="btn btn-lg btn-link btn-block" type="button" ui-sref="cadastrar">Cadastre-se</button> | |
35 | + </div> | |
36 | + </div> | |
37 | + </div> | |
38 | +</section> | ... | ... |
... | ... | @@ -0,0 +1,58 @@ |
1 | +<!-- Facebook --> | |
2 | +<!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 33" width="25" height="25"><path d="M18 32L12 32 12 16l-4 0 0-5.5 4 0 0-3.2C12 2.7 13.2 0 18.5 0l4.4 0 0 5.5 -2.8 0c-2.1 0-2.2 0.8-2.2 2.2l0 2.8 5 0 -0.6 5.5L18 16 18 32z"/></svg> --> | |
3 | +<!-- Twitter --> | |
4 | +<!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 33" width="25" height="25"><path d="M32 6.1c-1.2 0.5-2.4 0.9-3.8 1 1.4-0.8 2.4-2.1 2.9-3.6 -1.3 0.8-2.7 1.3-4.2 1.6 -1.2-1.3-2.9-2.1-4.8-2.1 -3.6 0-6.6 2.9-6.6 6.6 0 0.5 0.1 1 0.2 1.5 -5.5-0.3-10.3-2.9-13.5-6.9 -0.6 1-0.9 2.1-0.9 3.3 0 2.3 1.2 4.3 2.9 5.5 -1.1 0-2.1-0.3-3-0.8 0 0 0 0.1 0 0.1 0 3.2 2.3 5.8 5.3 6.4 -0.6 0.2-1.1 0.2-1.7 0.2 -0.4 0-0.8 0-1.2-0.1 0.8 2.6 3.3 4.5 6.1 4.6 -2.2 1.8-5.1 2.8-8.2 2.8 -0.5 0-1.1 0-1.6-0.1 2.9 1.9 6.4 3 10.1 3 12.1 0 18.7-10 18.7-18.7 0-0.3 0-0.6 0-0.8C30 8.5 31.1 7.4 32 6.1z"/></svg> --> | |
5 | +<!-- Google Plus --> | |
6 | +<!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 33" width="25" height="25"><path d="M17.5 2c0 0-6.3 0-8.4 0C5.3 2 1.8 4.8 1.8 8.1c0 3.4 2.6 6.1 6.4 6.1 0.3 0 0.5 0 0.8 0 -0.2 0.5-0.4 1-0.4 1.6 0 0.9 0.5 1.7 1.1 2.3 -0.5 0-0.9 0-1.5 0C3.6 18.1 0 21.1 0 24.1c0 3 3.9 4.9 8.6 4.9 5.3 0 8.2-3 8.2-6 0-2.4-0.7-3.9-2.9-5.4 -0.8-0.5-2.2-1.8-2.2-2.6 0-0.9 0.3-1.3 1.6-2.4 1.4-1.1 2.4-2.6 2.4-4.4 0-2.1-0.9-4.2-2.7-4.8l2.7 0L17.5 2zM14.5 22.5c0.1 0.3 0.1 0.6 0.1 0.9 0 2.4-1.6 4.4-6.1 4.4 -3.2 0-5.5-2-5.5-4.5 0-2.4 2.9-4.4 6.1-4.4 0.8 0 1.4 0.1 2.1 0.3C12.9 20.4 14.2 21.1 14.5 22.5zM9.4 13.4c-2.2-0.1-4.2-2.4-4.6-5.2 -0.4-2.8 1.1-5 3.2-4.9 2.2 0.1 4.2 2.3 4.6 5.2C13 11.2 11.6 13.4 9.4 13.4zM26 8L26 2 24 2 24 8 18 8 18 10 24 10 24 16 26 16 26 10 32 10 32 8z"/></svg> --> | |
7 | + | |
8 | +<section> | |
9 | + <div class="container"> | |
10 | + <div class="row"> | |
11 | + <div class="col-sm-12"> | |
12 | + <h1>Cadastro</h1> | |
13 | + <p>Cadastre-se para fazer parte do Dialoga Brasil, interagir com as propostas e enviar as suas!</p> | |
14 | + </div> | |
15 | + </div> | |
16 | + </div> | |
17 | +</section> | |
18 | +<section role="main" class="section-gray auth-content"> | |
19 | + <div class="container"> | |
20 | + <div class="row"> | |
21 | + <div class="col-sm-8 col-sm-offset-2"> | |
22 | + <h2>Conecte-se por redes sociais</h2> | |
23 | + <div class="col-sm-6"> | |
24 | + <button type="button" class="btn btn-lg btn-block btn-social btn-facebook"> | |
25 | + <span class="glyphicon icon-facebook icon-white" aria-hidden="true"> | |
26 | + <!-- Facebook --> | |
27 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 33" width="25" height="25"><path d="M18 32L12 32 12 16l-4 0 0-5.5 4 0 0-3.2C12 2.7 13.2 0 18.5 0l4.4 0 0 5.5 -2.8 0c-2.1 0-2.2 0.8-2.2 2.2l0 2.8 5 0 -0.6 5.5L18 16 18 32z"/></svg> | |
28 | + </span> | |
29 | + <span class="text"> | |
30 | + Conectar pelo Facebook | |
31 | + </span> | |
32 | + </button> | |
33 | + </div> | |
34 | + <div class="col-sm-6"> | |
35 | + <button type="button" class="btn btn-lg btn-block btn-social btn-google-plus"> | |
36 | + <span class="glyphicon icon-google-plus icon-white" aria-hidden="true"> | |
37 | + <!-- Google Plus --> | |
38 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 33" width="25" height="25"><path d="M17.5 2c0 0-6.3 0-8.4 0C5.3 2 1.8 4.8 1.8 8.1c0 3.4 2.6 6.1 6.4 6.1 0.3 0 0.5 0 0.8 0 -0.2 0.5-0.4 1-0.4 1.6 0 0.9 0.5 1.7 1.1 2.3 -0.5 0-0.9 0-1.5 0C3.6 18.1 0 21.1 0 24.1c0 3 3.9 4.9 8.6 4.9 5.3 0 8.2-3 8.2-6 0-2.4-0.7-3.9-2.9-5.4 -0.8-0.5-2.2-1.8-2.2-2.6 0-0.9 0.3-1.3 1.6-2.4 1.4-1.1 2.4-2.6 2.4-4.4 0-2.1-0.9-4.2-2.7-4.8l2.7 0L17.5 2zM14.5 22.5c0.1 0.3 0.1 0.6 0.1 0.9 0 2.4-1.6 4.4-6.1 4.4 -3.2 0-5.5-2-5.5-4.5 0-2.4 2.9-4.4 6.1-4.4 0.8 0 1.4 0.1 2.1 0.3C12.9 20.4 14.2 21.1 14.5 22.5zM9.4 13.4c-2.2-0.1-4.2-2.4-4.6-5.2 -0.4-2.8 1.1-5 3.2-4.9 2.2 0.1 4.2 2.3 4.6 5.2C13 11.2 11.6 13.4 9.4 13.4zM26 8L26 2 24 2 24 8 18 8 18 10 24 10 24 16 26 16 26 10 32 10 32 8z"/></svg> | |
39 | + </span> | |
40 | + <span class="text"> | |
41 | + Conectar pelo Google+ | |
42 | + </span> | |
43 | + </button> | |
44 | + </div> | |
45 | + </div> | |
46 | + </div> | |
47 | + <div class="row"> | |
48 | + <div class="col-sm-8 col-sm-offset-2"> | |
49 | + <hr class="separator-or"></hr> | |
50 | + </div> | |
51 | + </div> | |
52 | + <div class="row"> | |
53 | + <div class="col-sm-8 col-sm-offset-2"> | |
54 | + <h2>Faça o cadastro abaixo</h2> | |
55 | + </div> | |
56 | + </div> | |
57 | + </div> | |
58 | +</section> | ... | ... |
... | ... | @@ -0,0 +1,21 @@ |
1 | +$barra-theme: ("green": #00420c, "yellow": #2c66ce, "blue": #0042b1); | |
2 | + | |
3 | +#footer-brasil { | |
4 | + background: none repeat scroll 0% 0% map-get($barra-theme, "blue"); | |
5 | + padding: 1em 0px; | |
6 | + max-width: 100%; | |
7 | +} | |
8 | + | |
9 | +#footer { | |
10 | + padding: 20px 0; | |
11 | + a { | |
12 | + margin: 10px auto; | |
13 | + } | |
14 | + | |
15 | + .contraste & { | |
16 | + background-color: #000; | |
17 | + a { | |
18 | + color: #fff; | |
19 | + } | |
20 | + } | |
21 | +} | ... | ... |
... | ... | @@ -0,0 +1,26 @@ |
1 | +<header class="container"> | |
2 | + | |
3 | + <div class="row"> | |
4 | + <div class="accessibility-wrapper"> | |
5 | + <button type="button" id="display-contrast" class="btn btn-link" ng-click="toggleContrast()"> | |
6 | + <span class="glyphicon glyphicon-adjust" aria-hidden="true"></span> Alto Contraste | |
7 | + </button> | |
8 | + | |
9 | + <button type="button" class="btn btn-link pull-right" ui-sref="entrar"> | |
10 | + <span class="glyphicon glyphicon-user"></span> | |
11 | + Entrar | |
12 | + </button> | |
13 | + </div> | |
14 | + </div> | |
15 | + | |
16 | + <div class="row"> | |
17 | + <app-navbar></app-navbar> | |
18 | + </div> | |
19 | + | |
20 | + <!-- TODO: breadcrumb --> | |
21 | + <!-- <ol class="breadcrumb"> | |
22 | + <li><a href="#">Home</a></li> | |
23 | + <li><a href="#">Library</a></li> | |
24 | + <li class="active">Data</li> | |
25 | + </ol> --> | |
26 | +</header> | ... | ... |
... | ... | @@ -0,0 +1,152 @@ |
1 | +/* globals document:true, window:true */ | |
2 | +(function() { | |
3 | + 'use strict'; | |
4 | + | |
5 | + angular | |
6 | + .module('dialoga') | |
7 | + .controller('InicioPageController', InicioPageController); | |
8 | + | |
9 | + /** @ngInject */ | |
10 | + function InicioPageController(ArticleService, $sce, $log) { | |
11 | + var vm = this; | |
12 | + | |
13 | + // aliases | |
14 | + vm.ArticleService = ArticleService; | |
15 | + vm.$sce = $sce; | |
16 | + vm.$log = $log; | |
17 | + | |
18 | + vm.init(); | |
19 | + vm.$log.debug('InicioPageController'); | |
20 | + } | |
21 | + | |
22 | + InicioPageController.prototype.init = function() { | |
23 | + var vm = this; | |
24 | + | |
25 | + vm.error = null; | |
26 | + vm.loading = true; | |
27 | + vm.loadHomeArticle(); | |
28 | + }; | |
29 | + | |
30 | + InicioPageController.prototype.loadHomeArticle = function() { | |
31 | + var vm = this; | |
32 | + | |
33 | + vm.content = vm.ArticleService.getHomeAbstract(); | |
34 | + vm.isCached = !!vm.content; | |
35 | + | |
36 | + if (vm.isCached) { | |
37 | + hideBackground(2000); | |
38 | + } | |
39 | + | |
40 | + vm.ArticleService.getHome(function(data) { | |
41 | + vm.loading = false; | |
42 | + vm.article = data.article; | |
43 | + }, function(error) { | |
44 | + vm.$log.error('Error on getHome article.', error); | |
45 | + vm.error = 'Erro ao carregar o conteúdo principal.'; | |
46 | + }); | |
47 | + }; | |
48 | + | |
49 | + InicioPageController.prototype.showVideo = function() { | |
50 | + var vm = this; | |
51 | + | |
52 | + // we need handle home content | |
53 | + if (vm.isCached) { | |
54 | + hideBackground(0); // force to hide | |
55 | + vm.$log.warn('The content already cached. Aborting.'); | |
56 | + return; | |
57 | + } | |
58 | + | |
59 | + vm.content = vm.handleHomeAbstract(vm.article.abstract); | |
60 | + vm.ArticleService.setHomeAbstract(vm.content); | |
61 | + | |
62 | + // inject dependencies | |
63 | + injectIframeApiJs(); | |
64 | + window.onYouTubeIframeAPIReady = window.onYouTubeIframeAPIReady || onYouTubeIframeAPIReady; | |
65 | + window.onYouTubePlayerReady = window.onYouTubePlayerReady || onYouTubePlayerReady; | |
66 | + }; | |
67 | + | |
68 | + InicioPageController.prototype.handleHomeAbstract = function(abstract) { | |
69 | + var vm = this; | |
70 | + | |
71 | + abstract = forceIframeParams(abstract); | |
72 | + abstract = removeStylefromIframe(abstract); | |
73 | + | |
74 | + return vm.$sce.trustAsHtml(abstract); | |
75 | + }; | |
76 | + | |
77 | + function injectIframeApiJs() { | |
78 | + var tag = document.createElement('script'); | |
79 | + tag.src = 'https://www.youtube.com/iframe_api'; | |
80 | + | |
81 | + var firstScriptTag = document.getElementsByTagName('script')[0]; | |
82 | + firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); | |
83 | + } | |
84 | + | |
85 | + function onYouTubeIframeAPIReady() { | |
86 | + var ytIframe = angular.element.find('.js-iframe iframe'); | |
87 | + var YTPlayer = window.YT.Player; | |
88 | + new YTPlayer(ytIframe[0], { | |
89 | + events: { | |
90 | + 'onReady': onYouTubePlayerReady | |
91 | + } | |
92 | + }); | |
93 | + } | |
94 | + | |
95 | + function onYouTubePlayerReady (event) { | |
96 | + event.target.playVideo(); | |
97 | + hideBackground(1000); | |
98 | + } | |
99 | + | |
100 | + function hideBackground (ms) { | |
101 | + var $elBg = angular.element.find('.video-background'); | |
102 | + angular.element($elBg).fadeOut(ms || 100); | |
103 | + // angular.element($elBg).hide(); | |
104 | + } | |
105 | + | |
106 | + function forceIframeParams(abstract) { | |
107 | + var patternIframe = '<iframe src="'; | |
108 | + var indexOfIframe = abstract.indexOf(patternIframe); | |
109 | + | |
110 | + if (indexOfIframe === -1) { | |
111 | + return abstract; | |
112 | + } | |
113 | + | |
114 | + var startSrcUrl = indexOfIframe + patternIframe.length; | |
115 | + var endSrcUrl = abstract.indexOf('"', startSrcUrl); | |
116 | + var srcUrl = abstract.substring(startSrcUrl , endSrcUrl); | |
117 | + var resultUrl = srcUrl; | |
118 | + var c = (srcUrl.indexOf('?') !== -1) ? '&' : ''; // already have url params. So, append-it | |
119 | + | |
120 | + // enable js api | |
121 | + if (srcUrl.indexOf('enablejsapi=1') === -1) { | |
122 | + resultUrl += c + 'enablejsapi=1'; | |
123 | + c = '&'; // force to always use '&' after here | |
124 | + } | |
125 | + | |
126 | + // set opaque mode | |
127 | + if (srcUrl.indexOf('wmode=opaque') === -1) { | |
128 | + resultUrl += c + 'wmode=opaque'; | |
129 | + // c = '&'; // force to always use '&' after here | |
130 | + } | |
131 | + | |
132 | + abstract = abstract.replace(srcUrl, resultUrl); | |
133 | + | |
134 | + return abstract; | |
135 | + } | |
136 | + | |
137 | + function removeStylefromIframe (abstract) { | |
138 | + var patternIframe = 'style="'; | |
139 | + var indexOfIframe = abstract.indexOf('<iframe'); | |
140 | + var indexOfStyleOnIframe = abstract.indexOf('style="', indexOfIframe); | |
141 | + | |
142 | + if (indexOfStyleOnIframe === -1) { | |
143 | + return abstract; | |
144 | + } | |
145 | + | |
146 | + var startStyleContent = indexOfStyleOnIframe + patternIframe.length; | |
147 | + var endStyleContent = abstract.indexOf('"', startStyleContent); | |
148 | + var style = abstract.substring(startStyleContent , endStyleContent); | |
149 | + | |
150 | + return abstract.replace(style, ''); | |
151 | + } | |
152 | +})(); | ... | ... |
... | ... | @@ -0,0 +1,15 @@ |
1 | +(function() { | |
2 | + 'use strict'; | |
3 | + | |
4 | + describe('controllers', function(){ | |
5 | + | |
6 | + beforeEach(module('dialoga')); | |
7 | + | |
8 | + // it('should define more than 5 awesome things', inject(function($controller) { | |
9 | + // var vm = $controller('InicioPageController'); | |
10 | + | |
11 | + // expect(angular.isArray(vm.awesomeThings)).toBeTruthy(); | |
12 | + // expect(vm.awesomeThings.length > 5).toBeTruthy(); | |
13 | + // })); | |
14 | + }); | |
15 | +})(); | ... | ... |
... | ... | @@ -0,0 +1,33 @@ |
1 | +<section class="container video-wrapper" role="main"> | |
2 | + <div class="video-player js-youtube"> | |
3 | + <div class="embed-responsive embed-responsive-16by9"> | |
4 | + <div class="js-iframe" ng-show="pageInicio.content" ng-bind-html="pageInicio.content"></div> | |
5 | + <div class="video-background" ng-click="pageInicio.showVideo()"> | |
6 | + <div class="video-thumbnail" style="background-image:url(/assets/images/youtube-background.png)"></div> | |
7 | + <button class="video-play-button" aria-live="assertive" aria-label="Assistir o vídeo tutorial Dialoga Brasil"> | |
8 | + <svg height="100%" version="1.1" viewBox="0 0 68 48" width="100%"><path class="ytp-play-button-bg" d="m .66,37.62 c 0,0 .66,4.70 2.70,6.77 2.58,2.71 5.98,2.63 7.49,2.91 5.43,.52 23.10,.68 23.12,.68 .00,-1.3e-5 14.29,-0.02 23.81,-0.71 1.32,-0.15 4.22,-0.17 6.81,-2.89 2.03,-2.07 2.70,-6.77 2.70,-6.77 0,0 .67,-5.52 .67,-11.04 l 0,-5.17 c 0,-5.52 -0.67,-11.04 -0.67,-11.04 0,0 -0.66,-4.70 -2.70,-6.77 C 62.03,.86 59.13,.84 57.80,.69 48.28,0 34.00,0 34.00,0 33.97,0 19.69,0 10.18,.69 8.85,.84 5.95,.86 3.36,3.58 1.32,5.65 .66,10.35 .66,10.35 c 0,0 -0.55,4.50 -0.66,9.45 l 0,8.36 c .10,4.94 .66,9.45 .66,9.45 z" fill="#1f1f1e" fill-opacity="0.9"></path><path d="m 26.96,13.67 18.37,9.62 -18.37,9.55 -0.00,-19.17 z" fill="#fff"></path><path d="M 45.02,23.46 45.32,23.28 26.96,13.67 43.32,24.34 45.02,23.46 z" fill="#ccc"></path></svg> | |
9 | + </button> | |
10 | + </div> | |
11 | + </div> | |
12 | + </div> | |
13 | +</section> | |
14 | + | |
15 | +<section class="info-section" ng-if="pageInicio.loading || pageInicio.error"> | |
16 | + <div class="container"> | |
17 | + <div class="col-md-12"> | |
18 | + <div ng-if="pageInicio.loading && !pageInicio.error"> | |
19 | + <div class="alert alert-info">Carregando conteúdo...</div> | |
20 | + </div> | |
21 | + | |
22 | + <div ng-if="pageInicio.error"> | |
23 | + <div class="alert alert-danger">{{pageInicio.error}}</div> | |
24 | + </div> | |
25 | + </div> | |
26 | + </div> | |
27 | +</section> | |
28 | + | |
29 | +<section class="section-gray" ng-if="pageInicio.article"> | |
30 | + <div class="container"> | |
31 | + <programa-list article="pageInicio.article"></programa-list> | |
32 | + </div> | |
33 | +</section> | ... | ... |
... | ... | @@ -0,0 +1,85 @@ |
1 | +.section-gray { | |
2 | + background-color: $gray; | |
3 | + | |
4 | + .contraste & { | |
5 | + color: #fff; | |
6 | + background-color: #000; | |
7 | + } | |
8 | +} | |
9 | + | |
10 | +.video-wrapper { | |
11 | + margin-bottom: 30px; | |
12 | +} | |
13 | + | |
14 | +.video-player { | |
15 | + position: relative; | |
16 | + border: 1px solid #333; | |
17 | + | |
18 | + .video-background { | |
19 | + text-align: center; | |
20 | + cursor: pointer; | |
21 | + } | |
22 | + | |
23 | + .video-thumbnail { | |
24 | + position: absolute; | |
25 | + width: 100%; | |
26 | + height: 100%; | |
27 | + top: 0; | |
28 | + left: 0; | |
29 | + z-index: 10; | |
30 | + background-position: center; | |
31 | + background-repeat: no-repeat; | |
32 | + -moz-transition: opacity .5s cubic-bezier(0.0,0.0,0.2,1); | |
33 | + -webkit-transition: opacity .5s cubic-bezier(0.0,0.0,0.2,1); | |
34 | + transition: opacity .5s cubic-bezier(0.0,0.0,0.2,1); | |
35 | + background-size: cover; | |
36 | + -moz-background-size: cover; | |
37 | + -webkit-background-size: cover; | |
38 | + } | |
39 | + | |
40 | + .video-play-button { | |
41 | + border: none; | |
42 | + outline: 0; | |
43 | + color: inherit; | |
44 | + text-align: inherit; | |
45 | + font-size: 100%; | |
46 | + font-family: inherit; | |
47 | + cursor: pointer; | |
48 | + line-height: inherit; | |
49 | + background: transparent; | |
50 | + padding: 0; | |
51 | + | |
52 | + position: absolute; | |
53 | + top: 50%; | |
54 | + left: 50%; | |
55 | + width: 68px; | |
56 | + height: 48px; | |
57 | + margin-left: -34px; | |
58 | + margin-top: -24px; | |
59 | + z-index: 15; | |
60 | + | |
61 | + -moz-transition: opacity .25s cubic-bezier(0.0,0.0,0.2,1); | |
62 | + -webkit-transition: opacity .25s cubic-bezier(0.0,0.0,0.2,1); | |
63 | + transition: opacity .25s cubic-bezier(0.0,0.0,0.2,1); | |
64 | + } | |
65 | + | |
66 | + .ytp-play-button-bg { | |
67 | + -moz-transition: fill .1s cubic-bezier(0.4,0.0,1,1),opacity .1s cubic-bezier(0.4,0.0,1,1); | |
68 | + -webkit-transition: fill .1s cubic-bezier(0.4,0.0,1,1),opacity .1s cubic-bezier(0.4,0.0,1,1); | |
69 | + transition: fill .1s cubic-bezier(0.4,0.0,1,1),opacity .1s cubic-bezier(0.4,0.0,1,1); | |
70 | + fill: #1f1f1f; | |
71 | + opacity: .9; | |
72 | + } | |
73 | + | |
74 | + &:hover { | |
75 | + .ytp-play-button-bg { | |
76 | + fill: #cc181e; | |
77 | + opacity: 1; | |
78 | + } | |
79 | + } | |
80 | + | |
81 | + @media screen and (min-width: 992px) { | |
82 | + width: 80%; | |
83 | + margin: 0 auto; | |
84 | + } | |
85 | +} | ... | ... |
... | ... | @@ -0,0 +1,91 @@ |
1 | +(function() { | |
2 | + 'use strict'; | |
3 | + | |
4 | + angular | |
5 | + .module('dialoga') | |
6 | + .controller('ProgramaPageController', ProgramaPageController); | |
7 | + | |
8 | + /** @ngInject */ | |
9 | + function ProgramaPageController(ArticleService, $state, $location, $scope, $rootScope, $log) { | |
10 | + $log.debug('ProgramaPageController'); | |
11 | + | |
12 | + var vm = this; | |
13 | + | |
14 | + vm.ArticleService = ArticleService; | |
15 | + vm.$state = $state; | |
16 | + vm.$location = $location; | |
17 | + vm.$scope = $scope; | |
18 | + vm.$rootScope = $rootScope; | |
19 | + vm.$log = $log; | |
20 | + | |
21 | + vm.init(); | |
22 | + } | |
23 | + | |
24 | + ProgramaPageController.prototype.init = function () { | |
25 | + var vm = this; | |
26 | + | |
27 | + var params = vm.$state.params; | |
28 | + var slug = params.slug; | |
29 | + | |
30 | + vm.program = null; | |
31 | + vm.currentCategory = null; | |
32 | + | |
33 | + vm.ArticleService.getHome(function(data){ | |
34 | + vm.categories = data.article.categories; | |
35 | + }, function (error) { | |
36 | + vm.$log.error(error); | |
37 | + }); | |
38 | + | |
39 | + vm.ArticleService.getArticleBySlug(slug, function(program){ | |
40 | + vm.program = program; | |
41 | + vm.currentCategory = vm.program.categories[0]; | |
42 | + | |
43 | + vm.$scope.$watch('programa.currentCategory', function(newValue, oldValue){ | |
44 | + if(newValue !== oldValue){ | |
45 | + vm.$state.go('inicio', { | |
46 | + tema: newValue.slug | |
47 | + }, { | |
48 | + location: true | |
49 | + }); | |
50 | + } | |
51 | + }); | |
52 | + | |
53 | + // load proposals | |
54 | + // vm.ArticleService.getRandomProposals(program.id).then(function(proposal){ | |
55 | + // vm.program.proposal = proposal; | |
56 | + // }, function (error){ | |
57 | + // vm.$log.error(error); | |
58 | + // }); | |
59 | + | |
60 | + // load events | |
61 | + // vm.ArticleService.getEvents(program.id).then(function(proposal){ | |
62 | + // vm.program.proposal = proposal; | |
63 | + // }, function (error){ | |
64 | + // vm.$log.error(error); | |
65 | + // }); | |
66 | + | |
67 | + // load body content | |
68 | + // vm.ArticleService.getBodyContent(program.id).then(function(proposal){ | |
69 | + // vm.program.proposal = proposal; | |
70 | + // }, function (error){ | |
71 | + // vm.$log.error(error); | |
72 | + // }); | |
73 | + | |
74 | + }, function (error) { | |
75 | + vm.$log.error(error); | |
76 | + vm.$log.info('Rollback to home page.'); | |
77 | + vm.$state.go('inicio', {}, {location: true}); | |
78 | + }); | |
79 | + }; | |
80 | + | |
81 | + ProgramaPageController.prototype.goBack = function () { | |
82 | + var vm = this; | |
83 | + | |
84 | + var prevState = vm.$rootScope.$previousState; | |
85 | + if(prevState && prevState.state.name){ | |
86 | + vm.$state.go(prevState.state.name, prevState.params); | |
87 | + } else { | |
88 | + vm.$state.go('inicio'); | |
89 | + } | |
90 | + }; | |
91 | +})(); | ... | ... |
... | ... | @@ -0,0 +1,39 @@ |
1 | +<div class="container"> | |
2 | + | |
3 | + <div class="row"> | |
4 | + <div class="col-xs-12"> | |
5 | + <div class="article-bar" ng-class="pagePrograma.program.categories[0].slug"> | |
6 | + <div class="navbar"> | |
7 | + <div class="navbar-header"> | |
8 | + <button class="article-bar--item btn btn-link" ng-click="pagePrograma.goBack()"> | |
9 | + <!-- <span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span> --> | |
10 | + <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span> | |
11 | + Voltar | |
12 | + </button> | |
13 | + </div> | |
14 | + <div class="navbar-left"> | |
15 | + <button class="article-bar--item btn btn-link"> | |
16 | + <span class="glyphicon glyphicon-refresh"></span> | |
17 | + <span class="category-name">{{::pagePrograma.program.categories[0].name}}</span> | |
18 | + </button> | |
19 | + </div> | |
20 | + <div class="navbar-right" ng-if="pagePrograma.categories"> | |
21 | + <label for="selectCategory" class="control-label sr-only" title="Selecione uma opção para acessar os programas do tema">Temas:</label> | |
22 | + <select id="selectCategory" name="selectCategory" class="article-bar--item form-control" ng-model="pagePrograma.currentCategory" ng-options="category.name for category in pagePrograma.categories track by category.slug"> | |
23 | + </select> | |
24 | + </div> | |
25 | + </div> | |
26 | + </div> | |
27 | + </div> | |
28 | + </div> | |
29 | + | |
30 | + <div ng-if="!pagePrograma.program"> | |
31 | + <div class="alert alert-info" role="alert">Carregando informações sobre o progama</div> | |
32 | + </div> | |
33 | + | |
34 | + <div ng-if="pagePrograma.program"> | |
35 | + <programa-box program="pagePrograma.program" display="'preview'"></programa-box> | |
36 | + </div> | |
37 | + <div id="content" ng-bind-html="pagePrograma.program.body"></div> | |
38 | +</div> | |
39 | + | ... | ... |
... | ... | @@ -0,0 +1,27 @@ |
1 | +.article-bar { | |
2 | + | |
3 | + .btn { | |
4 | + color: #fff; | |
5 | + font-weight: bold; | |
6 | + } | |
7 | + | |
8 | + &--item { | |
9 | + margin: 8px 0; | |
10 | + } | |
11 | + | |
12 | + .navbar-right { | |
13 | + margin-right: 15px; | |
14 | + } | |
15 | + | |
16 | + @each $category, $color in $categories { | |
17 | + &.#{$category} { | |
18 | + background-color: $color; | |
19 | + } | |
20 | + } | |
21 | + | |
22 | + .contraste & { | |
23 | + background-color: #262626; | |
24 | + } | |
25 | +} | |
26 | + | |
27 | + | ... | ... |
src/app/partials/article/article.controller.js
... | ... | @@ -1,50 +0,0 @@ |
1 | -(function() { | |
2 | - 'use strict'; | |
3 | - | |
4 | - angular | |
5 | - .module('dialoga') | |
6 | - .controller('ArticleController', ArticleController); | |
7 | - | |
8 | - /** @ngInject */ | |
9 | - function ArticleController(ArticleService, $state, $sce, $log) { | |
10 | - $log.debug('ArticleController'); | |
11 | - | |
12 | - var vm = this; | |
13 | - vm.ArticleService = ArticleService; | |
14 | - vm.$state = $state; | |
15 | - vm.$sce = $sce; | |
16 | - vm.$log = $log; | |
17 | - | |
18 | - vm.init(); | |
19 | - } | |
20 | - | |
21 | - ArticleController.prototype.init = function() { | |
22 | - var vm = this; | |
23 | - | |
24 | - vm.page = vm.$state.current.name; | |
25 | - vm.article = null; | |
26 | - vm.loading = true; | |
27 | - switch (vm.page){ | |
28 | - case 'sobre': | |
29 | - vm.ArticleService.getAbout(handleSuccess, handleError); | |
30 | - break; | |
31 | - case 'termos-de-uso': | |
32 | - vm.ArticleService.getTerms(handleSuccess, handleError); | |
33 | - break; | |
34 | - default: | |
35 | - vm.$log.warn('Page not handled:', vm.page); | |
36 | - break; | |
37 | - } | |
38 | - | |
39 | - function handleSuccess (data) { | |
40 | - vm.loading = false; | |
41 | - vm.article = data.article; | |
42 | - // vm.article.body = vm.$sce.trustAsHtml(vm.article.body); | |
43 | - } | |
44 | - | |
45 | - function handleError (error) { | |
46 | - vm.loading = false; | |
47 | - vm.error = error; | |
48 | - } | |
49 | - }; | |
50 | -})(); |
src/app/partials/article/article.controller.spec.js
... | ... | @@ -1,15 +0,0 @@ |
1 | -(function() { | |
2 | - 'use strict'; | |
3 | - | |
4 | - describe('controllers', function(){ | |
5 | - | |
6 | - beforeEach(module('dialoga')); | |
7 | - | |
8 | - // it('should define more than 5 awesome things', inject(function($controller) { | |
9 | - // var vm = $controller('SobreController'); | |
10 | - | |
11 | - // // expect(angular.isArray(vm.awesomeThings)).toBeTruthy(); | |
12 | - // // expect(vm.awesomeThings.length > 5).toBeTruthy(); | |
13 | - // })); | |
14 | - }); | |
15 | -})(); |
src/app/partials/article/article.html
... | ... | @@ -1,24 +0,0 @@ |
1 | -<div class="container" role="main"> | |
2 | - <span class="hide">{{::article.page}}</span> | |
3 | - | |
4 | - <div ng-if="article.loading"> | |
5 | - <div class="alert alert-info"> | |
6 | - Carregando conteúdo... | |
7 | - </div> | |
8 | - </div> | |
9 | - | |
10 | - <div ng-if="article.error"> | |
11 | - <div class="alert alert-info"> | |
12 | - Erro ao carregar conteúdo. | |
13 | - </div> | |
14 | - </div> | |
15 | - | |
16 | - <div ng-if="article.article"> | |
17 | - <article> | |
18 | - <header> | |
19 | - <h1>{{::article.article.title}}</h1> | |
20 | - </header> | |
21 | - <section ng-bind-html="article.article.body"></section> | |
22 | - </article> | |
23 | - </div> | |
24 | -</div> |
src/app/partials/article/article.service.js
... | ... | @@ -1,129 +0,0 @@ |
1 | -(function() { | |
2 | - 'use strict'; | |
3 | - | |
4 | - angular | |
5 | - .module('dialoga') | |
6 | - .factory('ArticleService', ArticleService); | |
7 | - | |
8 | - /** @ngInject */ | |
9 | - function ArticleService($http, $q, $rootScope, UtilService, Slug, $log) { | |
10 | - $log.debug('ArticleService'); | |
11 | - | |
12 | - var idArticleHome = '103358'; | |
13 | - var idArticleAbout = '108073'; | |
14 | - var idArticleTerms = '107880'; | |
15 | - | |
16 | - var _savedAbstract = null; | |
17 | - | |
18 | - var service = { | |
19 | - apiArticles: $rootScope.basePath + '/api/v1/articles/', | |
20 | - getHome: getHome, | |
21 | - getAbout: getAbout, | |
22 | - getTerms: getTerms, | |
23 | - getArticleById: getArticleById, | |
24 | - getArticleBySlug: getArticleBySlug, | |
25 | - setHomeAbstract: setHomeAbstract, | |
26 | - getHomeAbstract: getHomeAbstract | |
27 | - }; | |
28 | - | |
29 | - var CACHE = {}; // cache by article id | |
30 | - | |
31 | - return service; | |
32 | - | |
33 | - function loadArticleById (articleId, params, cbSuccess, cbError) { | |
34 | - | |
35 | - var url = service.apiArticles + articleId; | |
36 | - var paramsExtended = angular.extend({}, params); | |
37 | - | |
38 | - UtilService.get(url, {params: paramsExtended}).then(function(data){ | |
39 | - CACHE[articleId] = data; | |
40 | - cbSuccess(data); | |
41 | - }, function(error){ | |
42 | - cbError(error); | |
43 | - }); | |
44 | - } | |
45 | - | |
46 | - function getArticleById (articleId, params, cbSuccess, cbError) { | |
47 | - var cachedArticle = CACHE[articleId]; | |
48 | - | |
49 | - if(cachedArticle){ | |
50 | - cbSuccess(cachedArticle); | |
51 | - }else{ | |
52 | - loadArticleById(articleId, params, cbSuccess, cbError); | |
53 | - } | |
54 | - } | |
55 | - | |
56 | - function getArticleBySlug (slug, cbSuccess, cbError) { | |
57 | - var vm = this; | |
58 | - | |
59 | - /** | |
60 | - * XXX: get from home article util we have a endpoint to do-it. | |
61 | - */ | |
62 | - vm.getHome(function (data) { | |
63 | - var mainArticle = data.article; | |
64 | - var programList = mainArticle.children; | |
65 | - var result = null; | |
66 | - | |
67 | - for (var i = programList.length - 1; i >= 0; i--) { | |
68 | - var program = programList[i]; | |
69 | - | |
70 | - if(!program.slug){ | |
71 | - program.slug = Slug.slugify(program.title); | |
72 | - } | |
73 | - | |
74 | - if(program.slug === slug){ | |
75 | - result = program; | |
76 | - break; | |
77 | - } | |
78 | - } | |
79 | - | |
80 | - if(result){ | |
81 | - cbSuccess(result); | |
82 | - }else{ | |
83 | - cbError('None program with slug "' + slug + '"" was found.'); | |
84 | - } | |
85 | - }, cbError); | |
86 | - } | |
87 | - | |
88 | - function getHome (cbSuccess, cbError) { | |
89 | - return getArticleById(idArticleHome, { | |
90 | - fields: 'id,children,categories,abstract,title,image,url,setting,position', | |
91 | - private_token: 'null' | |
92 | - }, _handleCategoryColors(cbSuccess), cbError); | |
93 | - } | |
94 | - | |
95 | - function getAbout (cbSuccess, cbError) { | |
96 | - return getArticleById(idArticleAbout, {}, cbSuccess, cbError); | |
97 | - } | |
98 | - | |
99 | - function getTerms (cbSuccess, cbError) { | |
100 | - return getArticleById(idArticleTerms, {}, cbSuccess, cbError); | |
101 | - } | |
102 | - | |
103 | - function _handleCategoryColors (cbSuccess) { | |
104 | - // var darkFactor = 0.15; | |
105 | - | |
106 | - return function (data) { | |
107 | - // if(data.article.categories){ | |
108 | - // var categories = data.article.categories; | |
109 | - | |
110 | - // for (var i = categories.length - 1; i >= 0; i--) { | |
111 | - // var category = categories[i]; | |
112 | - // if(category.color && !category.bgColor){ | |
113 | - // category.colorDarker = $window.ColorLuminance(category.color, 0.15); | |
114 | - // } | |
115 | - // }; | |
116 | - // } | |
117 | - cbSuccess(data); | |
118 | - }; | |
119 | - } | |
120 | - | |
121 | - function setHomeAbstract (newAbstract) { | |
122 | - _savedAbstract = newAbstract; | |
123 | - } | |
124 | - | |
125 | - function getHomeAbstract () { | |
126 | - return _savedAbstract; | |
127 | - } | |
128 | - } | |
129 | -})(); |
src/app/partials/article/article.service.spec.js
... | ... | @@ -1,68 +0,0 @@ |
1 | -(function() { | |
2 | - 'use strict'; | |
3 | - | |
4 | - describe('article services', function() { | |
5 | - var ArticleService, httpBackend; | |
6 | - | |
7 | - beforeEach(module('dialoga')); | |
8 | - | |
9 | - beforeEach(inject(function(_ArticleService_, $httpBackend) { | |
10 | - ArticleService = _ArticleService_; | |
11 | - httpBackend = $httpBackend; | |
12 | - })); | |
13 | - | |
14 | - it('should return the main article', function() { | |
15 | - var url = 'http://login.dialoga.gov.br/api/v1/articles/103358?fields=id,children,categories,abstract,title,image,url,setting,position&private_token=null'; | |
16 | - httpBackend.whenGET(url).respond({ | |
17 | - 'article':{'id':103358,'abstract':'\u003Cp style=\"text-align: center;\"\u003E\u003Ciframe src=\"https://www.youtube.com/embed/kpAdrO-emV0?rel=0\u0026amp;showinfo=0\u0026amp;iv_load_policy=3\u0026amp;controls=1\" style=\"max-width: 1000px; left: 5%;\" width=\"275\" height=\"200\"\u003E\u003C/iframe\u003E\u003C/p\u003E','title':'Dialoga Brasil','categories':[{'name':'Sa\u00fade','id':180,'slug':'saude','image':null},{'name':'Seguran\u00e7a P\u00fablica','id':182,'slug':'seguranca-publica','image':null},{'name':'Educa\u00e7\u00e3o','id':181,'slug':'educacao','image':null},{'name':'Redu\u00e7\u00e3o da Pobreza','id':183,'slug':'reducao-da-pobreza','image':null}],'image':null,'setting':{'custom_body_label':'Corpo','phase':'proposals','allow_topics':true,'moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Leandro Nunes dos Santos','moderate_proposals':true,'allow_members_to_edit':false},'position':null,'children':[{'id':103644,'abstract':'\u003Cp\u003EUm caminho de oportunidades com o Enem: Sisu, Prouni, Fies, Ci\u00eancia sem Fronteiras\u003C/p\u003E','title':'Ensino Superior','categories':[{'name':'Educa\u00e7\u00e3o','id':181,'slug':'educacao','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0128/enem.jpg'},'setting':{'color':'#cfe2f3','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':9},{'id':103673,'abstract':'\u003Cp\u003EA melhor escolha \u00e9 se informar.\u003C/p\u003E','title':'Incentivo ao Parto Normal','categories':[{'name':'Sa\u00fade','id':180,'slug':'saude','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0092/parto-normal.jpg'},'setting':{'color':'#ff0000','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':6},{'id':103397,'abstract':'\u003Cp\u003ERenda, inclus\u00e3o produtiva e acesso a servi\u00e7os.\u003C/p\u003E','title':'Brasil Sem Mis\u00e9ria','categories':[{'name':'Redu\u00e7\u00e3o da Pobreza','id':183,'slug':'reducao-da-pobreza','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0116/bsm_redim.jpg'},'setting':{'color':'','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':18},{'id':103379,'abstract':'\u003Cp\u003EResgate e atendimento 24 horas, sete dias da semana.\u003C/p\u003E','title':'SAMU 192 e UPAs','categories':[{'name':'Sa\u00fade','id':180,'slug':'saude','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0060/SAMU.jpg'},'setting':{'color':'#45818e','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':4},{'id':103521,'abstract':'\u003Cp\u003EMais atendimento nos munic\u00edpios, mais sa\u00fade para quem mais precisa.\u003C/p\u003E','title':'Mais M\u00e9dicos','categories':[{'name':'Sa\u00fade','id':180,'slug':'saude','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0025/Mais_M_dicos.jpg'},'setting':{'color':'#ffe599','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':1},{'id':103390,'abstract':'\u003Cp\u003EPreven\u00e7\u00e3o, tratamento e enfrentamento ao tr\u00e1fico.\u003C/p\u003E','title':'Crack, \u00e9 poss\u00edvel vencer!','categories':[{'name':'Seguran\u00e7a P\u00fablica','id':182,'slug':'seguranca-publica','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0104/crack.jpg'},'setting':{'color':'#00ff00','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':14},{'id':103592,'abstract':'\u003Cp\u003EGarantir acesso \u00e0 prote\u00e7\u00e3o social.\u003C/p\u003E','title':'Assist\u00eancia Social','categories':[{'name':'Redu\u00e7\u00e3o da Pobreza','id':183,'slug':'reducao-da-pobreza','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0122/assistencia_social.jpg'},'setting':{'color':'#a61c00','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':19},{'id':103426,'abstract':'\u003Cp\u003EDa sa\u00fade se cuida todos os dias.\u003C/p\u003E','title':'Vida saud\u00e1vel','categories':[{'name':'Sa\u00fade','id':180,'slug':'saude','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0046/vida_saudavel.jpg'},'setting':{'color':'#d9d2e9','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':7},{'id':103695,'abstract':'\u003Cp\u003ENovo modelo de atua\u00e7\u00e3o em Seguran\u00e7a P\u00fablica.\u003C/p\u003E','title':'Seguran\u00e7a P\u00fablica Integrada','categories':[{'name':'Seguran\u00e7a P\u00fablica','id':182,'slug':'seguranca-publica','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0152/policiaintegrada.jpg'},'setting':{'color':'#ff00ff','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':13},{'id':103663,'abstract':'\u003Cp\u003EMais educa\u00e7\u00e3o profissional e tecnol\u00f3gica, mais desenvolvimento\u003C/p\u003E','title':'Ensino T\u00e9cnico','categories':[{'name':'Educa\u00e7\u00e3o','id':181,'slug':'educacao','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0134/Ensino_tecnico.jpg'},'setting':{'color':'#d0e0e3','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':10},{'id':103472,'abstract':'\u003Cp\u003EPol\u00edcia Federal, Pol\u00edcia Rodovi\u00e1ria Federal e For\u00e7a Nacional de Seguran\u00e7a P\u00fablica.\u003C/p\u003E','title':'For\u00e7as Federais de Seguran\u00e7a','categories':[{'name':'Seguran\u00e7a P\u00fablica','id':182,'slug':'seguranca-publica','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0031/federais2.png'},'setting':{'color':'','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':16},{'id':103612,'abstract':'\u003Cp\u003EGarantir \u00e1gua para beber e produzir.\u003C/p\u003E','title':'Cisternas','categories':[{'name':'Redu\u00e7\u00e3o da Pobreza','id':183,'slug':'reducao-da-pobreza','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0039/cisterna_redim.jpg'},'setting':{'color':'#0000ff','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':20},{'id':103442,'abstract':'\u003Cp\u003EComplemento \u00e0 renda e acompanhamento em educa\u00e7\u00e3o e sa\u00fade.\u003C/p\u003E','title':'Bolsa Fam\u00edlia','categories':[{'name':'Redu\u00e7\u00e3o da Pobreza','id':183,'slug':'reducao-da-pobreza','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0013/bolsa_familia_redim.jpg'},'setting':{'color':'#ff9900','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':17},{'id':103507,'abstract':'\u003Cp\u003ETecnologia a servi\u00e7o da seguran\u00e7a do cidad\u00e3o.\u003C/p\u003E','title':'Sinesp','categories':[{'name':'Seguran\u00e7a P\u00fablica','id':182,'slug':'seguranca-publica','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0098/sinesp.png'},'setting':{'color':'#00ff00','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':12},{'id':103683,'abstract':'\u003Cp\u003ESa\u00fade n\u00e3o tem pre\u00e7o.\u003C/p\u003E','title':'Aqui tem Farm\u00e1cia Popular','categories':[{'name':'Sa\u00fade','id':180,'slug':'saude','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0019/saude_nao_tem_preco.jpg'},'setting':{'color':'#e69138','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':5},{'id':103457,'abstract':'\u003Cp\u003EA\u00e7\u00e3o conjunta e coopera\u00e7\u00e3o transfronteiri\u00e7a.\u003C/p\u003E','title':'Prote\u00e7\u00e3o das Fronteiras','categories':[{'name':'Seguran\u00e7a P\u00fablica','id':182,'slug':'seguranca-publica','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0110/fronteira_redim.jpg'},'setting':{'color':'#a64d79','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':15},{'id':103494,'abstract':'\u003Cp\u003EDa Educa\u00e7\u00e3o Infantil ao Ensino M\u00e9dio.\u003C/p\u003E','title':'Educa\u00e7\u00e3o B\u00e1sica','categories':[{'name':'Educa\u00e7\u00e3o','id':181,'slug':'educacao','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0076/Educa__o_B_sica.jpg'},'setting':{'color':'#fce5cd','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':8},{'id':103359,'abstract':'\u003Cp\u003EAcesso a exames e consultas com especialistas.\u003C/p\u003E','title':'Mais Especialidades','categories':[{'name':'Sa\u00fade','id':180,'slug':'saude','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0083/mais_especialidades1.png'},'setting':{'color':'#ea9999','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':2},{'id':103485,'abstract':'\u003Cp\u003ECaminho para uma educa\u00e7\u00e3o de qualidade.\u003C/p\u003E','title':'Valoriza\u00e7\u00e3o dos Professores','categories':[{'name':'Educa\u00e7\u00e3o','id':181,'slug':'educacao','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0140/valorizacao_professor.jpg'},'setting':{'color':'#ffff00','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':11},{'id':103416,'abstract':'\u003Cp\u003EEstrutura adequada para atender melhor a popula\u00e7\u00e3o na aten\u00e7\u00e3o b\u00e1sica.\u003C/p\u003E','title':'Melhorar os Postos de Sa\u00fade','categories':[{'name':'Sa\u00fade','id':180,'slug':'saude','image':null}],'image':{'url':'/image_uploads/dialoga/0000/0053/requalif_redim.jpg'},'setting':{'color':'#cc4125','moderate_comments':false,'comment_paragraph_plugin_activate':false,'author_name':'Ronald Emerson Scherolt da Costa','allow_members_to_edit':false},'position':3}]}}); | |
18 | - | |
19 | - ArticleService.getHome().then(function(result) { | |
20 | - | |
21 | - expect(result.article).toBeDefined(); | |
22 | - expect(result.article.title).toEqual('Dialoga Brasil'); | |
23 | - | |
24 | - }); | |
25 | - | |
26 | - httpBackend.flush(); | |
27 | - }); | |
28 | - | |
29 | - // it('should return a list of articles', function() { | |
30 | - | |
31 | - // httpBackend.whenGET('http://login.dialoga.gov.br/api/v1/articles').respond({ | |
32 | - // "articles": [ | |
33 | - // { | |
34 | - // abstract: "Que exista educação continuada permanente dos profissionais!!", | |
35 | - // author: null, | |
36 | - // body: "", | |
37 | - // categories: [], | |
38 | - // children: [], | |
39 | - // created_at: "2015/08/04 16:36:13", | |
40 | - // end_date: null, | |
41 | - // hits: 0, | |
42 | - // id: 120568, | |
43 | - // image: null, | |
44 | - // parent: {id: 103379,…}, | |
45 | - // position: null, | |
46 | - // profile: {identifier: "dialoga", name: "dialoga", id: 19195, created_at: "2015/04/15 09:38:36", image: null}, | |
47 | - // setting: {comment_paragraph_plugin_activate: false, author_name: "estacio"}, | |
48 | - // start_date: null, | |
49 | - // tag_list: [], | |
50 | - // title: "article_f4f4601c-0f36-e90e-d01a-9871f0bd126b", | |
51 | - // votes_against: 0, | |
52 | - // votes_for: 0, | |
53 | - // } | |
54 | - // ] | |
55 | - // }); | |
56 | - | |
57 | - // ArticleService.getList().then(function(result) { | |
58 | - // console.log('result', result); | |
59 | - | |
60 | - // expect(result.data.article).toBeDefined(); | |
61 | - // expect(result.data.article.title).toEqual('Dialoga Brasil'); | |
62 | - | |
63 | - // }); | |
64 | - | |
65 | - // httpBackend.flush(); | |
66 | - // }); | |
67 | - }); | |
68 | -})(); |
src/app/partials/auth/auth.controller.js
... | ... | @@ -1,44 +0,0 @@ |
1 | -(function () { | |
2 | - 'use strict'; | |
3 | - | |
4 | - angular | |
5 | - .module('dialoga') | |
6 | - .controller('AuthController', AuthController); | |
7 | - | |
8 | - /** @ngInject */ | |
9 | - function AuthController($rootScope, AUTH_EVENTS, AuthService, Session, $log) { | |
10 | - $log.debug('AuthController'); | |
11 | - | |
12 | - var vm = this; | |
13 | - | |
14 | - vm.$rootScope = $rootScope; | |
15 | - vm.AUTH_EVENTS = AUTH_EVENTS; | |
16 | - vm.AuthService = AuthService; | |
17 | - vm.Session = Session; | |
18 | - vm.$log = $log; | |
19 | - | |
20 | - vm.init(); | |
21 | - } | |
22 | - | |
23 | - AuthController.prototype.init = function() { | |
24 | - var vm = this; | |
25 | - | |
26 | - // init variables | |
27 | - vm.credentials = {}; | |
28 | - | |
29 | - // attach events | |
30 | - | |
31 | - // ... | |
32 | - }; | |
33 | - | |
34 | - AuthController.prototype.login = function(credentials) { | |
35 | - var vm = this; | |
36 | - | |
37 | - vm.AuthService.login(credentials).then(function(/*user*/) { | |
38 | - // handle view | |
39 | - }, function() { | |
40 | - // handle view | |
41 | - }); | |
42 | - }; | |
43 | - | |
44 | -})(); |
src/app/partials/auth/auth.scss
... | ... | @@ -1,63 +0,0 @@ |
1 | -.auth-content{ | |
2 | - | |
3 | - .btn-social { | |
4 | - color: #fff; | |
5 | - font-weight: bold; | |
6 | - | |
7 | - &:hover, | |
8 | - &:focus {color: #fff;} | |
9 | - | |
10 | - &.btn-facebook { | |
11 | - background-color: #33477a; | |
12 | - &:hover, | |
13 | - &:focus {background-color: #304373; } | |
14 | - &:active {background-color: #33477a; } | |
15 | - } | |
16 | - &.btn-google-plus { | |
17 | - background-color: #b92d25; | |
18 | - &:hover, | |
19 | - &:focus {background-color: #b12b23; } | |
20 | - &:active {background-color: #b92d25; } | |
21 | - } | |
22 | - } | |
23 | - | |
24 | - .btn { | |
25 | - .contraste & { | |
26 | - color: #fff; | |
27 | - } | |
28 | - } | |
29 | - .btn-primary { | |
30 | - .contraste & { | |
31 | - background-color: #262626; | |
32 | - border-color: #666; | |
33 | - } | |
34 | - } | |
35 | - | |
36 | - .glyphicon { | |
37 | - &.icon-white { | |
38 | - fill: white; | |
39 | - } | |
40 | - } | |
41 | - | |
42 | - .separator-or { | |
43 | - border-top: 2px solid #d8d8d8; | |
44 | - text-align: center; | |
45 | - font-weight: bold; | |
46 | - | |
47 | - &:after { | |
48 | - content: "ou"; | |
49 | - position: absolute; | |
50 | - top: 4px; | |
51 | - left: 50%; | |
52 | - margin-left: -26px; | |
53 | - font-size: 30px; | |
54 | - line-height: 30px; | |
55 | - padding: 0 0.25em; | |
56 | - background: $gray; | |
57 | - | |
58 | - .contraste & { | |
59 | - background: #000; | |
60 | - } | |
61 | - } | |
62 | - } | |
63 | -} |
src/app/partials/auth/signin.html
... | ... | @@ -1,38 +0,0 @@ |
1 | -<section role="main" class="section-gray auth-content"> | |
2 | - <div class="container"> | |
3 | - <div class="row"> | |
4 | - <div class="col-sm-8 col-sm-offset-2"> | |
5 | - <h2>Identifique-se</h2> | |
6 | - <form name="loginForm" ng-submit="login.login(login.credentials)"> | |
7 | - <div class="form-group"> | |
8 | - <label for="inputUsername" class="sr-only">E-mail:</label> | |
9 | - <div class="input-group"> | |
10 | - <div class="input-group-addon"><span class="glyphicon glyphicon-user"></span></div> | |
11 | - <input type="text" id="inputUsername" class="form-control" placeholder="E-mail" required="" autofocus="" ng-model="login.credentials.username"> | |
12 | - </div> | |
13 | - </div> | |
14 | - <div class="form-group"> | |
15 | - <label for="inputPassword" class="sr-only">Senha:</label> | |
16 | - <div class="input-group"> | |
17 | - <div class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></div> | |
18 | - <input type="password" id="inputPassword" class="form-control" placeholder="Senha" required="" ng-model="login.credentials.password"> | |
19 | - </div> | |
20 | - </div> | |
21 | - <div class="form-group"> | |
22 | - <button class="btn btn-lg btn-primary btn-block" type="submit">Entrar</button> | |
23 | - </div> | |
24 | - </form> | |
25 | - </div> | |
26 | - </div> | |
27 | - <div class="row"> | |
28 | - <div class="col-sm-8 col-sm-offset-2"> | |
29 | - <hr class="separator-or"></hr> | |
30 | - </div> | |
31 | - </div> | |
32 | - <div class="row"> | |
33 | - <div class="col-sm-8 col-sm-offset-2"> | |
34 | - <button class="btn btn-lg btn-link btn-block" type="button" ui-sref="cadastrar">Cadastre-se</button> | |
35 | - </div> | |
36 | - </div> | |
37 | - </div> | |
38 | -</section> |
src/app/partials/auth/signup.html
... | ... | @@ -1,58 +0,0 @@ |
1 | -<!-- Facebook --> | |
2 | -<!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 33" width="25" height="25"><path d="M18 32L12 32 12 16l-4 0 0-5.5 4 0 0-3.2C12 2.7 13.2 0 18.5 0l4.4 0 0 5.5 -2.8 0c-2.1 0-2.2 0.8-2.2 2.2l0 2.8 5 0 -0.6 5.5L18 16 18 32z"/></svg> --> | |
3 | -<!-- Twitter --> | |
4 | -<!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 33" width="25" height="25"><path d="M32 6.1c-1.2 0.5-2.4 0.9-3.8 1 1.4-0.8 2.4-2.1 2.9-3.6 -1.3 0.8-2.7 1.3-4.2 1.6 -1.2-1.3-2.9-2.1-4.8-2.1 -3.6 0-6.6 2.9-6.6 6.6 0 0.5 0.1 1 0.2 1.5 -5.5-0.3-10.3-2.9-13.5-6.9 -0.6 1-0.9 2.1-0.9 3.3 0 2.3 1.2 4.3 2.9 5.5 -1.1 0-2.1-0.3-3-0.8 0 0 0 0.1 0 0.1 0 3.2 2.3 5.8 5.3 6.4 -0.6 0.2-1.1 0.2-1.7 0.2 -0.4 0-0.8 0-1.2-0.1 0.8 2.6 3.3 4.5 6.1 4.6 -2.2 1.8-5.1 2.8-8.2 2.8 -0.5 0-1.1 0-1.6-0.1 2.9 1.9 6.4 3 10.1 3 12.1 0 18.7-10 18.7-18.7 0-0.3 0-0.6 0-0.8C30 8.5 31.1 7.4 32 6.1z"/></svg> --> | |
5 | -<!-- Google Plus --> | |
6 | -<!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 33" width="25" height="25"><path d="M17.5 2c0 0-6.3 0-8.4 0C5.3 2 1.8 4.8 1.8 8.1c0 3.4 2.6 6.1 6.4 6.1 0.3 0 0.5 0 0.8 0 -0.2 0.5-0.4 1-0.4 1.6 0 0.9 0.5 1.7 1.1 2.3 -0.5 0-0.9 0-1.5 0C3.6 18.1 0 21.1 0 24.1c0 3 3.9 4.9 8.6 4.9 5.3 0 8.2-3 8.2-6 0-2.4-0.7-3.9-2.9-5.4 -0.8-0.5-2.2-1.8-2.2-2.6 0-0.9 0.3-1.3 1.6-2.4 1.4-1.1 2.4-2.6 2.4-4.4 0-2.1-0.9-4.2-2.7-4.8l2.7 0L17.5 2zM14.5 22.5c0.1 0.3 0.1 0.6 0.1 0.9 0 2.4-1.6 4.4-6.1 4.4 -3.2 0-5.5-2-5.5-4.5 0-2.4 2.9-4.4 6.1-4.4 0.8 0 1.4 0.1 2.1 0.3C12.9 20.4 14.2 21.1 14.5 22.5zM9.4 13.4c-2.2-0.1-4.2-2.4-4.6-5.2 -0.4-2.8 1.1-5 3.2-4.9 2.2 0.1 4.2 2.3 4.6 5.2C13 11.2 11.6 13.4 9.4 13.4zM26 8L26 2 24 2 24 8 18 8 18 10 24 10 24 16 26 16 26 10 32 10 32 8z"/></svg> --> | |
7 | - | |
8 | -<section> | |
9 | - <div class="container"> | |
10 | - <div class="row"> | |
11 | - <div class="col-sm-12"> | |
12 | - <h1>Cadastro</h1> | |
13 | - <p>Cadastre-se para fazer parte do Dialoga Brasil, interagir com as propostas e enviar as suas!</p> | |
14 | - </div> | |
15 | - </div> | |
16 | - </div> | |
17 | -</section> | |
18 | -<section role="main" class="section-gray auth-content"> | |
19 | - <div class="container"> | |
20 | - <div class="row"> | |
21 | - <div class="col-sm-8 col-sm-offset-2"> | |
22 | - <h2>Conecte-se por redes sociais</h2> | |
23 | - <div class="col-sm-6"> | |
24 | - <button type="button" class="btn btn-lg btn-block btn-social btn-facebook"> | |
25 | - <span class="glyphicon icon-facebook icon-white" aria-hidden="true"> | |
26 | - <!-- Facebook --> | |
27 | - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 33" width="25" height="25"><path d="M18 32L12 32 12 16l-4 0 0-5.5 4 0 0-3.2C12 2.7 13.2 0 18.5 0l4.4 0 0 5.5 -2.8 0c-2.1 0-2.2 0.8-2.2 2.2l0 2.8 5 0 -0.6 5.5L18 16 18 32z"/></svg> | |
28 | - </span> | |
29 | - <span class="text"> | |
30 | - Conectar pelo Facebook | |
31 | - </span> | |
32 | - </button> | |
33 | - </div> | |
34 | - <div class="col-sm-6"> | |
35 | - <button type="button" class="btn btn-lg btn-block btn-social btn-google-plus"> | |
36 | - <span class="glyphicon icon-google-plus icon-white" aria-hidden="true"> | |
37 | - <!-- Google Plus --> | |
38 | - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 33" width="25" height="25"><path d="M17.5 2c0 0-6.3 0-8.4 0C5.3 2 1.8 4.8 1.8 8.1c0 3.4 2.6 6.1 6.4 6.1 0.3 0 0.5 0 0.8 0 -0.2 0.5-0.4 1-0.4 1.6 0 0.9 0.5 1.7 1.1 2.3 -0.5 0-0.9 0-1.5 0C3.6 18.1 0 21.1 0 24.1c0 3 3.9 4.9 8.6 4.9 5.3 0 8.2-3 8.2-6 0-2.4-0.7-3.9-2.9-5.4 -0.8-0.5-2.2-1.8-2.2-2.6 0-0.9 0.3-1.3 1.6-2.4 1.4-1.1 2.4-2.6 2.4-4.4 0-2.1-0.9-4.2-2.7-4.8l2.7 0L17.5 2zM14.5 22.5c0.1 0.3 0.1 0.6 0.1 0.9 0 2.4-1.6 4.4-6.1 4.4 -3.2 0-5.5-2-5.5-4.5 0-2.4 2.9-4.4 6.1-4.4 0.8 0 1.4 0.1 2.1 0.3C12.9 20.4 14.2 21.1 14.5 22.5zM9.4 13.4c-2.2-0.1-4.2-2.4-4.6-5.2 -0.4-2.8 1.1-5 3.2-4.9 2.2 0.1 4.2 2.3 4.6 5.2C13 11.2 11.6 13.4 9.4 13.4zM26 8L26 2 24 2 24 8 18 8 18 10 24 10 24 16 26 16 26 10 32 10 32 8z"/></svg> | |
39 | - </span> | |
40 | - <span class="text"> | |
41 | - Conectar pelo Google+ | |
42 | - </span> | |
43 | - </button> | |
44 | - </div> | |
45 | - </div> | |
46 | - </div> | |
47 | - <div class="row"> | |
48 | - <div class="col-sm-8 col-sm-offset-2"> | |
49 | - <hr class="separator-or"></hr> | |
50 | - </div> | |
51 | - </div> | |
52 | - <div class="row"> | |
53 | - <div class="col-sm-8 col-sm-offset-2"> | |
54 | - <h2>Faça o cadastro abaixo</h2> | |
55 | - </div> | |
56 | - </div> | |
57 | - </div> | |
58 | -</section> |
src/app/partials/footer/footer.html
src/app/partials/footer/footer.scss
... | ... | @@ -1,21 +0,0 @@ |
1 | -$barra-theme: ("green": #00420c, "yellow": #2c66ce, "blue": #0042b1); | |
2 | - | |
3 | -#footer-brasil { | |
4 | - background: none repeat scroll 0% 0% map-get($barra-theme, "blue"); | |
5 | - padding: 1em 0px; | |
6 | - max-width: 100%; | |
7 | -} | |
8 | - | |
9 | -#footer { | |
10 | - padding: 20px 0; | |
11 | - a { | |
12 | - margin: 10px auto; | |
13 | - } | |
14 | - | |
15 | - .contraste & { | |
16 | - background-color: #000; | |
17 | - a { | |
18 | - color: #fff; | |
19 | - } | |
20 | - } | |
21 | -} |
src/app/partials/header/header.html
... | ... | @@ -1,26 +0,0 @@ |
1 | -<header class="container"> | |
2 | - | |
3 | - <div class="row"> | |
4 | - <div class="accessibility-wrapper"> | |
5 | - <button type="button" id="display-contrast" class="btn btn-link" ng-click="toggleContrast()"> | |
6 | - <span class="glyphicon glyphicon-adjust" aria-hidden="true"></span> Alto Contraste | |
7 | - </button> | |
8 | - | |
9 | - <button type="button" class="btn btn-link pull-right" ui-sref="entrar"> | |
10 | - <span class="glyphicon glyphicon-user"></span> | |
11 | - Entrar | |
12 | - </button> | |
13 | - </div> | |
14 | - </div> | |
15 | - | |
16 | - <div class="row"> | |
17 | - <app-navbar></app-navbar> | |
18 | - </div> | |
19 | - | |
20 | - <!-- TODO: breadcrumb --> | |
21 | - <!-- <ol class="breadcrumb"> | |
22 | - <li><a href="#">Home</a></li> | |
23 | - <li><a href="#">Library</a></li> | |
24 | - <li class="active">Data</li> | |
25 | - </ol> --> | |
26 | -</header> |
src/app/partials/header/header.scss
src/app/partials/inicio/inicio.controller.js
... | ... | @@ -1,152 +0,0 @@ |
1 | -/* globals document:true, window:true */ | |
2 | -(function() { | |
3 | - 'use strict'; | |
4 | - | |
5 | - angular | |
6 | - .module('dialoga') | |
7 | - .controller('InicioController', InicioController); | |
8 | - | |
9 | - /** @ngInject */ | |
10 | - function InicioController(ArticleService, $sce, $log) { | |
11 | - var vm = this; | |
12 | - | |
13 | - // aliases | |
14 | - vm.ArticleService = ArticleService; | |
15 | - vm.$sce = $sce; | |
16 | - vm.$log = $log; | |
17 | - | |
18 | - vm.init(); | |
19 | - vm.$log.debug('InicioController'); | |
20 | - } | |
21 | - | |
22 | - InicioController.prototype.init = function() { | |
23 | - var vm = this; | |
24 | - | |
25 | - vm.error = null; | |
26 | - vm.loading = true; | |
27 | - vm.loadHomeArticle(); | |
28 | - }; | |
29 | - | |
30 | - InicioController.prototype.loadHomeArticle = function() { | |
31 | - var vm = this; | |
32 | - | |
33 | - vm.content = vm.ArticleService.getHomeAbstract(); | |
34 | - vm.isCached = !!vm.content; | |
35 | - | |
36 | - if (vm.isCached) { | |
37 | - hideBackground(2000); | |
38 | - } | |
39 | - | |
40 | - vm.ArticleService.getHome(function(data) { | |
41 | - vm.loading = false; | |
42 | - vm.article = data.article; | |
43 | - }, function(error) { | |
44 | - vm.$log.error('Error on getHome article.', error); | |
45 | - vm.error = 'Erro ao carregar o conteúdo principal.'; | |
46 | - }); | |
47 | - }; | |
48 | - | |
49 | - InicioController.prototype.showVideo = function() { | |
50 | - var vm = this; | |
51 | - | |
52 | - // we need handle home content | |
53 | - if (vm.isCached) { | |
54 | - hideBackground(0); // force to hide | |
55 | - vm.$log.warn('The content already cached. Aborting.'); | |
56 | - return; | |
57 | - } | |
58 | - | |
59 | - vm.content = vm.handleHomeAbstract(vm.article.abstract); | |
60 | - vm.ArticleService.setHomeAbstract(vm.content); | |
61 | - | |
62 | - // inject dependencies | |
63 | - injectIframeApiJs(); | |
64 | - window.onYouTubeIframeAPIReady = window.onYouTubeIframeAPIReady || onYouTubeIframeAPIReady; | |
65 | - window.onYouTubePlayerReady = window.onYouTubePlayerReady || onYouTubePlayerReady; | |
66 | - }; | |
67 | - | |
68 | - InicioController.prototype.handleHomeAbstract = function(abstract) { | |
69 | - var vm = this; | |
70 | - | |
71 | - abstract = forceIframeParams(abstract); | |
72 | - abstract = removeStylefromIframe(abstract); | |
73 | - | |
74 | - return vm.$sce.trustAsHtml(abstract); | |
75 | - }; | |
76 | - | |
77 | - function injectIframeApiJs() { | |
78 | - var tag = document.createElement('script'); | |
79 | - tag.src = 'https://www.youtube.com/iframe_api'; | |
80 | - | |
81 | - var firstScriptTag = document.getElementsByTagName('script')[0]; | |
82 | - firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); | |
83 | - } | |
84 | - | |
85 | - function onYouTubeIframeAPIReady() { | |
86 | - var ytIframe = angular.element.find('.js-iframe iframe'); | |
87 | - var YTPlayer = window.YT.Player; | |
88 | - new YTPlayer(ytIframe[0], { | |
89 | - events: { | |
90 | - 'onReady': onYouTubePlayerReady | |
91 | - } | |
92 | - }); | |
93 | - } | |
94 | - | |
95 | - function onYouTubePlayerReady (event) { | |
96 | - event.target.playVideo(); | |
97 | - hideBackground(1000); | |
98 | - } | |
99 | - | |
100 | - function hideBackground (ms) { | |
101 | - var $elBg = angular.element.find('.video-background'); | |
102 | - angular.element($elBg).fadeOut(ms || 100); | |
103 | - // angular.element($elBg).hide(); | |
104 | - } | |
105 | - | |
106 | - function forceIframeParams(abstract) { | |
107 | - var patternIframe = '<iframe src="'; | |
108 | - var indexOfIframe = abstract.indexOf(patternIframe); | |
109 | - | |
110 | - if (indexOfIframe === -1) { | |
111 | - return abstract; | |
112 | - } | |
113 | - | |
114 | - var startSrcUrl = indexOfIframe + patternIframe.length; | |
115 | - var endSrcUrl = abstract.indexOf('"', startSrcUrl); | |
116 | - var srcUrl = abstract.substring(startSrcUrl , endSrcUrl); | |
117 | - var resultUrl = srcUrl; | |
118 | - var c = (srcUrl.indexOf('?') !== -1) ? '&' : ''; // already have url params. So, append-it | |
119 | - | |
120 | - // enable js api | |
121 | - if (srcUrl.indexOf('enablejsapi=1') === -1) { | |
122 | - resultUrl += c + 'enablejsapi=1'; | |
123 | - c = '&'; // force to always use '&' after here | |
124 | - } | |
125 | - | |
126 | - // set opaque mode | |
127 | - if (srcUrl.indexOf('wmode=opaque') === -1) { | |
128 | - resultUrl += c + 'wmode=opaque'; | |
129 | - // c = '&'; // force to always use '&' after here | |
130 | - } | |
131 | - | |
132 | - abstract = abstract.replace(srcUrl, resultUrl); | |
133 | - | |
134 | - return abstract; | |
135 | - } | |
136 | - | |
137 | - function removeStylefromIframe (abstract) { | |
138 | - var patternIframe = 'style="'; | |
139 | - var indexOfIframe = abstract.indexOf('<iframe'); | |
140 | - var indexOfStyleOnIframe = abstract.indexOf('style="', indexOfIframe); | |
141 | - | |
142 | - if (indexOfStyleOnIframe === -1) { | |
143 | - return abstract; | |
144 | - } | |
145 | - | |
146 | - var startStyleContent = indexOfStyleOnIframe + patternIframe.length; | |
147 | - var endStyleContent = abstract.indexOf('"', startStyleContent); | |
148 | - var style = abstract.substring(startStyleContent , endStyleContent); | |
149 | - | |
150 | - return abstract.replace(style, ''); | |
151 | - } | |
152 | -})(); |
src/app/partials/inicio/inicio.controller.spec.js
... | ... | @@ -1,15 +0,0 @@ |
1 | -(function() { | |
2 | - 'use strict'; | |
3 | - | |
4 | - describe('controllers', function(){ | |
5 | - | |
6 | - beforeEach(module('dialoga')); | |
7 | - | |
8 | - // it('should define more than 5 awesome things', inject(function($controller) { | |
9 | - // var vm = $controller('InicioController'); | |
10 | - | |
11 | - // expect(angular.isArray(vm.awesomeThings)).toBeTruthy(); | |
12 | - // expect(vm.awesomeThings.length > 5).toBeTruthy(); | |
13 | - // })); | |
14 | - }); | |
15 | -})(); |
src/app/partials/inicio/inicio.html
... | ... | @@ -1,33 +0,0 @@ |
1 | -<section class="container video-wrapper" role="main"> | |
2 | - <div class="video-player js-youtube"> | |
3 | - <div class="embed-responsive embed-responsive-16by9"> | |
4 | - <div class="js-iframe" ng-show="inicio.content" ng-bind-html="inicio.content"></div> | |
5 | - <div class="video-background" ng-click="inicio.showVideo()"> | |
6 | - <div class="video-thumbnail" style="background-image:url(/assets/images/youtube-background.png)"></div> | |
7 | - <button class="video-play-button" aria-live="assertive" aria-label="Assistir o vídeo tutorial Dialoga Brasil"> | |
8 | - <svg height="100%" version="1.1" viewBox="0 0 68 48" width="100%"><path class="ytp-play-button-bg" d="m .66,37.62 c 0,0 .66,4.70 2.70,6.77 2.58,2.71 5.98,2.63 7.49,2.91 5.43,.52 23.10,.68 23.12,.68 .00,-1.3e-5 14.29,-0.02 23.81,-0.71 1.32,-0.15 4.22,-0.17 6.81,-2.89 2.03,-2.07 2.70,-6.77 2.70,-6.77 0,0 .67,-5.52 .67,-11.04 l 0,-5.17 c 0,-5.52 -0.67,-11.04 -0.67,-11.04 0,0 -0.66,-4.70 -2.70,-6.77 C 62.03,.86 59.13,.84 57.80,.69 48.28,0 34.00,0 34.00,0 33.97,0 19.69,0 10.18,.69 8.85,.84 5.95,.86 3.36,3.58 1.32,5.65 .66,10.35 .66,10.35 c 0,0 -0.55,4.50 -0.66,9.45 l 0,8.36 c .10,4.94 .66,9.45 .66,9.45 z" fill="#1f1f1e" fill-opacity="0.9"></path><path d="m 26.96,13.67 18.37,9.62 -18.37,9.55 -0.00,-19.17 z" fill="#fff"></path><path d="M 45.02,23.46 45.32,23.28 26.96,13.67 43.32,24.34 45.02,23.46 z" fill="#ccc"></path></svg> | |
9 | - </button> | |
10 | - </div> | |
11 | - </div> | |
12 | - </div> | |
13 | -</section> | |
14 | - | |
15 | -<section class="info-section" ng-if="inicio.loading || inicio.error"> | |
16 | - <div class="container"> | |
17 | - <div class="col-md-12"> | |
18 | - <div ng-if="inicio.loading && !inicio.error"> | |
19 | - <div class="alert alert-info">Carregando conteúdo...</div> | |
20 | - </div> | |
21 | - | |
22 | - <div ng-if="inicio.error"> | |
23 | - <div class="alert alert-danger">{{inicio.error}}</div> | |
24 | - </div> | |
25 | - </div> | |
26 | - </div> | |
27 | -</section> | |
28 | - | |
29 | -<section class="section-gray" ng-if="inicio.article"> | |
30 | - <div class="container"> | |
31 | - <programa-list article="inicio.article"></programa-list> | |
32 | - </div> | |
33 | -</section> |
src/app/partials/inicio/inicio.scss
... | ... | @@ -1,85 +0,0 @@ |
1 | -.section-gray { | |
2 | - background-color: $gray; | |
3 | - | |
4 | - .contraste & { | |
5 | - color: #fff; | |
6 | - background-color: #000; | |
7 | - } | |
8 | -} | |
9 | - | |
10 | -.video-wrapper { | |
11 | - margin-bottom: 30px; | |
12 | -} | |
13 | - | |
14 | -.video-player { | |
15 | - position: relative; | |
16 | - border: 1px solid #333; | |
17 | - | |
18 | - .video-background { | |
19 | - text-align: center; | |
20 | - cursor: pointer; | |
21 | - } | |
22 | - | |
23 | - .video-thumbnail { | |
24 | - position: absolute; | |
25 | - width: 100%; | |
26 | - height: 100%; | |
27 | - top: 0; | |
28 | - left: 0; | |
29 | - z-index: 10; | |
30 | - background-position: center; | |
31 | - background-repeat: no-repeat; | |
32 | - -moz-transition: opacity .5s cubic-bezier(0.0,0.0,0.2,1); | |
33 | - -webkit-transition: opacity .5s cubic-bezier(0.0,0.0,0.2,1); | |
34 | - transition: opacity .5s cubic-bezier(0.0,0.0,0.2,1); | |
35 | - background-size: cover; | |
36 | - -moz-background-size: cover; | |
37 | - -webkit-background-size: cover; | |
38 | - } | |
39 | - | |
40 | - .video-play-button { | |
41 | - border: none; | |
42 | - outline: 0; | |
43 | - color: inherit; | |
44 | - text-align: inherit; | |
45 | - font-size: 100%; | |
46 | - font-family: inherit; | |
47 | - cursor: pointer; | |
48 | - line-height: inherit; | |
49 | - background: transparent; | |
50 | - padding: 0; | |
51 | - | |
52 | - position: absolute; | |
53 | - top: 50%; | |
54 | - left: 50%; | |
55 | - width: 68px; | |
56 | - height: 48px; | |
57 | - margin-left: -34px; | |
58 | - margin-top: -24px; | |
59 | - z-index: 15; | |
60 | - | |
61 | - -moz-transition: opacity .25s cubic-bezier(0.0,0.0,0.2,1); | |
62 | - -webkit-transition: opacity .25s cubic-bezier(0.0,0.0,0.2,1); | |
63 | - transition: opacity .25s cubic-bezier(0.0,0.0,0.2,1); | |
64 | - } | |
65 | - | |
66 | - .ytp-play-button-bg { | |
67 | - -moz-transition: fill .1s cubic-bezier(0.4,0.0,1,1),opacity .1s cubic-bezier(0.4,0.0,1,1); | |
68 | - -webkit-transition: fill .1s cubic-bezier(0.4,0.0,1,1),opacity .1s cubic-bezier(0.4,0.0,1,1); | |
69 | - transition: fill .1s cubic-bezier(0.4,0.0,1,1),opacity .1s cubic-bezier(0.4,0.0,1,1); | |
70 | - fill: #1f1f1f; | |
71 | - opacity: .9; | |
72 | - } | |
73 | - | |
74 | - &:hover { | |
75 | - .ytp-play-button-bg { | |
76 | - fill: #cc181e; | |
77 | - opacity: 1; | |
78 | - } | |
79 | - } | |
80 | - | |
81 | - @media screen and (min-width: 992px) { | |
82 | - width: 80%; | |
83 | - margin: 0 auto; | |
84 | - } | |
85 | -} |
src/app/partials/programas/programa.controller.js
... | ... | @@ -1,91 +0,0 @@ |
1 | -(function() { | |
2 | - 'use strict'; | |
3 | - | |
4 | - angular | |
5 | - .module('dialoga') | |
6 | - .controller('ProgramaController', ProgramaController); | |
7 | - | |
8 | - /** @ngInject */ | |
9 | - function ProgramaController(ArticleService, $state, $location, $scope, $rootScope, $log) { | |
10 | - $log.debug('ProgramaController'); | |
11 | - | |
12 | - var vm = this; | |
13 | - | |
14 | - vm.ArticleService = ArticleService; | |
15 | - vm.$state = $state; | |
16 | - vm.$location = $location; | |
17 | - vm.$scope = $scope; | |
18 | - vm.$rootScope = $rootScope; | |
19 | - vm.$log = $log; | |
20 | - | |
21 | - vm.init(); | |
22 | - } | |
23 | - | |
24 | - ProgramaController.prototype.init = function () { | |
25 | - var vm = this; | |
26 | - | |
27 | - var params = vm.$state.params; | |
28 | - var slug = params.slug; | |
29 | - | |
30 | - vm.program = null; | |
31 | - vm.currentCategory = null; | |
32 | - | |
33 | - vm.ArticleService.getHome(function(data){ | |
34 | - vm.categories = data.article.categories; | |
35 | - }, function (error) { | |
36 | - vm.$log.error(error); | |
37 | - }); | |
38 | - | |
39 | - vm.ArticleService.getArticleBySlug(slug, function(program){ | |
40 | - vm.program = program; | |
41 | - vm.currentCategory = vm.program.categories[0]; | |
42 | - | |
43 | - vm.$scope.$watch('programa.currentCategory', function(newValue, oldValue){ | |
44 | - if(newValue !== oldValue){ | |
45 | - vm.$state.go('inicio', { | |
46 | - tema: newValue.slug | |
47 | - }, { | |
48 | - location: true | |
49 | - }); | |
50 | - } | |
51 | - }); | |
52 | - | |
53 | - // load proposals | |
54 | - // vm.ArticleService.getRandomProposals(program.id).then(function(proposal){ | |
55 | - // vm.program.proposal = proposal; | |
56 | - // }, function (error){ | |
57 | - // vm.$log.error(error); | |
58 | - // }); | |
59 | - | |
60 | - // load events | |
61 | - // vm.ArticleService.getEvents(program.id).then(function(proposal){ | |
62 | - // vm.program.proposal = proposal; | |
63 | - // }, function (error){ | |
64 | - // vm.$log.error(error); | |
65 | - // }); | |
66 | - | |
67 | - // load body content | |
68 | - // vm.ArticleService.getBodyContent(program.id).then(function(proposal){ | |
69 | - // vm.program.proposal = proposal; | |
70 | - // }, function (error){ | |
71 | - // vm.$log.error(error); | |
72 | - // }); | |
73 | - | |
74 | - }, function (error) { | |
75 | - vm.$log.error(error); | |
76 | - vm.$log.info('Rollback to home page.'); | |
77 | - vm.$state.go('inicio', {}, {location: true}); | |
78 | - }); | |
79 | - }; | |
80 | - | |
81 | - ProgramaController.prototype.goBack = function () { | |
82 | - var vm = this; | |
83 | - | |
84 | - var prevState = vm.$rootScope.$previousState; | |
85 | - if(prevState && prevState.state.name){ | |
86 | - vm.$state.go(prevState.state.name, prevState.params); | |
87 | - } else { | |
88 | - vm.$state.go('inicio'); | |
89 | - } | |
90 | - }; | |
91 | -})(); |
src/app/partials/programas/programa.html
... | ... | @@ -1,39 +0,0 @@ |
1 | -<div class="container"> | |
2 | - | |
3 | - <div class="row"> | |
4 | - <div class="col-xs-12"> | |
5 | - <div class="article-bar" ng-class="programa.program.categories[0].slug"> | |
6 | - <div class="navbar"> | |
7 | - <div class="navbar-header"> | |
8 | - <button class="article-bar--item btn btn-link" ng-click="programa.goBack()"> | |
9 | - <!-- <span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span> --> | |
10 | - <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span> | |
11 | - Voltar | |
12 | - </button> | |
13 | - </div> | |
14 | - <div class="navbar-left"> | |
15 | - <button class="article-bar--item btn btn-link"> | |
16 | - <span class="glyphicon glyphicon-refresh"></span> | |
17 | - <span class="category-name">{{::programa.program.categories[0].name}}</span> | |
18 | - </button> | |
19 | - </div> | |
20 | - <div class="navbar-right" ng-if="programa.categories"> | |
21 | - <label for="selectCategory" class="control-label sr-only" title="Selecione uma opção para acessar os programas do tema">Temas:</label> | |
22 | - <select id="selectCategory" name="selectCategory" class="article-bar--item form-control" ng-model="programa.currentCategory" ng-options="category.name for category in programa.categories track by category.slug"> | |
23 | - </select> | |
24 | - </div> | |
25 | - </div> | |
26 | - </div> | |
27 | - </div> | |
28 | - </div> | |
29 | - | |
30 | - <div ng-if="!programa.program"> | |
31 | - <div class="alert alert-info" role="alert">Carregando informações sobre o progama</div> | |
32 | - </div> | |
33 | - | |
34 | - <div ng-if="programa.program"> | |
35 | - <programa-box program="programa.program" display="'preview'"></programa-box> | |
36 | - </div> | |
37 | - <div id="content" ng-bind-html="programa.program.body"></div> | |
38 | -</div> | |
39 | - |
src/app/partials/programas/programas.scss
... | ... | @@ -1,27 +0,0 @@ |
1 | -.article-bar { | |
2 | - | |
3 | - .btn { | |
4 | - color: #fff; | |
5 | - font-weight: bold; | |
6 | - } | |
7 | - | |
8 | - &--item { | |
9 | - margin: 8px 0; | |
10 | - } | |
11 | - | |
12 | - .navbar-right { | |
13 | - margin-right: 15px; | |
14 | - } | |
15 | - | |
16 | - @each $category, $color in $categories { | |
17 | - &.#{$category} { | |
18 | - background-color: $color; | |
19 | - } | |
20 | - } | |
21 | - | |
22 | - .contraste & { | |
23 | - background-color: #262626; | |
24 | - } | |
25 | -} | |
26 | - | |
27 | - |