Skip to content

Commit

Permalink
Merge pull request #30 from keitaroinc/custom-footer
Browse files Browse the repository at this point in the history
Custom footer
  • Loading branch information
blagojabozinovski authored Jan 10, 2024
2 parents 4e8f956 + 36fba46 commit a993b65
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 27 deletions.
9 changes: 9 additions & 0 deletions ckanext/kepa/assets/css/kepa.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ckanext/kepa/assets/css/kepa.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions ckanext/kepa/assets/scss/kepa.scss
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,11 @@
justify-content: end;
align-items: center;
}

.links p{
@include column;
}

.links p a{
margin-bottom: 5px;
}
13 changes: 12 additions & 1 deletion ckanext/kepa/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@ def update_config(self, config_):
toolkit.add_template_directory(config_, "templates")
toolkit.add_public_directory(config_, "public")
toolkit.add_resource("assets", "kepa")


def update_config_schema(self, schema):

ignore_missing = toolkit.get_validator('ignore_missing')
validators = [ignore_missing]
schema.update({
'footer_social': validators,
'footer_dataportal': validators,
'footer_toolbox': validators,
})

return schema
14 changes: 14 additions & 0 deletions ckanext/kepa/templates/admin/config.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% ckan_extends %}

{% import 'macros/form.html' as form %}

{% block admin_form %}
{{ h.csrf_input() }}
{{ super() }}

{{ form.markdown('footer_dataportal', label=_('Footer Dataportal'), value=data.footer_dataportal, error=error, placeholder=_('Enter a list of links - one per line - to be shown as a list withing the secondary footer navigation. Please format the links with Markdown (i.e. * [Example link](https://www.example.com)).'), classes=['control-full']) }}
{{ form.markdown('footer_toolbox', label=_('Footer Toolbox'), value=data.footer_toolbox, error=error, placeholder=_('Enter a list of links - one per line - to be shown as a list withing the secondary footer navigation. Please format the links with Markdown (i.e. * [Example link](https://www.example.com)).'), classes=['control-full']) }}
{{ form.markdown('footer_social', label=_('Footer Social'), value=data.footer_social, error=error, placeholder=_('Enter a list of links - one per line - to be shown as a list withing the secondary footer navigation. Please format the links with Markdown (i.e. * [Example link](https://www.example.com)).'), classes=['control-full']) }}

{% endblock %}

28 changes: 3 additions & 25 deletions ckanext/kepa/templates/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,9 @@
<div class="container">
{% block footer_content %}
<div class="row">
<div class="col-md-4 attribution">
<h2>{{_('The Kosovo dataportal')}} </h2>
<div class="column">
<a class="" href="http://ckan.org">{{_('About this website')}}</a>
<a class="" href="http://ckan.org">{{_('Open source on GitHub')}}</a>
<a class="" href="http://ckan.org">{{_('Feedback on dataportal.xk')}}</a>
<a class="" href="http://ckan.org">{{_('[email protected]')}}</a>
</div>
</div>
<div class="col-md-4 attribution">
<h2>{{_('Toolbox for sharing data')}}</h2>
<div class="column">
<a class="" href="http://ckan.org">{{_('Documentation and services - Kosovo`s data portal')}}</a>
<a class="" href="http://ckan.org">{{_('Guidance for open and shared data')}}</a>
</div>
</div>
<div class="col-md-4 attribution">
<h2>{{_('Social')}}</h2>
<div class="column">
<a class="" href="http://ckan.org">{{_('Network Open Source and Data')}}</a>
<a class="" href="http://ckan.org">{{_('Facebook')}}</a>
<a class="" href="http://ckan.org">{{_('Twitter')}}</a>
</div>
</div>
{% include "/snippets/footer_dataportal.html" %}
{% include "/snippets/footer_toolbox.html" %}
{% include "/snippets/footer_social.html" %}
</div>

</div>
Expand All @@ -39,7 +18,6 @@ <h2>{{_('Social')}}</h2>
</div>
</footer>


<script>
document.addEventListener("DOMContentLoaded", function () {
calculateSpaceToBottom();
Expand Down
8 changes: 8 additions & 0 deletions ckanext/kepa/templates/snippets/footer_dataportal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% if g.footer_dataportal %}
<div class="col-md-4 attribution">
<h2 class="title">{{ _('The Kosovo dataportal') }}</h2>
<div class="links">
{{ h.render_markdown(g.footer_dataportal) }}
</div>
</div>
{% endif %}
8 changes: 8 additions & 0 deletions ckanext/kepa/templates/snippets/footer_social.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% if g.footer_social %}
<div class="col-md-4 attribution">
<h2 class="title">{{ _('Social') }}</h2>
<div class="links">
{{ h.render_markdown(g.footer_social) }}
</div>
</div>
{% endif %}
8 changes: 8 additions & 0 deletions ckanext/kepa/templates/snippets/footer_toolbox.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% if g.footer_toolbox %}
<div class="col-md-4 attribution">
<h2 class="title">{{ _('Toolbox for sharing data') }}</h2>
<div class="links">
{{ h.render_markdown(g.footer_social) }}
</div>
</div>
{% endif %}

0 comments on commit a993b65

Please sign in to comment.