Commit 6533f507a77a3ea294f8765416454fa46a8bf687
Exists in
master
and in
11 other branches
Merge branch 'master' of gitlab.com:participa/proposal-app
Showing
7 changed files
with
183 additions
and
287 deletions
Show diff stats
css/style.css
1 | -@font-face { | |
2 | - font-family: asap_bold_italic; | |
3 | - src: url(../fonts/Asap-BoldItalic.ttf); | |
4 | -} | |
5 | - | |
6 | -@font-face { | |
7 | - font-family: asap_bold; | |
8 | - src: url(../fonts/Asap-Bold.ttf); | |
9 | -} | |
10 | - | |
11 | -@font-face { | |
12 | - font-family: asap_italic; | |
13 | - src: url(../fonts/Asap-Italic.ttf); | |
14 | -} | |
15 | - | |
16 | -@font-face { | |
17 | - font-family: asap; | |
18 | - src: url(../fonts/Asap-Regular.ttf); | |
19 | -} | |
20 | - | |
21 | -html, body { | |
22 | - margin: 0; | |
23 | - padding: 0; | |
24 | - height: 100%; | |
25 | - font-family: asap, sans; | |
26 | -} | |
27 | - | |
28 | -header { | |
29 | - height: 100px; | |
30 | - background: #fff; | |
31 | - margin: 0; | |
32 | - padding: 0; | |
33 | - position: relative; | |
34 | -} | |
35 | - | |
36 | -h1 { | |
37 | - position: absolute; | |
38 | - bottom: 0; | |
39 | - left: 0; | |
40 | - color: #03316f; | |
41 | - font-size: 28px; | |
42 | - padding: 20px; | |
43 | - margin: 0; | |
44 | - display: block; | |
45 | - width: 100%; | |
46 | - text-transform: uppercase; | |
47 | - border-bottom: 1px solid #d6dcd7; | |
48 | -} | |
49 | - | |
50 | -#content { | |
51 | - padding-bottom: 150px; | |
52 | - background: transparent url(../images/header.png) center bottom no-repeat; | |
53 | -} | |
54 | - | |
55 | -#content p { | |
56 | - font-weight: lighter; | |
57 | - text-align: justify; | |
58 | - margin: 20px; | |
59 | - font-size: 14px; | |
60 | - line-height: 1.5em; | |
61 | -} | |
62 | - | |
63 | -nav { | |
64 | - width: 100%; | |
65 | - padding: 0; | |
66 | - margin: 0; | |
67 | -} | |
68 | - | |
69 | -nav ul { | |
70 | - padding: 0; | |
71 | - margin: 0; | |
72 | -} | |
73 | - | |
74 | -nav li { | |
75 | - display: inline; | |
76 | - list-style: none; | |
77 | - padding: 0; | |
78 | - margin: 0; | |
79 | -} | |
80 | - | |
81 | -nav li a { | |
82 | - display: block; | |
83 | - width: 48%; | |
84 | - float: left; | |
85 | - text-align: center; | |
86 | - text-decoration: none; | |
87 | - font-size: 16px; | |
88 | - font-weight: bold; | |
89 | - color: #fff; | |
90 | - background: #03316f; | |
91 | - margin: 0; | |
92 | - padding: 20px 1%; | |
93 | - text-transform: uppercase; | |
94 | - border-bottom: 3px solid #001129; | |
95 | -} | |
96 | - | |
97 | -nav li a.active { | |
98 | - position: relative; | |
99 | - background: #fff; | |
100 | - color: #03316f; | |
101 | - border-bottom: 3px solid #fff; | |
102 | -} | |
103 | - | |
104 | -#proposal-categories, #proposal-group { | |
105 | - background: #fff; | |
106 | - clear: both; | |
107 | - margin: 0; | |
108 | - width: 100%; | |
109 | - padding: 10px; | |
110 | - text-align: center; | |
111 | -} | |
112 | - | |
113 | -#proposal-categories li, #proposal-group li { | |
114 | - list-style: none; | |
115 | - display: inline-block; | |
116 | -} | |
117 | - | |
118 | -#proposal-categories .proposal-category > a, #proposal-group a { | |
119 | - text-decoration: none; | |
120 | - color: #fff; | |
121 | - margin: 10px; | |
122 | - -webkit-border-radius: 6px; | |
123 | - -moz-border-radius: 6px; | |
124 | - border-radius: 6px; | |
125 | - background-position: center 30px; | |
126 | - background-repeat: no-repeat; | |
127 | - width: 140px; | |
128 | - height: 40px; | |
129 | - display: inline-block; | |
130 | - font-size: 14px | |
131 | - font-family: asap_bold, sans; | |
132 | - font-weight: bolder; | |
133 | - text-align: center; | |
134 | - padding-top: 100px; | |
135 | - overflow: hidden; | |
136 | - border-width: 2px; | |
137 | - border-style: solid; | |
138 | -} | |
139 | - | |
140 | -#proposal-categories a:hover, #proposal-group a:hover { | |
141 | - border-color: #fff !important; | |
142 | -} | |
143 | - | |
144 | -.hide { | |
145 | - display: none; | |
146 | -} | |
147 | - | |
148 | -.mobile nav { | |
149 | - position: absolute; | |
150 | - bottom: 0; | |
151 | -} | |
152 | - | |
153 | -footer { | |
154 | - display: none; | |
155 | -} | |
156 | - | |
157 | -#login a { | |
158 | - margin: 10px; | |
159 | - font-size: 12px; | |
160 | - color: #333; | |
161 | - text-decoration: none; | |
162 | -} | |
163 | - | |
164 | 1 | /* |
165 | - * Each button | |
166 | - * FIXME: This selector doesn't look reliable | |
167 | - */ | |
168 | - | |
169 | -#proposal-category-saude a { | |
170 | - background-image: url(../images/icons/saude.png); | |
171 | - background-color: #00cbd7; | |
172 | - border-color: #00cbd7; | |
173 | -} | |
174 | -.proposal-category-items-saude { | |
175 | - background-color: #00cbd7; | |
176 | -} | |
177 | - | |
178 | -#proposal-category-seguranca a { | |
179 | - background-image: url(../images/icons/seguranca.png); | |
180 | - background-color: #e34748; | |
181 | - border-color: #e34748; | |
182 | -} | |
183 | -.proposal-category-items-seguranca { | |
184 | - background-color: #e34748; | |
185 | -} | |
186 | - | |
187 | -#proposal-category-educacao a { | |
188 | - background-image: url(../images/icons/educacao.png); | |
189 | - background-color: #ffb400; | |
190 | - border-color: #ffb400; | |
191 | -} | |
192 | -.proposal-category-items-educacao { | |
193 | - background-color: #ffb400; | |
194 | -} | |
195 | - | |
196 | -#proposal-category-desenvolvimento-social a { | |
197 | - background-image: url(../images/icons/desenvolvimento.png); | |
198 | - background-color: #51d0b3; | |
199 | - border-color: #51d0b3; | |
200 | -} | |
201 | -.proposal-category-items-desenvolvimento-social { | |
202 | - background-color: #51d0b3; | |
203 | -} | |
204 | -#proposal-categories-container { | |
205 | - display: inline; | |
206 | - width: auto; | |
207 | -} | |
208 | - | |
209 | -.proposal-category-items { | |
210 | - margin: 0 auto; | |
211 | - padding: 0; | |
212 | - -webkit-border-radius: 6px; | |
213 | - -moz-border-radius: 6px; | |
214 | - border-radius: 6px; | |
215 | -} | |
216 | - | |
217 | -ul.category { | |
218 | - display: block; | |
219 | - text-align: left; | |
220 | - padding: 0; | |
221 | -} | |
222 | - | |
223 | -.category > li { | |
224 | - color: #FFFFFF; | |
225 | - text-align: left; | |
226 | - font-family: asap_bold; | |
227 | - font-size: 16px; | |
228 | - padding: 10px 10px 5px 10px; | |
229 | - margin-bottom: 10px; | |
230 | - background-color: gray; | |
231 | -} | |
232 | - | |
233 | -.proposal-item p { | |
234 | - font-size: 14px; | |
235 | - color: #172938; | |
236 | - margin: 0; | |
237 | - padding-top: 5px; | |
238 | - background: #fff; | |
239 | - margin-bottom: 10px; | |
240 | - text-align: left; | |
241 | -} | |
242 | - | |
243 | -.proposal-item > a { | |
244 | - border-top: 1px dotted #03316f; | |
245 | - padding-top: 10px; | |
246 | - display: block; | |
247 | - margin: 0; | |
248 | - color: #03316f; | |
249 | - text-align: left; | |
250 | - font-family: asap_bold; | |
251 | - font-size: 16px; | |
252 | - text-decoration: none; | |
253 | - background: #fff; | |
254 | -} | |
255 | - | |
256 | -.proposal-category-items .proposal-item { | |
257 | - width: 290px; | |
258 | - min-height: 134px; | |
259 | - margin: 10px; | |
260 | - background: #fff; | |
261 | - border-radius: 7px; | |
262 | - padding: 15px; | |
263 | - vertical-align: top; | |
264 | -} | |
2 | +Error: Invalid CSS after "...ackground: #fff": expected "{", was "; " | |
3 | + on line 78 of _proposal_categories.scss | |
4 | + from line 25 of style.scss | |
5 | + | |
6 | +73: font-family: asap_bold; | |
7 | +74: font-size: 18pt; | |
8 | +75: font-weight: bold; | |
9 | +76: text-decoration: none; | |
10 | +77: <<<<<<< HEAD | |
11 | +78: background: #fff; | |
12 | +79: ======= | |
13 | +80: >>>>>>> 450d03f922b650755bff80ce172cd13d76d06632 | |
14 | +81: } | |
15 | +82: | |
16 | +83: .proposal-item { | |
17 | + | |
18 | +Backtrace: | |
19 | +_proposal_categories.scss:78 | |
20 | +style.scss:25 | |
21 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:1165:in `expected' | |
22 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:1101:in `expected' | |
23 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:1096:in `tok!' | |
24 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:641:in `block' | |
25 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:711:in `declaration_or_ruleset' | |
26 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:661:in `block_child' | |
27 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:653:in `block_contents' | |
28 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:642:in `block' | |
29 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:711:in `declaration_or_ruleset' | |
30 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:661:in `block_child' | |
31 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:653:in `block_contents' | |
32 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:642:in `block' | |
33 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:635:in `ruleset' | |
34 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:660:in `block_child' | |
35 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:653:in `block_contents' | |
36 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:117:in `stylesheet' | |
37 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/scss/parser.rb:42:in `parse' | |
38 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/engine.rb:393:in `_to_tree' | |
39 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/engine.rb:299:in `to_tree' | |
40 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:323:in `block in visit_import' | |
41 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/stack.rb:88:in `block in with_import' | |
42 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/stack.rb:115:in `with_frame' | |
43 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/stack.rb:88:in `with_import' | |
44 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:322:in `visit_import' | |
45 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:36:in `visit' | |
46 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:158:in `block in visit' | |
47 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/stack.rb:79:in `block in with_base' | |
48 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/stack.rb:115:in `with_frame' | |
49 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/stack.rb:79:in `with_base' | |
50 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:158:in `visit' | |
51 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:52:in `block in visit_children' | |
52 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:52:in `map' | |
53 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:52:in `visit_children' | |
54 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:167:in `block in visit_children' | |
55 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:179:in `with_environment' | |
56 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:166:in `visit_children' | |
57 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:36:in `block in visit' | |
58 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:186:in `visit_root' | |
59 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/visitors/base.rb:36:in `visit' | |
60 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:157:in `visit' | |
61 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/visitors/perform.rb:8:in `visit' | |
62 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/root_node.rb:36:in `css_tree' | |
63 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/tree/root_node.rb:29:in `render_with_sourcemap' | |
64 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/engine.rb:368:in `_render_with_sourcemap' | |
65 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/engine.rb:285:in `render_with_sourcemap' | |
66 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/plugin/compiler.rb:490:in `update_stylesheet' | |
67 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/plugin/compiler.rb:215:in `block in update_stylesheets' | |
68 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/plugin/compiler.rb:209:in `each' | |
69 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/plugin/compiler.rb:209:in `update_stylesheets' | |
70 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/plugin/compiler.rb:470:in `on_file_changed' | |
71 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/lib/sass/plugin/compiler.rb:328:in `block in watch' | |
72 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/vendor/listen/lib/listen/listener.rb:252:in `call' | |
73 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/vendor/listen/lib/listen/listener.rb:252:in `on_change' | |
74 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/vendor/listen/lib/listen/listener.rb:290:in `block in initialize_adapter' | |
75 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/vendor/listen/lib/listen/adapters/polling.rb:48:in `call' | |
76 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/vendor/listen/lib/listen/adapters/polling.rb:48:in `poll_changed_directories' | |
77 | +C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sass-3.4.13/vendor/listen/lib/listen/adapter.rb:299:in `block in start_poller' | |
78 | +*/ | |
79 | +body:before { | |
80 | + white-space: pre; | |
81 | + font-family: monospace; | |
82 | + content: "Error: Invalid CSS after \"...ackground: #fff\": expected \"{\", was \"; \"\A on line 78 of _proposal_categories.scss\A from line 25 of style.scss\A \A 73: font-family: asap_bold;\A 74: font-size: 18pt;\A 75: font-weight: bold; \A 76: text-decoration: none;\A 77: <<<<<<< HEAD\A 78: background: #fff; \A 79: =======\A 80: >>>>>>> 450d03f922b650755bff80ce172cd13d76d06632\A 81: }\A 82: \A 83: .proposal-item {"; } | ... | ... |
index.html
... | ... | @@ -80,7 +80,9 @@ |
80 | 80 | <div class='subtitle'>Qual a sua sugestão para melhorar este programa?</div> |
81 | 81 | <div class='info'>Ela se tornará pública em até 24 horas após o envio e poderá ser apoiada por outros participantes.</div> |
82 | 82 | <div class='send-proposal-button'><a href='#'>Envie Sua Proposta</a></div> |
83 | + <div class="login-container hide">Login</div> | |
83 | 84 | <form class='make-proposal-form hide' id='make-proposal-form-{{id}}'> |
85 | + <div class="message"></div> | |
84 | 86 | <div class="name"> |
85 | 87 | <div><label>Título</label></div> |
86 | 88 | <input id="article_name" name="article[name]" type="text" placeholder="Título"> |
... | ... | @@ -89,7 +91,6 @@ |
89 | 91 | <div><label>Descrição</label></div> |
90 | 92 | <textarea id="article_abstract" name="article[abstract]" placeholder="Descrição"></textarea> |
91 | 93 | </div> |
92 | - <input id='private_token' name='private_token' value='{{../private_token}}' type='hidden'> | |
93 | 94 | <input id='content_type' name='content_type' value='ProposalsDiscussionPlugin::Proposal' type='hidden'> |
94 | 95 | <input type='submit' id='make-proposal-button' class='make-proposal-button' name='make-proposal-button' value='Enviar'> |
95 | 96 | </form> |
... | ... | @@ -142,13 +143,31 @@ |
142 | 143 | </div> |
143 | 144 | </script> |
144 | 145 | |
145 | - <div id='proposal-result'></div> | |
146 | + <script id='login' type='text/x-handlebars-template'> | |
147 | + <form class="login"> | |
148 | + <div class="message"></div> | |
149 | + <div class="username"> | |
150 | + <div class="label">Nome de Usuário / E-mail:</div> | |
151 | + <input id="user_name" name="login" type="text" placeholder="Nome do usuário / E-mail"> | |
152 | + </div> | |
153 | + <div class="password"> | |
154 | + <div class="label">Senha:</div> | |
155 | + <input id="user_password" name="password" type="password" placeholder="Senha"> | |
156 | + </div> | |
157 | + <div class="actions"> | |
158 | + <a href="http://www.participa.br/account/forgot_password" target="_blank" class="forgot-password">Esqueci minha senha</a> | |
159 | + <a href="#" class="login-action">Acessar</a> | |
160 | + </div> | |
161 | + <div class="oauth"> | |
162 | + <div class="label">Acessar com:</div> | |
163 | + <a href="/plugin/oauth_client/facebook?oauth_client_popup=true&id=1" target="_blank" class="facebook">Facebook</a> | |
164 | + <a href="/plugin/oauth_client/google_oauth2?oauth_client_popup=true&id=2" target="_blank" class="google">Google +</a> | |
165 | + <a href="http://www.participa.br/account/signup" target="_blank" class="new-user">Cadastrar</a> | |
166 | + </div> | |
167 | + </form> | |
168 | + </script> | |
146 | 169 | |
147 | - <div id="login" style="display: none"> | |
148 | - <a href="/plugin/oauth_client/google_oauth2?oauth_client_popup=true&id=2" target="_blank" class="google">Google</a> | |
149 | - <a href="/plugin/oauth_client/facebook?oauth_client_popup=true&id=1" target="_blank" class="facebook">Facebook</a> | |
150 | - <a href="/plugin/oauth_client/noosfero_oauth2?oauth_client_popup=true&id=3" target="_blank" class="participa">Participa</a> | |
151 | - </div> | |
170 | + <div id='proposal-result'></div> | |
152 | 171 | |
153 | 172 | <script src='js/main.js'></script> |
154 | 173 | </body> | ... | ... |
js/handlebars-helpers.js
... | ... | @@ -26,7 +26,7 @@ Handlebars.registerHelper('list_proposal', function(proposals, options) { |
26 | 26 | } |
27 | 27 | element = element + '</ul>'; |
28 | 28 | element = element + options.fn(proposals[i]); |
29 | - element = element + '<p>' + proposals[i].body + '</p>'; | |
29 | + element = element + '<p>' + (proposals[i].abstract ? proposals[i].abstract : '') + '</p>'; | |
30 | 30 | ret = ret + element + '</li>'; |
31 | 31 | } |
32 | 32 | return ret; | ... | ... |
js/main.js
... | ... | @@ -5,12 +5,15 @@ var templateSource = document.getElementById('proposal-template').innerHTML; |
5 | 5 | var template = Handlebars.compile(templateSource); |
6 | 6 | |
7 | 7 | var supportProposalTemplate = Handlebars.compile(document.getElementById('support-proposal-template').innerHTML); |
8 | +var loginTemplate = Handlebars.compile(document.getElementById('login').innerHTML); | |
8 | 9 | |
9 | 10 | // The div/container that we are going to display the results in |
10 | 11 | var resultsPlaceholder = document.getElementById('proposal-result'); |
11 | 12 | |
12 | 13 | var topics; |
13 | 14 | |
15 | +var logged_in = false; | |
16 | + | |
14 | 17 | var participa = true; |
15 | 18 | if(participa){ |
16 | 19 | var host = 'http://www.participa.br'; |
... | ... | @@ -31,6 +34,7 @@ $.getJSON(noosferoAPI) |
31 | 34 | data['host'] = host; |
32 | 35 | data['private_token'] = private_token; |
33 | 36 | resultsPlaceholder.innerHTML = template(data); |
37 | + $('.login-container').html(loginTemplate()); | |
34 | 38 | //Actions for links |
35 | 39 | $( '#nav-proposal-categories a' ).click(function(event){ |
36 | 40 | //Display the category tab |
... | ... | @@ -62,6 +66,10 @@ $.getJSON(noosferoAPI) |
62 | 66 | $('.proposal-detail').hide(); |
63 | 67 | $('#' + item).show(); |
64 | 68 | |
69 | + $('.send-proposal-button').show(); | |
70 | + $('.make-proposal-form').hide(); | |
71 | + $('.login-container').hide(); | |
72 | + | |
65 | 73 | var topic_id = this.id.replace('\#',''); |
66 | 74 | loadRandomProposal(topic_id, private_token); |
67 | 75 | }); |
... | ... | @@ -82,35 +90,32 @@ $.getJSON(noosferoAPI) |
82 | 90 | } |
83 | 91 | event.preventDefault(); |
84 | 92 | }); |
85 | - $( '.send-proposal-button a' ).click(function(event){ | |
86 | - //Display Topics or Discussion by category | |
87 | - $('.make-proposal-form').show(); | |
93 | + $( '.send-proposal-button a, .success-proposal-sent a' ).click(function(event){ | |
94 | + //display form to send proposal (or login form for non-logged users) | |
88 | 95 | $('.send-proposal-button').hide(); |
89 | - event.preventDefault(); | |
90 | - }); | |
91 | - $( '.success-proposal-sent a' ).click(function(event){ | |
92 | - //Display Topics or Discussion by category | |
93 | - $('.make-proposal-form').show(); | |
94 | 96 | $('.success-proposal-sent').hide(); |
97 | + loginCallback(logged_in); | |
95 | 98 | event.preventDefault(); |
96 | 99 | }); |
97 | 100 | |
98 | 101 | $('.make-proposal-form').submit(function (e) { |
99 | 102 | e.preventDefault(); |
100 | 103 | var proposal_id = this.id.split('-').pop(); |
104 | + var form = this; | |
101 | 105 | $.ajax({ |
102 | 106 | type: 'post', |
103 | 107 | url: host + '/api/v1/articles/' + proposal_id + '/children', |
104 | - data: $('#'+this.id).serialize() | |
108 | + data: $('#'+this.id).serialize() + "&private_token="+private_token+"&fields=id" | |
105 | 109 | }) |
106 | 110 | .done(function( data ) { |
107 | - this.reset(); | |
111 | + form.reset(); | |
108 | 112 | $('.make-proposal-form').hide(); |
109 | 113 | $('.success-proposal-sent').show(); |
110 | 114 | }) |
111 | 115 | .fail(function( jqxhr, textStatus, error ) { |
112 | 116 | var err = textStatus + ", " + error; |
113 | 117 | console.log( "Request Failed: " + err ); |
118 | + $('.make-proposal-form .message').text('Não foi possível enviar sua proposta.'); | |
114 | 119 | }); |
115 | 120 | }); |
116 | 121 | |
... | ... | @@ -121,7 +126,7 @@ $.getJSON(noosferoAPI) |
121 | 126 | }); |
122 | 127 | |
123 | 128 | function loadRandomProposal(topic_id, private_token) { |
124 | - var url = host + '/api/v1/articles/' + topic_id + '/children' + '?private_token=' + private_token + '&limit=1&order=random()&_='+new Date().getTime()+'&fields=id,name,created_by'; | |
129 | + var url = host + '/api/v1/articles/' + topic_id + '/children' + '?private_token=' + private_token + '&limit=1&order=random()&_='+new Date().getTime()+'&fields=id,name,abstract,created_by'; | |
125 | 130 | $.getJSON(url).done(function( data ) { |
126 | 131 | if(data.articles.length == 0) return; |
127 | 132 | var article = data.articles[0]; |
... | ... | @@ -149,6 +154,36 @@ function loadRandomProposal(topic_id, private_token) { |
149 | 154 | }); |
150 | 155 | } |
151 | 156 | |
157 | +function loginCallback(loggedIn, token) { | |
158 | + logged_in = loggedIn; | |
159 | + $('.login .message').text(''); | |
160 | + | |
161 | + if(logged_in) { | |
162 | + if(token) private_token = token; | |
163 | + $('.make-proposal-form').show(); | |
164 | + $('.make-proposal-form .message').text(''); | |
165 | + $('.login-container').hide(); | |
166 | + } else { | |
167 | + $('.make-proposal-form').hide(); | |
168 | + $('.login-container').show(); | |
169 | + } | |
170 | +} | |
171 | + | |
152 | 172 | function oauthPluginHandleLoginResult(loggedIn, token) { |
153 | - private_token = token; | |
173 | + loginCallback(loggedIn, token); | |
154 | 174 | } |
175 | + | |
176 | +jQuery(document).ready(function($) { | |
177 | + $(document).on('click', '.login-action', function(e) { | |
178 | + $.ajax({ | |
179 | + type: 'post', | |
180 | + url: host + '/api/v1/login', | |
181 | + data: $(this).parents('.login').serialize(), | |
182 | + }).done(function(data) { | |
183 | + loginCallback(true, data.private_token); | |
184 | + }).fail(function(data) { | |
185 | + $('.login .message').text('Não foi possível logar'); | |
186 | + }); | |
187 | + e.preventDefault(); | |
188 | + }); | |
189 | +}); | ... | ... |
sass/_nav.scss
sass/_proposal_categories.scss
... | ... | @@ -6,6 +6,9 @@ |
6 | 6 | margin: 0; |
7 | 7 | padding: 10px; |
8 | 8 | text-align: center; |
9 | + border-bottom: 1px solid #03316f; | |
10 | + border-left: 1px solid #03316f; | |
11 | + border-right: 1px solid #03316f; | |
9 | 12 | li { |
10 | 13 | list-style: none; |
11 | 14 | display: inline-block; |
... | ... | @@ -42,7 +45,7 @@ |
42 | 45 | text-align: left; |
43 | 46 | font-family: asap_bold; |
44 | 47 | font-size: 16px; |
45 | - padding: 10px 10px 5px 30px; | |
48 | + padding: 5px 12px; | |
46 | 49 | margin-bottom: 10px; |
47 | 50 | } |
48 | 51 | |
... | ... | @@ -68,18 +71,28 @@ |
68 | 71 | color: #335277; |
69 | 72 | text-align: left; |
70 | 73 | font-family: asap_bold; |
71 | - font-size: 16px; | |
74 | + font-size: 18pt; | |
75 | + font-weight: bold; | |
72 | 76 | text-decoration: none; |
77 | +<<<<<<< HEAD | |
78 | + background: #fff; | |
79 | +======= | |
80 | +>>>>>>> 450d03f922b650755bff80ce172cd13d76d06632 | |
73 | 81 | } |
74 | 82 | |
75 | 83 | .proposal-item { |
76 | 84 | width: 46%; |
77 | 85 | height: 134px; |
86 | +<<<<<<< HEAD | |
87 | + margin: 10px 30px; | |
88 | +======= | |
78 | 89 | margin: 0.5%; |
90 | +>>>>>>> 450d03f922b650755bff80ce172cd13d76d06632 | |
79 | 91 | background: #fff; |
80 | 92 | border-radius: 5px; |
81 | 93 | padding: 15px; |
82 | 94 | vertical-align: top; |
95 | + border: 1px solid #03316f; | |
83 | 96 | } |
84 | 97 | |
85 | 98 | .proposal-item:hover { |
... | ... | @@ -109,6 +122,7 @@ |
109 | 122 | padding-bottom: 10px; |
110 | 123 | padding-top: 20px; |
111 | 124 | margin-bottom: 10px; |
125 | + font-size: 18pt; | |
112 | 126 | } |
113 | 127 | } |
114 | 128 | ... | ... |
sass/style.scss
... | ... | @@ -49,9 +49,14 @@ h1 { |
49 | 49 | border-bottom: 1px solid #d6dcd7; |
50 | 50 | } |
51 | 51 | |
52 | +#proposal-result { | |
53 | + width: 90%; | |
54 | + margin: 0 auto; | |
55 | +} | |
56 | + | |
52 | 57 | #content { |
53 | - padding-bottom: 150px; | |
54 | - background: transparent url(./images/header.png) center bottom no-repeat; | |
58 | + padding-bottom: 50px; | |
59 | + /*background: transparent url(./images/header.png) center bottom no-repeat;*/ | |
55 | 60 | p { |
56 | 61 | font{ |
57 | 62 | weight: lighter; | ... | ... |