Commit df39a5fb646996202bc8fda6d540fbd1b0dc17e6
- Diff rendering mode:
- inline
- side by side
app/app.py
(5 / 3)
  | |||
54 | 54 | Solutions = client.Solution.cursor( | |
55 | 55 | reply=['guid', 'content', 'parent', 'author', 'tags'], order_by='-mtime') | |
56 | 56 | Comments = client.Comment.cursor( | |
57 | reply=['guid', 'message', 'tags', 'author']) | ||
57 | reply=['guid', 'message', 'tags', 'author', 'parent', 'parent_resource']) | ||
58 | 58 | ||
59 | 59 | def get_colors(): | |
60 | 60 | client = gconf.client_get_default() | |
… | … | ||
273 | 273 | resource_type=resource_type) | |
274 | 274 | ||
275 | 275 | @app.route('/resource/contexts/<query>') | |
276 | @app.route('/resource/contexts/') | ||
276 | 277 | @app.route('/context/search/') | |
277 | 278 | @app.route('/context/search/<query>') | |
278 | 279 | @app.route('/context') | |
… | … | ||
329 | 329 | ||
330 | 330 | @app.route('/_comments/<resource_guid>') | |
331 | 331 | def comments_browser(resource_guid=None): | |
332 | resource_type=request.args.get('resource_type') | ||
333 | result = Comments.filter(parent=resource_guid, parent_resource=resource_type) | ||
332 | resource_type = request.args.get('resource_type') | ||
333 | Comments.filter(parent=resource_guid) | ||
334 | result = Comments | ||
334 | 335 | if not result: | |
335 | 336 | result = [] | |
336 | 337 | return render_template('_context-comment-list.html', |
app/messages.pot
(16 / 16)
  | |||
8 | 8 | msgstr "" | |
9 | 9 | "Project-Id-Version: PROJECT VERSION\n" | |
10 | 10 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | |
11 | "POT-Creation-Date: 2012-05-16 04:19-0500\n" | ||
11 | "POT-Creation-Date: 2012-05-16 22:56-0500\n" | ||
12 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | |
13 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | |
14 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | |
… | … | ||
17 | 17 | "Content-Transfer-Encoding: 8bit\n" | |
18 | 18 | "Generated-By: Babel 0.9.6\n" | |
19 | 19 | ||
20 | #: app.py:204 | ||
20 | #: app.py:206 | ||
21 | 21 | msgid "zero results" | |
22 | 22 | msgstr "" | |
23 | 23 | ||
24 | #: app.py:206 | ||
24 | #: app.py:208 | ||
25 | 25 | #, python-format | |
26 | 26 | msgid "page %(page)s of %(total)s" | |
27 | 27 | msgstr "" | |
28 | 28 | ||
29 | #: app.py:241 app.py:392 | ||
29 | #: app.py:243 app.py:397 | ||
30 | 30 | msgid "questions" | |
31 | 31 | msgstr "" | |
32 | 32 | ||
33 | #: app.py:244 app.py:395 | ||
33 | #: app.py:246 app.py:400 | ||
34 | 34 | msgid "problems" | |
35 | 35 | msgstr "" | |
36 | 36 | ||
37 | #: app.py:247 app.py:398 | ||
37 | #: app.py:249 app.py:403 | ||
38 | 38 | msgid "ideas" | |
39 | 39 | msgstr "" | |
40 | 40 | ||
41 | #: app.py:259 app.py:407 | ||
41 | #: app.py:261 app.py:412 | ||
42 | 42 | #, python-format | |
43 | 43 | msgid "browsing %(total)s %(resource_label)s" | |
44 | 44 | msgstr "" | |
45 | 45 | ||
46 | #: app.py:303 | ||
46 | #: app.py:307 | ||
47 | 47 | #, python-format | |
48 | 48 | msgid "browsing %(total)s contexts" | |
49 | 49 | msgstr "" | |
50 | 50 | ||
51 | #: templates/_context-comment-list.html:22 | ||
51 | #: templates/_context-comment-list.html:23 | ||
52 | 52 | msgid "comment" | |
53 | 53 | msgstr "" | |
54 | 54 | ||
… | … | ||
66 | 66 | "first to share with the community!" | |
67 | 67 | msgstr "" | |
68 | 68 | ||
69 | #: templates/_context-solution-list.html:64 | ||
70 | msgid "Contribute" | ||
69 | #: templates/_context-solution-list.html:60 | ||
70 | msgid "contribute" | ||
71 | 71 | msgstr "" | |
72 | 72 | ||
73 | 73 | #: templates/_resource-list.html:39 | |
… | … | ||
82 | 82 | msgid "solutions" | |
83 | 83 | msgstr "" | |
84 | 84 | ||
85 | #: templates/browser-view.html:44 templates/context-view.html:144 | ||
85 | #: templates/browser-view.html:44 templates/context-view.html:160 | ||
86 | 86 | #: templates/resource-list.html:59 | |
87 | 87 | msgid "page '+new_page+' of" | |
88 | 88 | msgstr "" | |
… | … | ||
100 | 100 | msgstr "" | |
101 | 101 | ||
102 | 102 | #: templates/report-form.html:5 | |
103 | msgid "Submit failure report" | ||
103 | msgid "Report to developers: Activity failed to start!" | ||
104 | 104 | msgstr "" | |
105 | 105 | ||
106 | 106 | #: templates/report-form.html:12 | |
107 | msgid "You may optionally comment failure conditions." | ||
107 | msgid "You may also add a comment regarding failure conditions." | ||
108 | 108 | msgstr "" | |
109 | 109 | ||
110 | #: templates/report-form.html:17 | ||
111 | msgid "Send" | ||
110 | #: templates/report-form.html:19 | ||
111 | msgid "Report" | ||
112 | 112 | msgstr "" | |
113 | 113 | ||
114 | 114 | #: templates/resource-form.html:5 |
app/static/css/browser.css
(33 / 8)
  | |||
20 | 20 | input { | |
21 | 21 | border: 2px solid #282828; | |
22 | 22 | } | |
23 | textarea { | ||
24 | resize: none; | ||
25 | } | ||
23 | 26 | ||
24 | 27 | .notice { | |
25 | 28 | font-size:13pt; | |
… | … | ||
173 | 173 | width: 300px; | |
174 | 174 | display:none; | |
175 | 175 | } | |
176 | span.comment-content { | ||
176 | div.comment-content { | ||
177 | 177 | color: #808080; | |
178 | 178 | } | |
179 | 179 | .comment-author { | |
180 | 180 | float: right; | |
181 | 181 | } | |
182 | 182 | ||
183 | li.comment-resource-list { | ||
184 | width: 340px; | ||
185 | clear: both; | ||
186 | text-align: left; | ||
187 | } | ||
188 | |||
183 | 189 | .half { | |
190 | float: left; | ||
184 | 191 | width: 27px; | |
185 | 192 | height: 27px; | |
193 | padding: 5px; | ||
186 | 194 | } | |
187 | 195 | ||
188 | 196 | li.resource-list + li.resource-list { | |
… | … | ||
373 | 373 | width: 100%; | |
374 | 374 | text-align: center; | |
375 | 375 | } | |
376 | .resource-throbber { | ||
377 | display:none; | ||
378 | } | ||
376 | 379 | ||
377 | 380 | #mejorar-sistema { | |
378 | 381 | position: fixed; | |
… | … | ||
503 | 503 | } | |
504 | 504 | div.comment-content-column { | |
505 | 505 | padding: 10px 0px 0px 40px; | |
506 | float: left; | ||
507 | 506 | width: 100%; | |
508 | 507 | margin: 5px; | |
509 | 508 | position: relative; | |
… | … | ||
600 | 600 | ||
601 | 601 | #textarea-solution { | |
602 | 602 | border: 3px solid #c0c0c0; | |
603 | text-indent: 5px; | ||
604 | 603 | margin-top:10px; | |
605 | 604 | width: 400px; | |
606 | 605 | height: 100px; | |
607 | 606 | } | |
607 | |||
608 | 608 | #textarea-comment { | |
609 | 609 | border: 2px solid #c0c0c0; | |
610 | text-indent: 5px; | ||
611 | margin:10px 30px; | ||
610 | margin: 10px 70px 0px; | ||
612 | 611 | width: 280px; | |
613 | height: 25px; | ||
612 | height: 3em; | ||
614 | 613 | } | |
615 | 614 | .comment-form { | |
616 | 615 | margin-left: 10px; | |
617 | 616 | } | |
618 | 617 | .comment-button { | |
618 | margin-left: 240px; | ||
619 | margin-bottom: 20px; | ||
620 | } | ||
621 | |||
622 | span.collapse-button { | ||
619 | 623 | position: absolute; | |
620 | overflow: hidden; | ||
624 | bottom: 0px; | ||
621 | 625 | right: 0px; | |
622 | bottom: 14px; | ||
626 | } | ||
627 | span.collapse-button:hover { | ||
628 | background-color: #808080; | ||
629 | border-radius: 15px; | ||
630 | cursor:pointer; | ||
631 | } | ||
632 | img.collapse-icon { | ||
633 | width:27; | ||
634 | height:27px; | ||
623 | 635 | } | |
624 | 636 | ||
625 | 637 | .sugar-button { |
Binary files differ
  | |||
1 | 1 | {%- for item in result %} | |
2 | <li class="resource-list"> | ||
2 | <li class="comment-resource-list"> | ||
3 | 3 | <div class="comment-content-column"> | |
4 | 4 | <div class="resource-content"> | |
5 | 5 | {%- if item['author'] %} | |
6 | 6 | <img class="half" src="/static/icons/sugar-xo.png" /> | |
7 | 7 | {%- endif %} | |
8 | <span class="comment-content">{{item['message']}}</span> | ||
8 | <div class="comment-content">{{item['message']}}</div> | ||
9 | 9 | </div> | |
10 | 10 | <div class="resource-meta"> | |
11 | 11 | {%- for tag in item['tags'] %} | |
… | … | ||
15 | 15 | </div> | |
16 | 16 | </li> | |
17 | 17 | {%- endfor %} | |
18 | <img class="resource-throbber" id="comment_throbber_{{resource_guid}}" src="/static/images/throbber4.gif" /> | ||
18 | 19 | <form id="comment_form_{{resource_guid}}" class="comment-form" data-guid="{{resource_guid}}" method="POST" action="/submit_comment"> | |
19 | 20 | <input type="hidden" name="resource_guid" value="{{resource_guid}}" /> | |
20 | 21 | <input type="hidden" name="resource_type" value="solution" /> | |
21 | 22 | <textarea id="textarea-comment" name="comment"></textarea> | |
22 | <input class="comment-button sugar-button" data-guid="{{resource_guid}}" type="submit" value="{{_('comment')}}" /> | ||
23 | <input id="comment_button_{{resource_guid}}" class="comment-button sugar-button" data-guid="{{resource_guid}}" type="submit" value="{{_('comment')}}" /> | ||
23 | 24 | </form> | |
25 | <span class="collapse-button" | ||
26 | id="collapse_button_{{resource_guid}}" | ||
27 | data-guid="{{resource_guid}}"> | ||
28 | <img class="collapse-icon" src="/static/icons/collapse.png" /> | ||
29 | </span> |
  | |||
40 | 40 | data-guid="{{item['guid']}}"> | |
41 | 41 | <img src="/static/icons/comments.png" /> | |
42 | 42 | </span> | |
43 | <!--span class="collapse-button" | ||
44 | id="collapse-button-{{item['guid']}}" | ||
45 | data-guid="{{item['guid']}}"> | ||
46 | <img src="/static/icons/collapse.png" /> | ||
47 | </span--> | ||
43 | <img class="resource-throbber" id="throbber_{{item['guid']}}" src="/static/images/throbber4.gif" /> | ||
48 | 44 | <div class="comments" id="comments-{{item['guid']}}"></div> | |
49 | 45 | </div> | |
50 | 46 | <div class="icon-column"> | |
… | … | ||
52 | 52 | {%- endfor %} | |
53 | 53 | </ul> | |
54 | 54 | <hr /> | |
55 | <form id="solution-form" method="POST" action="/submit_solution"> | ||
55 | <form id="solution-form" method="POST" data-guid="{{resource['guid']}}" action="/submit_solution"> | ||
56 | 56 | <input type="hidden" name="resource_guid" value="{{resource['guid']}}" /> | |
57 | 57 | <input type="hidden" name="resource_type" value="{{resource_type}}" /> | |
58 | 58 | <textarea id="textarea-solution" name="solution"></textarea> | |
59 | 59 | <br /> | |
60 | <input id="contribute-button" class="sugar-button" type="submit" value="{{_('Contribute')}}" /> | ||
60 | <input id="contribute-button" class="sugar-button" type="submit" value="{{_('contribute')}}" /> | ||
61 | 61 | </form> |
app/templates/context-view.html
(19 / 3)
  | |||
59 | 59 | {%- endblock view %} | |
60 | 60 | {%- block script %} | |
61 | 61 | {{ super() }} | |
62 | |||
63 | function initCollapse (guid) { | ||
64 | $('span.collapse-button').click( function() { | ||
65 | $('#comments-'+guid).slideUp(); | ||
66 | $('#comments-button-'+guid).slideDown(); | ||
67 | }); | ||
68 | } | ||
69 | |||
70 | // This is what happens when we (re)load the comments section. | ||
62 | 71 | function onSubmit_Comment (e) { | |
63 | 72 | e.preventDefault(); | |
64 | 73 | var guid = $(this).data('guid'); | |
65 | 74 | $('#comment_form_'+guid).slideUp(); | |
66 | $('.comment-button').slideUp(); | ||
75 | $('#comment_button_'+guid).slideUp(); | ||
76 | $('#comment_throbber_'+guid).slideDown(); | ||
67 | 77 | $.post( '/submit_comment', | |
68 | 78 | $(this).serialize(), | |
69 | 79 | function(response) { | |
70 | 80 | $.get('/_comments/'+guid, | |
71 | 81 | { resource_type:'{{resource_type}}' }, function ( data ) { | |
82 | $('#comment_throbber_'+guid).slideUp(); | ||
72 | 83 | $('#comments-'+guid).empty().append( data ); | |
73 | 84 | $('#comment_form_'+guid).submit(onSubmit_Comment); | |
85 | initCollapse (guid); | ||
74 | 86 | }); | |
75 | 87 | }); | |
76 | 88 | }; | |
… | … | ||
104 | 104 | /* $('#contribute-button').attr("disabled", "disabled");*/ | |
105 | 105 | }); | |
106 | 106 | ||
107 | |||
108 | 107 | $('span.comments-button').click( function() { | |
109 | 108 | var guid = $(this).data('guid'); | |
109 | $('#throbber_'+guid).slideDown(); | ||
110 | 110 | $('#comments-button-'+guid).slideUp( function () { | |
111 | $('#comments-'+guid).slideDown(); | ||
112 | 111 | }); | |
113 | 112 | $.get('/_comments/'+guid, { resource_type:'{{resource_type}}' }, function ( data ) { | |
114 | 113 | $('#comments-'+guid).empty().append( data ); | |
114 | $('#throbber_'+guid).slideUp( | ||
115 | function() { | ||
116 | $('#comments-'+guid).slideDown(); | ||
117 | }); | ||
115 | 118 | $('#comment_form_'+guid).submit(onSubmit_Comment); | |
119 | initCollapse (guid); | ||
116 | 120 | }); | |
117 | 121 | }); | |
118 | 122 |
  | |||
