Skip to content

Commit

Permalink
[#890] Renaming of basic template blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmartin committed Jun 20, 2013
1 parent 1d9a0c6 commit 69b0d88
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 34 deletions.
4 changes: 2 additions & 2 deletions ckan/public/base/less/layout.less
Expand Up @@ -46,8 +46,8 @@
.primary {
.primary {
float: left;
width: 479px;
margin-left: 20px;
width: 467px;
margin-left: 0;
margin-bottom: 20px;
h1, h2, h3, h4 {
&:first-child {
Expand Down
4 changes: 2 additions & 2 deletions ckan/public/base/less/toolbar.less
Expand Up @@ -5,7 +5,7 @@
padding: 5px 0;
}

.add_action {
.page_primary_action {
margin-bottom: 20px;
}

Expand Down Expand Up @@ -87,7 +87,7 @@
background-color: @moduleBackgroundColor;
}
}
.edit_action {
.content_action {
float: right;
margin-top: -5px;
margin-right: -7px;
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/admin/base.html
Expand Up @@ -5,7 +5,7 @@
{% block breadcrumb_content %}
{% endblock %}

{% block page_header_tabs %}
{% block content_primary_nav %}
{{ h.build_nav_icon('ckanadmin_index', _('Sysadmins')) }}
{{ h.build_nav_icon('ckanadmin_config', _('Config')) }}
{% endblock %}
2 changes: 1 addition & 1 deletion ckan/templates/group/base_form_page.html
@@ -1,6 +1,6 @@
{% extends "group/index.html" %}

{% block add_action %}{% endblock %}
{% block page_primary_action %}{% endblock %}

{% block breadcrumb_content %}
<li>{{ h.nav_link(_('Groups'), controller='group', action='index') }}</li>
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/group/index.html
Expand Up @@ -8,7 +8,7 @@

{% block page_header %}{% endblock %}

{% block add_action %}
{% block page_primary_action %}
{% if h.check_access('group_create') %}
{% link_for _('Add Group'), controller='group', action='new', class_='btn btn-primary', icon='plus-sign-alt' %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/group/read.html
Expand Up @@ -2,7 +2,7 @@

{% block subtitle %}{{ c.group_dict.display_name }}{% endblock %}

{% block add_action %}
{% block page_primary_action %}
{% link_for _('Add Dataset'), controller='package', action='new', group=c.group_dict.id, class_='btn btn-primary', icon='plus-sign-alt' %}
{% endblock %}

Expand Down
4 changes: 2 additions & 2 deletions ckan/templates/group/read_base.html
Expand Up @@ -7,13 +7,13 @@
<li class="active">{% link_for c.group_dict.display_name|truncate(35), controller='group', action='read', id=c.group_dict.name %}</li>
{% endblock %}

{% block edit_action %}
{% block content_action %}
{% if h.check_access('group_update', {'id': c.group_dict.id}) %}
{% link_for _('Edit'), controller='group', action='edit', id=c.group_dict.name, class_='btn', icon='wrench' %}
{% endif %}
{% endblock %}

{% block page_header_tabs %}
{% block content_primary_nav %}
{{ h.build_nav_icon('group_read', _('Datasets'), id=c.group_dict.name) }}
{{ h.build_nav_icon('group_activity', _('Activity Stream'), id=c.group_dict.name, offset=0) }}
{{ h.build_nav_icon('group_about', _('About'), id=c.group_dict.name) }}
Expand Down
5 changes: 4 additions & 1 deletion ckan/templates/organization/bulk_process.html
Expand Up @@ -2,11 +2,14 @@

{% block subtitle %}{{ _('Edit datasets') }} - {{ super() }}{% endblock %}

{% block page_primary_action %}
{% link_for _('Add dataset'), controller='package', action='new', group=c.group_dict.id, class_='btn btn-primary', icon='plus-sign-alt' %}
{% endblock %}

{% block primary_content_inner %}
<div class="clearfix">
<h1 class="hide-heading">{{ _('Edit datasets') }}</h1>
<div class="primary">
{% link_for _('Add Dataset'), controller='package', action='new', group=c.group_dict.id, class_='btn pull-right', icon='plus-sign-alt' %}
<h3 class="page-heading">
{% block page_heading %}
{%- if c.page.item_count -%}
Expand Down
4 changes: 2 additions & 2 deletions ckan/templates/organization/edit_base.html
Expand Up @@ -12,14 +12,14 @@
{% endblock %}
{% endblock %}

{% block edit_action %}
{% block content_action %}
{% if organization and h.check_access('organization_update', {'id': organization.id}) %}
{% link_for _('View organization'), controller='organization', action='read', id=organization.name, class_='btn', icon='eye-open' %}
{% endif %}
{# <li>{% link_for _('History'), controller='organization', action='history', id=organization.name, class_='btn', icon='undo' %}</li> #}
{% endblock %}

{% block page_header_tabs %}
{% block content_primary_nav %}
{{ h.build_nav_icon('organization_edit', _('Edit'), id=c.group_dict.name) }}
{{ h.build_nav_icon('organization_bulk_process', _('Datasets'), id=c.group_dict.name) }}
{{ h.build_nav_icon('organization_members', _('Members'), id=c.group_dict.name) }}
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/organization/index.html
Expand Up @@ -8,7 +8,7 @@

{% block page_header %}{% endblock %}

{% block add_action %}
{% block page_primary_action %}
{% if h.check_access('organization_create') %}
{% link_for _('Add Organization'), controller='organization', action='new', class_='btn btn-primary', icon='plus-sign-alt' %}
{% endif %}
Expand Down
5 changes: 4 additions & 1 deletion ckan/templates/organization/members.html
Expand Up @@ -2,8 +2,11 @@

{% block subtitle %}{{ _('Members') }} - {{ c.group_dict.display_name }}{% endblock %}

{% block page_primary_action %}
{% link_for _('Add Member'), controller='organization', action='member_new', id=c.group_dict.id, class_='btn btn-primary', icon='plus-sign-alt' %}
{% endblock %}

{% block primary_content_inner %}
{% link_for _('Add Member'), controller='organization', action='member_new', id=c.group_dict.id, class_='btn pull-right', icon='plus-sign-alt' %}
<h3 class="page-heading">{{ _('{0} members'.format(c.members|length)) }}</h3>
<table class="table table-header table-hover table-bordered">
<col width="70" />
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/organization/read.html
@@ -1,6 +1,6 @@
{% extends "organization/read_base.html" %}

{% block add_action %}
{% block page_primary_action %}
{% if h.check_access('organization_update', {'id': c.group_dict.id}) %}
{% link_for _('Add Dataset'), controller='package', action='new', group=c.group_dict.id, class_='btn btn-primary', icon='plus-sign-alt' %}
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions ckan/templates/organization/read_base.html
Expand Up @@ -7,13 +7,13 @@
<li class="active">{% link_for c.group_dict.display_name|truncate(35), controller='organization', action='read', id=c.group_dict.name %}</li>
{% endblock %}

{% block edit_action %}
{% block content_action %}
{% if h.check_access('organization_update', {'id': c.group_dict.id}) %}
{% link_for _('Admin'), controller='organization', action='edit', id=c.group_dict.name, class_='btn', icon='wrench' %}
{% endif %}
{% endblock %}

{% block page_header_tabs %}
{% block content_primary_nav %}
{{ h.build_nav_icon('organization_read', _('Datasets'), id=c.group_dict.name) }}
{{ h.build_nav_icon('organization_activity', _('Activity Stream'), id=c.group_dict.name) }}
{{ h.build_nav_icon('organization_about', _('About'), id=c.group_dict.name) }}
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/package/edit.html
Expand Up @@ -13,7 +13,7 @@
{% snippet 'package/snippets/resources.html', pkg=pkg, action='resource_edit' %}
{% endblock %}

{% block edit_action %}
{% block content_action %}
{% link_for _('View dataset'), controller='package', action='read', id=pkg.name, class_='btn', icon='eye-open' %}
{% endblock %}

Expand Down
4 changes: 2 additions & 2 deletions ckan/templates/package/read_base.html
Expand Up @@ -14,13 +14,13 @@
<meta property="og:description" content="{{ description|forceescape }}">
{% endblock -%}

{% block edit_action %}
{% block content_action %}
{% if h.check_access('package_update', {'id':pkg.id }) %}
{% link_for _('Edit'), controller='package', action='edit', id=pkg.name, class_='btn', icon='wrench' %}
{% endif %}
{% endblock %}

{% block page_header_tabs %}
{% block content_primary_nav %}
{{ h.build_nav_icon('dataset_read', _('Dataset'), id=pkg.name) }}
{{ h.build_nav_icon('dataset_activity', _('Activity Stream'), id=pkg.name) }}
{{ h.build_nav_icon('related_list', _('Related'), id=pkg.name) }}
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/package/resource_edit.html
Expand Up @@ -12,7 +12,7 @@
<li class="active"><a href="">{{ _('Edit') }}</a></li>
{% endblock %}

{% block edit_action %}
{% block content_action %}
{% link_for _('View resource'), controller='package', action='resource_read', id=pkg_dict.name, resource_id=res.id, class_='btn', icon='eye-open' %}
{% endblock %}

Expand Down
4 changes: 2 additions & 2 deletions ckan/templates/package/search.html
Expand Up @@ -10,9 +10,9 @@
{% block primary_content %}
<section class="module">
<div class="module-content">
{% block add_action %}
{% block page_primary_action %}
{% if h.check_access('package_create') %}
<div class="add_action">
<div class="page_primary_action">
{% link_for _('Add Dataset'), controller='package', action='new', class_='btn btn-primary', icon='plus-sign-alt' %}
</div>
{% endif %}
Expand Down
14 changes: 7 additions & 7 deletions ckan/templates/page.html
Expand Up @@ -72,20 +72,20 @@ <h1>My page content</h1>
<article class="module">
{% block page_header %}
<header class="module-content page-header">
{% if self.edit_action() | trim %}
<div class="edit_action">
{% block edit_action %}{% endblock %}
{% if self.content_action() | trim %}
<div class="content_action">
{% block content_action %}{% endblock %}
</div>
{% endif %}
<ul class="nav nav-tabs">
{% block page_header_tabs %}{% endblock %}
{% block content_primary_nav %}{% endblock %}
</ul>
</header>
{% endblock %}
<div class="module-content">
{% if self.add_action() | trim %}
<div class="add_action">
{% block add_action %}{% endblock %}
{% if self.page_primary_action() | trim %}
<div class="page_primary_action">
{% block page_primary_action %}{% endblock %}
</div>
{% endif %}
{% block primary_content_inner %}
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/user/dashboard.html
@@ -1,6 +1,6 @@
{% extends "user/edit_base.html" %}

{% block add_action %}
{% block page_primary_action %}
{% if h.check_access('package_create') %}
{% link_for _('Add Dataset'), controller='package', action='new', class_="btn btn-primary", icon="plus-sign-alt" %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/user/edit_base.html
Expand Up @@ -13,7 +13,7 @@
{% block page_header %}
<header class="module-content page-header">
<ul class="nav nav-tabs">
{% block page_header_tabs %}
{% block content_primary_nav %}
{{ h.build_nav_icon('user_dashboard', _('News feed')) }}
{{ h.build_nav_icon('user_edit', _('Settings'), id=user.name) }}
{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/user/read_base.html
Expand Up @@ -23,7 +23,7 @@
{% block page_header %}
<header class="module-content page-header">
<ul class="nav nav-tabs">
{% block page_header_tabs %}
{% block content_primary_nav %}
{{ h.build_nav_icon('user_datasets', _('Datasets'), id=user.name) }}
{{ h.build_nav_icon('user_activity_stream', _('Activity Stream'), id=user.name) }}
{% endblock %}
Expand Down

0 comments on commit 69b0d88

Please sign in to comment.