From: Alex Sadleir Date: Mon, 12 May 2014 01:00:56 +0000 Subject: related auth func X-Git-Url: https://maxious.lambdacomplex.org/git/?p=ckanext-datagovau.git&a=commitdiff&h=0c359c5cf4f96321d5758623e3882b64b9227c18 --- related auth func --- --- a/README.rst +++ b/README.rst @@ -7,7 +7,7 @@ * Provides HTML to users to embed data previews on their own website * A cut down licenses.json file -This extension is complimented by ckanext-agls for AGLS metadata and ckanext-googleanalytics for Google Analytics tracking of API usage +This extension is complemented by ckanext-agls for AGLS metadata, ckanext-googleanalytics for Google Analytics tracking of API usage and ckanext-dga-stats for the customised site statistics page. Installation ============ --- /dev/null +++ b/admin/start.sh @@ -1,1 +1,6 @@ +export NEW_RELIC_CONFIG_FILE="newrelic.ini" +export VIRTUAL_ENV="/var/lib/ckan/dga/pyenv" +export PATH="/var/lib/ckan/dga/pyenv:/var/lib/ckan/dga/pyenv/bin:$PATH" +cd /var/lib/ckan/dga/pyenv/src/ckan +newrelic-admin run-program paster serve development.ini --- a/ckanext/datagovau/plugin.py +++ b/ckanext/datagovau/plugin.py @@ -22,6 +22,9 @@ 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. @@ -31,6 +34,10 @@ ''' 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 --- /dev/null +++ b/ckanext/datagovau/templates/header.html @@ -1,1 +1,18 @@ +{% ckan_extends %} +{% block header_site_navigation %} + +{% endblock %} + --- /dev/null +++ b/ckanext/datagovau/templates/home/index.html @@ -1,1 +1,47 @@ +{% ckan_extends %} +{% block home_secondary_content %} + + +
+ + + +{{ super() }} + {% endblock %} + --- /dev/null +++ b/ckanext/datagovau/templates/home/snippets/promoted.html @@ -1,1 +1,17 @@ +{% set intro = g.site_intro_text %} +
+
+ {% if intro %} + {{ h.render_markdown(intro) }} + {% else %} +

{{ _("Welcome to CKAN") }}

+

+ {% 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 %} +

+ {% endif %} +
+
+ --- /dev/null +++ b/ckanext/datagovau/templates/home/snippets/stats.html @@ -1,1 +1,78 @@ +{% set stats = h.get_site_statistics() %} + +
+ +
+ +
+
+ + + + + +