Commit 93f86bd3c9537d484658de8dccfa7432f55f851d
- Diff rendering mode:
- inline
- side by side
app/app.py
(101 / 39)
  | |||
46 | 46 | offline_client = Client('~') | |
47 | 47 | ||
48 | 48 | Contexts = client.Context.cursor( | |
49 | reply=['guid', 'title', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime') | ||
49 | reply=['guid', 'type', 'title', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime') | ||
50 | 50 | offline_Contexts = offline_client.Context.cursor(keep_impl=2, | |
51 | reply=['guid', 'title', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime') | ||
51 | reply=['guid', 'type', 'title', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime') | ||
52 | Activities = client.Context.cursor(type='activity', | ||
53 | reply=['guid', 'type', 'title', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime') | ||
54 | offline_Activities = offline_client.Context.cursor(type='activity', keep_impl=2, | ||
55 | reply=['guid', 'type', 'title', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime') | ||
56 | Applications = client.Context.cursor(type='application', | ||
57 | reply=['guid', 'type', 'title', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime') | ||
58 | offline_Applications = offline_client.Context.cursor(type='application', keep_impl=2, | ||
59 | reply=['guid', 'type', 'title', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime') | ||
60 | Articles = client.Context.cursor(type='article', | ||
61 | reply=['guid', 'type', 'title', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime') | ||
62 | offline_Articles = offline_client.Context.cursor(type='article', keep_impl=2, | ||
63 | reply=['guid', 'type', 'title', 'description', 'keep', 'keep_impl', 'mtime'], order_by='-mtime') | ||
52 | 64 | autocomplete_Contexts = client.Context.cursor( | |
53 | 65 | reply=['guid', 'title'], order_by='-mtime') | |
54 | 66 | autocomplete_offline_Contexts = offline_client.Context.cursor(keep_impl=2, | |
55 | 67 | reply=['guid', 'title'], order_by='-mtime') | |
56 | Questions = client.Question.cursor( | ||
57 | reply=['guid', 'title', 'content', 'context', 'author', 'user', 'tags', 'mtime'], order_by='-mtime') | ||
58 | Problems = client.Problem.cursor( | ||
59 | reply=['guid', 'title', 'content', 'context', 'author', 'user', 'tags', 'mtime'], order_by='-mtime') | ||
60 | Ideas = client.Idea.cursor( | ||
61 | reply=['guid', 'title', 'content', 'context', 'author', 'user', 'tags', 'mtime'], order_by='-mtime') | ||
68 | Questions = client.Feedback.cursor(type="question", | ||
69 | reply=['guid', 'type', 'title', 'content', 'context', 'author', 'user', 'tags', 'mtime'], order_by='-mtime') | ||
70 | Problems = client.Problem.cursor(type="problem", | ||
71 | reply=['guid', 'type', 'title', 'content', 'context', 'author', 'user', 'tags', 'mtime'], order_by='-mtime') | ||
72 | Ideas = client.Idea.cursor(type="idea", | ||
73 | reply=['guid', 'type', 'title', 'content', 'context', 'author', 'user', 'tags', 'mtime'], order_by='-mtime') | ||
62 | 74 | Solutions = client.Solution.cursor( | |
63 | 75 | reply=['guid', 'content', 'parent', 'author', 'user', 'tags', 'mtime'], order_by='-mtime') | |
64 | 76 | Comments = client.Comment.cursor( | |
65 | 77 | reply=['guid', 'message', 'tags', 'author', 'user' ,'parent', 'parent_resource', 'mtime']) | |
66 | Reviews = client.Review.cursor( | ||
67 | reply=['guid', 'content', 'context', 'author', 'user', 'tags', 'mtime'], order_by='-mtime') | ||
78 | Reviews = client.Review.cursor(type="review", | ||
79 | reply=['guid', 'type', 'content', 'context', 'author', 'user', 'tags', 'mtime'], order_by='-mtime') | ||
68 | 80 | ||
69 | 81 | @babel.localeselector | |
70 | 82 | def get_locale(): | |
… | … | ||
103 | 103 | def inject_colors(): | |
104 | 104 | # Here we can inject variables into every template call | |
105 | 105 | stroke,fill = get_colors() | |
106 | userid = sugar.uid() | ||
107 | return dict(stroke=stroke, fill=fill, userid=userid) | ||
106 | |||
107 | mounts = [] | ||
108 | for mount in Client.mounts(): | ||
109 | if mount == '~': | ||
110 | name = _("Home") | ||
111 | elif mount == '/': | ||
112 | name = _("Library") | ||
113 | else: | ||
114 | name = mount | ||
115 | mounts.append({ 'name': name, | ||
116 | 'value': mount }) | ||
117 | kwvar = { | ||
118 | 'userid': sugar.uid(), | ||
119 | 'mounts': mounts | ||
120 | } | ||
108 | 121 | ||
122 | return dict(stroke=stroke, fill=fill, **kwvar) | ||
123 | |||
109 | 124 | @app.before_request | |
110 | 125 | def before_request(): | |
111 | 126 | if 'connected' not in session: | |
… | … | ||
128 | 128 | if not session['connected']: | |
129 | 129 | g.client = offline_client | |
130 | 130 | g.Contexts = offline_Contexts | |
131 | g.Applications = offline_Applications | ||
132 | g.Activities= offline_Activities | ||
133 | g.Articles = offline_Articles | ||
131 | 134 | g.autocomplete_Contexts = autocomplete_offline_Contexts | |
132 | 135 | else: | |
133 | 136 | g.client = client | |
134 | 137 | g.Contexts = Contexts | |
138 | g.Applications = Applications | ||
139 | g.Activities= Activities | ||
140 | g.Articles = Articles | ||
135 | 141 | g.autocomplete_Contexts = autocomplete_Contexts | |
136 | 142 | ||
137 | 143 | @app.route('/') | |
… | … | ||
150 | 150 | session['connected'] = False | |
151 | 151 | else: | |
152 | 152 | session['connected'] = True | |
153 | |||
154 | # Palette mount selector | ||
155 | if request.args.get('select')=='~': | ||
156 | session['connected'] = False | ||
157 | if request.args.get('select')=='/': | ||
158 | session['connected'] = True | ||
153 | 159 | return redirect(url_for('context_grid')) | |
154 | 160 | ||
155 | 161 | @app.route('/context/icon/<context_guid>') | |
156 | 162 | def gen_icon(context_guid): | |
157 | type=request.path.split('/')[2] | ||
163 | type=request.args.get('type') or session['current_type'] | ||
158 | 164 | offset=int(request.args.get('cursor_offset') or 0) | |
159 | if offset: | ||
160 | context=g.Contexts[offset] | ||
165 | if offset and type: | ||
166 | if type in ['activity']: | ||
167 | context_cursor = g.Activities | ||
168 | elif type in ['application']: | ||
169 | context_cursor = g.Applications | ||
170 | elif type in ['article']: | ||
171 | context_cursor = g.Articles | ||
172 | else: #type in [None, '', 'all']: | ||
173 | context_cursor = g.Contexts | ||
174 | context=context_cursor[offset] | ||
161 | 175 | else: | |
162 | 176 | context=g.client.Context(context_guid) | |
163 | 177 | def download(context): | |
164 | with context.get_blob(type) as icon: | ||
178 | with context.get_blob('icon') as icon: | ||
165 | 179 | if icon.closed: | |
166 | 180 | icon=app.open_resource('static/icons/document-generic.png') | |
167 | 181 | while True: | |
… | … | ||
187 | 187 | header.add("Content-Type", "image/png") | |
188 | 188 | return Response(download(context), headers=header, direct_passthrough=True) | |
189 | 189 | ||
190 | @app.route('/templates/<path:filename>') | ||
191 | def download_file(filename): | ||
192 | return send_from_directory(app.root_path + '/templates', | ||
193 | filename, as_attachment=True) | ||
194 | |||
195 | 190 | @app.route('/launch/<context_guid>') | |
196 | 191 | def launch(context_guid): | |
197 | 192 | #workaround in 0.3 : non-activity contexts | |
… | … | ||
220 | 220 | implementation=request.args.get('implementation') or '', | |
221 | 221 | filename=request.args.get('filename') or '') | |
222 | 222 | ||
223 | |||
224 | 223 | @app.route('/favorites') | |
225 | 224 | def favorites(): | |
226 | 225 | if session.get('favorites-filter'): | |
… | … | ||
297 | 297 | return jsonify(keep_impl=keep_impl) | |
298 | 298 | ||
299 | 299 | def paginate(resource, full_query, _PAGE_SIZE=6, page=1, context=None): | |
300 | """ This function attempts to query SN resources and | ||
301 | return a specific page of result items. """ | ||
300 | 302 | r = [] | |
301 | 303 | ||
302 | 304 | resource.update_filter(full_query, context=context) | |
… | … | ||
338 | 338 | @app.route('/resource') | |
339 | 339 | def resource_list(query=None): | |
340 | 340 | """ | |
341 | Resource Browser (list) | ||
341 | Feedback Resource Browser (list) | ||
342 | 342 | """ | |
343 | 343 | page=request.args.get('page') | |
344 | 344 | if page: | |
… | … | ||
413 | 413 | session.modified = True | |
414 | 414 | except KeyError: | |
415 | 415 | return redirect(url_for('context_grid', | |
416 | type=request.args.get('type'), | ||
416 | 417 | query=query, page=session.get('page',1))) | |
417 | 418 | ||
418 | 419 | #try: | |
… | … | ||
424 | 424 | if query: | |
425 | 425 | terms.append(query) | |
426 | 426 | ||
427 | type=request.args.get('type') or session.get('current_type') | ||
428 | if type in ['activity']: | ||
429 | context_cursor = g.Activities | ||
430 | resource_label=_('activities') | ||
431 | elif type in ['application']: | ||
432 | context_cursor = g.Applications | ||
433 | resource_label=_('applications') | ||
434 | elif type in ['article']: | ||
435 | context_cursor = g.Articles | ||
436 | resource_label=_('articles') | ||
437 | else: # type in [None, '', 'all']: | ||
438 | context_cursor = g.Contexts | ||
439 | resource_label=_('contexts') | ||
440 | session['current_type']=type | ||
441 | |||
427 | 442 | full_query = join(terms, " AND ") | |
428 | 443 | ||
429 | 444 | try: | |
430 | r, total_pages, total, info = paginate(g.Contexts, full_query, page=page) | ||
445 | r, total_pages, total, info = paginate(context_cursor, full_query, page=page) | ||
431 | 446 | except KeyError: | |
432 | 447 | return redirect(url_for('context_grid',resource_type='context', | |
433 | 448 | query=query, page=1)) | |
434 | 449 | ||
435 | meta = _("browsing %(total)s contexts", total=total) | ||
450 | meta = _("browsing %(total)s %(label)s", total=total, label=resource_label) | ||
436 | 451 | ||
437 | 452 | stroke, fill = get_colors() | |
438 | 453 | if '_pjax' in request.args: | |
… | … | ||
456 | 456 | template='browser-view.html' | |
457 | 457 | return render_template(template, total=total, meta=meta, resource_type='context', | |
458 | 458 | query=query, total_pages=total_pages, fill=fill, | |
459 | result=r, type='context', info=info, page=page) | ||
459 | result=r, type=type, info=info, page=page) | ||
460 | 460 | ||
461 | 461 | @app.route('/user/search/') | |
462 | 462 | @app.route('/user/search/<query>') | |
… | … | ||
465 | 465 | """ | |
466 | 466 | Users Grid | |
467 | 467 | """ | |
468 | #result = fakeserver.questions() | ||
469 | 468 | result = client.User.cursor(query) | |
470 | 469 | return render_template('users-grid.html',query=query, | |
471 | 470 | result=result, type='user') | |
… | … | ||
584 | 584 | ||
585 | 585 | offset=int(request.args.get('cursor_offset') or 0) | |
586 | 586 | if offset: | |
587 | context=g.Contexts[offset] | ||
587 | context=resource_cursor[offset] | ||
588 | 588 | else: | |
589 | 589 | context=g.client.Context(context_guid, reply=['guid', 'title', 'description', 'keep', 'keep_impl']) | |
590 | 590 | try: | |
… | … | ||
650 | 650 | resource['content'] = request.form['content'] | |
651 | 651 | resource['title'] = request.form['title'] | |
652 | 652 | resource['context'] = request.form['guid'] | |
653 | resource['type'] = resource_type | ||
653 | 654 | if resource['title']: | |
654 | 655 | resource.post() | |
655 | 656 | resource_cursor._reset() | |
656 | 657 | return redirect('/context/%ss/%s' % (resource_type, resource['context'])) | |
657 | 658 | ||
659 | @app.route('/submit_context', methods=['POST']) | ||
660 | def new_context(): | ||
661 | context=client.Context() | ||
662 | context['type'] = ['article'] | ||
663 | context['title'] = request.form['title'] | ||
664 | context['summary'] = request.form['summary'] | ||
665 | context['description'] = request.form['content'] | ||
666 | context.post() | ||
667 | Contexts._reset() | ||
668 | return redirect(url_for('context_grid', page=1, type='articles')) | ||
669 | |||
658 | 670 | @app.route('/submit_solution', methods=['POST']) | |
659 | 671 | def new_solution(): | |
660 | 672 | solution=client.Solution() | |
… | … | ||
682 | 682 | def new_review(): | |
683 | 683 | review=client.Review() | |
684 | 684 | review['content'] = request.form['review'] | |
685 | review['title'] = '' | ||
686 | review['type'] = 'review' | ||
685 | 687 | context = review['context'] = request.form['resource_guid'] | |
686 | 688 | if review['content']: | |
687 | 689 | review.post() | |
… | … | ||
757 | 757 | return 'Take off every Zig' | |
758 | 758 | ||
759 | 759 | if __name__=="__main__": | |
760 | import sugar_network_server as server | ||
761 | import restful_document | ||
762 | from gevent.wsgi import WSGIServer | ||
763 | |||
764 | #client.api_url.value = \ | ||
765 | # 'http://%s:%s' % (server.host.value, server.port.value) | ||
766 | #client.api_url.value = \ | ||
767 | # 'http://api.network.sugarlabs.org:8000' | ||
768 | client.api_url.value = 'http://18.85.44.120:8000' | ||
769 | #client.api_url.value = \ | ||
770 | # 'http://localhost:8000' | ||
771 | 760 | host = '0.0.0.0' #'0.0.0.0' for all | |
772 | 761 | ||
773 | 762 | try: | |
… | … | ||
764 | 764 | except IndexError: | |
765 | 765 | port=5000 | |
766 | 766 | ||
767 | #from gevent.wsgi import WSGIServer | ||
767 | 768 | #http_server = WSGIServer((host, port), app) | |
768 | 769 | #http_server.serve_forever() | |
769 | 770 | app.debug = True |
app/static/css/browser.css
(28 / 4)
  | |||
64 | 64 | vertical-align: middle; | |
65 | 65 | z-index: 100; | |
66 | 66 | } | |
67 | .tooltip { | ||
68 | background-color: #000000; | ||
69 | border: 2px solid #808080; | ||
70 | display: none; | ||
71 | z-index: 110; | ||
72 | line-height: 2em; | ||
73 | } | ||
74 | .menu-option{ | ||
75 | padding: 10px 20px; | ||
76 | } | ||
77 | .menu-option:hover { | ||
78 | background-color: #808080; | ||
79 | } | ||
80 | hr.menu-separator { | ||
81 | border: 0px; | ||
82 | border-top: 2px solid #808080; | ||
83 | } | ||
67 | 84 | ||
68 | 85 | #query { | |
69 | 86 | height: 28px; | |
… | … | ||
571 | 571 | height: 300px; | |
572 | 572 | z-index: 110; | |
573 | 573 | border-radius: 15px; | |
574 | -moz-border-radius: 15px; | ||
575 | -webkit-border-radius: 15px; | ||
574 | /*-moz-border-radius: 15px; | ||
575 | -webkit-border-radius: 15px;*/ | ||
576 | 576 | border: 2px solid #282828; | |
577 | 577 | } | |
578 | |||
579 | div#summary_section { | ||
580 | height: 0px; | ||
581 | padding: 0px; | ||
582 | overflow: hidden; | ||
583 | } | ||
584 | |||
578 | 585 | #edit-form { | |
579 | 586 | padding: 20px; | |
580 | 587 | position: absolute; | |
… | … | ||
758 | 758 | color: white; | |
759 | 759 | background-color: #282828; | |
760 | 760 | padding-left:50px; | |
761 | border-top-left-radius: 15px; | ||
762 | border-top-right-radius: 15px; | ||
761 | border-top-left-radius: 10px; | ||
762 | border-top-right-radius: 10px; | ||
763 | 763 | } | |
764 | 764 | #resource-form-title { | |
765 | 765 | font-weight: bold; |
app/static/icons/go-up.png
(7 / 0)
Binary files differ
app/static/icons/go-up.svg
(8 / 0)
  | |||
1 | <?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [ | ||
2 | <!ENTITY stroke_color "#010101"> | ||
3 | <!ENTITY fill_color "#FFFFFF"> | ||
4 | ]><svg enable-background="new 0 0 55.125 55" height="55px" version="1.1" viewBox="0 0 55.125 55" width="55.125px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px"><g display="block" id="go-up"> | ||
5 | <g display="inline"> | ||
6 | <path d="M27.5,5C15.073,5,5,15.073,5,27.5C5,39.928,15.073,50,27.5,50S50,39.928,50,27.5 C50,15.073,39.927,5,27.5,5z M37.906,32.275c-0.626,0.624-1.447,0.939-2.271,0.939c-0.821,0-1.645-0.315-2.271-0.939l-5.84-5.833 l-5.657,5.802c-0.63,0.645-1.464,0.967-2.3,0.967c-0.808,0-1.62-0.305-2.246-0.914c-1.266-1.238-1.295-3.271-0.056-4.546 l7.929-8.126c0.002,0,0.002,0,0.003,0c0.01-0.011,0.015-0.021,0.022-0.028c0.116-0.115,0.245-0.208,0.371-0.302 c0.039-0.028,0.071-0.064,0.111-0.093c0.114-0.075,0.24-0.133,0.36-0.194c0.068-0.035,0.131-0.078,0.2-0.107 c0.1-0.039,0.203-0.064,0.306-0.093c0.099-0.032,0.191-0.068,0.292-0.09c0.083-0.018,0.169-0.018,0.251-0.028 c0.122-0.015,0.244-0.033,0.366-0.036c0.071,0,0.147,0.014,0.219,0.021c0.133,0.007,0.266,0.011,0.395,0.036 c0.075,0.014,0.146,0.043,0.223,0.064c0.123,0.035,0.251,0.061,0.373,0.111c0.082,0.032,0.161,0.082,0.243,0.121 c0.106,0.055,0.216,0.104,0.316,0.165c0.084,0.058,0.159,0.13,0.238,0.194c0.086,0.064,0.176,0.122,0.255,0.201 c0.005,0.003,0.009,0.011,0.013,0.014c0.007,0.004,0.011,0.008,0.014,0.011l8.142,8.13C39.162,28.981,39.166,31.014,37.906,32.275 z" fill="&fill_color;"/> | ||
7 | </g> | ||
8 | </g></svg> |
app/templates/base.html
(72 / 4)
  | |||
1 | 1 | <!DOCTYPE HTML> | |
2 | 2 | <head> | |
3 | 3 | <meta charset="UTF-8" /> | |
4 | <title></title> | ||
4 | <title>{{_('Welcome to Sugar Network')}}</title> | ||
5 | 5 | <script src="/static/js/jquery.tools.min.js"></script> | |
6 | <!-- history.js used to support older browsers --!> | ||
7 | 6 | <script src="/static/js/jquery.history.js"></script> | |
8 | 7 | <script src="/static/js/jquery-ui-1.8.16.sugar.min.js" type="text/javascript"></script> | |
9 | 8 | <link rel="stylesheet" href="/static/css/browser.css" type="text/css" /> | |
… | … | ||
68 | 68 | </div> | |
69 | 69 | <form id="resource-form1" method="POST" action="/submit_resource"> | |
70 | 70 | <div class="resource-form-field"> | |
71 | {{_('Title')}}<br/> | ||
71 | <span id="title_label">{{_('Title')}}</span><br/> | ||
72 | 72 | <input name="guid" type="hidden" value="{{session['last_context']}}" /> | |
73 | 73 | <input onkeypress="return event.keyCode != 13;" name="title" class="resource-input" type="text"/> | |
74 | 74 | <input id="resource_type" name="resource_type" type="hidden" value="" /> | |
75 | 75 | <input id="href" name="href" type="hidden" value="" /> | |
76 | 76 | <input id="edit_guid" name="edit_guid" type="hidden" value="" /> | |
77 | 77 | </div> | |
78 | <div class="resource-form-field" id="summary_section"> | ||
79 | <span id="summary_label">{{_('Summary')}}</span><br/> | ||
80 | <input onkeypress="return event.keyCode != 13;" name="summary" class="resource-input" type="text"/> | ||
81 | </div> | ||
78 | 82 | <div class="resource-form-field"> | |
79 | 83 | <span id="details_label">{{_('Details')}}</span><br/> | |
80 | 84 | <textarea name="content" class="resource-inputarea" ></textarea> | |
… | … | ||
94 | 94 | </div> | |
95 | 95 | <script type="text/javascript"> | |
96 | 96 | {%- block script %} | |
97 | var oldh; | ||
98 | var oldw; | ||
99 | |||
97 | 100 | (function(window,undefined){ | |
98 | 101 | // Prepare History.js | |
99 | 102 | var History = window.History; // Note: We are using a capital H instead of a lower h | |
… | … | ||
107 | 107 | } | |
108 | 108 | })(window); | |
109 | 109 | ||
110 | function new_context(resource_type, guid, content, title) { | ||
111 | dialog = $('#mejorar-sistema-form'); | ||
112 | oldh = dialog.css('height'); | ||
113 | oldw = dialog.css('width'); | ||
114 | dialog.css('height', '450px'); | ||
115 | dialog.css('width', '700px'); | ||
116 | $('#summary_section').css('height', '73px'); | ||
117 | $('#summary_section').css('padding', '7px 20px'); | ||
118 | $('#dialog-title').empty().append('{{_("Create new context")}}'); | ||
119 | $('#title_label').empty().append('{{_("Name")}}'); | ||
120 | $('#details_label').empty().append('{{_("Article (optional)")}}'); | ||
121 | $('textarea.resource-inputarea').css('height', '170px'); | ||
122 | dialog.expose({ | ||
123 | closeOnClick: false, | ||
124 | onBeforeClose: function(event) { | ||
125 | dialog.fadeOut( | ||
126 | function () { | ||
127 | dialog.css('height', oldh); | ||
128 | dialog.css('width', oldw); | ||
129 | $('#title_label').empty().append('{{_("Title")}}'); | ||
130 | $('#details_label').empty().append('{{_("Details")}}'); | ||
131 | $('#summary_section').css('height', '0px'); | ||
132 | $('#summary_section').css('padding', '0px 0px'); | ||
133 | $('textarea.resource-inputarea').css('height', '100px'); | ||
134 | } | ||
135 | ); | ||
136 | } | ||
137 | }); | ||
138 | dialog.fadeIn(); | ||
139 | $('input.resource-input').val(title); | ||
140 | $('input#resource_type').val(resource_type); | ||
141 | $('input#edit_guid').val(guid); | ||
142 | $('input#href').val(location.href); | ||
143 | $('input.resource-input').focus(); | ||
144 | $('textarea.resource-inputarea').val(content); | ||
145 | |||
146 | $('#submit-buttons').hide(); | ||
147 | $('#accept-button').show(); | ||
148 | if (title==false) { | ||
149 | $('input.resource-input').parent().hide(); | ||
150 | $('#details_label').hide(); | ||
151 | $('input.resource-input').val(''); | ||
152 | } | ||
153 | else { | ||
154 | $('#details_label').show(); | ||
155 | $('input.resource-input').parent().show(); | ||
156 | } | ||
157 | $('#accept-button').click( function () { | ||
158 | $("#resource-form1").attr('action', '/submit_context'); | ||
159 | $("#resource-form1").submit(); | ||
160 | $('#mejorar-sistema-form').fadeOut(); | ||
161 | }); | ||
162 | |||
163 | $('#cancel-button').click( function () { | ||
164 | $('#mejorar-sistema-form').fadeOut(); | ||
165 | $.mask.close(); | ||
166 | }); | ||
167 | } | ||
168 | |||
110 | 169 | function edit_resource(resource_type, guid, content, title) { | |
111 | 170 | dialog = $('#mejorar-sistema-form'); | |
112 | $('#dialog-title').empty().append(' '); | ||
171 | $('#dialog-title').empty().append('{{_("Edit resource")}}'); | ||
113 | 172 | dialog.expose({ | |
114 | 173 | closeOnClick: false, | |
115 | 174 | onBeforeClose: function(event) { | |
… | … | ||
378 | 378 | } | |
379 | 379 | $(document).ready( function() { | |
380 | 380 | bind_del(); | |
381 | $( "#sn-button" ).tooltip({position:"bottom right", offset:[-3,-60], predelay:500}); | ||
382 | $( "#browser-button" ).tooltip({position:"bottom right", offset:[-3,-60], predelay:500}); | ||
383 | $( "#list-button" ).tooltip({position:"bottom right", offset:[-3,-60], predelay:500}); | ||
381 | 384 | $( "#query" ).autocomplete({ | |
382 | 385 | source: "/query", | |
383 | 386 | dataType: "json", |
  | |||
67 | 67 | <h2 class="current">{{_('Description')}}</h2> | |
68 | 68 | <div class="pane" style="display:block">{{context['description']}}</div> | |
69 | 69 | ||
70 | <h2>{{_('Owner(s)')}}</h2> | ||
70 | <h2>{{_('Author(s)')}}</h2> | ||
71 | 71 | <div class="pane"> | |
72 | 72 | <div id="sugar-man"> | |
73 | 73 | <img class="grid-icon" src="/static/icons/sugar-xo.png" /> |
app/templates/toolbar.html
(47 / 22)
  | |||
1 | <div id="palette"> | ||
2 | <span id="tags-section"> | ||
3 | <span id="back-button" onclick="history.back();">{{_('Atrás')}}</span> | ||
4 | <span id="location">{{meta}}</span> | ||
5 | {%- for tag in session.tags %} | ||
6 | <span class="tag">{{tag}}</span> | ||
7 | {%- endfor %} | ||
8 | </span> | ||
9 | </div> | ||
1 | 10 | <div id="toolbar"> | |
2 | 11 | <ul class="toolbar-bar"> | |
3 | <li class="toolbar-items" onclick="location='/_toggle_connect'"> | ||
4 | <div> | ||
12 | <li class="toolbar-items"> | ||
13 | <div id="sn-button" onclick="location='/_toggle_connect'"> | ||
5 | 14 | {% if (session['connected'] or False) %} | |
6 | 15 | <img class="toolbar-icon sugar-network-online" src="/static/icons/sugar-network.png" /> | |
7 | 16 | {% else %} | |
8 | 17 | <img class="toolbar-icon" src="/static/icons/sugar-network.png" /> | |
9 | 18 | {% endif %} | |
10 | 19 | </div> | |
20 | <div id="sn-tooltip" class="tooltip"> | ||
21 | {%- for item in mounts -%} | ||
22 | <div class="menu-option" onclick="location='/_toggle_connect?select={{item['mount']}}'">{{item['name']}}</div> | ||
23 | {%- endfor -%} | ||
24 | </div> | ||
11 | 25 | </li> | |
12 | 26 | <!--li class="toolbar-items" onclick="location='/favorites'"> | |
13 | 27 | <div> | |
… | … | ||
30 | 30 | </div> | |
31 | 31 | </li--> | |
32 | 32 | <!--li class="toolbar-items" onclick="location='/new/resource'"--> | |
33 | <li class="toolbar-items" onclick="improve_the_system('{{session.get('last_context')}}')"> | ||
33 | <li class="toolbar-items"> | ||
34 | <div id="browser-button" onclick="location='/context?type=all'"> | ||
35 | <img class="toolbar-icon" src="/static/icons/insert-table.png" /> | ||
36 | </div> | ||
37 | <div id="browser-tooltip" class="tooltip"> | ||
38 | <div class="menu-option" onclick="location='/context?type=article'">{{_('Articles')}}</div> | ||
39 | <div class="menu-option" onclick="location='/context?type=application'">{{_('Applications')}}</div> | ||
40 | <div class="menu-option" onclick="location='/context?type=activity'">{{_('Activities')}}</div> | ||
41 | <hr class="menu-separator"/> | ||
42 | <div class="menu-option" onclick="location='/context?type=all'">{{_('All')}}</div> | ||
43 | </div> | ||
44 | </li> | ||
45 | <li class="toolbar-items"> | ||
46 | <div id="list-button" onclick="location='/resource'"> | ||
47 | <img class="toolbar-icon" src="/static/icons/view-list.png" /> | ||
48 | </div> | ||
49 | <div id="browser-tooltip" class="tooltip"> | ||
50 | <div class="menu-option" onclick="location='/resource/questions'">{{_('Questions')}}</div> | ||
51 | <div class="menu-option" onclick="location='/resource/ideas'">{{_('Ideas')}}</div> | ||
52 | <div class="menu-option" onclick="location='/resource/problems'">{{_('Problems')}}</div> | ||
53 | <div class="menu-option" onclick="location='/resource/reviews'">{{_('Reviews')}}</div> | ||
54 | <hr class="menu-separator"/> | ||
55 | <div class="menu-option" onclick="location='/resource'">{{_('All')}}</div> | ||
56 | </div> | ||
57 | </li> | ||
58 | <li class="toolbar-items" onclick='alert("{% trans %}Work in progress.{% endtrans %}")'> | ||
34 | 59 | <div> | |
35 | <img class="toolbar-icon" src="/static/icons/list-add.png" /> | ||
60 | <img class="toolbar-icon" src="/static/icons/sugar-xo.png" /> | ||
36 | 61 | </div> | |
37 | 62 | </li> | |
38 | 63 | <li class="toolbar-items"> | |
… | … | ||
67 | 67 | <input id="query" name="terms" value="{{query or ''}}"> | |
68 | 68 | </div> | |
69 | 69 | </li> | |
70 | <li class="toolbar-items" onclick="location='/context'"> | ||
70 | <li class="toolbar-items" onclick="improve_the_system('{{session.get('last_context')}}')"> | ||
71 | 71 | <div> | |
72 | <img class="toolbar-icon" src="/static/icons/insert-table.png" /> | ||
72 | <img class="toolbar-icon" src="/static/icons/list-add.png" /> | ||
73 | 73 | </div> | |
74 | 74 | </li> | |
75 | <li class="toolbar-items" onclick="location='/resource'"> | ||
75 | <li class="toolbar-items" onclick="new_context('{{session.get('last_context')}}')"> | ||
76 | 76 | <div> | |
77 | <img class="toolbar-icon" src="/static/icons/view-list.png" /> | ||
77 | <img class="toolbar-icon" src="/static/icons/go-up.png" /> | ||
78 | 78 | </div> | |
79 | 79 | </li> | |
80 | <li class="toolbar-items" onclick='alert("{% trans %}Work in progress.{% endtrans %}")'> | ||
81 | <div> | ||
82 | <img class="toolbar-icon" src="/static/icons/sugar-xo.png" /> | ||
83 | </div> | ||
84 | </li> | ||
85 | 80 | </ul> | |
86 | </div> | ||
87 | <div id="palette"> | ||
88 | <span id="tags-section"> | ||
89 | <span id="back-button" onclick="history.back();">{{_('Atrás')}}</span> | ||
90 | <span id="location">{{meta}}</span> | ||
91 | {%- for tag in session.tags %} | ||
92 | <span class="tag">{{tag}}</span> | ||
93 | {%- endfor %} | ||
94 | </span> | ||
95 | 81 | </div> |
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-06-27 23:00-0500\n" | ||
10 | "POT-Creation-Date: 2012-07-01 19:01-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" | |
… | … | ||
21 | 21 | msgid "MMMM d, yyyy" | |
22 | 22 | msgstr "d 'de' MMMM 'de' 2012" | |
23 | 23 | ||
24 | #: app.py:277 | ||
24 | #: app.py:98 | ||
25 | msgid "Home" | ||
26 | msgstr "Hogar" | ||
27 | |||
28 | #: app.py:100 | ||
29 | msgid "Library" | ||
30 | msgstr "Biblioteca" | ||
31 | |||
32 | #: app.py:299 | ||
25 | 33 | msgid "zero results" | |
26 | 34 | msgstr "cero resultados" | |
27 | 35 | ||
28 | #: app.py:279 | ||
36 | #: app.py:301 | ||
29 | 37 | #, python-format | |
30 | 38 | msgid "page %(page)s of %(total)s" | |
31 | 39 | msgstr "página %(page)s de %(total)s" | |
32 | 40 | ||
33 | #: app.py:316 app.py:509 | ||
41 | #: app.py:338 app.py:530 | ||
34 | 42 | msgid "questions" | |
35 | 43 | msgstr "preguntas" | |
36 | 44 | ||
37 | #: app.py:319 app.py:512 | ||
45 | #: app.py:341 app.py:533 | ||
38 | 46 | msgid "problems" | |
39 | 47 | msgstr "problemas" | |
40 | 48 | ||
41 | #: app.py:322 app.py:515 | ||
49 | #: app.py:344 app.py:536 | ||
42 | 50 | msgid "ideas" | |
43 | 51 | msgstr "ideas" | |
44 | 52 | ||
45 | #: app.py:325 app.py:450 | ||
53 | #: app.py:347 app.py:471 | ||
46 | 54 | msgid "reviews" | |
47 | 55 | msgstr "reseñas" | |
48 | 56 | ||
49 | #: app.py:338 app.py:524 | ||
57 | #: app.py:360 app.py:545 | ||
50 | 58 | #, python-format | |
51 | 59 | msgid "browsing %(total)s %(resource_label)s" | |
52 | 60 | msgstr "navegando por %(total)s %(resource_label)s" | |
53 | 61 | ||
54 | #: app.py:354 | ||
62 | #: app.py:376 | ||
55 | 63 | msgid "Error" | |
56 | 64 | msgstr "Error" | |
57 | 65 | ||
58 | #: app.py:356 | ||
66 | #: app.py:378 | ||
59 | 67 | msgid "Object not found." | |
60 | msgstr "Objeto no encontrado.\"" | ||
68 | msgstr "Objeto no encontrado." | ||
61 | 69 | ||
62 | #: app.py:391 | ||
70 | #: app.py:413 | ||
63 | 71 | #, python-format | |
64 | 72 | msgid "browsing %(total)s contexts" | |
65 | 73 | msgstr "navegando por %(total)s contextos" | |
… | … | ||
128 | 128 | "Aún no se han compartido %(resource)s en este contexto.<br><br>¡Se el " | |
129 | 129 | "primero en compartir con la comunidad!" | |
130 | 130 | ||
131 | #: templates/_context-review-list.html:42 | ||
131 | #: templates/_context-review-list.html:52 | ||
132 | 132 | msgid "contribute a review" | |
133 | 133 | msgstr "contribuir una reseña" | |
134 | 134 | ||
135 | #: templates/_context-solution-list.html:79 | ||
135 | #: templates/_context-solution-list.html:89 | ||
136 | 136 | msgid "contribute a solution" | |
137 | 137 | msgstr "contribuir una solución" | |
138 | 138 | ||
139 | #: templates/base.html:54 templates/base.html:134 | ||
139 | #: templates/base.html:4 | ||
140 | msgid "Welcome to Sugar Network" | ||
141 | msgstr "Bienvenido(a) a Red Azúcar" | ||
142 | |||
143 | #: templates/base.html:63 templates/base.html:192 | ||
140 | 144 | #: templates/resource-form.html:5 | |
141 | 145 | msgid "Improve the system" | |
142 | 146 | msgstr "Mejorar el sistema" | |
143 | 147 | ||
144 | #: templates/base.html:54 templates/base.html:134 | ||
148 | #: templates/base.html:63 templates/base.html:192 | ||
145 | 149 | msgid "Sugar Network" | |
146 | 150 | msgstr "Red Azúcar" | |
147 | 151 | ||
148 | #: templates/base.html:62 templates/resource-form.html:21 | ||
152 | #: templates/base.html:71 templates/resource-form.html:21 | ||
149 | 153 | msgid "Title" | |
150 | 154 | msgstr "Título" | |
151 | 155 | ||
152 | #: templates/base.html:70 templates/resource-form.html:25 | ||
156 | #: templates/base.html:79 templates/resource-form.html:25 | ||
153 | 157 | msgid "Details" | |
154 | 158 | msgstr "Detalles" | |
155 | 159 | ||
160 | #: templates/base.html:105 | ||
161 | msgid "Create new context" | ||
162 | msgstr "Crear nuevo contexto" | ||
163 | |||
164 | #: templates/base.html:145 | ||
165 | msgid "Edit resource" | ||
166 | msgstr "Editar recurso" | ||
167 | |||
156 | 168 | #: templates/browser-view.html:51 templates/context-view.html:198 | |
157 | 169 | #: templates/resource-list.html:75 | |
158 | 170 | msgid "page '+new_page+' of" | |
… | … | ||
175 | 175 | msgstr "Descripción" | |
176 | 176 | ||
177 | 177 | #: templates/context-view.html:70 | |
178 | msgid "Owner(s)" | ||
179 | msgstr "Dueño(s)" | ||
178 | msgid "Author(s)" | ||
179 | msgstr "Autor(es)" | ||
180 | 180 | ||
181 | 181 | #: templates/context-view.html:77 | |
182 | 182 | msgid "License" | |
… | … | ||
198 | 198 | msgid "Context" | |
199 | 199 | msgstr "Contexto" | |
200 | 200 | ||
201 | #: templates/toolbar.html:41 | ||
202 | msgid "Work in progress." | ||
203 | msgstr "En construcción." | ||
204 | |||
205 | #: templates/toolbar.html:50 | ||
201 | #: templates/toolbar.html:3 | ||
206 | 202 | msgid "Atrás" | |
207 | 203 | msgstr "" | |
204 | |||
205 | #: templates/toolbar.html:43 | ||
206 | msgid "Work in progress." | ||
207 | msgstr "En construcción." |