Add text for header icons
--- a/ckanext/datagovau/plugin.py
+++ b/ckanext/datagovau/plugin.py
@@ -22,9 +22,6 @@
filtered_dict[dataset['id']] = dataset
return filtered_dict.values()
-def related_create(context, data_dict=None):
- return {'success': False, 'msg': 'No one is allowed to create related items'}
-
class DataGovAuPlugin(plugins.SingletonPlugin,
tk.DefaultDatasetForm):
'''An example IDatasetForm CKAN plugin.
@@ -34,10 +31,6 @@
'''
plugins.implements(plugins.IConfigurer, inherit=False)
plugins.implements(plugins.ITemplateHelpers, inherit=False)
- plugins.implements(plugins.IAuthFunctions)
-
- def get_auth_functions(self):
- return {'rekated_create': related_create}
def update_config(self, config):
# Add this plugin's templates dir to CKAN's extra_template_paths, so
--- a/ckanext/datagovau/templates/header.html
+++ b/ckanext/datagovau/templates/header.html
@@ -1,4 +1,41 @@
{% ckan_extends %}
+
+{% block header_account_logged %}
+{% if c.userobj.sysadmin %}
+<li>
+ <a href="{{ h.url_for(controller='admin', action='index') }}" title="{{ _('Sysadmin settings') }}">
+ <i class="icon-legal"> Sysadmin settings</i>
+ </a>
+</li>
+{% endif %}
+<li>
+ <a href="{{ h.url_for(controller='user', action='read', id=c.userobj.name) }}" class="image" title="{{ _('View profile') }}">
+ {{ h.gravatar((c.userobj.email_hash if c and c.userobj else ''), size=22) }}
+ <span class="username">{{ c.userobj.display_name }}</span>
+ </a>
+</li>
+{% set new_activities = h.new_activities() %}
+<li class="notifications {% if new_activities > 0 %}notifications-important{% endif %}">
+ {% set notifications_tooltip = ngettext('Dashboard (%(num)d new item)', 'Dashboard (%(num)d new items)', new_activities) %}
+ <a href="{{ h.url_for(controller='user', action='dashboard') }}" title="{{ notifications_tooltip }}">
+ <i class="icon-dashboard"> notifications_tooltip</i>
+ <span>{{ new_activities }}</span>
+ </a>
+</li>
+{% block header_account_settings_link %}
+<li>
+ <a href="{{ h.url_for(controller='user', action='edit', id=c.userobj.name) }}" title="{{ _('Edit settings') }}">
+ <i class="icon-cog"> Edit settings</i>
+ </a>
+</li>
+{% endblock %}
+{% block header_account_log_out_link %}
+<li>
+ <a href="{{ h.url_for('/user/_logout') }}" title="{{ _('Log out') }}">
+ <i class="icon-signout"> Log out</i>
+ </a>
+</li>
+{% endblock %}
{% block header_site_navigation %}
<nav class="section navigation">
--- a/ckanext/datagovau/templates/home/snippets/promoted.html
+++ /dev/null
@@ -1,17 +1,1 @@
-{% set intro = g.site_intro_text %}
-<div class="module-content box">
- <header>
- {% if intro %}
- {{ h.render_markdown(intro) }}
- {% else %}
- <h1 class="page-heading">{{ _("Welcome to CKAN") }}</h1>
- <p>
- {% trans %}This is a nice introductory paragraph about CKAN or the site
- in general. We don't have any copy to go here yet but soon we will
- {% endtrans %}
- </p>
- {% endif %}
- </header>
-</div>
-