2 | 2 | {% block view %} | |
3 | 3 | <div class="resource-form"> | |
4 | 4 | <div id="resource-form-title"> | |
5 | {{_('Submit failure report')}} | ||
5 | {{_('Report to developers: Activity failed to start!')}} | ||
6 | 6 | <div class="window-buttons"> | |
7 | 7 | <img id="cancel-button" class="button window-button" src="/static/icons/dialog-cancel.png" /> | |
8 | 8 | </div> | |
9 | 9 | </div> | |
10 | 10 | <form id="resource-form1" method="POST" action="/submit_report"> | |
11 | 11 | <div class="resource-form-field"> | |
12 | {{_('You may optionally comment failure conditions.')}}<br/> | ||
12 | {{_('You may also add a comment regarding failure conditions.')}}<br/> | ||
13 | 13 | <textarea name="content" class="resource-inputarea" ></textarea> | |
14 | 14 | <input type="hidden" name="context" value="{{context}}" /> | |
15 | 15 | <input type="hidden" name="implementation" value="{{implementation}}" /> | |
16 | 16 | <input type="hidden" name="filename" value="{{filename}}" /> | |
17 | 17 | </div> | |
18 | 18 | <div class="resource-form-field"> | |
19 | <input class="sugar-button" type="submit" id="submit" value="{{_('Send')}}" /> | ||
19 | <input class="sugar-button" type="submit" id="submit" value="{{_('Report')}}" /> | ||
20 | 20 | </div> | |
21 | 21 | </form> | |
22 | 22 | </div> |
  | |||
