Skip to content

Commit

Permalink
Merge pull request #94 from SADiLaR/feature/ui-tweaks-for-demo
Browse files Browse the repository at this point in the history
UI tweaks for demo
  • Loading branch information
friedelwolff authored Jul 22, 2024
2 parents c21b077 + b628d05 commit 52fa1ca
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ def institution_detail(request, institution_id):
template = "app/institution_detail.html"

institution = get_object_or_404(Institution, id=institution_id)
projects = Project.objects.filter(institution=institution)
documents = DocumentFile.objects.filter(institution=institution)
projects = Project.objects.filter(institution=institution).order_by("name")
documents = DocumentFile.objects.filter(institution=institution).order_by("title")

logo = institution.logo

Expand Down
11 changes: 5 additions & 6 deletions app/templates/app/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ <h5 class="card-title">{% trans "Search" %}</h5>
{% blocktrans %}This platforms hosts terminology and other useful language resources.{% endblocktrans %}
</p>
<p class="card-text">
{% blocktrans %}Search for a term or topic you are interested in.
(Functionality coming soon.){% endblocktrans %}
<form method="get" action="{% url 'search' %}" class="container">
<input type="search" name="search" placeholder="{% trans 'Search term...' %}"
class="form-control search-input">
<input type="submit" value="{% trans 'Search' %}" class="btn btn-primary float-left"/>
</form>
</p>
{# TODO: create the search box right here so that no additional click is required. #}
<a href="{% url 'search' %}" class="btn btn-primary">
{% trans "Search a term" %}
</a>
</div>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions app/templates/app/project_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<div class="col-12 {% if logo %}col-md-6{% else %}col-md-12{% endif %} detail-left-col">
<h1>{{ project.name }}</h1>
<a href="{{ project.url }}">{{ project.url }}</a>
<p>
{{ project.description | linebreaks }}
</p>
<p>
<a href="{% url 'institution_detail' project.institution.id %}">
{{ project.institution.name }}
Expand Down
23 changes: 19 additions & 4 deletions app/templates/app/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ <h5 class="card-title">{% trans "Search a term" %}</h5>
<div class="container">
{% for document in search_results %}
<div>
<!--
<ul>
<li>
<span class="mr-5 text-primary"><b>{% trans "Title:" %}</b></span>
Expand All @@ -33,10 +34,6 @@ <h5 class="card-title">{% trans "Search a term" %}</h5>
<span class="mr-5"><b>{% trans "Headline:" %}</b></span>
<span>{{ document.search_headline|safe }}</span>
</li>
<li>
<span class="mr-5"><b>{% trans "File:" %}</b></span>
<span>{{ document.uploaded_file }}</span>
</li>
<li>
<span class="mr-5"><b>{% trans "License:" %}</b></span>
<span>{{ document.license }}</span>
Expand All @@ -54,6 +51,24 @@ <h5 class="card-title">{% trans "Search a term" %}</h5>
<span><i>{{ document.rank }}</i></span>
</li>
</ul>
-->
<h2><a href="{% url 'document_detail' document.id %}">{{ document.title }}</a></h2>
<span><a href="{% url 'institution_detail' document.institution.id %}">{{ document.institution }}</a></span>
<div>
<span class="mr-5"><b>{% trans "Excerpt:" %}</b></span>
<span>… {{ document.search_headline|safe }} …</span>
</div>
<div>
<span class="mr-5"><b>{% trans "License:" %}</b></span>
<span>{{ document.license }}</span>
</div>
<div>
<span>{{ document.languages.all |join:", " }}</span>
</div>
<div>
<span>{{ document.subjects.all |join:", " }}</span>
</div>
<br>
</div>
{% endfor %}
</div>
Expand Down

0 comments on commit 52fa1ca

Please sign in to comment.