Web · Wiki · Activities · Blog · Lists · Chat · Meeting · Bugs · Git · Translate · Archive · People · Donate

Commit df39a5fb646996202bc8fda6d540fbd1b0dc17e6

Fix comments functionality.
app/app.py
(5 / 3)
  
5454Solutions = client.Solution.cursor(
5555 reply=['guid', 'content', 'parent', 'author', 'tags'], order_by='-mtime')
5656Comments = client.Comment.cursor(
57 reply=['guid', 'message', 'tags', 'author'])
57 reply=['guid', 'message', 'tags', 'author', 'parent', 'parent_resource'])
5858
5959def get_colors():
6060 client = gconf.client_get_default()
273273 resource_type=resource_type)
274274
275275@app.route('/resource/contexts/<query>')
276@app.route('/resource/contexts/')
276277@app.route('/context/search/')
277278@app.route('/context/search/<query>')
278279@app.route('/context')
329329
330330@app.route('/_comments/<resource_guid>')
331331def 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
334335 if not result:
335336 result = []
336337 return render_template('_context-comment-list.html',
  
88msgstr ""
99"Project-Id-Version: PROJECT VERSION\n"
1010"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"
1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414"Language-Team: LANGUAGE <LL@li.org>\n"
1717"Content-Transfer-Encoding: 8bit\n"
1818"Generated-By: Babel 0.9.6\n"
1919
20#: app.py:204
20#: app.py:206
2121msgid "zero results"
2222msgstr ""
2323
24#: app.py:206
24#: app.py:208
2525#, python-format
2626msgid "page %(page)s of %(total)s"
2727msgstr ""
2828
29#: app.py:241 app.py:392
29#: app.py:243 app.py:397
3030msgid "questions"
3131msgstr ""
3232
33#: app.py:244 app.py:395
33#: app.py:246 app.py:400
3434msgid "problems"
3535msgstr ""
3636
37#: app.py:247 app.py:398
37#: app.py:249 app.py:403
3838msgid "ideas"
3939msgstr ""
4040
41#: app.py:259 app.py:407
41#: app.py:261 app.py:412
4242#, python-format
4343msgid "browsing %(total)s %(resource_label)s"
4444msgstr ""
4545
46#: app.py:303
46#: app.py:307
4747#, python-format
4848msgid "browsing %(total)s contexts"
4949msgstr ""
5050
51#: templates/_context-comment-list.html:22
51#: templates/_context-comment-list.html:23
5252msgid "comment"
5353msgstr ""
5454
6666"first to share with the community!"
6767msgstr ""
6868
69#: templates/_context-solution-list.html:64
70msgid "Contribute"
69#: templates/_context-solution-list.html:60
70msgid "contribute"
7171msgstr ""
7272
7373#: templates/_resource-list.html:39
8282msgid "solutions"
8383msgstr ""
8484
85#: templates/browser-view.html:44 templates/context-view.html:144
85#: templates/browser-view.html:44 templates/context-view.html:160
8686#: templates/resource-list.html:59
8787msgid "page '+new_page+' of"
8888msgstr ""
100100msgstr ""
101101
102102#: templates/report-form.html:5
103msgid "Submit failure report"
103msgid "Report to developers: Activity failed to start!"
104104msgstr ""
105105
106106#: templates/report-form.html:12
107msgid "You may optionally comment failure conditions."
107msgid "You may also add a comment regarding failure conditions."
108108msgstr ""
109109
110#: templates/report-form.html:17
111msgid "Send"
110#: templates/report-form.html:19
111msgid "Report"
112112msgstr ""
113113
114114#: templates/resource-form.html:5
  
2020input {
2121 border: 2px solid #282828;
2222 }
23textarea {
24 resize: none;
25 }
2326
2427.notice {
2528 font-size:13pt;
173173 width: 300px;
174174 display:none;
175175 }
176span.comment-content {
176div.comment-content {
177177 color: #808080;
178178 }
179179.comment-author {
180180 float: right;
181181 }
182182
183li.comment-resource-list {
184 width: 340px;
185 clear: both;
186 text-align: left;
187 }
188
183189.half {
190 float: left;
184191 width: 27px;
185192 height: 27px;
193 padding: 5px;
186194 }
187195
188196li.resource-list + li.resource-list {
373373 width: 100%;
374374 text-align: center;
375375 }
376.resource-throbber {
377 display:none;
378 }
376379
377380#mejorar-sistema {
378381 position: fixed;
503503 }
504504div.comment-content-column {
505505 padding: 10px 0px 0px 40px;
506 float: left;
507506 width: 100%;
508507 margin: 5px;
509508 position: relative;
600600
601601#textarea-solution {
602602 border: 3px solid #c0c0c0;
603 text-indent: 5px;
604603 margin-top:10px;
605604 width: 400px;
606605 height: 100px;
607606}
607
608608#textarea-comment {
609609 border: 2px solid #c0c0c0;
610 text-indent: 5px;
611 margin:10px 30px;
610 margin: 10px 70px 0px;
612611 width: 280px;
613 height: 25px;
612 height: 3em;
614613}
615614.comment-form {
616615 margin-left: 10px;
617616 }
618617.comment-button {
618 margin-left: 240px;
619 margin-bottom: 20px;
620 }
621
622span.collapse-button {
619623 position: absolute;
620 overflow: hidden;
624 bottom: 0px;
621625 right: 0px;
622 bottom: 14px;
626 }
627span.collapse-button:hover {
628 background-color: #808080;
629 border-radius: 15px;
630 cursor:pointer;
631 }
632img.collapse-icon {
633 width:27;
634 height:27px;
623635 }
624636
625637.sugar-button {
Binary files differ
  
11 {%- for item in result %}
2 <li class="resource-list">
2 <li class="comment-resource-list">
33 <div class="comment-content-column">
44 <div class="resource-content">
55 {%- if item['author'] %}
66 <img class="half" src="/static/icons/sugar-xo.png" />
77 {%- endif %}
8 <span class="comment-content">{{item['message']}}</span>
8 <div class="comment-content">{{item['message']}}</div>
99 </div>
1010 <div class="resource-meta">
1111 {%- for tag in item['tags'] %}
1515 </div>
1616 </li>
1717 {%- endfor %}
18 <img class="resource-throbber" id="comment_throbber_{{resource_guid}}" src="/static/images/throbber4.gif" />
1819 <form id="comment_form_{{resource_guid}}" class="comment-form" data-guid="{{resource_guid}}" method="POST" action="/submit_comment">
1920 <input type="hidden" name="resource_guid" value="{{resource_guid}}" />
2021 <input type="hidden" name="resource_type" value="solution" />
2122 <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')}}" />
2324 </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>
  
4040 data-guid="{{item['guid']}}">
4141 <img src="/static/icons/comments.png" />
4242 </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" />
4844 <div class="comments" id="comments-{{item['guid']}}"></div>
4945 </div>
5046 <div class="icon-column">
5252 {%- endfor %}
5353 </ul>
5454 <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">
5656 <input type="hidden" name="resource_guid" value="{{resource['guid']}}" />
5757 <input type="hidden" name="resource_type" value="{{resource_type}}" />
5858 <textarea id="textarea-solution" name="solution"></textarea>
5959 <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')}}" />
6161 </form>
  
5959 {%- endblock view %}
6060 {%- block script %}
6161 {{ 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.
6271 function onSubmit_Comment (e) {
6372 e.preventDefault();
6473 var guid = $(this).data('guid');
6574 $('#comment_form_'+guid).slideUp();
66 $('.comment-button').slideUp();
75 $('#comment_button_'+guid).slideUp();
76 $('#comment_throbber_'+guid).slideDown();
6777 $.post( '/submit_comment',
6878 $(this).serialize(),
6979 function(response) {
7080 $.get('/_comments/'+guid,
7181 { resource_type:'{{resource_type}}' }, function ( data ) {
82 $('#comment_throbber_'+guid).slideUp();
7283 $('#comments-'+guid).empty().append( data );
7384 $('#comment_form_'+guid).submit(onSubmit_Comment);
85 initCollapse (guid);
7486 });
7587 });
7688 };
104104 /* $('#contribute-button').attr("disabled", "disabled");*/
105105 });
106106
107
108107 $('span.comments-button').click( function() {
109108 var guid = $(this).data('guid');
109 $('#throbber_'+guid).slideDown();
110110 $('#comments-button-'+guid).slideUp( function () {
111 $('#comments-'+guid).slideDown();
112111 });
113112 $.get('/_comments/'+guid, { resource_type:'{{resource_type}}' }, function ( data ) {
114113 $('#comments-'+guid).empty().append( data );
114 $('#throbber_'+guid).slideUp(
115 function() {
116 $('#comments-'+guid).slideDown();
117 });
115118 $('#comment_form_'+guid).submit(onSubmit_Comment);
119 initCollapse (guid);
116120 });
117121 });
118122
  
22{% block view %}
33<div class="resource-form">
44 <div id="resource-form-title">
5 {{_('Submit failure report')}}
5 {{_('Report to developers: Activity failed to start!')}}
66 <div class="window-buttons">
77 <img id="cancel-button" class="button window-button" src="/static/icons/dialog-cancel.png" />
88 </div>
99 </div>
1010 <form id="resource-form1" method="POST" action="/submit_report">
1111 <div class="resource-form-field">
12 {{_('You may optionally comment failure conditions.')}}<br/>
12 {{_('You may also add a comment regarding failure conditions.')}}<br/>
1313 <textarea name="content" class="resource-inputarea" ></textarea>
1414 <input type="hidden" name="context" value="{{context}}" />
1515 <input type="hidden" name="implementation" value="{{implementation}}" />
1616 <input type="hidden" name="filename" value="{{filename}}" />
1717 </div>
1818 <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')}}" />
2020 </div>
2121 </form>
2222</div>
  
2929 <div id="submit-buttons">
3030 <img class="question-button button" src="/static/icons/emblem-question.png" />
3131 <br />
32 <img class="problem-button button" src="/static/icons/emblem-notification.png" />
33 <br />
3432 <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" />
3535 </div>
3636</div>
3737<script type="text/javascript">
  
22 {% block view %}
33 <div id="resource-buttons">
44 <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" />
65 <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" />
77 </div>
88 <div class="resource-list-scrollable" id="resource-list-scrollable">
99 <div class="items">
  
77msgstr ""
88"Project-Id-Version: PROJECT VERSION\n"
99"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"
1111"PO-Revision-Date: 2012-04-21 20:49-0500\n"
1212"Last-Translator: Sebastian Silva <sebastian@sugarlabs.org>\n"
1313"Language-Team: es <LL@li.org>\n"
1717"Content-Transfer-Encoding: 8bit\n"
1818"Generated-By: Babel 0.9.6\n"
1919
20#: app.py:204
20#: app.py:206
2121msgid "zero results"
2222msgstr "cero resultados"
2323
24#: app.py:206
24#: app.py:208
2525#, python-format
2626msgid "page %(page)s of %(total)s"
2727msgstr "página %(page)s de %(total)s"
2828
29#: app.py:241 app.py:392
29#: app.py:243 app.py:397
3030msgid "questions"
3131msgstr "preguntas"
3232
33#: app.py:244 app.py:395
33#: app.py:246 app.py:400
3434msgid "problems"
3535msgstr "problemas"
3636
37#: app.py:247 app.py:398
37#: app.py:249 app.py:403
3838msgid "ideas"
3939msgstr "ideas"
4040
41#: app.py:259 app.py:407
41#: app.py:261 app.py:412
4242#, python-format
4343msgid "browsing %(total)s %(resource_label)s"
4444msgstr "navegando por %(total)s %(resource_label)s"
4545
46#: app.py:303
46#: app.py:307
4747#, python-format
4848msgid "browsing %(total)s contexts"
4949msgstr "navegando por %(total)s contextos"
5050
51#: templates/_context-comment-list.html:22
52#, fuzzy
51#: templates/_context-comment-list.html:23
5352msgid "comment"
54msgstr "comentarios"
53msgstr "comentar"
5554
5655#: templates/_context-resource-list.html:40
57#, fuzzy, python-format
56#, python-format
5857msgid ""
5958"No %(resource)s have been shared yet for this context.<br><br>Be the "
6059"first to contribute with the community!"
7070"Aún no se han compartido %(resource)s en este contexto.<br><br>¡Se el "
7171"primero en compartir con la comunidad!"
7272
73#: templates/_context-solution-list.html:64
74msgid "Contribute"
75msgstr "Contribuye"
73#: templates/_context-solution-list.html:60
74msgid "contribute"
75msgstr "contribuir"
7676
7777#: templates/_resource-list.html:39
7878msgid "followers"
8686msgid "solutions"
8787msgstr "soluciones"
8888
89#: templates/browser-view.html:44 templates/context-view.html:144
89#: templates/browser-view.html:44 templates/context-view.html:160
9090#: templates/resource-list.html:59
9191msgid "page '+new_page+' of"
9292msgstr "página '+new_page+' de"
104104msgstr "Licencia"
105105
106106#: templates/report-form.html:5
107msgid "Submit failure report"
108msgstr "Enviar reporte de fallo"
107msgid "Report to developers: Activity failed to start!"
108msgstr "Reporte a desarrolladores: ¡La Actividad falló al iniciar!"
109109
110110#: templates/report-form.html:12
111msgid "You may optionally comment failure conditions."
112msgstr "Opcionalmente deje un comentario sobre las condiciones del fallo."
111msgid "You may also add a comment regarding failure conditions."
112msgstr "Si lo deseas, deja un comentario sobre las condiciones del fallo."
113113
114#: templates/report-form.html:17
115msgid "Send"
116msgstr "Enviar"
114#: templates/report-form.html:19
115msgid "Report"
116msgstr "Reportar"
117117
118118#: templates/resource-form.html:5
119119msgid "Improve the system"
134134#: templates/toolbar.html:27
135135msgid "Work in progress."
136136msgstr "En construcción."
137
138#~ msgid "Contribute a solution"
139#~ msgstr "Contribuir solución"