29 | 29 | <div id="submit-buttons"> | |
30 | 30 | <img class="question-button button" src="/static/icons/emblem-question.png" /> | |
31 | 31 | <br /> | |
32 | <img class="problem-button button" src="/static/icons/emblem-notification.png" /> | ||
33 | <br /> | ||
34 | 32 | <img class="idea-button button" src="/static/icons/emblem-charging.png" /> | |
33 | <br /> | ||
34 | <img class="problem-button button" src="/static/icons/emblem-notification.png" /> | ||
35 | 35 | </div> | |
36 | 36 | </div> | |
37 | 37 | <script type="text/javascript"> |
  | |||
2 | 2 | {% block view %} | |
3 | 3 | <div id="resource-buttons"> | |
4 | 4 | <img class="question-button button{%if resource=='questions' %} selected{% endif %}" src="/static/icons/emblem-question.png" alt="Es una pregunta"/> | |
5 | <img class="problem-button button{%if resource=='problems' %} selected{% endif %}" src="/static/icons/emblem-notification.png" alt="Es un problema" /> | ||
6 | 5 | <img class="idea-button button{%if resource=='ideas' %} selected{% endif %}" src="/static/icons/emblem-charging.png" alt="Es una idea" /> | |
6 | <img class="problem-button button{%if resource=='problems' %} selected{% endif %}" src="/static/icons/emblem-notification.png" alt="Es un problema" /> | ||
7 | 7 | </div> | |
8 | 8 | <div class="resource-list-scrollable" id="resource-list-scrollable"> | |
9 | 9 | <div class="items"> |
Binary files differ
  | |||
