Skip to content

Commit

Permalink
new detail view for source (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
csae8092 authored Jul 13, 2024
1 parent 8a7bc2d commit 6278951
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 152 deletions.
2 changes: 1 addition & 1 deletion shps/templates/shps/shape_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h1 class="display-5 text-center">
<i class="bi bi-chat-left-quote modalpointer fs-1" title="How to quote this page"
data-bs-toggle="modal" data-bs-target="#howToQuoteModal">
</i>
</a>
</button>
{% if user.is_authenticated %}
<small>
<a href="{% url 'shapes:shape_edit' pk=object.id %}">
Expand Down
186 changes: 84 additions & 102 deletions shps/templates/shps/source_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,113 +4,95 @@
{% load webpage_extras %}
{% block title %}{{ object.name }}{% endblock %}
{% block scriptHeader %}
{% leaflet_js %}
{% leaflet_css %}
{% leaflet_js %}
{% leaflet_css %}
{% endblock %}
{% block content %}
<!-- <div class="container"> -->
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-md-2">
{% if object.get_prev %}
<h2>
<a href="{% url 'shapes:source_detail' pk=object.get_prev %}">
<i class="fas fa-chevron-left" title="previous"></i>
</a>
</h2>
{% endif %}
</div>
<div class="col-md-8">
<h2 style="text-align: center;">
{{ object }}
{% if user.is_authenticated %}
<small>
<a href="{% url 'shapes:source_edit' pk=object.id %}">
<i class="far fa-edit" title="edit"></i>
</a>
</small>
|
<small>
<a href="{% url 'shapes:source_delete' pk=object.id %}">
<i class="far fa-trash-alt" title="delete"></i>
</a>
</small>
{% endif %}
</h2>
<h2 style="text-align: center;">
<a href="/things-we-promise-to-do">
<i class="fas fa-download" title="one day you'll be able to download a shape file"></i>
</a>
</h2>


</div>
<div class="col-md-2">
<h2>
{% if object.get_next %}
<a href="{% url 'shapes:source_detail' pk=object.get_next %}" style="float:right">
<i class="fas fa-chevron-right" title="next"></i>
<div class="container-fluid">
<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
<ol class="breadcrumb pt-2">
<li class="breadcrumb-item"><a href="{% url 'webpage:start' %}">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">{{ object.name }}</li>
</ol>
</nav>
<div class="row p-4">
<div class="col-md-2">
{% if object.get_prev %}
<h2 class="text-start">
<a href="{% url 'shapes:shape_detail' pk=object.get_prev %}">
<i class="bi bi-chevron-left" title="previous"></i>
</a>
</h2>
{% endif %}
</div>
<div class="col-md-8 ">
<h1 class="display-5 text-center">
{{ object }}
{% if user.is_audtenticated %}
<small>
<a href="{% url 'shapes:shape_edit' pk=object.id %}">
<i class="bi bi-pencil-square" title="Edit {{ object }}"></i>
</a>
</h2>
</small>
{% endif %}
</div>
</h1>

</div>
</div>
<div class="card-body">
<legend>Basic Information</legend>
<table class="table table-bordered table-hover">
<tr>
<th>
{% get_verbose_name source "name" %}
</th>
<td>
{{ object.name }}
</td>
</tr>
<tr>
<th>
{% get_verbose_name source "description" %}
</th>
<td>
{{ object.description }}
</td>
</tr>
<tr>
<th>
{% get_verbose_name source "quote" %}
</th>
<td>
{{ object.quote }}
</td>
</tr>
<tr>
<th>
{% get_verbose_name source "original_url" %}
</th>
<td>
{{ object.original_url }}
</td>
</tr>
</table>
<legend>Related Objects
<span class="badge badge-secondary">
{{ object.source_of.count }}
</span>
</legend>
<table class="table table-bordered table-hover">
{% for x in object.source_of.all %}
<tr>
<th>
Name
</th>
<td>
<a href="{{ x.get_absolute_url }}">
{{ x }}
</a>
</td>
</tr>
{% endfor %}
</table>
<div class="col-md-2 text-end">
<h2>
{% if object.get_next %}
<a href="{% url 'shapes:shape_detail' pk=object.get_next %}" style="float:right">
<i class="bi bi-chevron-right" title="next"></i>
</a>
</h2>
{% endif %}
</div>
{% endblock %}
</div>
</div>
<div class="container">
<dl>
<dt>
{% get_verbose_name source "name" %}
</dt>
<dd>
{{ object.name }}
</dd>

<dt>
{% get_verbose_name source "description" %}
</dt>
<dd>
{{ object.description }}
</dd>

<dt>
{% get_verbose_name source "quote" %}
</dt>
<dd>
{{ object.quote }}
</dd>

<dt>
{% get_verbose_name source "original_url" %}
</dt>
<dd>
{{ object.original_url }}
</dd>
</dl>
<h2>Related Objects</h2>
<dl>
{% for x in object.source_of.all %}
<dt>
Name
</dt>
<dd>
<a href="{{ x.get_absolute_url }}">
{{ x }}
</a>
</dd>
{% endfor %}
</dl>
</div>
{% endblock %}
99 changes: 50 additions & 49 deletions webpage/templates/webpage/partials/footer.html
Original file line number Diff line number Diff line change
@@ -1,65 +1,66 @@
{% load webpage_extras %}
{% load static %}
<footer class="footer mt-auto py-3 bg-body-tertiary">
<div class="row justify-content-center">
<div class="col-lg-1 col-md-2 col-sm-2 col-xs-6 text-center">
<div>
<a href="https://www.oeaw.ac.at/acdh/"><img
src="{% static 'webpage/img/acdh_logo.svg' %}" class="image" alt="ACDH-CH Logo"
style="max-width: 100%; height: auto;" title="ACDH-CH Logo"></a>
</div>
</div>
<div class="col-lg-4 col-md-3 col-sm-3">
<div>
<p>
ACDH-CH
<br>
Austrian Centre for Digital Humanities and Cultural Heritage
<br>
Österreichische Akademie der Wissenschaften
</p>
<p>
Bäckerstraße 13
<br>
1010 Wien
</p>
<p>
T: +43 1 51581-2200
<br>
E: <a href="mailto:[email protected]
">[email protected]</a>
</p>
<div class="container-fluid">
<div class="row justify-content-center">
<div class="col-lg-1 col-md-2 col-sm-2 col-xs-6 text-center">
<div>
<a href="https://www.oeaw.ac.at/acdh/"><img
src="{% static 'webpage/img/acdh_logo.svg' %}" class="image" alt="ACDH-CH Logo"
style="max-width: 100%; height: auto;" title="ACDH-CH Logo"></a>
</div>
</div>
</div>
<div class="col-lg-3 col-md-4 col-sm-3">
<div class="row">
<div class="col-lg-4 col-md-3 col-sm-3">
<div>
<h6>HELPDESK</h6>
<p>ACDH-CH betreibt einen Helpdesk mit Rat und Hilfestellung zu verschiedensten Fragen der Digital Humanities.
<p>
ACDH-CH
<br>
Austrian Centre for Digital Humanities and Cultural Heritage
<br>
Österreichische Akademie der Wissenschaften
</p>
<p>
<a href="mailto:[email protected]">e-Mail</a>
Bäckerstraße 13
<br>
1010 Wien
</p>
<p>
T: +43 1 51581-2200
<br>
E: <a href="mailto:[email protected]
">[email protected]</a>
</p>
</div>
</div>
<div class="row">
<div class="col-lg-3 col-md-4 col-sm-3">
<div class="col-md-4">
<a id="github-logo" title="GitHub" href="{% projects_metadata 'github' %}"
class="nav-link" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24">
<path
d="M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-4.466 19.59c-.405.078-.534-.171-.534-.384v-2.195c0-.747-.262-1.233-.55-1.481 1.782-.198 3.654-.875 3.654-3.947 0-.874-.312-1.588-.823-2.147.082-.202.356-1.016-.079-2.117 0 0-.671-.215-2.198.82-.64-.18-1.324-.267-2.004-.271-.68.003-1.364.091-2.003.269-1.528-1.035-2.2-.82-2.2-.82-.434 1.102-.16 1.915-.077 2.118-.512.56-.824 1.273-.824 2.147 0 3.064 1.867 3.751 3.645 3.954-.229.2-.436.552-.508 1.07-.457.204-1.614.557-2.328-.666 0 0-.423-.768-1.227-.825 0 0-.78-.01-.055.487 0 0 .525.246.889 1.17 0 0 .463 1.428 2.688.944v1.489c0 .211-.129.459-.528.385-3.18-1.057-5.472-4.056-5.472-7.59 0-4.419 3.582-8 8-8s8 3.581 8 8c0 3.533-2.289 6.531-5.466 7.59z">
</path>
</svg>
</a>
<div class="col-lg-3 col-md-4 col-sm-3">
<div class="row">
<div>
<h6>HELPDESK</h6>
<p>ACDH-CH betreibt einen Helpdesk mit Rat und Hilfestellung zu verschiedensten Fragen der Digital Humanities.
</p>
<p>
<a href="mailto:[email protected]">e-Mail</a>
</p>
</div>
</div>
<div class="row">
<div class="col-lg-3 col-md-4 col-sm-3">
<div class="col-md-4">
<a id="github-logo" title="GitHub" href="{% projects_metadata 'github' %}"
class="nav-link" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24">
<path
d="M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-4.466 19.59c-.405.078-.534-.171-.534-.384v-2.195c0-.747-.262-1.233-.55-1.481 1.782-.198 3.654-.875 3.654-3.947 0-.874-.312-1.588-.823-2.147.082-.202.356-1.016-.079-2.117 0 0-.671-.215-2.198.82-.64-.18-1.324-.267-2.004-.271-.68.003-1.364.091-2.003.269-1.528-1.035-2.2-.82-2.2-.82-.434 1.102-.16 1.915-.077 2.118-.512.56-.824 1.273-.824 2.147 0 3.064 1.867 3.751 3.645 3.954-.229.2-.436.552-.508 1.07-.457.204-1.614.557-2.328-.666 0 0-.423-.768-1.227-.825 0 0-.78-.01-.055.487 0 0 .525.246.889 1.17 0 0 .463 1.428 2.688.944v1.489c0 .211-.129.459-.528.385-3.18-1.057-5.472-4.056-5.472-7.59 0-4.419 3.582-8 8-8s8 3.581 8 8c0 3.533-2.289 6.531-5.466 7.59z">
</path>
</svg>
</a>
</div>
</div>

</div>
</div>
<!-- .-->
</div>
<div class="text-center fs-6 fw-lighter">© Copyright OEAW | <a href="{% url 'webpage:staticpage' template='imprint' %}">Imprint</a>
</div>
<!-- .-->
</div>
<div class="text-center fs-6 fw-lighter">© Copyright OEAW | <a href="{% url 'webpage:staticpage' template='imprint' %}">Imprint</a>
</div>
</footer>

0 comments on commit 6278951

Please sign in to comment.