Skip to content
Snippets Groups Projects
Commit bab5d2f9 authored by Thorge Petersen's avatar Thorge Petersen
Browse files

Removed usage of c var where possible (wip)

parent 9f88d19f
No related branches found
No related tags found
1 merge request!50Upgraded to CKAN 2.10
......@@ -14,7 +14,7 @@
<div class='search-box-container'>
<div class='search-box'>
<div class="field">
<input id="field-sitewide-search" type="text" name="q" value="{{c.q}}" placeholder="{{ _('Search organizations') }}" />
<input id="field-sitewide-search" type="text" name="q" value="{{q}}" placeholder="{{ _('Search organizations') }}" />
<button class="btn-search" type="submit">
</div>
</div>
......@@ -27,8 +27,7 @@
{% block primary %}
<div class="primary organization">
{% if h.check_access('organization_create') %}
{% link_for _('Add Organization'), named_route='organization.new', class_='btn btn-primary',
icon='plus-square' %}
{% link_for _('Add Organization'), named_route='organization.new', class_='btn btn-primary', icon='plus-square' %}
{% endif %}
<h1 class="hide-heading">{% block page_heading %}{{ _('Organizations') }}{% endblock %}</h1>
<div class="search-form">
......@@ -37,8 +36,8 @@
{% endblock %}
</div>
{% block organizations_list %}
{% if c.page.items or request.args %}
{% if c.page.items %}
{% if page.items or request.args %}
{% if page.items %}
{% snippet "organization/snippets/odsh_organization_list.html", organizations=c.page.items %}
{% endif %}
{% else %}
......@@ -51,7 +50,7 @@
{% endif %}
{% endblock %}
{% block page_pagination %}
{{ c.page.pager(q=c.q or '', sort=c.sort_by_selected or '') }}
{{ page.pager(q=q or '', sort=sort_by_selected or '') }}
{% endblock %}
</div>
{% endblock %}
......
{% extends 'package/snippets/package_form.html' %}
{% set form_style = c.form_style or c.action %}
{% block stages %}
{% if form_style != 'edit' %}
<div class='search-form'>
<h2>{{ _('Create Dataset') }}</h2>
</div>
{{ super() }}
{% else %}
{% endif %}
{% endblock %}
......
{% extends "package/read_base.html" %}
{% set pkg = c.pkg_dict %}
{% set pkg = pkg_dict %}
{% set collection = h.get_collection(pkg) %}
{% set collection_title = collection['title'] if collection else None %}
{% set collection_url = collection['url'] if collection else None %}
......@@ -103,7 +103,7 @@
{% snippet "package/snippets/resources_list.html", pkg=pkg, resources=pkg.resources %}
{% if h.check_access('package_update', {'id':pkg.id }) %}
<div class='add-resource-container'>
{% link_for _('Add new resource'), named_route='resource.new', id=c.pkg_dict.name, class_='btn btn-primary', icon='plus' %}
{% link_for _('Add new resource'), named_route='resource.new', id=pkg.name, class_='btn btn-primary', icon='plus' %}
</div>
{% endif %}
{% endblock package_resources %}
......
......@@ -9,7 +9,7 @@
errors=errors,
error_summary=error_summary,
pkg_name=pkg.name,
form_action=c.form_action,
form_action=form_action,
allow_upload=g.ofs_impl and logged_in,
resource_form_snippet=resource_form_snippet,
dataset_type=dataset_type %}
......
......@@ -31,12 +31,12 @@ method="get" data-module="select-switch">
{% endblock %}
</div>
{% block package_search_results_list %}
{{ h.snippet('snippets/package_list.html', packages=c.page.items) }}
{{ h.snippet('snippets/package_list.html', packages=page.items) }}
{% endblock %}
</div>
{% block page_pagination %}
{{ c.page.pager(q=c.q,symbol_next='>') }}
{{ page.pager(q=q,symbol_next='>') }}
{% endblock %}
</section>
......@@ -57,8 +57,8 @@ method="get" data-module="select-switch">
<div class="filters">
<div>
{% for facet in c.facet_titles %}
{{ h.snippet('snippets/facet_list.html', title=c.facet_titles[facet], name=facet, search_facets=search_facets) }}
{% for facet in facet_titles %}
{{ h.snippet('snippets/facet_list.html', title=facet_titles[facet], name=facet, search_facets=search_facets) }}
{% endfor %}
</div>
......
{% import 'macros/form.html' as form %}
{% set action = c.form_action or '' %}
{% set form_style = c.form_style or c.action %}
{% set action = g.form_action or '' %}
{% set form_style = g.form_style or g.action %}
<form id="dataset-edit" class="dataset-form {% if(form_style=='edit') %} dataset-edit-form {%endif%} " method="post"
action="{{ action }}" data-module="basic-form" novalidate>
......@@ -15,8 +15,7 @@
{# {% block errors %}{{ form.errors(error_summary) }}{% endblock %} #}
{% block basic_fields %}
{% snippet 'package/snippets/package_basic_fields.html', data=data, errors=errors, licenses=c.licenses,
groups_available=c.groups_available %}
{% snippet 'package/snippets/package_basic_fields.html', data=data, errors=errors %}
{% endblock %}
{% block metadata_fields %}
......
<div class='search-box-container'>
<div class='search-box'>
<div class="field search-field">
<input
aria-label="{{ _('Enter search query for datasets') }}"
id="field-sitewide-search"
class="search"
type="text"
value="{{c.q}}"
name="q"
placeholder="{{ _('Search dataset') }}"
/>
<input aria-label="{{ _('Enter search query for datasets') }}" id="field-sitewide-search" class="search"
type="text" value="{{ query }}" name="q" placeholder="{{ _('Search dataset') }}" />
<button class="btn-search" type="submit" aria-label="{{ _('Search dataset') }}"></button>
</div>
</div>
......
......@@ -58,7 +58,7 @@
<legend>{{ _('Change password') }}</legend>
{{ form.input('old_password',
type='password',
label=_('Sysadmin Password') if c.is_sysadmin else _('Old Password'),
label=_('Old Password'),
id='field-password',
value=data.oldpassword,
error=errors.oldpassword,
......
......@@ -15,7 +15,7 @@
<div class="module-content">
<h2 class="page-heading">{% block page_heading %}{{ _('Login') }}{% endblock %}</h2>
{% block form %}
{% snippet "user/snippets/login_form.html", action=c.login_handler, error_summary=error_summary %}
{% snippet "user/snippets/login_form.html", error_summary=error_summary %}
{% endblock %}
</div>
</section>
......
......@@ -6,7 +6,7 @@ error_summary - A tuple/list of form errors.
Example:
{% snippet "user/snippets/login_form.html", action=c.login_handler, error_summary=error_summary %}
{% snippet "user/snippets/login_form.html", action=g.login_handler, error_summary=error_summary %}
#}
{% import 'macros/form.html' as form %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment