Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar_network_webui/templates/_context-solution-list.html
blob: 086f62be137225c4e341d68cfacea802b02f3118 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
                <div>
                    <div class="icon-column">
                        <img src="/static/icons/sugar-xo.png"/>
                        <br/>
                        <img class="resource-button" src="/static/icons/button-{{resource['type']|special_str}}.png"/>
                    </div>
                    <div class="resource-header-column">
                        <div class="resource-title">
                        {{resource['title']}}
                        </div>
                        <div class="resource-content">
                        <pre>{{resource['content']}}</pre>
                        </div>
                        <div class='mtime'>
                        {% if (session['connected'] or False) %}
                            {{_('by %(author)s on %(date)s', author=resource['author'][0]['name'], date=resource['mtime']|timedelta)}}
                        {% else %}
                            {{_('by %(author)s on %(date)s', author=sugar_nick, date=resource['mtime']|timedelta)}}
                        {% endif %}
                        </div>
                        <div class="resource-meta">
                        {%- for tag in resource['tags'] %}
                            <span class="tag">{{tag}}</span>
                        {%- endfor %}
                        </div>
                        {%- if resource.is_author -%}
                        <!--span class="edit-button"
                            onclick="edit_resource( {{resource_type|tojson}},
                                                    {{resource["guid"]|tojson}},
                                                    {{resource["content"]|tojson}},
                                                    {{resource["title"]|tojson}} )" -->
                        <a href="{{ url_for('FeedbackView:edit' ,
                                                    resource_type=resource_type,
                                                    context=context["guid"],
                                                    context_name=context["title"],
                                                    resource=resource["guid"],
                                                    content=resource["content"],
                                                    title=resource["title"])}}" >
                            <span class="edit-button">
                                <img src="/static/icons/toolbar-edit.png" />
                            </span>
                        </a>
                        {%- endif -%}
                        <span class="comments-button has_tooltip"
                            title="{{_('comment')}}"
                            id="comments-button-{{resource['guid']}}"
                            data-document="feedback"
                            data-guid="{{resource['guid']}}">
                            <img src="/static/icons/comments.png" />
                        </span>
                        <img class="resource-throbber" id="throbber_{{resource['guid']}}" src="/static/images/throbber4.gif" />
                        <div class="comments" id="comments-{{resource['guid']}}"></div>
                    </div>
                </div>
                <hr />
                <ul class='generic-list'>
                {%- if not result %}
                <div class="notice">{{_('No %(resource)s have been shared yet for this context.<br><br>Be the first to share with the community!', resource=resource_label )}}
                </div>
                {%- endif %}
                {%- for item in result %}
                <li class="resource-list">
                    <div class="solution-content-column">
                        <img class="watermark" src="/static/icons/dialog-ok.png"/>
                        <div class="resource-content">
                        {{item['content']}}
                        </div>
                        <div class='mtime'>
                        {% if (session['connected'] or False) %}
                            {{_('by %(author)s on %(date)s', author=item['author'][0]['name'], date=item['mtime']|timedelta)}}
                        {% else %}
                            {{_('by %(author)s on %(date)s', author=sugar_nick, date=item['mtime']|timedelta)}}
                        {% endif %}
                        </div>
                        <div class="resource-meta">
                        {%- for tag in item['tags'] %}
                            <span class="tag">{{tag}}</span>
                        {%- endfor %}
                        </div>
                        {%- if item.is_author -%}
                        <span class="comments-button has_tooltip"
                            title="{{_('edit')}}"
                            onclick="edit_resource('solution',
                                            {{item["guid"]|tojson}},
                                            {{item["content"]|tojson}},
                                            false)">
                            <img src="/static/icons/toolbar-edit.png">
                            </img>
                            </span>
                        {%- endif -%}
                        <span class="comments-button has_tooltip"
                            title="{{_('comment')}}"
                            id="comments-button-{{item['guid']}}"
                            data-document="solution"
                            data-guid="{{item['guid']}}">
                            <img src="/static/icons/comments.png" />
                        </span>
                        <img class="resource-throbber" id="throbber_{{item['guid']}}" src="/static/images/throbber4.gif" />
                        <div class="comments" id="comments-{{item['guid']}}"></div>
                    </div>
                    <div class="icon-column">
                        <img src="/static/icons/sugar-xo.png"/>
                    </div>
                </li>
                {%- endfor %}
                </ul>
                <hr />
                <form id="solution-form" method="POST" data-guid="{{resource['guid']}}" action="/submit_solution">
                    <input type="hidden" name="resource_guid" value="{{resource['guid']}}" />
                    <input type="hidden" name="resource_type" value="{{resource_type}}" />
        {%- if (session['connected'] or False) -%}
                    <textarea id="textarea-solution" name="solution"></textarea>
                    <br />
                    <input id="contribute-button" class="sugar-button" type="submit" value="{{_('contribute a solution')}}" />
        {%- else -%}
                    <textarea id="textarea-solution" name="solution"></textarea>
                    <br />
                    <input id="contribute-button" class="sugar-button" type="submit" value="{{_('contribute a solution in offline mode')}}" />
        {%- endif -%}
                </form>
                <div id="mejorar-sistema">
                <!--img onclick="location='/new/resource?cursor_offset={{context_offset}}'" class="toolbar-icon white-button" src="/static/icons/list-add.png" /-->
                <img onclick="location='/feedback/new?context={{context['guid']}}'" class="toolbar-icon white-button has_tooltip_left" title="{{_('New question, idea or problem')}}" src="/static/icons/list-add.png" />
                </div>
                <script type="text/javascript">
                    $(document).ready( function() {
                        $('#bottom-palette').slideUp();
                    });
                </script>