diff --git a/amadeus/static/css/themes/green.css b/amadeus/static/css/themes/green.css index 7374fee..ff25d02 100644 --- a/amadeus/static/css/themes/green.css +++ b/amadeus/static/css/themes/green.css @@ -370,7 +370,7 @@ a.add-row { } .resource_list > .disabled a { - color: #777; + color: #BDBDBD; } .resource_list > .list-group-item:hover { diff --git a/topics/models.py b/topics/models.py index c59c0dd..1d29234 100644 --- a/topics/models.py +++ b/topics/models.py @@ -77,3 +77,19 @@ class Resource(KnowsChild): @always_as_child def access_link(self): pass + + """ + Method to get the appropriated update link + Must override in the child models + """ + @always_as_child + def update_link(self): + pass + + """ + Method to get the appropriated delete link + Must override in the child models + """ + @always_as_child + def delete_link(self): + pass \ No newline at end of file diff --git a/topics/templates/resources/list.html b/topics/templates/resources/list.html new file mode 100644 index 0000000..24bf3cd --- /dev/null +++ b/topics/templates/resources/list.html @@ -0,0 +1,108 @@ +{% load static i18n pagination permissions_tags %} +{% load django_bootstrap_breadcrumbs %} + +{% subject_permissions request.user topic.subject as has_subject_permissions %} + +
+ {% for resource in topic.resource_topic.all %} + {% if resource.visible or has_subject_permissions %} +
+ + + + +

+ + {{ resource }} + +

+ + {% if has_subject_permissions %} + + {% endif %} +
+ {% autoescape off %} + {{ resource.brief_description }} + {% endautoescape %} +
+ {% endif %} + {% endfor %} +
+ \ No newline at end of file diff --git a/topics/templates/topics/list.html b/topics/templates/topics/list.html index 0b5c5d0..e15d1ab 100644 --- a/topics/templates/topics/list.html +++ b/topics/templates/topics/list.html @@ -59,7 +59,7 @@ {% endif %} - {% include 'webpages/list.html' with topic=topic %} + {% include 'resources/list.html' with topic=topic %} {% endif %} diff --git a/webpage/models.py b/webpage/models.py index 07aaccf..2234aeb 100644 --- a/webpage/models.py +++ b/webpage/models.py @@ -19,3 +19,9 @@ class Webpage(Resource): return 'webpages:window_view' return 'webpages:view' + + def update_link(self): + return 'webpages:update' + + def delete_link(self): + return 'webpages:delete' diff --git a/webpage/templates/webpages/list.html b/webpage/templates/webpages/list.html deleted file mode 100644 index c25c1ef..0000000 --- a/webpage/templates/webpages/list.html +++ /dev/null @@ -1,108 +0,0 @@ -{% load static i18n pagination permissions_tags %} -{% load django_bootstrap_breadcrumbs %} - -{% subject_permissions request.user topic.subject as has_subject_permissions %} - -
- {% for resource in topic.resource_topic.all %} - {% if resource.visible or has_subject_permissions %} -
- - - - -

- - {{ resource }} - -

- - {% if has_subject_permissions %} - - {% endif %} -
- {% autoescape off %} - {{ resource.brief_description }} - {% endautoescape %} -
- {% endif %} - {% endfor %} -
- \ No newline at end of file -- libgit2 0.21.2