Commit 7361d66ecfc3bd9c80dbdb31bb158b01b96d6895

Authored by Zambom
1 parent 55e6ca7a

Adding invisible resource style

amadeus/static/css/base/amadeus.css
... ... @@ -786,6 +786,10 @@ a.add-row {
786 786 margin: 0px;
787 787 }
788 788  
  789 +.resource_list > .disabled a {
  790 + cursor: not-allowed;
  791 +}
  792 +
789 793 .resource_list a:hover, .resource_list a:focus {
790 794 text-decoration: none;
791 795 }
792 796 \ No newline at end of file
... ...
amadeus/static/css/themes/green.css
... ... @@ -361,6 +361,18 @@ a.add-row {
361 361 border: 1px solid #ddd;
362 362 }
363 363  
  364 +.resource_list > .disabled {
  365 + background-color: #eee;
  366 +}
  367 +
  368 +.resource_list > .disabled:hover {
  369 + background-color: #eee !important;
  370 +}
  371 +
  372 +.resource_list > .disabled a {
  373 + color: #777;
  374 +}
  375 +
364 376 .resource_list > .list-group-item:hover {
365 377 background: #F5F5F5;
366 378 }
... ... @@ -373,6 +385,10 @@ a.add-row {
373 385 color: #CCCCCC;
374 386 }
375 387  
  388 +.resource_list .category-card-items .dropdown-menu i {
  389 + color: #333;
  390 +}
  391 +
376 392 .resource_list a {
377 393 color: inherit;
378 394 }
... ...
webpage/templates/webpages/list.html
1 1 {% load static i18n pagination permissions_tags %}
2 2 {% load django_bootstrap_breadcrumbs %}
3 3  
  4 +{% subject_permissions request.user topic.subject as has_subject_permissions %}
  5 +
4 6 <div id="resource_{{ topic.slug }}" class="list-group resource_list">
5 7 {% for resource in topic.resource_topic.all %}
6   - <div class="list-group-item">
7   - <input type="hidden" class="id_inp" name="id" value="{{ resource.id }}" />
8   - <input type="hidden" class="order_inp" name="order" value="{{ resource.order }}" />
9   - <input type="hidden" class="url_order" value="{% url 'topics:update_resource_order' %}" />
  8 + {% if resource.visible or has_subject_permissions %}
  9 + <div class="list-group-item {% if not resource.visible %}disabled{% endif %}">
  10 + <input type="hidden" class="id_inp" name="id" value="{{ resource.id }}" />
  11 + <input type="hidden" class="order_inp" name="order" value="{{ resource.order }}" />
  12 + <input type="hidden" class="url_order" value="{% url 'topics:update_resource_order' %}" />
  13 +
  14 + <h4 class="pull-left list-group-item-heading">
  15 + <a href="{% url resource.access_link resource.slug %}" class="resource_link" {% if resource.show_window %}target="_blank"{% endif %}>
  16 + {{ resource }}
  17 + </a>
  18 + </h4>
10 19  
11   - <h4 class="pull-left list-group-item-heading">
12   - <a href="{% url resource.access_link resource.slug %}" class="resource_link" {% if resource.show_window %}target="_blank"{% endif %}>
13   - {{ resource }}
14   - </a>
15   - </h4>
16   - <div class="pull-right category-card-items">
17   - <a><i class="fa fa-arrows" aria-hidden="true"></i></a>
18   - <span class="btn-group">
19   - <a href="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
20   - <i class="fa fa-ellipsis-v" aria-hidden="true"></i>
21   - </a>
22   - <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="moreResources">
23   - <li><a href="{% url 'topics:update' subject.slug topic.slug %}"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i>{% trans 'Edit' %}</a></li>
24   - <li><a href="javascript:delete_topic('{% url 'topics:delete' topic.slug %}')"><i class="fa fa-trash fa-fw" aria-hidden="true"></i>{% trans 'Remove' %}</a></li>
25   - </ul>
26   - </span>
27   - </div>
28   - <br clear="all" />
29   - {% autoescape off %}
30   - {{ resource.brief_description }}
31   - {% endautoescape %}
32   - </div>
  20 + {% if has_subject_permissions %}
  21 + <div class="pull-right category-card-items">
  22 + <a><i class="fa fa-arrows" aria-hidden="true"></i></a>
  23 + <span class="btn-group">
  24 + <a href="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  25 + <i class="fa fa-ellipsis-v" aria-hidden="true"></i>
  26 + </a>
  27 + <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="moreResources">
  28 + <li><a href="{% url 'topics:update' subject.slug topic.slug %}"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i>{% trans 'Edit' %}</a></li>
  29 + <li><a href="javascript:delete_topic('{% url 'topics:delete' topic.slug %}')"><i class="fa fa-trash fa-fw" aria-hidden="true"></i>{% trans 'Remove' %}</a></li>
  30 + </ul>
  31 + </span>
  32 + </div>
  33 + {% endif %}
  34 + <br clear="all" />
  35 + {% autoescape off %}
  36 + {{ resource.brief_description }}
  37 + {% endautoescape %}
  38 + </div>
  39 + {% endif %}
33 40 {% endfor %}
34 41 </div>
35 42 <script type="text/javascript">
... ...