7 | 7 | msgstr "" | |
8 | 8 | "Project-Id-Version: PROJECT VERSION\n" | |
9 | 9 | "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | |
10 | "POT-Creation-Date: 2012-05-16 04:19-0500\n" | ||
10 | "POT-Creation-Date: 2012-05-16 22:56-0500\n" | ||
11 | 11 | "PO-Revision-Date: 2012-04-21 20:49-0500\n" | |
12 | 12 | "Last-Translator: Sebastian Silva <sebastian@sugarlabs.org>\n" | |
13 | 13 | "Language-Team: es <LL@li.org>\n" | |
… | … | ||
17 | 17 | "Content-Transfer-Encoding: 8bit\n" | |
18 | 18 | "Generated-By: Babel 0.9.6\n" | |
19 | 19 | ||
20 | #: app.py:204 | ||
20 | #: app.py:206 | ||
21 | 21 | msgid "zero results" | |
22 | 22 | msgstr "cero resultados" | |
23 | 23 | ||
24 | #: app.py:206 | ||
24 | #: app.py:208 | ||
25 | 25 | #, python-format | |
26 | 26 | msgid "page %(page)s of %(total)s" | |
27 | 27 | msgstr "página %(page)s de %(total)s" | |
28 | 28 | ||
29 | #: app.py:241 app.py:392 | ||
29 | #: app.py:243 app.py:397 | ||
30 | 30 | msgid "questions" | |
31 | 31 | msgstr "preguntas" | |
32 | 32 | ||
33 | #: app.py:244 app.py:395 | ||
33 | #: app.py:246 app.py:400 | ||
34 | 34 | msgid "problems" | |
35 | 35 | msgstr "problemas" | |
36 | 36 | ||
37 | #: app.py:247 app.py:398 | ||
37 | #: app.py:249 app.py:403 | ||
38 | 38 | msgid "ideas" | |
39 | 39 | msgstr "ideas" | |
40 | 40 | ||
41 | #: app.py:259 app.py:407 | ||
41 | #: app.py:261 app.py:412 | ||
42 | 42 | #, python-format | |
43 | 43 | msgid "browsing %(total)s %(resource_label)s" | |
44 | 44 | msgstr "navegando por %(total)s %(resource_label)s" | |
45 | 45 | ||
46 | #: app.py:303 | ||
46 | #: app.py:307 | ||
47 | 47 | #, python-format | |
48 | 48 | msgid "browsing %(total)s contexts" | |
49 | 49 | msgstr "navegando por %(total)s contextos" | |
50 | 50 | ||
51 | #: templates/_context-comment-list.html:22 | ||
52 | #, fuzzy | ||
51 | #: templates/_context-comment-list.html:23 | ||
53 | 52 | msgid "comment" | |
54 | msgstr "comentarios" | ||
53 | msgstr "comentar" | ||
55 | 54 | ||
56 | 55 | #: templates/_context-resource-list.html:40 | |
57 | #, fuzzy, python-format | ||
56 | #, python-format | ||
58 | 57 | msgid "" | |
59 | 58 | "No %(resource)s have been shared yet for this context.<br><br>Be the " | |
60 | 59 | "first to contribute with the community!" | |
… | … | ||
70 | 70 | "Aún no se han compartido %(resource)s en este contexto.<br><br>¡Se el " | |
71 | 71 | "primero en compartir con la comunidad!" | |
72 | 72 | ||
73 | #: templates/_context-solution-list.html:64 | ||
74 | msgid "Contribute" | ||
75 | msgstr "Contribuye" | ||
73 | #: templates/_context-solution-list.html:60 | ||
74 | msgid "contribute" | ||
75 | msgstr "contribuir" | ||
76 | 76 | ||
77 | 77 | #: templates/_resource-list.html:39 | |
78 | 78 | msgid "followers" | |
… | … | ||
86 | 86 | msgid "solutions" | |
87 | 87 | msgstr "soluciones" | |
88 | 88 | ||
89 | #: templates/browser-view.html:44 templates/context-view.html:144 | ||
89 | #: templates/browser-view.html:44 templates/context-view.html:160 | ||
90 | 90 | #: templates/resource-list.html:59 | |
91 | 91 | msgid "page '+new_page+' of" | |
92 | 92 | msgstr "página '+new_page+' de" | |
… | … | ||
104 | 104 | msgstr "Licencia" | |
105 | 105 | ||
106 | 106 | #: templates/report-form.html:5 | |
107 | msgid "Submit failure report" | ||
108 | msgstr "Enviar reporte de fallo" | ||
107 | msgid "Report to developers: Activity failed to start!" | ||
108 | msgstr "Reporte a desarrolladores: ¡La Actividad falló al iniciar!" | ||
109 | 109 | ||
110 | 110 | #: templates/report-form.html:12 | |
111 | msgid "You may optionally comment failure conditions." | ||
112 | msgstr "Opcionalmente deje un comentario sobre las condiciones del fallo." | ||
111 | msgid "You may also add a comment regarding failure conditions." | ||
112 | msgstr "Si lo deseas, deja un comentario sobre las condiciones del fallo." | ||
113 | 113 | ||
114 | #: templates/report-form.html:17 | ||
115 | msgid "Send" | ||
116 | msgstr "Enviar" | ||
114 | #: templates/report-form.html:19 | ||
115 | msgid "Report" | ||
116 | msgstr "Reportar" | ||
117 | 117 | ||
118 | 118 | #: templates/resource-form.html:5 | |
119 | 119 | msgid "Improve the system" | |
… | … | ||
134 | 134 | #: templates/toolbar.html:27 | |
135 | 135 | msgid "Work in progress." | |
136 | 136 | msgstr "En construcción." | |
137 | |||
138 | #~ msgid "Contribute a solution" | ||
139 | #~ msgstr "Contribuir solución" |