summaryrefslogtreecommitdiff
path: root/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/course.html
blob: bed3a68c6d894fd5e7ae6c15e067a927198023b3 (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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
{% extends "ndf/base.html" %}
{% load i18n %}
{% load ndf_tags %}
{% load pagination_tags %}
{% get_group_name groupid as group_name_tag %}

{% block title %} {{title}} {% endblock %}

{% block help_content %}
<p>{% blocktrans %} "About Course... <em>Coming soon..</em>" {% endblocktrans %}</p>
{% endblock %}


{% block meta_content %}

  <a href="{% url course_gst.name|lower group_name_tag %}">
    <h2 class="subheader">
      {% if course_gst.altnames and course_gst.altnames != "None" %}
        {{course_gst.altnames}}
      {% else %}
        {{course_gst.name}}
      {% endif%}
    </h2>
    {{course_gst.content|default_if_none:""|safe}}
  </a>

  {% if user.is_authenticated %}
    {% user_access_policy groupid request.user as user_access %}
    {% if user_access == "allow" %}
      <a class="small button" href="{% url 'create_edit' group_name_tag %}">
        <span class="fi-plus">&nbsp;&nbsp; {% trans "New" %} {{title}} </span>
      </a>
      <a class="small publish-btn button" style="width:73%" href="{% url 'ann_course_create_edit' group_id app_id app_set_id %}">{% trans "Announce" %}</a>
    {% endif %}
  {% endif %}
{% endblock %}


{% block search_content %}
  {% include "ndf/node_search_base.html" %}
{% endblock %}


{% block related_content %}
{% endblock %}


{% block body_content %}

    <header class="row" data-tab data-options="deep_linking:true">
    <dl class="tabs " data-tab role="tablist">
    {% if user.is_authenticated %}
      {% user_access_policy groupid request.user as user_access %}
      {% if user_access == "allow" %}
          <dd class="tab-title active" role="presentational" ><a href="#panel2-1" role="tab" tabindex="0" aria-selected="true" controls="panel2-1">{% trans "All Courses" %}</a></dd>
          <dd class="tab-title" role="presentational" ><a href="#panel2-2" role="tab" tabindex="0"aria-selected="false" controls="panel2-2">{% trans "Courses" %}</a></dd>
      {% else %}
          <dd class="tab-title active" role="presentational"><a href="#panel2-4" role="tab" tabindex="0" aria-selected="false" controls="panel2-4">{% trans "My Courses" %}</a></dd>
      {% endif %}    
      <dd class="tab-title" role="presentational"><a href="#panel2-3" role="tab" tabindex="0" aria-selected="false" controls="panel2-3">{% trans "Announced Courses" %}</a></dd>
    {% else %}
      <dd class="tab-title active" role="presentational"><a href="#panel2-3" role="tab" tabindex="0" aria-selected="false" controls="panel2-3">{% trans "Announced Courses" %}</a></dd>
    {% endif %}    
    </dl>
    </header>

    <div class="tabs-content small-block-grid-1 medium-block-grid-2 large-block-grid-4">
    {% if user.is_authenticated %}

      {% user_access_policy groupid request.user as user_access %}
      {% if user_access == "allow" %}
          <section role="tabpanel" aria-hidden="false" class="content active small-block-grid-1 medium-block-grid-2 large-block-grid-4" id="panel2-1">
            {% for course in all_course_coll %}

              <li class="card">
                {% if course.status == "DRAFT" %}
                  <div class="draft course">
                {% elif course.status == "PUBLISHED" %}
                  <div class="published course">
                {% endif %}

                  <a href="{% url 'course_detail' group_name_tag course %}">
                    <div class="row">
                      <div class="small-8 column">
                        <b>{{course.name}}</b>
                        {% if course.status == "PUBLISHED" %}
                        <span data-tooltip title="Announced Course"><i class="fi-volume"></i></span>
                        {% endif %}
                      </div>
                    </div>
                    <hr/>
                    <span style="font-size:12px;">{{ course.html_content|default_if_none:"Add some description."|safe|striptags|truncatechars:75 }}</span><br/>
                  </a>

                    <footer>
                      <div class="age">
                        {{ course.member_of_names_list|join:', ' }} created {{course.created_at|timesince}} ago 
                        <br/>
                        by <a class="user" href="{% url 'dashboard' course.created_by %}" data-gnow="">{{course.user_details_dict.created_by}}</a> 
                      </div>
                      <span><strong>{{course.contributors|length}}</strong> Contributor{{course.contributors|pluralize}}</span>
                    </footer>

                  <div class="label-list small-12 columns">
                    {% for tag in course.tags|slice:":3" %}
                    <a href="{% url 'tag_info' group_name_tag tag %}">
                      <span class="label" style="background-color:yellow">{{tag}}</span>
                    </a>{% endfor %}
                  </div>
                    <span style="font-size:12px;">{{ node.html_content|default_if_none:"Add some description."|safe|striptags|truncatechars:75 }}</span><br/>
                </div>
              </li>        

            {% empty %}
                <div class="row">
                  <div class="small-12 columns">
                    <h5>
                     {% blocktrans %}
                          This group doesn't have any courses. <b>Be the first to create a course!</b>
                          {% endblocktrans %}
                    </h5>
                  </div>
                </div>
            
            {% endfor %}
          </section>
      
          <section role="tabpanel" aria-hidden="true" class="content small-block-grid-1 medium-block-grid-2 large-block-grid-4" id="panel2-2">
              {% for course in course_coll %}
                <li class="card">
                  {% if course.status == "DRAFT" %}
                    <div class="draft course">
                  {% elif course.status == "PUBLISHED" %}
                    <div class="published course">
                  {% endif %}

                    <a href="{% url 'course_detail' group_name_tag course %}">
                      <div class="row">
                        <div class="small-8 column">
                          <b>{{course.name}}
                          </b>
                        </div>
                      </div>
                      <hr/>
                      <span style="font-size:12px;">{{ course.html_content|default_if_none:"Add some description."|safe|striptags|truncatechars:75 }}</span><br/>
                    </a>

                      <footer>
                        <div class="age">
                          {{ course.member_of_names_list|join:', ' }} created {{course.created_at|timesince}} ago 
                          <br/>
                          by <a class="user" href="{% url 'dashboard' course.created_by %}" data-gnow="">{{course.user_details_dict.created_by}}</a> 
                        </div>
                        <span><strong>{{course.contributors|length}}</strong> Contributor{{course.contributors|pluralize}}</span>
                      </footer>

                    <div class="label-list small-12 columns">
                      {% for tag in course.tags|slice:":3" %}
                      <a href="{% url 'tag_info' group_name_tag tag %}">
                        <span class="label" style="background-color:yellow">{{tag}}</span>
                      </a>{% endfor %}
                    </div>
                      <span style="font-size:12px;">{{ node.html_content|default_if_none:"Add some description."|safe|striptags|truncatechars:75 }}</span><br/>
                  </div>
                </li>        

              {% empty %}
                  <div class="row">
                    <div class="small-12 columns">
                      <h5>
                       {% blocktrans %}
                            This group doesn't have any courses. <b>Be the first to create a course!</b>
                            {% endblocktrans %}
                      </h5>
                    </div>
                  </div>
              
              {% endfor %}
          </section>
      {% else %}
          <section role="tabpanel" aria-hidden="true" class="content active small-block-grid-1 medium-block-grid-2 large-block-grid-4" id="panel2-4">
              {% for course in enrolled_course_coll %}
                <li class="card">
                  {% if course.status == "DRAFT" %}
                    <div class="draft course">
                  {% elif course.status == "PUBLISHED" %}
                    <div class="published course">
                  {% endif %}

                    <a href="{% url 'course_detail' group_name_tag course %}">
                      <div class="row">
                        <div class="small-8 column">
                          <b>{{course.name}}
                          </b>
                        </div>
                      </div>
                      <hr/>
                      <span style="font-size:12px;">{{ course.html_content|default_if_none:"Add some description."|safe|striptags|truncatechars:75 }}</span><br/>
                    </a>

                      <footer>
                        <div class="age">
                          {{ course.member_of_names_list|join:', ' }} created {{course.created_at|timesince}} ago 
                          <br/>
                          by <a class="user" href="{% url 'dashboard' course.created_by %}" data-gnow="">{{course.user_details_dict.created_by}}</a> 
                        </div>
                        <span><strong>{{course.contributors|length}}</strong> Contributor{{course.contributors|pluralize}}</span>
                      </footer>

                    <div class="label-list small-12 columns">
                      {% for tag in course.tags|slice:":3" %}
                      <a href="{% url 'tag_info' group_name_tag tag %}">
                        <span class="label" style="background-color:yellow">{{tag}}</span>
                      </a>{% endfor %}
                    </div>
                      <span style="font-size:12px;">{{ node.html_content|default_if_none:"Add some description."|safe|striptags|truncatechars:75 }}</span><br/>
                  </div>
                </li>        

              {% empty %}
                  <div class="row">
                    <div class="small-12 columns">
                      <h5>
                        {% blocktrans %}
                          You are not enrolled to any course yet.
                        {% endblocktrans %}
                      </h5>
                    </div>
                  </div>
              
              {% endfor %}
          
          </section> 
      {% endif %}
    

      <section role="tabpanel" aria-hidden="true" class="content small-block-grid-1 medium-block-grid-2 large-block-grid-4" id="panel2-3">
    {% else %}
      <section role="tabpanel" aria-hidden="true" class="active content small-block-grid-1 medium-block-grid-2 large-block-grid-4" id="panel2-3">
    {% endif %}  
          {% for course in ann_course_coll %}
            <li class="card">
                <div class="published course">
                <a href="{% url 'course_detail' group_name_tag course %}">
                  <div class="row">
                    <div class="small-8 column">
                      <b>{{course.name}}
                      </b>
                    </div>
                  </div>
                  <span data-tooltip title="Announced Course"><i class="fi-volume"></i></span>
                  <hr/>
                  <span style="font-size:12px;">{{ course.html_content|default_if_none:"Add some description."|safe|striptags|truncatechars:75 }}</span><br/>
                </a>

                  <footer>
                    <div class="age">
                      {{ course.member_of_names_list|join:', ' }} created {{course.created_at|timesince}} ago 
                      <br/>
                      by <a class="user" href="{% url 'dashboard' course.created_by %}" data-gnow="">{{course.user_details_dict.created_by}}</a> 
                    </div>
                    <span><strong>{{course.contributors|length}}</strong> Contributor{{course.contributors|pluralize}}</span>
                  </footer>

                <div class="label-list small-12 columns">
                  {% for tag in course.tags|slice:":3" %}
                  <a href="{% url 'tag_info' group_name_tag tag %}">
                    <span class="label" style="background-color:yellow">{{tag}}</span>
                  </a>{% endfor %}
                </div>
                  <span style="font-size:12px;">{{ node.html_content|default_if_none:"Add some description."|safe|striptags|truncatechars:75 }}</span><br/>
              </div>
            </li>        

          {% empty %}
              <div class="row">
                <div class="small-12 columns">
                  <h5>
                    {% if user_access == "allow" %}
                      {% blocktrans %}
                        This group doesn't have any Announced courses. <b>Be the first to Announce a course!</b>
                      {% endblocktrans %}
                    {% else %}
                      {% blocktrans %}
                        This group doesn't have any Announced courses.
                      {% endblocktrans %}
                    {% endif %}
                  </h5>
                </div>
              </div>
          
          {% endfor %}
      </section>

    
    </div>


  {% paginate %}

{% endblock %}


{% block document_ready %}
  {{block.super}}
  {% if not user.is_authenticated %}
    $(".my_courses_class").removeClass("active")
    $(".ann_course_class").addClass("active")
  {% endif %}
{% endblock %}