Skip to content

Commit

Permalink
Merge pull request #102 from asc-csa/issue#91
Browse files Browse the repository at this point in the history
Issue#91
  • Loading branch information
nfee006 authored Mar 10, 2021
2 parents 5007c93 + 698572f commit 9893c4f
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 31 deletions.
9 changes: 7 additions & 2 deletions ckanext/csa/fanstatic/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@
a {
background-color: white;
}

.dataset-private.pull-right {
font-size: 12px;
margin-top: 8px;
}
@media (min-width: 768px) {
[role=main],
.main {
.main, .page-wrap {
padding-top: 10px;
background: white;
}
Expand All @@ -34,7 +39,7 @@

@media (min-width: 768px) {
[role=main],
.main {
.main, .page-wrap {
padding-top: 10px;
background: #fff;
}
Expand Down
32 changes: 16 additions & 16 deletions ckanext/csa/templates/package/read.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,6 @@
{% block primary_content_inner %}
{{ super() }}
{% block package_description %}
{% if pkg.private %}
<span class="dataset-private label label-inverse pull-right">
<i class="fa fa-lock"></i>
{{ _('Private') }}
</span>
{% endif %}
{% block package_archive_notice %}
{% if is_activity_archive %}
<div class="alert alert-danger">
{% trans url=h.url_for('dataset.read', id=pkg.id) %}
You're currently viewing an old version of this dataset. To see the
current version, click <a href="{{ url }}">here</a>.
{% endtrans %}
</div>
{% endif %}
{% endblock %}
<h1>
{% block page_heading %}
{{ h.dataset_display_name(pkg) }}
Expand All @@ -31,7 +15,23 @@ <h1>
[{{ _('Deleted') }}]
{% endif %}
{% endblock %}
{% if pkg.private %}
<span class="dataset-private label label-inverse pull-right">
<i class="fa fa-lock"></i>
{{ _('Private') }}
</span>
{% endif %}
</h1>
{% block package_archive_notice %}
{% if is_activity_archive %}
<div class="alert alert-danger">
{% trans url=h.url_for('dataset.read', id=pkg.id) %}
You're currently viewing an old version of this dataset. To see the
current version, click <a href="{{ url }}">here</a>.
{% endtrans %}
</div>
{% endif %}
{% endblock %}
{% block package_notes %}
{% if pkg.notes %}
<div class="notes embedded-content">
Expand Down
17 changes: 14 additions & 3 deletions ckanext/csa/templates/package/search.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
{% ckan_extends %}
{% set pkg = c.pkg_dict %}
{% set res = c.resource %}

{% block page_header_block %}
{% if not pkg %}
{%if h.lang()=='en'%}
<h1>CSA Open Government Portal</h1>
{%else%}
<h1>Portail du gouvernement ouvert de l'ASC</h1>
{%endif%}
{% endif %}
{% endblock %}

{% block main_search_role %}role="main"{% endblock %}

{% block secondary_content %}
<!--template/package/search.html start-->
Expand All @@ -20,9 +34,6 @@ <h2 style="padding-left: 12px; padding-right: 12px; padding-top: 12px; padding-b


<!--template/package/search.html end-->



{% endblock %}

{% block form %}
Expand Down
9 changes: 5 additions & 4 deletions ckanext/csa/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

{# The content block allows you to replace the content of the page if needed #}
{%- block content %}
{% block maintag %}<div role="main" >{% endblock %}
{% block maintag %}<div class='page-wrap'>{% endblock %}
<div id="content" class="container" >
{% block main_content %}
{% block flash %}
Expand All @@ -44,14 +44,15 @@
</div>
{% endblock %}


<div class="row wrapper{% block wrapper_class %}{% endblock %}{% if self.secondary()|trim == '' or c.action=='resource_read' %} no-nav{% endif %}">
<div {% block main_search_role %}{% endblock %} class="row wrapper{% block wrapper_class %}{% endblock %}{% if self.secondary()|trim == '' or c.action=='resource_read' %} no-nav{% endif %}">
{#
The pre_primary block can be used to add content to before the
rendering of the main content columns of the page.
#}
{% block pre_primary %}
{% endblock %}
{% block page_header_block %}
{% endblock %}

{% block secondary %}
<aside class="secondary col-sm-3">
Expand Down Expand Up @@ -102,7 +103,7 @@ <h1>My page content</h1>
{% endblock %}
#}

<div class="module-content">
<div role='main' class="module-content">
{% if self.page_primary_action() | trim %}
<div class="page_primary_action">
{% block page_primary_action %}{% endblock %}
Expand Down
12 changes: 10 additions & 2 deletions ckanext/csa/templates/snippets/home_breadcrumb_item.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
<!--template/snippets/home_breadcrumb.html start-->
{% set pkg = c.pkg_dict %}
{% set res = c.resource %}
{# Used to insert the home icon into a breadcrumb #}
{% if h.lang() == 'en' %}
<li><a href="https://www.canada.ca/en.html">Canada.ca</a></li>
<li><a href="https://www.asc-csa.gc.ca/eng/Default.asp">Canadian Space Agency</a></li>
<li id="wb-cont"><a href="/en">Open Data</a></li>
<li id="wb-cont"><a href="/en">Open Government</a></li>
{% if pkg %}
<li>{{ h.dataset_display_name(pkg) }}</li>
{% endif %}
{% else %}
<li><a href="https://www.canada.ca/fr.html">Canada.ca</a></li>
<li><a href="https://www.asc-csa.gc.ca/fra/Default.asp">Agence spatiale canadienne</a></li>
<li id="wb-cont"><a href="/fr/dataset">Données ouvertes</a></li>
<li id="wb-cont"><a href="/fr/dataset">Gouvernement ouvert</a></li>
{% if pkg %}
<li>{{ h.dataset_display_name(pkg) }}</li>
{% endif %}
{% endif %}
<!--template/snippets/home_breadcrumb.html end-->
4 changes: 2 additions & 2 deletions ckanext/csa/templates/snippets/package_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<article class="panel panel-default mrgn-bttm-sm relative">
<header class="panel-heading" style="background-color: white;">

<h2 class="panel-title">
<h3 class="panel-title">
{% block heading %}
{% set my_title, machine_translated = h.csa_get_translated_t(package, 'title') %}
{% if 'title_translated' not in package %}
Expand All @@ -23,7 +23,7 @@ <h2 class="panel-title">
<i class="fa fa-language text-muted mrgn-lft-sm" title="{{ _("This third party metadata element has been translated using an automated translation tool (DeepL). To report any discrepancies please contact [email protected]") }}"></i>
{% endif %}
{% endblock %}
</h2></header>
</h3></header>

<div class="panel-body">
{% block banner %}
Expand Down
4 changes: 2 additions & 2 deletions ckanext/csa/templates/snippets/search_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@

{% block search_title %}
{% if not error %}
<h1>{% snippet 'snippets/search_result_text.html', query=query, count=count, type=type %}</h1>
<h2>{% snippet 'snippets/search_result_text.html', query=query, count=count, type=type %}</h2>
{% else %}
<h1>Error</h1>
<h2>Error</h2>
{% endif %}
{% endblock %}

Expand Down

0 comments on commit 9893c4f

Please sign in to comment.