Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Commit

Permalink
[#853] Populate entry page with entry details
Browse files Browse the repository at this point in the history
  • Loading branch information
brew committed Jan 27, 2017
1 parent 1861457 commit ffe7f5e
Showing 1 changed file with 26 additions and 46 deletions.
72 changes: 26 additions & 46 deletions census/views/entry.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,27 @@
<div class="row">
<div class="col-md-{% if is_index %}6{% else %}12{% endif %}">
<h1>
<a href="http://index.okfn.org/dataset/{{ dataset.id }}/" title="{{ format("See more data on %(name)s in the Open Data Index", {name: dataset.name}) }}">{{ dataset.name }}</a>
<span class="place-openness" data-score="{{ computedRelativeScore }}" style="background-color: rgb(122, 184, 0); color: white;">{{ format(gettext("%(score)s% open"), {score: computedRelativeScore}) }}</span>
<a href="/dataset/{{ dataset.id }}{{ urlContext }}">{{ dataset.name }}</a>
<span class="place-openness" data-score="{{ entry.computedRelativeScore }}" style="background-color: rgb(122, 184, 0); color: white;">{{ format(gettext("%(score)s% open"), {score: entry.computedRelativeScore}) }}</span>
</h1>
<h3>
<a href="http://index.okfn.org/place/{{ place.id }}{{ urlContext }}" title="{{ format("See more data on %(name)s in the Open Data Index", {name: place.name}) }}">{{ place.name }}</a>
<a href="/place/{{ place.id }}{{ urlContext }}">{{ place.name }}</a>
{% if entry.computedRelativeScore == 100 %}
<div class="open-badge"><img src="http://assets.okfn.org/images/ok_buttons/od_80x15_blue.png"></div>
{% endif %}
</h3>

<div class="row navigate">

<div class="col-md-12">
{% include 'includes/share_buttons.html' %}

{% if is_index %}
<div class="history">
<h6>{{ gettext("See other years") }}</h6>
<ul>
<li><a href="http://index.okfn.org/place/united-kingdom/companies/2014/" title="2014">2014</a></li>
<li><a href="http://index.okfn.org/place/united-kingdom/companies/2013/" title="2013">2013</a></li>
<li><a href="http://index.okfn.org/place/{{ place.slug }}/{{ dataset.id }}/2013/" title="2013">2013</a></li>
<li><a href="http://index.okfn.org/place/{{ place.slug }}/{{ dataset.id }}/2014/" title="2014">2014</a></li>
<li><a href="http://index.okfn.org/place/{{ place.slug }}/{{ dataset.id }}" title="2015">2015</a></li>
</ul>
</div>
{% endif %}
Expand Down Expand Up @@ -57,46 +59,26 @@ <h6>{{ gettext("See other years") }}</h6>
<div class="col-md-12">
<h3>{{ gettext("What data is expected?") }}</h3>
<p>{{dataset.description}}</p>
<ul>
{% for characteristic in dataset.characteristics %}
<li>{{ characteristic }}</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}

<h3>{{ gettext("What data is available?") }}</h3>
<ul class="availability-single">
{% for qu in questions %}
{% if qu.type == '' %}

{% set description = '' %}
{% set state = entry.answers[qu.id] %}

{% if state == true %}
{% set stateClass = 'yes' %}
{% set stateDisplay = 'Y' %}
{% elif state == false %}
{% set stateClass = 'no' %}
{% set stateDisplay = 'N' %}
{% elif state == null %}
{% set stateClass = 'maybe' %}
{% set stateDisplay = '?' %}

{% else %}

{% set stateClass = '' %}
{% set stateDisplay = 'No data' %}

{% endif %}

<li class="{{ stateClass }}">
<i class="fa fa-{{ qu.icon }}"
data-toggle="popover"
data-trigger="click"
data-placement="top"
data-html="true"
data-content="{{ qu.description|replace ('\"', '\'') }}"></i> {# " #}
<span>{{ qu.question }}</span>
</li>
{% endif %}
{% endfor %}
{% for question in questions -%}
{% if question.score -%}
{% set answer = entry.getAnswerValueForQuestion(question) %}
{% set pass = 'yes' if question.pass(answer) else 'no' %}
<li class="{{ pass }}" title="{{ question.question }}">
<i class="fa fa-{{ question.icon }}"></i>&nbsp;{% if pass == 'yes' %}It's {% elif pass == 'no' %}It's not {% endif %}{{ question.questionshort|lower }}
</li>
{%- endif %}
{%- endfor %}
</ul>

{% if entry.details %}
Expand All @@ -106,11 +88,12 @@ <h4><strong>{{ gettext("Details") }}</strong></h4>
</div>
{% endif %}

{% if entry.reviewComments %}
<div class="place-comments">
<h4><strong>{{ gettext("Reviewer comments") }}</strong></h4>
<p>All fields satisfied, no issues. Updated title and short description and details fields.</p>
<p>{{ entry.reviewComments }}</p>
</div>

{% endif %}
</div>
</section>

Expand All @@ -119,7 +102,6 @@ <h4><strong>{{ gettext("Reviewer comments") }}</strong></h4>
<div class="container">
<h2>{{ gettext("Contributors") }}</h2>
<div class="row">

<div class="col-md-6">
<h4>{{ gettext("Reviewers") }}</h4>
{% if entry.Reviewer %}
Expand All @@ -128,7 +110,6 @@ <h4>{{ gettext("Reviewers") }}</h4>
</ul>
{% endif %}
</div>

<div class="col-md-6">
<h4>{{ gettext("Submitters") }}</h4>
{% if entry.Submitter %}
Expand All @@ -137,13 +118,12 @@ <h4>{{ gettext("Submitters") }}</h4>
</ul>
{% endif %}
</div>

</div>
</div>
</section>
{% endif %}

{% if is_index != "true" %}
{% if not is_index %}
<section class="place-meta">
<div class="container">
<h3>{{ gettext("Meta data") }}</h3>
Expand Down

0 comments on commit ffe7f5e

Please sign in to comment.