Skip to content

Commit

Permalink
[#24] Porządki elementów
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofMadejski committed Mar 23, 2015
1 parent b61e205 commit d452b19
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 11 deletions.
5 changes: 4 additions & 1 deletion ckanext/DanePubliczneGovPl/fanstatic/singleitem.css
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@
margin: 0;
padding: 0;
background: none;
display: none;
}

.wrapper .dataset-result .page-header .nav.nav-tabs {
background-color: red;
}

.wrapper .dataset-result .module h1 {
Expand Down
12 changes: 8 additions & 4 deletions ckanext/DanePubliczneGovPl/schema/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ class DatasetForm(p.SingletonPlugin, tk.DefaultDatasetForm):
p.implements(p.ITemplateHelpers) # Helpers for templates

def get_helpers(self):
return {'dp_update_frequencies': self.update_frequencies,
'dp_update_frequencies_options': self.update_frequencies_options}
return {'dp_update_frequencies': self.h_update_frequencies,
'dp_update_frequencies_options': self.h_update_frequencies_options,
'dp_package_has_license_restrictions': self.h_package_has_license_restrictions}

def update_frequencies(self):
def h_update_frequencies(self):
try:
tags = tk.get_action('tag_list')(
data_dict={'vocabulary_id': 'update_frequencies'})
Expand All @@ -24,9 +25,12 @@ def update_frequencies(self):
except tk.ObjectNotFound:
return []

def update_frequencies_options(self):
def h_update_frequencies_options(self):
return ({'value': freq, 'text': freq} for freq in self.update_frequencies())

def h_package_has_license_restrictions(self, dpkg):
return dpkg.get('license_condition_source', False) or dpkg.get('license_condition_timestamp',False) or dpkg.get('license_condition_original',False) \
or dpkg.get('license_condition_modification',False) or dpkg.get('license_condition_responsibilities',False)

p.implements(p.IAuthFunctions)
def get_auth_functions(self):
Expand Down
4 changes: 4 additions & 0 deletions ckanext/DanePubliczneGovPl/templates/package/read.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
{{ _('Private') }}
</span>
{% endif %}

{% set org_url = h.url_for(controller='organization', action='read', id=pkg.organization.name) %}
<a href="{{ org_url }}">{{ pkg.organization.title }}</a>

<h1>
{% block page_heading %}
{{ pkg.title or pkg.name }}
Expand Down
4 changes: 3 additions & 1 deletion ckanext/DanePubliczneGovPl/templates/package/read_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
{% endblock %}

{% block content_primary_nav %}
{#
{{ h.build_nav_icon('dataset_read', _('Dataset'), id=pkg.name) }}
{{ h.build_nav_icon('dataset_groups', _('Groups'), id=pkg.name) }}
{{ h.build_nav_icon('dataset_activity', _('Activity Stream'), id=pkg.name) }}
{{ h.build_nav_icon('related_list', _('Related'), id=pkg.name) }}
#}
{% endblock %}

{% block primary_content_inner %}
Expand All @@ -51,7 +53,7 @@
{% endblock %}

{% block package_license %}
{% snippet "snippets/license.html", pkg_dict=pkg %}
{#{% snippet "snippets/license.html", pkg_dict=pkg %}#}
{% endblock %}

{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,23 @@
</div>
{% endif %}

{#
{% if pkg_dict.version %}
<div class="list">
<span class="dataset-label">{{ _("Version") }}</span>
<span class="dataset-details">{{ pkg_dict.version }}</span>
</div>
{% endif %}
#}

{#
{% if h.check_access('package_update',{'id':pkg_dict.id}) %}
<div class="list">
<span class="dataset-label">{{ _("State") }}</span>
<span class="dataset-details">{{ _(pkg_dict.state) }}</span>
</div>
{% endif %}
#}

{% if pkg_dict.metadata_modified %}
<div class="list">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
{{ h.follow_button('dataset', pkg.name) }}
</div>
{% endif %}
<div class="history_button">
<a href="{{ h.url_for('dataset_activity', id=pkg.name) }}" class="btn">
{{ _('History') }}
</a>
</div>
</div>
</div>
</section>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{# Warunki ponownego wykorzystywania informacji #}

Warunki ponownego wykorzystywania informacji:
<h2>Warunki ponownego wykorzystywania informacji:</h2>

{% if h.dp_package_has_license_restrictions(pkg_dict) %}
<span>{{_("This dataset is considered public data and can be used under following restrictions") }}:</span>
<ul>
{% if pkg_dict.license_condition_source %}
{% if pkg_dict.license_condition_source or pkg_dict.license_condition_timestamp %}
<li>{{ _('Odbiorca powinien poinformować o źródle pozyskania informacji') }}</li>
{% endif %}

{% if pkg_dict.license_condition_timestamp %}
<li>{{ _('Odbiorca powinien poinformować o czasie wytworzenia i pozyskania informacji od dostawcy') }}</li>
{% endif %}

Expand All @@ -23,3 +23,9 @@
<li>{{ pkg_dict.license_condition_responsibilities }}</li>
{% endif %}
</ul>

{%- else -%}

<span>{{_("This dataset is considered public data and can be used without any restrictions") }}.</span>

{%- endif %}

0 comments on commit d452b19

Please sign in to comment.