Skip to content

Commit

Permalink
Add "Manage Detail" view
Browse files Browse the repository at this point in the history
Next edit and display the column
  • Loading branch information
cpina committed Aug 19, 2020
1 parent 8eefcd0 commit 50c4afb
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% if value %}{{ value }}{% else %}-{% endif %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends 'management/_base_with_sidebar.html' %}

{% block title %}Datapackage detail{% endblock %}
{% block main_contents %}
<h1>Datapackage detail</h1>
<strong>Name:</strong> {% include 'core/_value-or-dash.tmpl' with value=schema.name %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ <h1>List of schemas</h1>
<td>
<a href="{% url 'schema-detail' uuid=schema.uuid %}" class="btn btn-primary btn-sm active">View</a>
<a href="{% url 'datapackage-ui' %}?load={{ schema.uuid }}" class="btn btn-primary btn-sm active">Edit</a>
<a href="{% url 'management:datapackage-manage' uuid=schema.uuid %}"
class="btn btn-primary btn-sm active">Manage</a>
<a href="{% url 'management:datapackage-detail' pk=schema.pk %}"
class="btn btn-primary btn-sm active">View Manage</a>
</td>
</tr>
{% endfor %}
Expand Down
3 changes: 2 additions & 1 deletion SchemaCollaboration/management/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@

path('person/<int:pk>/', views.PersonDetail.as_view(), name='person-detail'),

path('datapackage/manage/<uuid:uuid>', views.DatapackageManage.as_view(), name='datapackage-manage'),
path('datapackage/<int:pk>/', views.DatapackageDetail.as_view(), name='datapackage-detail'),
path('datapackage/<uuid:uuid>/edit/', views.DatapackageUpdate.as_view(), name='datapackage-update'),
]
24 changes: 24 additions & 0 deletions SchemaCollaboration/management/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,27 @@ class DatapackageManage(View):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
return context


class SchemaMixin():
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['sidebar_active'] = 'people'
return context


class DatapackageDetail(SchemaMixin, DetailView):
model = Schema
template_name = 'management/datapackage-detail.tmpl'

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)

context['breadcrumb'] = [{'name': 'Datapackage', 'url': reverse('management:list-schemas')},
{'name': 'Detail'}]

return context


class DatapackageUpdate(SchemaMixin, DetailView):
pass

0 comments on commit 50c4afb

Please sign in to comment.