diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6dce68e7c..14a7de4eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: needs: lint strategy: matrix: - ckan-version: ["2.10"] + ckan-version: ["2.11"] fail-fast: false name: CKAN ${{ matrix.ckan-version }} @@ -56,12 +56,12 @@ jobs: -v "${{ github.workspace }}/solr/stopwords_en.txt":"$SOLR_CONFIG_CKAN_DIR/stopwords_en.txt" \ -v "${{ github.workspace }}/solr/stopwords_fr.txt":"$SOLR_CONFIG_CKAN_DIR/stopwords_fr.txt" \ -v "${{ github.workspace }}/solr/stopwords_it.txt":"$SOLR_CONFIG_CKAN_DIR/stopwords_it.txt" \ - ckan/ckan-solr:${{ matrix.ckan-version }} + ckan/ckan-solr:${{ matrix.ckan-version }}-solr9 docker start test_solr - name: Create ckan container run: | /usr/bin/docker create --name test_ckan --network ${{ job.container.network }} --network-alias ckan \ - --env-file ${{ github.workspace }}/github-workflow.env \ + --env-file ${{ github.workspace }}/github-workflow.env --user root \ -v "/var/run/docker.sock":"/var/run/docker.sock" \ -v "/home/runner/work":"/__w" -v "/home/runner/work/_temp":"/__w/_temp" \ -v "/home/runner/work/_actions":"/__w/_actions" -v "/opt/hostedtoolcache":"/__t" \ diff --git a/README.md b/README.md index 176b7c0b7..cb1aee307 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ ckanext-switzerland =================== -CKAN extension for DCAT-AP Switzerland, templates and different plugins including FTP- and S3-Harvester for [opentransportdata.swiss](https://opentransportdata.swiss). +CKAN extension for DCAT-AP Switzerland, templates and different plugins including FTP- and S3-Harvester for +[opentransportdata.swiss](https://opentransportdata.swiss). ## Requirements -- CKAN 2.8+ +- CKAN 2.10+ - ckanext-fluent - ckanext-harvest - ckanext-scheming @@ -35,15 +36,12 @@ To install ckanext-switzerland: This extension uses the following config options (.ini file) - # the URL of the WordPress AJAX interface - ckanext.switzerland.wp_ajax_url = https://wp/wp-admin/admin-ajax.php - ckanext.switzerland.wp_ajax_url = http://wp/cms/wp-admin/admin-ajax.php - ckanext.switzerland.wp_template_url = http://wp/cms/wp-admin/admin-post.php?action=get_nav - ckanext.switzerland.wp_url = http://wp + # For linking to the associated WordPress site from the header logo + ckanext.switzerland.wp_url - # matomo config - matomo.site_id = 1 - matomo.url = stats.opentransportdata.swiss + # For managing cookie consent and tracking with OneTrust and Matomo + ckanext.switzerland.cookie_law_url + ckanext.switzerland.cookie_law_id ## Development Installation @@ -183,7 +181,7 @@ The harvester will receive its configuration from the Database. This configuration will be passed to the `StorageAdapterFactory`. This object has for sole responsibility to read the configuration, and decide which Storage Adapter to instantiate. -THe two possibilities are `S3StorageAdapter` or `FTPStorageAdapter`. +The two possibilities are `S3StorageAdapter` or `FTPStorageAdapter`. Both classes extends the `StorageAdapterBase` class. In this base class, designed as an abstract class (meaning all methods are there, and the ones that have to be reimplement just throw `NotImplementedException`), @@ -193,3 +191,53 @@ but also some common function to manage the local folder used by the harvesters Each implementation (`S3StorageAdapter` and `FTPStorageAdapter`), are responsible to get their storage configuration, from the storage identifier received from the harvester configuration. Each implementation is also unit tested, see respectively `TestS3StorageAdapter` and `TestFTPStorageAdapter` classes. + +# Updating the translations + +The translation files for this ckanext are found in `i18n/`: + - `ckanext-switzerland.pot`: this is a template file containing all the translatable strings found in the code + - `{LANG}/LC_MESSAGES/ckanext-switzerland.po`: one translation file for each of our supported languages apart from +English (German, French and Italian) + - `{LANG}/LC_MESSAGES/ckanext-switzerland.mo`: the compiled translations in binary format + +If you update the code and add or remove translatable strings, you will have to update the translations too. + +The following instructions assume you are working inside a docker container based on the official [Docker Compose setup +for CKAN](https://github.com/ckan/ckan-docker/). + +1. Enter the container and go to the ckanext-switzerland directory: + ```shell + docker compose exec ckan bash + cd src_extensions/ckanext-switzerland/ + ``` +2. Update the `.pot` file: + ```shell + python setup.py extract_messages + ``` +3. *Optional* If you have copied templates from core CKAN to override them, you might want to copy the translations +from CKAN too: + ```shell + apt-get install gettext + msgcat --use-first i18n/de/LC_MESSAGES/ckanext-switzerland.po ../../src/ckan/ckan/i18n/de/LC_MESSAGES/ckan.po > temp_de.po + cp temp_de.po i18n/de/LC_MESSAGES/ckanext-switzerland.po + msgcat --use-first i18n/fr/LC_MESSAGES/ckanext-switzerland.po ../../src/ckan/ckan/i18n/fr/LC_MESSAGES/ckan.po > temp_fr.po + cp temp_fr.po i18n/fr/LC_MESSAGES/ckanext-switzerland.po + msgcat --use-first i18n/it/LC_MESSAGES/ckanext-switzerland.po ../../src/ckan/ckan/i18n/it/LC_MESSAGES/ckan.po > temp_it.po + cp temp_it.po i18n/it/LC_MESSAGES/ckanext-switzerland.po + rm temp_de.po temp_fr.po temp_it.po + ``` + This adds a lot of translations to our `.po` files that we don't want, but they will be removed in the next step. +4. Update the `.po` files: + ```shell + python setup.py update_catalog --ignore-obsolete=true --no-fuzzy-matching + ``` + To update one language at a time, add `-l de` (etc.) to the command. +5. Check the `.po` files and add any new translations that are needed. +6. Update the `.mo` files: + ```shell + python setup.py compile_catalog + ``` +7. Restart the docker container: + ```shell + docker compose restart ckan + ``` diff --git a/bin/build-combined-ckan-mo.sh b/bin/build-combined-ckan-mo.sh deleted file mode 100755 index 46a0cf1b0..000000000 --- a/bin/build-combined-ckan-mo.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -HERE=`dirname $0` -msgcat --use-first \ - "$HERE/../i18n/de/LC_MESSAGES/ckanext-switzerland.po" \ - "$HERE/../../../ckan/ckan/i18n/de/LC_MESSAGES/ckan.po" \ - | msgfmt - -o "$HERE/../../../ckan/ckan/i18n/de/LC_MESSAGES/ckan.mo" -msgcat --use-first \ - "$HERE/../i18n/fr/LC_MESSAGES/ckanext-switzerland.po" \ - "$HERE/../../../ckan/ckan/i18n/fr/LC_MESSAGES/ckan.po" \ - | msgfmt - -o "$HERE/../../../ckan/ckan/i18n/fr/LC_MESSAGES/ckan.mo" -msgcat --use-first \ - "$HERE/../i18n/it/LC_MESSAGES/ckanext-switzerland.po" \ - "$HERE/../../../ckan/ckan/i18n/it/LC_MESSAGES/ckan.po" \ - | msgfmt - -o "$HERE/../../../ckan/ckan/i18n/it/LC_MESSAGES/ckan.mo" diff --git a/bin/install_test_requirements.sh b/bin/install_test_requirements.sh index 57a92528a..f36fb732c 100755 --- a/bin/install_test_requirements.sh +++ b/bin/install_test_requirements.sh @@ -6,18 +6,14 @@ pip install --ignore-installed -r /__w/ckanext-switzerland/ckanext-switzerland/d pip install -e /__w/ckanext-switzerland/ckanext-switzerland/ # Install ckanext dependencies -pip install -e git+https://github.com/ckan/ckanext-dcat.git@v1.5.1#egg=ckanext-dcat -pip install -r https://raw.githubusercontent.com/ckan/ckanext-dcat/v1.5.1/requirements.txt -pip install -e git+https://gitlab.liip.ch/odp_oev_schweiz/ckanext-harvest.git@v1.0.2#egg=ckanext-harvest -pip install -r https://gitlab.liip.ch/odp_oev_schweiz/ckanext-harvest/-/raw/v1.0.2/requirements.txt -pip install -e git+https://github.com/ckan/ckanext-scheming.git@release-3.0.0#egg=ckanext-scheming +pip install -e git+https://github.com/ckan/ckanext-dcat.git#egg=ckanext-dcat +pip install -r https://raw.githubusercontent.com/ckan/ckanext-dcat/master/requirements.txt +pip install -e git+https://gitlab.liip.ch/odp_oev_schweiz/ckanext-harvest.git#egg=ckanext-harvest +pip install -r https://gitlab.liip.ch/odp_oev_schweiz/ckanext-harvest/-/raw/main/requirements.txt +pip install -e git+https://github.com/ckan/ckanext-scheming.git#egg=ckanext-scheming pip install -e git+https://github.com/ckan/ckanext-fluent.git#egg=ckanext-fluent pip install -r https://raw.githubusercontent.com/ckan/ckanext-fluent/master/requirements.txt -# Replace default path to CKAN core config file with the one on the container -sed -i -e 's/use = config:.*/use = config:\/srv\/app\/src\/ckan\/test-core.ini/' /__w/ckanext-switzerland/ckanext-switzerland/test.ini - # Init db and re-enable required plugins -ckan config-tool /__w/ckanext-switzerland/ckanext-switzerland/test.ini "ckan.plugins = " ckan -c /__w/ckanext-switzerland/ckanext-switzerland/test.ini db init -ckan config-tool /__w/ckanext-switzerland/ckanext-switzerland/test.ini "ckan.plugins = ogdch ogdch_pkg ogdch_res ogdch_group ogdch_org harvest sbb_harvester timetable_harvester datastore fluent scheming_datasets scheming_groups scheming_organizations" +ckan -c /__w/ckanext-switzerland/ckanext-switzerland/test.ini db pending-migrations --apply diff --git a/ckanext/switzerland/assets/a_vue.js b/ckanext/switzerland/assets/a_vue.js deleted file mode 100644 index 2c9a8a0e1..000000000 --- a/ckanext/switzerland/assets/a_vue.js +++ /dev/null @@ -1,9 +0,0 @@ -/*! - * Vue.js v1.0.26 - * (c) 2016 Evan You - * Released under the MIT License. - */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Vue=e()}(this,function(){"use strict";function t(e,n,r){if(i(e,n))return void(e[n]=r);if(e._isVue)return void t(e._data,n,r);var s=e.__ob__;if(!s)return void(e[n]=r);if(s.convert(n,r),s.dep.notify(),s.vms)for(var o=s.vms.length;o--;){var a=s.vms[o];a._proxy(n),a._digest()}return r}function e(t,e){if(i(t,e)){delete t[e];var n=t.__ob__;if(!n)return void(t._isVue&&(delete t._data[e],t._digest()));if(n.dep.notify(),n.vms)for(var r=n.vms.length;r--;){var s=n.vms[r];s._unproxy(e),s._digest()}}}function i(t,e){return Oi.call(t,e)}function n(t){return Ti.test(t)}function r(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function s(t){return null==t?"":t.toString()}function o(t){if("string"!=typeof t)return t;var e=Number(t);return isNaN(e)?t:e}function a(t){return"true"===t?!0:"false"===t?!1:t}function h(t){var e=t.charCodeAt(0),i=t.charCodeAt(t.length-1);return e!==i||34!==e&&39!==e?t:t.slice(1,-1)}function l(t){return t.replace(Ni,c)}function c(t,e){return e?e.toUpperCase():""}function u(t){return t.replace(ji,"$1-$2").toLowerCase()}function f(t){return t.replace(Ei,c)}function p(t,e){return function(i){var n=arguments.length;return n?n>1?t.apply(e,arguments):t.call(e,i):t.call(e)}}function d(t,e){e=e||0;for(var i=t.length-e,n=new Array(i);i--;)n[i]=t[i+e];return n}function v(t,e){for(var i=Object.keys(e),n=i.length;n--;)t[i[n]]=e[i[n]];return t}function m(t){return null!==t&&"object"==typeof t}function g(t){return Si.call(t)===Fi}function _(t,e,i,n){Object.defineProperty(t,e,{value:i,enumerable:!!n,writable:!0,configurable:!0})}function y(t,e){var i,n,r,s,o,a=function h(){var a=Date.now()-s;e>a&&a>=0?i=setTimeout(h,e-a):(i=null,o=t.apply(r,n),i||(r=n=null))};return function(){return r=this,n=arguments,s=Date.now(),i||(i=setTimeout(a,e)),o}}function b(t,e){for(var i=t.length;i--;)if(t[i]===e)return i;return-1}function w(t){var e=function i(){return i.cancelled?void 0:t.apply(this,arguments)};return e.cancel=function(){e.cancelled=!0},e}function C(t,e){return t==e||(m(t)&&m(e)?JSON.stringify(t)===JSON.stringify(e):!1)}function $(t){this.size=0,this.limit=t,this.head=this.tail=void 0,this._keymap=Object.create(null)}function k(){var t,e=en.slice(hn,on).trim();if(e){t={};var i=e.match(vn);t.name=i[0],i.length>1&&(t.args=i.slice(1).map(x))}t&&(nn.filters=nn.filters||[]).push(t),hn=on+1}function x(t){if(mn.test(t))return{value:o(t),dynamic:!1};var e=h(t),i=e===t;return{value:i?t:e,dynamic:i}}function A(t){var e=dn.get(t);if(e)return e;for(en=t,ln=cn=!1,un=fn=pn=0,hn=0,nn={},on=0,an=en.length;an>on;on++)if(sn=rn,rn=en.charCodeAt(on),ln)39===rn&&92!==sn&&(ln=!ln);else if(cn)34===rn&&92!==sn&&(cn=!cn);else if(124===rn&&124!==en.charCodeAt(on+1)&&124!==en.charCodeAt(on-1))null==nn.expression?(hn=on+1,nn.expression=en.slice(0,on).trim()):k();else switch(rn){case 34:cn=!0;break;case 39:ln=!0;break;case 40:pn++;break;case 41:pn--;break;case 91:fn++;break;case 93:fn--;break;case 123:un++;break;case 125:un--}return null==nn.expression?nn.expression=en.slice(0,on).trim():0!==hn&&k(),dn.put(t,nn),nn}function O(t){return t.replace(_n,"\\$&")}function T(){var t=O(An.delimiters[0]),e=O(An.delimiters[1]),i=O(An.unsafeDelimiters[0]),n=O(An.unsafeDelimiters[1]);bn=new RegExp(i+"((?:.|\\n)+?)"+n+"|"+t+"((?:.|\\n)+?)"+e,"g"),wn=new RegExp("^"+i+"((?:.|\\n)+?)"+n+"$"),yn=new $(1e3)}function N(t){yn||T();var e=yn.get(t);if(e)return e;if(!bn.test(t))return null;for(var i,n,r,s,o,a,h=[],l=bn.lastIndex=0;i=bn.exec(t);)n=i.index,n>l&&h.push({value:t.slice(l,n)}),r=wn.test(i[0]),s=r?i[1]:i[2],o=s.charCodeAt(0),a=42===o,s=a?s.slice(1):s,h.push({tag:!0,value:s.trim(),html:r,oneTime:a}),l=n+i[0].length;return l1?t.map(function(t){return E(t,e)}).join("+"):E(t[0],e,!0)}function E(t,e,i){return t.tag?t.oneTime&&e?'"'+e.$eval(t.value)+'"':S(t.value,i):'"'+t.value+'"'}function S(t,e){if(Cn.test(t)){var i=A(t);return i.filters?"this._applyFilters("+i.expression+",null,"+JSON.stringify(i.filters)+",false)":"("+t+")"}return e?t:"("+t+")"}function F(t,e,i,n){R(t,1,function(){e.appendChild(t)},i,n)}function D(t,e,i,n){R(t,1,function(){B(t,e)},i,n)}function P(t,e,i){R(t,-1,function(){z(t)},e,i)}function R(t,e,i,n,r){var s=t.__v_trans;if(!s||!s.hooks&&!qi||!n._isCompiled||n.$parent&&!n.$parent._isCompiled)return i(),void(r&&r());var o=e>0?"enter":"leave";s[o](i,r)}function L(t){if("string"==typeof t){t=document.querySelector(t)}return t}function H(t){if(!t)return!1;var e=t.ownerDocument.documentElement,i=t.parentNode;return e===t||e===i||!(!i||1!==i.nodeType||!e.contains(i))}function I(t,e){var i=t.getAttribute(e);return null!==i&&t.removeAttribute(e),i}function M(t,e){var i=I(t,":"+e);return null===i&&(i=I(t,"v-bind:"+e)),i}function V(t,e){return t.hasAttribute(e)||t.hasAttribute(":"+e)||t.hasAttribute("v-bind:"+e)}function B(t,e){e.parentNode.insertBefore(t,e)}function W(t,e){e.nextSibling?B(t,e.nextSibling):e.parentNode.appendChild(t)}function z(t){t.parentNode.removeChild(t)}function U(t,e){e.firstChild?B(t,e.firstChild):e.appendChild(t)}function J(t,e){var i=t.parentNode;i&&i.replaceChild(e,t)}function q(t,e,i,n){t.addEventListener(e,i,n)}function Q(t,e,i){t.removeEventListener(e,i)}function G(t){var e=t.className;return"object"==typeof e&&(e=e.baseVal||""),e}function Z(t,e){Mi&&!/svg$/.test(t.namespaceURI)?t.className=e:t.setAttribute("class",e)}function X(t,e){if(t.classList)t.classList.add(e);else{var i=" "+G(t)+" ";i.indexOf(" "+e+" ")<0&&Z(t,(i+e).trim())}}function Y(t,e){if(t.classList)t.classList.remove(e);else{for(var i=" "+G(t)+" ",n=" "+e+" ";i.indexOf(n)>=0;)i=i.replace(n," ");Z(t,i.trim())}t.className||t.removeAttribute("class")}function K(t,e){var i,n;if(it(t)&&at(t.content)&&(t=t.content),t.hasChildNodes())for(tt(t),n=e?document.createDocumentFragment():document.createElement("div");i=t.firstChild;)n.appendChild(i);return n}function tt(t){for(var e;e=t.firstChild,et(e);)t.removeChild(e);for(;e=t.lastChild,et(e);)t.removeChild(e)}function et(t){return t&&(3===t.nodeType&&!t.data.trim()||8===t.nodeType)}function it(t){return t.tagName&&"template"===t.tagName.toLowerCase()}function nt(t,e){var i=An.debug?document.createComment(t):document.createTextNode(e?" ":"");return i.__v_anchor=!0,i}function rt(t){if(t.hasAttributes())for(var e=t.attributes,i=0,n=e.length;n>i;i++){var r=e[i].name;if(Nn.test(r))return l(r.replace(Nn,""))}}function st(t,e,i){for(var n;t!==e;)n=t.nextSibling,i(t),t=n;i(e)}function ot(t,e,i,n,r){function s(){if(a++,o&&a>=h.length){for(var t=0;tr;r++){var o=n[r];jn.test(o)||En.test(o)||(e=i[o],g(e)&&(i[o]=wi.extend(e)))}}function dt(t){var e,i,n=t.props;if(Di(n))for(t.props={},e=n.length;e--;)i=n[e],"string"==typeof i?t.props[i]=null:i.name&&(t.props[i.name]=i);else if(g(n)){var r=Object.keys(n);for(e=r.length;e--;)i=n[r[e]],"function"==typeof i&&(n[r[e]]={type:i})}}function vt(t){if(Di(t)){for(var e,i={},n=t.length;n--;){e=t[n];var r="function"==typeof e?e.options&&e.options.name||e.id:e.name||e.id;r&&(i[r]=e)}return i}return t}function mt(t,e,n){function r(i){var r=Sn[i]||Fn;o[i]=r(t[i],e[i],n,i)}pt(e),dt(e);var s,o={};if(e["extends"]&&(t="function"==typeof e["extends"]?mt(t,e["extends"].options,n):mt(t,e["extends"],n)),e.mixins)for(var a=0,h=e.mixins.length;h>a;a++){var l=e.mixins[a],c=l.prototype instanceof wi?l.options:l;t=mt(t,c,n)}for(s in t)r(s);for(s in e)i(t,s)||r(s);return o}function gt(t,e,i,n){if("string"==typeof i){var r,s=t[e],o=s[i]||s[r=l(i)]||s[r.charAt(0).toUpperCase()+r.slice(1)];return o}}function _t(){this.id=Dn++,this.subs=[]}function yt(t){Hn=!1,t(),Hn=!0}function bt(t){if(this.value=t,this.dep=new _t,_(t,"__ob__",this),Di(t)){var e=Pi?wt:Ct;e(t,Rn,Ln),this.observeArray(t)}else this.walk(t)}function wt(t,e){t.__proto__=e}function Ct(t,e,i){for(var n=0,r=i.length;r>n;n++){var s=i[n];_(t,s,e[s])}}function $t(t,e){if(t&&"object"==typeof t){var n;return i(t,"__ob__")&&t.__ob__ instanceof bt?n=t.__ob__:Hn&&(Di(t)||g(t))&&Object.isExtensible(t)&&!t._isVue&&(n=new bt(t)),n&&e&&n.addVm(e),n}}function kt(t,e,i){var n=new _t,r=Object.getOwnPropertyDescriptor(t,e);if(!r||r.configurable!==!1){var s=r&&r.get,o=r&&r.set,a=$t(i);Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var e=s?s.call(t):i;if(_t.target&&(n.depend(),a&&a.dep.depend(),Di(e)))for(var r,o=0,h=e.length;h>o;o++)r=e[o],r&&r.__ob__&&r.__ob__.dep.depend();return e},set:function(e){var r=s?s.call(t):i;e!==r&&(o?o.call(t,e):i=e,a=$t(e),n.notify())}})}}function xt(t){t.prototype._init=function(t){t=t||{},this.$el=null,this.$parent=t.parent,this.$root=this.$parent?this.$parent.$root:this,this.$children=[],this.$refs={},this.$els={},this._watchers=[],this._directives=[],this._uid=Mn++,this._isVue=!0,this._events={},this._eventsCount={},this._isFragment=!1,this._fragment=this._fragmentStart=this._fragmentEnd=null,this._isCompiled=this._isDestroyed=this._isReady=this._isAttached=this._isBeingDestroyed=this._vForRemoving=!1,this._unlinkFn=null,this._context=t._context||this.$parent,this._scope=t._scope,this._frag=t._frag,this._frag&&this._frag.children.push(this),this.$parent&&this.$parent.$children.push(this),t=this.$options=mt(this.constructor.options,t,this),this._updateRef(),this._data={},this._callHook("init"),this._initState(),this._initEvents(),this._callHook("created"),t.el&&this.$mount(t.el)}}function At(t){if(void 0===t)return"eof";var e=t.charCodeAt(0);switch(e){case 91:case 93:case 46:case 34:case 39:case 48:return t;case 95:case 36:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return e>=97&&122>=e||e>=65&&90>=e?"ident":e>=49&&57>=e?"number":"else"}function Ot(t){var e=t.trim();return"0"===t.charAt(0)&&isNaN(t)?!1:n(e)?h(e):"*"+e}function Tt(t){function e(){var e=t[c+1];return u===Xn&&"'"===e||u===Yn&&'"'===e?(c++,n="\\"+e,p[Bn](),!0):void 0}var i,n,r,s,o,a,h,l=[],c=-1,u=Jn,f=0,p=[];for(p[Wn]=function(){void 0!==r&&(l.push(r),r=void 0)},p[Bn]=function(){void 0===r?r=n:r+=n},p[zn]=function(){p[Bn](),f++},p[Un]=function(){if(f>0)f--,u=Zn,p[Bn]();else{if(f=0,r=Ot(r),r===!1)return!1;p[Wn]()}};null!=u;)if(c++,i=t[c],"\\"!==i||!e()){if(s=At(i),h=er[u],o=h[s]||h["else"]||tr,o===tr)return;if(u=o[0],a=p[o[1]],a&&(n=o[2],n=void 0===n?i:n,a()===!1))return;if(u===Kn)return l.raw=t,l}}function Nt(t){var e=Vn.get(t);return e||(e=Tt(t),e&&Vn.put(t,e)),e}function jt(t,e){return It(e).get(t)}function Et(e,i,n){var r=e;if("string"==typeof i&&(i=Tt(i)),!i||!m(e))return!1;for(var s,o,a=0,h=i.length;h>a;a++)s=e,o=i[a],"*"===o.charAt(0)&&(o=It(o.slice(1)).get.call(r,r)),h-1>a?(e=e[o],m(e)||(e={},t(s,o,e))):Di(e)?e.$set(o,n):o in e?e[o]=n:t(e,o,n);return!0}function St(){}function Ft(t,e){var i=vr.length;return vr[i]=e?t.replace(lr,"\\n"):t,'"'+i+'"'}function Dt(t){var e=t.charAt(0),i=t.slice(1);return sr.test(i)?t:(i=i.indexOf('"')>-1?i.replace(ur,Pt):i,e+"scope."+i)}function Pt(t,e){return vr[e]}function Rt(t){ar.test(t),vr.length=0;var e=t.replace(cr,Ft).replace(hr,"");return e=(" "+e).replace(pr,Dt).replace(ur,Pt),Lt(e)}function Lt(t){try{return new Function("scope","return "+t+";")}catch(e){return St}}function Ht(t){var e=Nt(t);return e?function(t,i){Et(t,e,i)}:void 0}function It(t,e){t=t.trim();var i=nr.get(t);if(i)return e&&!i.set&&(i.set=Ht(i.exp)),i;var n={exp:t};return n.get=Mt(t)&&t.indexOf("[")<0?Lt("scope."+t):Rt(t),e&&(n.set=Ht(t)),nr.put(t,n),n}function Mt(t){return fr.test(t)&&!dr.test(t)&&"Math."!==t.slice(0,5)}function Vt(){gr.length=0,_r.length=0,yr={},br={},wr=!1}function Bt(){for(var t=!0;t;)t=!1,Wt(gr),Wt(_r),gr.length?t=!0:(Li&&An.devtools&&Li.emit("flush"),Vt())}function Wt(t){for(var e=0;e0){var o=s+(n?e:ht(e));r=Pr.get(o),r||(r=De(i,t.$options,!0),Pr.put(o,r))}else r=De(i,t.$options,!0);this.linker=r}function oe(t,e,i){var n=t.node.previousSibling;if(n){for(t=n.__v_frag;!(t&&t.forId===i&&t.inserted||n===e);){if(n=n.previousSibling,!n)return;t=n.__v_frag}return t}}function ae(t){var e=t.node;if(t.end)for(;!e.__vue__&&e!==t.end&&e.nextSibling;)e=e.nextSibling;return e.__vue__}function he(t){for(var e=-1,i=new Array(Math.floor(t));++ea;a++)if(n=t.options[a],s=i?n.hasAttribute("selected"):n.selected){if(r=n.hasOwnProperty("_value")?n._value:n.value,!e)return r;o.push(r)}return o}function ue(t,e){for(var i=t.length;i--;)if(C(t[i],e))return i;return-1}function fe(t,e){var i=e.map(function(t){var e=t.charCodeAt(0);return e>47&&58>e?parseInt(t,10):1===t.length&&(e=t.toUpperCase().charCodeAt(0),e>64&&91>e)?e:is[t]});return i=[].concat.apply([],i),function(e){return i.indexOf(e.keyCode)>-1?t.call(this,e):void 0}}function pe(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function de(t){return function(e){return e.preventDefault(),t.call(this,e)}}function ve(t){return function(e){return e.target===e.currentTarget?t.call(this,e):void 0}}function me(t){if(as[t])return as[t];var e=ge(t);return as[t]=as[e]=e,e}function ge(t){t=u(t);var e=l(t),i=e.charAt(0).toUpperCase()+e.slice(1);hs||(hs=document.createElement("div"));var n,r=rs.length;if("filter"!==e&&e in hs.style)return{kebab:t,camel:e};for(;r--;)if(n=ss[r]+i,n in hs.style)return{kebab:rs[r]+t,camel:n}}function _e(t){var e=[];if(Di(t))for(var i=0,n=t.length;n>i;i++){var r=t[i];if(r)if("string"==typeof r)e.push(r);else for(var s in r)r[s]&&e.push(s)}else if(m(t))for(var o in t)t[o]&&e.push(o);return e}function ye(t,e,i){if(e=e.trim(),-1===e.indexOf(" "))return void i(t,e);for(var n=e.split(/\s+/),r=0,s=n.length;s>r;r++)i(t,n[r])}function be(t,e,i){function n(){++s>=r?i():t[s].call(e,n)}var r=t.length,s=0;t[0].call(e,n)}function we(t,e,i){for(var r,s,o,a,h,c,f,p=[],d=Object.keys(e),v=d.length;v--;)s=d[v],r=e[s]||ks,h=l(s),xs.test(h)&&(f={name:s,path:h,options:r,mode:$s.ONE_WAY,raw:null},o=u(s),null===(a=M(t,o))&&(null!==(a=M(t,o+".sync"))?f.mode=$s.TWO_WAY:null!==(a=M(t,o+".once"))&&(f.mode=$s.ONE_TIME)),null!==a?(f.raw=a,c=A(a),a=c.expression,f.filters=c.filters,n(a)&&!c.filters?f.optimizedLiteral=!0:f.dynamic=!0,f.parentPath=a):null!==(a=I(t,o))&&(f.raw=a),p.push(f));return Ce(p)}function Ce(t){return function(e,n){e._props={};for(var r,s,l,c,f,p=e.$options.propsData,d=t.length;d--;)if(r=t[d],f=r.raw,s=r.path,l=r.options,e._props[s]=r,p&&i(p,s)&&ke(e,r,p[s]),null===f)ke(e,r,void 0);else if(r.dynamic)r.mode===$s.ONE_TIME?(c=(n||e._context||e).$get(r.parentPath),ke(e,r,c)):e._context?e._bindDir({name:"prop",def:Os,prop:r},null,null,n):ke(e,r,e.$get(r.parentPath));else if(r.optimizedLiteral){var v=h(f);c=v===f?a(o(f)):v,ke(e,r,c)}else c=l.type!==Boolean||""!==f&&f!==u(r.name)?f:!0,ke(e,r,c)}}function $e(t,e,i,n){var r=e.dynamic&&Mt(e.parentPath),s=i;void 0===s&&(s=Ae(t,e)),s=Te(e,s,t);var o=s!==i;Oe(e,s,t)||(s=void 0),r&&!o?yt(function(){n(s)}):n(s)}function ke(t,e,i){$e(t,e,i,function(i){kt(t,e.path,i)})}function xe(t,e,i){$e(t,e,i,function(i){t[e.path]=i})}function Ae(t,e){var n=e.options;if(!i(n,"default"))return n.type===Boolean?!1:void 0;var r=n["default"];return m(r),"function"==typeof r&&n.type!==Function?r.call(t):r}function Oe(t,e,i){if(!t.options.required&&(null===t.raw||null==e))return!0;var n=t.options,r=n.type,s=!r,o=[];if(r){Di(r)||(r=[r]);for(var a=0;ar;r++)n[r]._bind();return n}function Re(t,e){return t=t.descriptor.def.priority||zs,e=e.descriptor.def.priority||zs,t>e?-1:t===e?0:1}function Le(t,e,i,n){function r(r){He(t,e,r),i&&n&&He(i,n)}return r.dirs=e,r}function He(t,e,i){for(var n=e.length;n--;)e[n]._teardown()}function Ie(t,e,i,n){var r=we(e,i,t),s=Pe(function(){r(t,n)},t);return Le(t,s)}function Me(t,e,i){var n,r,s=e._containerAttrs,o=e._replacerAttrs;return 11!==t.nodeType&&(e._asComponent?(s&&i&&(n=ti(s,i)),o&&(r=ti(o,e))):r=ti(t.attributes,e)),e._containerAttrs=e._replacerAttrs=null,function(t,e,i){var s,o=t._context;o&&n&&(s=Pe(function(){n(o,e,null,i)},o));var a=Pe(function(){r&&r(t,e)},t);return Le(t,a,o,s)}}function Ve(t,e){var i=t.nodeType;return 1!==i||ri(t)?3===i&&t.data.trim()?We(t,e):null:Be(t,e)}function Be(t,e){if("TEXTAREA"===t.tagName){var i=N(t.value);i&&(t.setAttribute(":value",j(i)),t.value="")}var n,r=t.hasAttributes(),s=r&&d(t.attributes);return r&&(n=Xe(t,s,e)),n||(n=Ge(t,e)),n||(n=Ze(t,e)),!n&&r&&(n=ti(s,e)),n}function We(t,e){if(t._skip)return ze;var i=N(t.wholeText);if(!i)return null;for(var n=t.nextSibling;n&&3===n.nodeType;)n._skip=!0,n=n.nextSibling;for(var r,s,o=document.createDocumentFragment(),a=0,h=i.length;h>a;a++)s=i[a],r=s.tag?Ue(s,e):document.createTextNode(s.value),o.appendChild(r);return Je(i,o,e)}function ze(t,e){z(e)}function Ue(t,e){function i(e){if(!t.descriptor){var i=A(t.value);t.descriptor={name:e,def:bs[e],expression:i.expression,filters:i.filters}}}var n;return t.oneTime?n=document.createTextNode(t.value):t.html?(n=document.createComment("v-html"),i("html")):(n=document.createTextNode(" "),i("text")),n}function Je(t,e){return function(i,n,r,o){for(var a,h,l,c=e.cloneNode(!0),u=d(c.childNodes),f=0,p=t.length;p>f;f++)a=t[f],h=a.value,a.tag&&(l=u[f],a.oneTime?(h=(o||i).$eval(h),a.html?J(l,Xt(h,!0)):l.data=s(h)):i._bindDir(a.descriptor,l,r,o));J(n,c)}}function qe(t,e){for(var i,n,r,s=[],o=0,a=t.length;a>o;o++)r=t[o],i=Ve(r,e),n=i&&i.terminal||"SCRIPT"===r.tagName||!r.hasChildNodes()?null:qe(r.childNodes,e),s.push(i,n);return s.length?Qe(s):null}function Qe(t){return function(e,i,n,r,s){for(var o,a,h,l=0,c=0,u=t.length;u>l;c++){o=i[c],a=t[l++],h=t[l++];var f=d(o.childNodes);a&&a(e,o,n,r,s),h&&h(e,f,n,r,s)}}}function Ge(t,e){var i=t.tagName.toLowerCase();if(!jn.test(i)){var n=gt(e,"elementDirectives",i);return n?Ke(t,i,"",e,n):void 0}}function Ze(t,e){var i=lt(t,e);if(i){var n=rt(t),r={name:"component",ref:n,expression:i.id,def:Hs.component,modifiers:{literal:!i.dynamic}},s=function(t,e,i,s,o){n&&kt((s||t).$refs,n,null),t._bindDir(r,e,i,s,o)};return s.terminal=!0,s}}function Xe(t,e,i){if(null!==I(t,"v-pre"))return Ye;if(t.hasAttribute("v-else")){var n=t.previousElementSibling;if(n&&n.hasAttribute("v-if"))return Ye}for(var r,s,o,a,h,l,c,u,f,p,d=0,v=e.length;v>d;d++)r=e[d],s=r.name.replace(Bs,""),(h=s.match(Vs))&&(f=gt(i,"directives",h[1]),f&&f.terminal&&(!p||(f.priority||Us)>p.priority)&&(p=f,c=r.name,a=ei(r.name),o=r.value,l=h[1],u=h[2]));return p?Ke(t,l,o,i,p,c,u,a):void 0}function Ye(){}function Ke(t,e,i,n,r,s,o,a){var h=A(i),l={name:e,arg:o,expression:h.expression,filters:h.filters,raw:i,attr:s,modifiers:a,def:r};"for"!==e&&"router-view"!==e||(l.ref=rt(t));var c=function(t,e,i,n,r){l.ref&&kt((n||t).$refs,l.ref,null),t._bindDir(l,e,i,n,r)};return c.terminal=!0,c}function ti(t,e){function i(t,e,i){var n=i&&ni(i),r=!n&&A(s);v.push({name:t,attr:o,raw:a,def:e,arg:l,modifiers:c,expression:r&&r.expression,filters:r&&r.filters,interp:i,hasOneTime:n})}for(var n,r,s,o,a,h,l,c,u,f,p,d=t.length,v=[];d--;)if(n=t[d],r=o=n.name,s=a=n.value,f=N(s),l=null,c=ei(r),r=r.replace(Bs,""),f)s=j(f),l=r,i("bind",bs.bind,f);else if(Ws.test(r))c.literal=!Is.test(r),i("transition",Hs.transition);else if(Ms.test(r))l=r.replace(Ms,""),i("on",bs.on);else if(Is.test(r))h=r.replace(Is,""),"style"===h||"class"===h?i(h,Hs[h]):(l=h,i("bind",bs.bind));else if(p=r.match(Vs)){if(h=p[1],l=p[2],"else"===h)continue;u=gt(e,"directives",h,!0),u&&i(h,u)}return v.length?ii(v):void 0}function ei(t){var e=Object.create(null),i=t.match(Bs);if(i)for(var n=i.length;n--;)e[i[n].slice(1)]=!0;return e}function ii(t){return function(e,i,n,r,s){for(var o=t.length;o--;)e._bindDir(t[o],i,n,r,s)}}function ni(t){for(var e=t.length;e--;)if(t[e].oneTime)return!0}function ri(t){return"SCRIPT"===t.tagName&&(!t.hasAttribute("type")||"text/javascript"===t.getAttribute("type"))}function si(t,e){return e&&(e._containerAttrs=ai(t)),it(t)&&(t=Xt(t)),e&&(e._asComponent&&!e.template&&(e.template=""),e.template&&(e._content=K(t),t=oi(t,e))),at(t)&&(U(nt("v-start",!0),t),t.appendChild(nt("v-end",!0))),t}function oi(t,e){var i=e.template,n=Xt(i,!0);if(n){var r=n.firstChild,s=r.tagName&&r.tagName.toLowerCase();return e.replace?(t===document.body,n.childNodes.length>1||1!==r.nodeType||"component"===s||gt(e,"components",s)||V(r,"is")||gt(e,"elementDirectives",s)||r.hasAttribute("v-for")||r.hasAttribute("v-if")?n:(e._replacerAttrs=ai(r),hi(t,r),r)):(t.appendChild(n),t)}}function ai(t){return 1===t.nodeType&&t.hasAttributes()?d(t.attributes):void 0}function hi(t,e){for(var i,n,r=t.attributes,s=r.length;s--;)i=r[s].name,n=r[s].value,e.hasAttribute(i)||Js.test(i)?"class"===i&&!N(n)&&(n=n.trim())&&n.split(/\s+/).forEach(function(t){X(e,t)}):e.setAttribute(i,n)}function li(t,e){if(e){for(var i,n,r=t._slotContents=Object.create(null),s=0,o=e.children.length;o>s;s++)i=e.children[s],(n=i.getAttribute("slot"))&&(r[n]||(r[n]=[])).push(i);for(n in r)r[n]=ci(r[n],e);if(e.hasChildNodes()){var a=e.childNodes;if(1===a.length&&3===a[0].nodeType&&!a[0].data.trim())return;r["default"]=ci(e.childNodes,e)}}}function ci(t,e){var i=document.createDocumentFragment();t=d(t);for(var n=0,r=t.length;r>n;n++){var s=t[n];!it(s)||s.hasAttribute("v-if")||s.hasAttribute("v-for")||(e.removeChild(s),s=Xt(s,!0)),i.appendChild(s)}return i}function ui(t){function e(){}function n(t,e){var i=new Ut(e,t,null,{lazy:!0});return function(){return i.dirty&&i.evaluate(),_t.target&&i.depend(),i.value}}Object.defineProperty(t.prototype,"$data",{get:function(){return this._data},set:function(t){t!==this._data&&this._setData(t)}}),t.prototype._initState=function(){this._initProps(),this._initMeta(),this._initMethods(),this._initData(),this._initComputed()},t.prototype._initProps=function(){var t=this.$options,e=t.el,i=t.props;e=t.el=L(e),this._propsUnlinkFn=e&&1===e.nodeType&&i?Ie(this,e,i,this._scope):null},t.prototype._initData=function(){var t=this.$options.data,e=this._data=t?t():{};g(e)||(e={});var n,r,s=this._props,o=Object.keys(e);for(n=o.length;n--;)r=o[n],s&&i(s,r)||this._proxy(r);$t(e,this)},t.prototype._setData=function(t){t=t||{};var e=this._data;this._data=t;var n,r,s;for(n=Object.keys(e),s=n.length;s--;)r=n[s],r in t||this._unproxy(r);for(n=Object.keys(t),s=n.length;s--;)r=n[s],i(this,r)||this._proxy(r);e.__ob__.removeVm(this),$t(t,this),this._digest()},t.prototype._proxy=function(t){if(!r(t)){var e=this;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return e._data[t]},set:function(i){e._data[t]=i}})}},t.prototype._unproxy=function(t){r(t)||delete this[t]},t.prototype._digest=function(){for(var t=0,e=this._watchers.length;e>t;t++)this._watchers[t].update(!0)},t.prototype._initComputed=function(){var t=this.$options.computed;if(t)for(var i in t){var r=t[i],s={enumerable:!0,configurable:!0};"function"==typeof r?(s.get=n(r,this),s.set=e):(s.get=r.get?r.cache!==!1?n(r.get,this):p(r.get,this):e,s.set=r.set?p(r.set,this):e),Object.defineProperty(this,i,s)}},t.prototype._initMethods=function(){var t=this.$options.methods;if(t)for(var e in t)this[e]=p(t[e],this)},t.prototype._initMeta=function(){var t=this.$options._meta;if(t)for(var e in t)kt(this,e,t[e])}}function fi(t){function e(t,e){for(var i,n,r,s=e.attributes,o=0,a=s.length;a>o;o++)i=s[o].name,Qs.test(i)&&(i=i.replace(Qs,""),n=s[o].value,Mt(n)&&(n+=".apply(this, $arguments)"),r=(t._scope||t._context).$eval(n,!0),r._fromParent=!0,t.$on(i.replace(Qs),r))}function i(t,e,i){if(i){var r,s,o,a;for(s in i)if(r=i[s],Di(r))for(o=0,a=r.length;a>o;o++)n(t,e,s,r[o]);else n(t,e,s,r)}}function n(t,e,i,r,s){var o=typeof r;if("function"===o)t[e](i,r,s);else if("string"===o){var a=t.$options.methods,h=a&&a[r];h&&t[e](i,h,s)}else r&&"object"===o&&n(t,e,i,r.handler,r)}function r(){this._isAttached||(this._isAttached=!0,this.$children.forEach(s))}function s(t){!t._isAttached&&H(t.$el)&&t._callHook("attached")}function o(){this._isAttached&&(this._isAttached=!1,this.$children.forEach(a))}function a(t){t._isAttached&&!H(t.$el)&&t._callHook("detached")}t.prototype._initEvents=function(){var t=this.$options;t._asComponent&&e(this,t.el),i(this,"$on",t.events),i(this,"$watch",t.watch)},t.prototype._initDOMHooks=function(){this.$on("hook:attached",r),this.$on("hook:detached",o)},t.prototype._callHook=function(t){this.$emit("pre-hook:"+t);var e=this.$options[t];if(e)for(var i=0,n=e.length;n>i;i++)e[i].call(this);this.$emit("hook:"+t)}}function pi(){}function di(t,e,i,n,r,s){this.vm=e,this.el=i,this.descriptor=t,this.name=t.name,this.expression=t.expression,this.arg=t.arg,this.modifiers=t.modifiers,this.filters=t.filters,this.literal=this.modifiers&&this.modifiers.literal,this._locked=!1,this._bound=!1,this._listeners=null,this._host=n,this._scope=r,this._frag=s}function vi(t){t.prototype._updateRef=function(t){var e=this.$options._ref;if(e){var i=(this._scope||this._context).$refs;t?i[e]===this&&(i[e]=null):i[e]=this}},t.prototype._compile=function(t){var e=this.$options,i=t;if(t=si(t,e),this._initElement(t),1!==t.nodeType||null===I(t,"v-pre")){var n=this._context&&this._context.$options,r=Me(t,e,n);li(this,e._content);var s,o=this.constructor;e._linkerCachable&&(s=o.linker,s||(s=o.linker=De(t,e)));var a=r(this,t,this._scope),h=s?s(this,t):De(t,e)(this,t);this._unlinkFn=function(){a(),h(!0)},e.replace&&J(i,t),this._isCompiled=!0,this._callHook("compiled")}},t.prototype._initElement=function(t){at(t)?(this._isFragment=!0,this.$el=this._fragmentStart=t.firstChild,this._fragmentEnd=t.lastChild,3===this._fragmentStart.nodeType&&(this._fragmentStart.data=this._fragmentEnd.data=""),this._fragment=t):this.$el=t,this.$el.__vue__=this,this._callHook("beforeCompile")},t.prototype._bindDir=function(t,e,i,n,r){this._directives.push(new di(t,this,e,i,n,r))},t.prototype._destroy=function(t,e){if(this._isBeingDestroyed)return void(e||this._cleanup());var i,n,r=this,s=function(){!i||n||e||r._cleanup()};t&&this.$el&&(n=!0,this.$remove(function(){ -n=!1,s()})),this._callHook("beforeDestroy"),this._isBeingDestroyed=!0;var o,a=this.$parent;for(a&&!a._isBeingDestroyed&&(a.$children.$remove(this),this._updateRef(!0)),o=this.$children.length;o--;)this.$children[o].$destroy();for(this._propsUnlinkFn&&this._propsUnlinkFn(),this._unlinkFn&&this._unlinkFn(),o=this._watchers.length;o--;)this._watchers[o].teardown();this.$el&&(this.$el.__vue__=null),i=!0,s()},t.prototype._cleanup=function(){this._isDestroyed||(this._frag&&this._frag.children.$remove(this),this._data&&this._data.__ob__&&this._data.__ob__.removeVm(this),this.$el=this.$parent=this.$root=this.$children=this._watchers=this._context=this._scope=this._directives=null,this._isDestroyed=!0,this._callHook("destroyed"),this.$off())}}function mi(t){t.prototype._applyFilters=function(t,e,i,n){var r,s,o,a,h,l,c,u,f;for(l=0,c=i.length;c>l;l++)if(r=i[n?c-l-1:l],s=gt(this.$options,"filters",r.name,!0),s&&(s=n?s.write:s.read||s,"function"==typeof s)){if(o=n?[t,e]:[t],h=n?2:1,r.args)for(u=0,f=r.args.length;f>u;u++)a=r.args[u],o[u+h]=a.dynamic?this.$get(a.value):a.value;t=s.apply(this,o)}return t},t.prototype._resolveComponent=function(e,i){var n;if(n="function"==typeof e?e:gt(this.$options,"components",e,!0))if(n.options)i(n);else if(n.resolved)i(n.resolved);else if(n.requested)n.pendingCallbacks.push(i);else{n.requested=!0;var r=n.pendingCallbacks=[i];n.call(this,function(e){g(e)&&(e=t.extend(e)),n.resolved=e;for(var i=0,s=r.length;s>i;i++)r[i](e)},function(t){})}}}function gi(t){function i(t){return JSON.parse(JSON.stringify(t))}t.prototype.$get=function(t,e){var i=It(t);if(i){if(e){var n=this;return function(){n.$arguments=d(arguments);var t=i.get.call(n,n);return n.$arguments=null,t}}try{return i.get.call(this,this)}catch(r){}}},t.prototype.$set=function(t,e){var i=It(t,!0);i&&i.set&&i.set.call(this,this,e)},t.prototype.$delete=function(t){e(this._data,t)},t.prototype.$watch=function(t,e,i){var n,r=this;"string"==typeof t&&(n=A(t),t=n.expression);var s=new Ut(r,t,e,{deep:i&&i.deep,sync:i&&i.sync,filters:n&&n.filters,user:!i||i.user!==!1});return i&&i.immediate&&e.call(r,s.value),function(){s.teardown()}},t.prototype.$eval=function(t,e){if(Gs.test(t)){var i=A(t),n=this.$get(i.expression,e);return i.filters?this._applyFilters(n,null,i.filters):n}return this.$get(t,e)},t.prototype.$interpolate=function(t){var e=N(t),i=this;return e?1===e.length?i.$eval(e[0].value)+"":e.map(function(t){return t.tag?i.$eval(t.value):t.value}).join(""):t},t.prototype.$log=function(t){var e=t?jt(this._data,t):this._data;if(e&&(e=i(e)),!t){var n;for(n in this.$options.computed)e[n]=i(this[n]);if(this._props)for(n in this._props)e[n]=i(this[n])}console.log(e)}}function _i(t){function e(t,e,n,r,s,o){e=i(e);var a=!H(e),h=r===!1||a?s:o,l=!a&&!t._isAttached&&!H(t.$el);return t._isFragment?(st(t._fragmentStart,t._fragmentEnd,function(i){h(i,e,t)}),n&&n()):h(t.$el,e,t,n),l&&t._callHook("attached"),t}function i(t){return"string"==typeof t?document.querySelector(t):t}function n(t,e,i,n){e.appendChild(t),n&&n()}function r(t,e,i,n){B(t,e),n&&n()}function s(t,e,i){z(t),i&&i()}t.prototype.$nextTick=function(t){Yi(t,this)},t.prototype.$appendTo=function(t,i,r){return e(this,t,i,r,n,F)},t.prototype.$prependTo=function(t,e,n){return t=i(t),t.hasChildNodes()?this.$before(t.firstChild,e,n):this.$appendTo(t,e,n),this},t.prototype.$before=function(t,i,n){return e(this,t,i,n,r,D)},t.prototype.$after=function(t,e,n){return t=i(t),t.nextSibling?this.$before(t.nextSibling,e,n):this.$appendTo(t.parentNode,e,n),this},t.prototype.$remove=function(t,e){if(!this.$el.parentNode)return t&&t();var i=this._isAttached&&H(this.$el);i||(e=!1);var n=this,r=function(){i&&n._callHook("detached"),t&&t()};if(this._isFragment)ot(this._fragmentStart,this._fragmentEnd,this,this._fragment,r);else{var o=e===!1?s:P;o(this.$el,this,r)}return this}}function yi(t){function e(t,e,n){var r=t.$parent;if(r&&n&&!i.test(e))for(;r;)r._eventsCount[e]=(r._eventsCount[e]||0)+n,r=r.$parent}t.prototype.$on=function(t,i){return(this._events[t]||(this._events[t]=[])).push(i),e(this,t,1),this},t.prototype.$once=function(t,e){function i(){n.$off(t,i),e.apply(this,arguments)}var n=this;return i.fn=e,this.$on(t,i),this},t.prototype.$off=function(t,i){var n;if(!arguments.length){if(this.$parent)for(t in this._events)n=this._events[t],n&&e(this,t,-n.length);return this._events={},this}if(n=this._events[t],!n)return this;if(1===arguments.length)return e(this,t,-n.length),this._events[t]=null,this;for(var r,s=n.length;s--;)if(r=n[s],r===i||r.fn===i){e(this,t,-1),n.splice(s,1);break}return this},t.prototype.$emit=function(t){var e="string"==typeof t;t=e?t:t.name;var i=this._events[t],n=e||!i;if(i){i=i.length>1?d(i):i;var r=e&&i.some(function(t){return t._fromParent});r&&(n=!1);for(var s=d(arguments,1),o=0,a=i.length;a>o;o++){var h=i[o],l=h.apply(this,s);l!==!0||r&&!h._fromParent||(n=!0)}}return n},t.prototype.$broadcast=function(t){var e="string"==typeof t;if(t=e?t:t.name,this._eventsCount[t]){var i=this.$children,n=d(arguments);e&&(n[0]={name:t,source:this});for(var r=0,s=i.length;s>r;r++){var o=i[r],a=o.$emit.apply(o,n);a&&o.$broadcast.apply(o,n)}return this}},t.prototype.$dispatch=function(t){var e=this.$emit.apply(this,arguments);if(e){var i=this.$parent,n=d(arguments);for(n[0]={name:t,source:this};i;)e=i.$emit.apply(i,n),i=e?i.$parent:null;return this}};var i=/^hook:/}function bi(t){function e(){this._isAttached=!0,this._isReady=!0,this._callHook("ready")}t.prototype.$mount=function(t){return this._isCompiled?void 0:(t=L(t),t||(t=document.createElement("div")),this._compile(t),this._initDOMHooks(),H(this.$el)?(this._callHook("attached"),e.call(this)):this.$once("hook:attached",e),this)},t.prototype.$destroy=function(t,e){this._destroy(t,e)},t.prototype.$compile=function(t,e,i,n){return De(t,this.$options,!0)(this,t,e,i,n)}}function wi(t){this._init(t)}function Ci(t,e,i){return i=i?parseInt(i,10):0,e=o(e),"number"==typeof e?t.slice(i,i+e):t}function $i(t,e,i){if(t=Ks(t),null==e)return t;if("function"==typeof e)return t.filter(e);e=(""+e).toLowerCase();for(var n,r,s,o,a="in"===i?3:2,h=Array.prototype.concat.apply([],d(arguments,a)),l=[],c=0,u=t.length;u>c;c++)if(n=t[c],s=n&&n.$value||n,o=h.length){for(;o--;)if(r=h[o],"$key"===r&&xi(n.$key,e)||xi(jt(s,r),e)){l.push(n);break}}else xi(n,e)&&l.push(n);return l}function ki(t){function e(t,e,i){var r=n[i];return r&&("$key"!==r&&(m(t)&&"$value"in t&&(t=t.$value),m(e)&&"$value"in e&&(e=e.$value)),t=m(t)?jt(t,r):t,e=m(e)?jt(e,r):e),t===e?0:t>e?s:-s}var i=null,n=void 0;t=Ks(t);var r=d(arguments,1),s=r[r.length-1];"number"==typeof s?(s=0>s?-1:1,r=r.length>1?r.slice(0,-1):r):s=1;var o=r[0];return o?("function"==typeof o?i=function(t,e){return o(t,e)*s}:(n=Array.prototype.concat.apply([],r),i=function(t,r,s){return s=s||0,s>=n.length-1?e(t,r,s):e(t,r,s)||i(t,r,s+1)}),t.slice().sort(i)):t}function xi(t,e){var i;if(g(t)){var n=Object.keys(t);for(i=n.length;i--;)if(xi(t[n[i]],e))return!0}else if(Di(t)){for(i=t.length;i--;)if(xi(t[i],e))return!0}else if(null!=t)return t.toString().toLowerCase().indexOf(e)>-1}function Ai(i){function n(t){return new Function("return function "+f(t)+" (options) { this._init(options) }")()}i.options={directives:bs,elementDirectives:Ys,filters:eo,transitions:{},components:{},partials:{},replace:!0},i.util=In,i.config=An,i.set=t,i["delete"]=e,i.nextTick=Yi,i.compiler=qs,i.FragmentFactory=se,i.internalDirectives=Hs,i.parsers={path:ir,text:$n,template:Fr,directive:gn,expression:mr},i.cid=0;var r=1;i.extend=function(t){t=t||{};var e=this,i=0===e.cid;if(i&&t._Ctor)return t._Ctor;var s=t.name||e.options.name,o=n(s||"VueComponent");return o.prototype=Object.create(e.prototype),o.prototype.constructor=o,o.cid=r++,o.options=mt(e.options,t),o["super"]=e,o.extend=e.extend,An._assetTypes.forEach(function(t){o[t]=e[t]}),s&&(o.options.components[s]=o),i&&(t._Ctor=o),o},i.use=function(t){if(!t.installed){var e=d(arguments,1);return e.unshift(this),"function"==typeof t.install?t.install.apply(t,e):t.apply(null,e),t.installed=!0,this}},i.mixin=function(t){i.options=mt(i.options,t)},An._assetTypes.forEach(function(t){i[t]=function(e,n){return n?("component"===t&&g(n)&&(n.name||(n.name=e),n=i.extend(n)),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}),v(i.transition,Tn)}var Oi=Object.prototype.hasOwnProperty,Ti=/^\s?(true|false|-?[\d\.]+|'[^']*'|"[^"]*")\s?$/,Ni=/-(\w)/g,ji=/([a-z\d])([A-Z])/g,Ei=/(?:^|[-_\/])(\w)/g,Si=Object.prototype.toString,Fi="[object Object]",Di=Array.isArray,Pi="__proto__"in{},Ri="undefined"!=typeof window&&"[object Object]"!==Object.prototype.toString.call(window),Li=Ri&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Hi=Ri&&window.navigator.userAgent.toLowerCase(),Ii=Hi&&Hi.indexOf("trident")>0,Mi=Hi&&Hi.indexOf("msie 9.0")>0,Vi=Hi&&Hi.indexOf("android")>0,Bi=Hi&&/(iphone|ipad|ipod|ios)/i.test(Hi),Wi=Bi&&Hi.match(/os ([\d_]+)/),zi=Wi&&Wi[1].split("_"),Ui=zi&&Number(zi[0])>=9&&Number(zi[1])>=3&&!window.indexedDB,Ji=void 0,qi=void 0,Qi=void 0,Gi=void 0;if(Ri&&!Mi){var Zi=void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend,Xi=void 0===window.onanimationend&&void 0!==window.onwebkitanimationend;Ji=Zi?"WebkitTransition":"transition",qi=Zi?"webkitTransitionEnd":"transitionend",Qi=Xi?"WebkitAnimation":"animation",Gi=Xi?"webkitAnimationEnd":"animationend"}var Yi=function(){function t(){n=!1;var t=i.slice(0);i=[];for(var e=0;ee;e++)t[e].update()};var Pn=Array.prototype,Rn=Object.create(Pn);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(t){var e=Pn[t];_(Rn,t,function(){for(var i=arguments.length,n=new Array(i);i--;)n[i]=arguments[i];var r,s=e.apply(this,n),o=this.__ob__;switch(t){case"push":r=n;break;case"unshift":r=n;break;case"splice":r=n.slice(2)}return r&&o.observeArray(r),o.dep.notify(),s})}),_(Pn,"$set",function(t,e){return t>=this.length&&(this.length=Number(t)+1),this.splice(t,1,e)[0]}),_(Pn,"$remove",function(t){if(this.length){var e=b(this,t);return e>-1?this.splice(e,1):void 0}});var Ln=Object.getOwnPropertyNames(Rn),Hn=!0;bt.prototype.walk=function(t){for(var e=Object.keys(t),i=0,n=e.length;n>i;i++)this.convert(e[i],t[e[i]])},bt.prototype.observeArray=function(t){for(var e=0,i=t.length;i>e;e++)$t(t[e])},bt.prototype.convert=function(t,e){kt(this.value,t,e)},bt.prototype.addVm=function(t){(this.vms||(this.vms=[])).push(t)},bt.prototype.removeVm=function(t){this.vms.$remove(t)};var In=Object.freeze({defineReactive:kt,set:t,del:e,hasOwn:i,isLiteral:n,isReserved:r,_toString:s,toNumber:o,toBoolean:a,stripQuotes:h,camelize:l,hyphenate:u,classify:f,bind:p,toArray:d,extend:v,isObject:m,isPlainObject:g,def:_,debounce:y,indexOf:b,cancellable:w,looseEqual:C,isArray:Di,hasProto:Pi,inBrowser:Ri,devtools:Li,isIE:Ii,isIE9:Mi,isAndroid:Vi,isIos:Bi,iosVersionMatch:Wi,iosVersion:zi,hasMutationObserverBug:Ui,get transitionProp(){return Ji},get transitionEndEvent(){return qi},get animationProp(){return Qi},get animationEndEvent(){return Gi},nextTick:Yi,get _Set(){return Ki},query:L,inDoc:H,getAttr:I,getBindAttr:M,hasBindAttr:V,before:B,after:W,remove:z,prepend:U,replace:J,on:q,off:Q,setClass:Z,addClass:X,removeClass:Y,extractContent:K,trimNode:tt,isTemplate:it,createAnchor:nt,findRef:rt,mapNodeRange:st,removeNodeRange:ot,isFragment:at,getOuterHTML:ht,mergeOptions:mt,resolveAsset:gt,checkComponentAttr:lt,commonTagRE:jn,reservedTagRE:En,warn:On}),Mn=0,Vn=new $(1e3),Bn=0,Wn=1,zn=2,Un=3,Jn=0,qn=1,Qn=2,Gn=3,Zn=4,Xn=5,Yn=6,Kn=7,tr=8,er=[];er[Jn]={ws:[Jn],ident:[Gn,Bn],"[":[Zn],eof:[Kn]},er[qn]={ws:[qn],".":[Qn],"[":[Zn],eof:[Kn]},er[Qn]={ws:[Qn],ident:[Gn,Bn]},er[Gn]={ident:[Gn,Bn],0:[Gn,Bn],number:[Gn,Bn],ws:[qn,Wn],".":[Qn,Wn],"[":[Zn,Wn],eof:[Kn,Wn]},er[Zn]={"'":[Xn,Bn],'"':[Yn,Bn],"[":[Zn,zn],"]":[qn,Un],eof:tr,"else":[Zn,Bn]},er[Xn]={"'":[Zn,Bn],eof:tr,"else":[Xn,Bn]},er[Yn]={'"':[Zn,Bn],eof:tr,"else":[Yn,Bn]};var ir=Object.freeze({parsePath:Nt,getPath:jt,setPath:Et}),nr=new $(1e3),rr="Math,Date,this,true,false,null,undefined,Infinity,NaN,isNaN,isFinite,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,parseInt,parseFloat",sr=new RegExp("^("+rr.replace(/,/g,"\\b|")+"\\b)"),or="break,case,class,catch,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,in,instanceof,let,return,super,switch,throw,try,var,while,with,yield,enum,await,implements,package,protected,static,interface,private,public",ar=new RegExp("^("+or.replace(/,/g,"\\b|")+"\\b)"),hr=/\s/g,lr=/\n/g,cr=/[\{,]\s*[\w\$_]+\s*:|('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`)|new |typeof |void /g,ur=/"(\d+)"/g,fr=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*$/,pr=/[^\w$\.](?:[A-Za-z_$][\w$]*)/g,dr=/^(?:true|false|null|undefined|Infinity|NaN)$/,vr=[],mr=Object.freeze({parseExpression:It,isSimplePath:Mt}),gr=[],_r=[],yr={},br={},wr=!1,Cr=0;Ut.prototype.get=function(){this.beforeGet();var t,e=this.scope||this.vm;try{t=this.getter.call(e,e)}catch(i){}return this.deep&&Jt(t),this.preProcess&&(t=this.preProcess(t)),this.filters&&(t=e._applyFilters(t,null,this.filters,!1)),this.postProcess&&(t=this.postProcess(t)),this.afterGet(),t},Ut.prototype.set=function(t){var e=this.scope||this.vm;this.filters&&(t=e._applyFilters(t,this.value,this.filters,!0));try{this.setter.call(e,e,t)}catch(i){}var n=e.$forContext;if(n&&n.alias===this.expression){if(n.filters)return;n._withLock(function(){e.$key?n.rawValue[e.$key]=t:n.rawValue.$set(e.$index,t)})}},Ut.prototype.beforeGet=function(){_t.target=this},Ut.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},Ut.prototype.afterGet=function(){_t.target=null;for(var t=this.deps.length;t--;){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var i=this.depIds;this.depIds=this.newDepIds,this.newDepIds=i,this.newDepIds.clear(),i=this.deps,this.deps=this.newDeps,this.newDeps=i,this.newDeps.length=0},Ut.prototype.update=function(t){this.lazy?this.dirty=!0:this.sync||!An.async?this.run():(this.shallow=this.queued?t?this.shallow:!1:!!t,this.queued=!0,zt(this))},Ut.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||(m(t)||this.deep)&&!this.shallow){var e=this.value;this.value=t;this.prevError;this.cb.call(this.vm,t,e)}this.queued=this.shallow=!1}},Ut.prototype.evaluate=function(){var t=_t.target;this.value=this.get(),this.dirty=!1,_t.target=t},Ut.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},Ut.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||this.vm._vForRemoving||this.vm._watchers.$remove(this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1,this.vm=this.cb=this.value=null}};var $r=new Ki,kr={bind:function(){this.attr=3===this.el.nodeType?"data":"textContent"},update:function(t){this.el[this.attr]=s(t)}},xr=new $(1e3),Ar=new $(1e3),Or={efault:[0,"",""],legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"]};Or.td=Or.th=[3,"","
"],Or.option=Or.optgroup=[1,'"],Or.thead=Or.tbody=Or.colgroup=Or.caption=Or.tfoot=[1,"","
"],Or.g=Or.defs=Or.symbol=Or.use=Or.image=Or.text=Or.circle=Or.ellipse=Or.line=Or.path=Or.polygon=Or.polyline=Or.rect=[1,'',""];var Tr=/<([\w:-]+)/,Nr=/&#?\w+?;/,jr=/ -
-
-
-
-
- {{ c.wordpress_user_navigation|safe }} - {{ c.wordpress_admin_navigation|safe }} -
-
- {% include "snippets/language_selector.html" %} -
-
-
-
+{% ckan_extends %} - -
-
- + {% if c.userobj %} + {{ h.build_nav_main( + (dataset_type ~ '.search', h.humanize_entity_type('package', dataset_type, 'main nav') or _('Datasets'), ["dataset", "resource"]), + (org_type ~ '.index', + h.humanize_entity_type('organization', org_type, 'main nav') or _('Organizations'), ['organization']), + (group_type ~ '.index', + h.humanize_entity_type('group', group_type, 'main nav') or _('Groups'), ['group']), + ('harvest.search', _('Harvester')), + ('home.about', _('About')) ) }} + {% else %} + {{ h.build_nav_main( + (dataset_type ~ '.search', h.humanize_entity_type('package', dataset_type, 'main nav') or _('Datasets'), ["dataset", "resource"]), + (group_type ~ '.index', + h.humanize_entity_type('group', group_type, 'main nav') or _('Groups'), ['group']), + ('home.about', _('About')) ) }} + {% endif %} +{% endblock %} - - -
- -
- -
-
+{% block header_logo %} + {% if g.site_logo %} + + {% else %} +

+ {{ g.site_title }} +

+ {% if g.site_description %} +

{{ g.site_description }}

+ {% endif %} + {% endif %} +{% endblock %} diff --git a/ckanext/switzerland/templates/macros/form/input_block.html b/ckanext/switzerland/templates/macros/form/input_block.html deleted file mode 100644 index fd3140c2f..000000000 --- a/ckanext/switzerland/templates/macros/form/input_block.html +++ /dev/null @@ -1,14 +0,0 @@ -{# - Overwritten from CKAN in order to keep the "col" classes, which we still need for our CSS based on Bootstrap 3. -#} - -{% macro input_block(for, label="", error="", classes=[], control_classes=[], extra_html="", is_required=false) %} -
- -
- {{ caller() }} - {% if error and error is iterable %}{{ error|join(', ') }}{% endif %} - {{ extra_html }} -
-
-{% endmacro %} diff --git a/ckanext/switzerland/templates/navigation.html b/ckanext/switzerland/templates/navigation.html deleted file mode 100644 index 8cf8ed8c1..000000000 --- a/ckanext/switzerland/templates/navigation.html +++ /dev/null @@ -1 +0,0 @@ -{{ c.wordpress_main_navigation|safe }} diff --git a/ckanext/switzerland/templates/organization/bulk_process.html b/ckanext/switzerland/templates/organization/bulk_process.html deleted file mode 100644 index 416a6fe06..000000000 --- a/ckanext/switzerland/templates/organization/bulk_process.html +++ /dev/null @@ -1,79 +0,0 @@ -{% ckan_extends %} - -{% block search_form %} - {% set sorting = [ - (_('Name Ascending'), 'title_string asc'), - (_('Name Descending'), 'title_string desc'), - (_('Last Modified'), 'metadata_modified desc') ] - %} - {% snippet 'snippets/search_form.html', form_id='organization-datasets-search-form', type=dataset_type, query=q, count=page.item_count, sorting=sorting, sorting_selected=sort_by_selected, no_title=true, search_class=' ' %} -{% endblock %} - -{% block form %} - {% if page.item_count %} -
- {{ h.csrf_input() }} - - - - - - - - - - - {% for package in packages %} - {% set title = h.dataset_display_name(package) %} - {% set notes = h.markdown_extract(h.parse_and_localize(package.notes), extract_length=180) %} - - - - - {% endfor %} - -
-
- - -
-
- -
-
- - - - {{ _('Edit') }} - -

- - {{ title|truncate(80) }} - - {% if package.get('state', '').startswith('draft') %} - {{ _('Draft') }} - {% elif package.get('state', '').startswith('deleted') %} - {{ _('Deleted') }} - {% endif %} - {% if package.private %} - {{ _('Private') }} - {% endif %} -

- {% if notes %} -

{{ notes|urlize }}

- {% endif %} -
-
- {% else %} -

{{ _('This organization has no datasets associated to it') }}

- {% endif %} -{% endblock %} diff --git a/ckanext/switzerland/templates/organization/index.html b/ckanext/switzerland/templates/organization/index.html deleted file mode 100644 index e6afead50..000000000 --- a/ckanext/switzerland/templates/organization/index.html +++ /dev/null @@ -1,37 +0,0 @@ -{% extends "page.html" %} - -{% block subtitle %}{{ h.humanize_entity_type('organization', group_type, 'page title') or _('Organizations') }}{% endblock %} - -{% block breadcrumb_content %} -
  • {% link_for h.humanize_entity_type('organization', group_type, 'breadcrumb') or _('Organizations'), named_route=group_type+'.index' %}
  • -{% endblock %} - -{% block primary %} -
    -

    {% block page_heading %}{{ _('Organizations') }}{% endblock %}

    - -
    - {% if h.check_access('organization_create') %} - {% link_for _('Add Organization'), named_route='organization.new', class_='btn btn-primary', icon='plus-sign-alt' %} - {% endif %} -
    -
    - - {% block organizations_list %} - {% if page.items or request.args %} - {% if page.items %} - {% snippet "organization/snippets/organization_list.html", organizations=page.items %} - {% endif %} - {% else %} -

    - {{ _('There are currently no organizations for this site') }}. - {% if h.check_access('organization_create') %} - {% link_for _('How about creating one?'), named_route=group_type+'.new' %}. - {% endif %} -

    - {% endif %} - {% endblock %} - {% block page_pagination %} - {{ page.pager(q=q or '', sort=sort_by_selected or '') }} - {% endblock %} -{% endblock %} diff --git a/ckanext/switzerland/templates/organization/new.html b/ckanext/switzerland/templates/organization/new.html deleted file mode 100644 index f12e08189..000000000 --- a/ckanext/switzerland/templates/organization/new.html +++ /dev/null @@ -1,4 +0,0 @@ -{% ckan_extends %} - -{% block secondary_content %} -{% endblock %} diff --git a/ckanext/switzerland/templates/organization/read.html b/ckanext/switzerland/templates/organization/read.html deleted file mode 100644 index c08e11fd3..000000000 --- a/ckanext/switzerland/templates/organization/read.html +++ /dev/null @@ -1,22 +0,0 @@ -{% extends "organization/read_base.html" %} - -{% block primary_content_inner %} -

    {{ group_dict.title }}

    -

    {{ group_dict.description }}

    - -
    -

    {% trans count=page.item_count %}{{ count }} datasets{% endtrans %}

    -
    - - {% block packages_list %} - {% if page.items %} - {{ h.snippet('snippets/package_list.html', packages=page.items) }} - {% endif %} - {% endblock %} - {% block page_pagination %} - {{ page.pager(q=q) }} - {% endblock %} -{% endblock %} - -{% block organization_facets %} -{% endblock %} diff --git a/ckanext/switzerland/templates/organization/read_base.html b/ckanext/switzerland/templates/organization/read_base.html deleted file mode 100644 index e17d16321..000000000 --- a/ckanext/switzerland/templates/organization/read_base.html +++ /dev/null @@ -1,45 +0,0 @@ -{% extends "page.html" %} - -{% block subtitle %}{{ group_dict.display_name }} - {{ _('Organizations') }}{% endblock %} - -{% block breadcrumb_content %} -
  • {% link_for _('Organizations'), named_route='organization.index' %}
  • -
  • {% link_for group_dict.display_name|truncate(35), named_route='organization.read', id=group_dict.name %}
  • -{% endblock %} - -{% block head_extras -%} - {{ super() }} - - - - -{% endblock -%} - -{% block secondary_content %} - {% snippet 'snippets/organization.html', organization=group_dict, show_nums=true, hide_heading=true %} - {% block organization_facets %}{% endblock %} -{% endblock %} - -{% block links %} - {{ super() }} - {% include "organization/snippets/feeds.html" %} -{% endblock %} - - -{% block page_header %} -
    - {% if self.content_action() | trim %} -
    - {% block content_action %} - {% if h.check_access('organization_update', {'id': group_dict.id}) %} - {% link_for _('Manage'), named_route='organization.edit', id=group_dict.name, class_='btn btn-default pull-right', icon='wrench' %} - {% endif %} - - {% if h.check_access('package_create', {'owner_org': group_dict.id}) %} - {% link_for _('Add Dataset'), named_route='dataset.new', group=group_dict.id, class_='btn btn-primary', icon='plus-sign-alt' %} - {% endif %} - {% endblock %} -
    - {% endif %} -
    -{% endblock %} diff --git a/ckanext/switzerland/templates/organization/snippets/helper.html b/ckanext/switzerland/templates/organization/snippets/helper.html deleted file mode 100644 index cbbea7da5..000000000 --- a/ckanext/switzerland/templates/organization/snippets/helper.html +++ /dev/null @@ -1,15 +0,0 @@ -
    -

    - - {{ _('What are Organizations?') }} -

    -
    -

    - {% trans %} - The public transport Open Data Platform provides customer information about the whole public transport - network in Switzerland as Open Data. Further there are information from the Federal Office of Transport, - which are directly related. - {% endtrans %} -

    -
    -
    diff --git a/ckanext/switzerland/templates/organization/snippets/info.html b/ckanext/switzerland/templates/organization/snippets/info.html new file mode 100644 index 000000000..5b1f98002 --- /dev/null +++ b/ckanext/switzerland/templates/organization/snippets/info.html @@ -0,0 +1,37 @@ +{% ckan_extends %} + +{% block heading %} +

    {{ h.parse_and_localize(organization.title) }} + {% if organization.state == 'deleted' %} + [{{ _('Deleted') }}] + {% endif %} +

    +{% endblock %} + +{% block description %} + {% set description = h.parse_and_localize(organization.description) %} + {% if description %} +

    + {{ h.markdown_extract(description, 180) }} +

    +

    + {% link_for _('read more'), named_route=organization.type ~ '.about', id=organization.name %} +

    + {% else %} +

    {{ h.humanize_entity_type('organization', organization.type, 'no description') or _('There is no description for this organization') }}

    + {% endif %} +{% endblock %} + +{% block nums %} +{% set num_followers = h.follow_count('group', organization.id) %} +
    +
    +
    {{ _('Followers') }}
    +
    {{ h.SI_number_span(num_followers) }}
    +
    +
    +
    {{ h.humanize_entity_type('package', dataset_type, 'facet label') or _('Datasets') }}
    +
    {{ h.SI_number_span(organization.package_count) }}
    +
    +
    +{% endblock %} diff --git a/ckanext/switzerland/templates/organization/snippets/item_organization.html b/ckanext/switzerland/templates/organization/snippets/item_organization.html deleted file mode 100644 index cf6bf1084..000000000 --- a/ckanext/switzerland/templates/organization/snippets/item_organization.html +++ /dev/null @@ -1,12 +0,0 @@ -{{ gettext('On %(timestamp)s, %(username)s:', timestamp=h.render_datetime(activity_diff.activities[1].timestamp, with_hours=True, with_seconds=True), username=h.linked_user(activity_diff.activities[1].user_id)) }} - -{% set changes = h.localize_change_dict( - h.compare_group_dicts(activity_diff.activities[0].data.group, activity_diff.activities[1].data.group, activity_diff.activities[0].id) -) %} -
      - {% for change in changes %} - {% snippet "snippets/organization_changes/{}.html".format( - change.type), change=change %} -
      - {% endfor %} -
    diff --git a/ckanext/switzerland/templates/organization/snippets/organization_item.html b/ckanext/switzerland/templates/organization/snippets/organization_item.html index 14ab7426c..934d7b6d1 100644 --- a/ckanext/switzerland/templates/organization/snippets/organization_item.html +++ b/ckanext/switzerland/templates/organization/snippets/organization_item.html @@ -5,45 +5,19 @@ Example: -
      - {% for organization in organizations %} - {% snippet "organization/snippets/organization_item.html", organization=organization %} - {% endfor %} -
    +
      + {% for organization in organizations %} + {% snippet "organization/snippets/organization_item.html", organization=organization %} + {% endfor %} +
    #} -{% set url = h.url_for(organization.type ~ '.read', id=organization.name) %} -{% set org_display_name = h.parse_and_localize(organization.display_name) %} -{% block item %} -
    -
    - {% block item_inner %} - {% block image %} - {{ organization.name }} - {% endblock %} - {% block title %} -

    {{ h.dataset_display_name(organization) }}

    - {% endblock %} - {% block description %} - {% if organization.description %} -

    {{ h.markdown_extract(h.parse_and_localize(organization.description), extract_length=80) }}

    - {% endif %} - {% endblock %} - {% block datasets %} - {% if organization.package_count %} - {{ ungettext('{num} Dataset', '{num} Datasets', organization.package_count).format(num=organization.package_count) }} - {% else %} - {{ _('0 Datasets') }} - {% endif %} - {% endblock %} - {% block link %} - - {{ _('View {organization_name}').format(organization_name=org_display_name) }} - - {% endblock %} - {% endblock %} -
    -
    +{% ckan_extends %} +{% block title %} +

    {{ h.parse_and_localize(organization.display_name) }}

    {% endblock %} -{% if position is divisibleby 3 %} -
  • +{% block description %} +{% if organization.description %} +{% set description = h.parse_and_localize(organization.description) %} +

    {{ h.markdown_extract(description, 80) }}

    {% endif %} +{% endblock %} \ No newline at end of file diff --git a/ckanext/switzerland/templates/organization/snippets/organization_list.html b/ckanext/switzerland/templates/organization/snippets/organization_list.html deleted file mode 100644 index 5d55a5a78..000000000 --- a/ckanext/switzerland/templates/organization/snippets/organization_list.html +++ /dev/null @@ -1,19 +0,0 @@ -{# -Display a grid of organization items. - -organizations - A list of organizations. - -Example: - - {% snippet "organization/snippets/organization_list.html" %} - -#} -{% block organization_list %} -
    - {% block organization_list_inner %} - {% for organization in organizations %} - {% snippet "organization/snippets/organization_item.html", organization=organization, position=loop.index %} - {% endfor %} - {% endblock %} -
    -{% endblock %} diff --git a/ckanext/switzerland/templates/package/base.html b/ckanext/switzerland/templates/package/base.html index b619adf4f..196c0db0a 100644 --- a/ckanext/switzerland/templates/package/base.html +++ b/ckanext/switzerland/templates/package/base.html @@ -4,14 +4,14 @@ {% if pkg %} {% set dataset = h.dataset_display_name(pkg) %} {% if pkg.organization %} - {% set organization = h.dataset_display_name(pkg.organization) %} + {% set organization = h.parse_and_localize(pkg.organization.title) or pkg.organization.name %} {% set group_type = pkg.organization.type %}
  • {% link_for h.humanize_entity_type('organization', group_type, 'breadcrumb') or _('Organizations'), named_route=group_type ~ '.index' %}
  • -
  • {% link_for organization|truncate(30), named_route=group_type ~ '.read', id=pkg.organization.name %}
  • +
  • {% link_for organization|truncate(30), named_route=group_type ~ '.read', id=pkg.organization.name, title=organization %}
  • {% else %}
  • {% link_for _(dataset_type.title()), named_route=dataset_type ~ '.search' %}
  • {% endif %} - {% link_for dataset|truncate(30), named_route=pkg.type ~ '.read', id=pkg.name %} + {% link_for dataset|truncate(30), named_route=pkg.type ~ '.read', id=pkg.name, title=dataset %} {% else %}
  • {% link_for _(dataset_type.title()), named_route=dataset_type ~ '.search' %}
  • {{ h.humanize_entity_type('package', dataset_type, 'create label') or _('Create Dataset') }}
  • diff --git a/ckanext/switzerland/templates/package/read.html b/ckanext/switzerland/templates/package/read.html deleted file mode 100644 index 00bc9329d..000000000 --- a/ckanext/switzerland/templates/package/read.html +++ /dev/null @@ -1,53 +0,0 @@ -{% extends "package/read_base.html" %} - -{% set pkg = pkg_dict %} - -{% block maintag_class %}dataset-detail{% endblock %} - -{% block primary_content_inner %} - - {% block package_revision_info %} - {% if revision_date %} -
    -

    - {% set timestamp = h.render_datetime(revision_date, with_hours=True) %} - {% set url = h.url_for('dataset.read', id=pkg.name) %} - - {% trans timestamp=timestamp, url=url %}This is an old revision of this dataset, as edited at {{ timestamp }}. It may differ significantly from the current revision.{% endtrans %} -

    -
    - {% endif %} - {% endblock %} - - {% block page_heading %} - {% if pkg.private %} - {{ _('Private') }} - {% endif %} -

    - {{ h.dataset_display_name(pkg) }} - {% if pkg.state.startswith('draft') %} - [{{ _('Draft') }}] - {% endif %} - {% if pkg.state == 'deleted' %} - [{{ _('Deleted') }}] - {% endif %} -

    - {% endblock %} - - {% block package_description %} - {% snippet "package/snippets/description.html", pkg=pkg %} - {% endblock %} - - {% block package_resources %} - {% snippet "package/snippets/resources_list.html", pkg=pkg, resources=pkg.resources %} - {% endblock %} - - {% block package_additional_info %} - {% snippet "package/snippets/additional_info.html", pkg_dict=pkg %} - {% endblock %} - - {% block package_related_datasets %} - {% snippet "package/snippets/related_datasets.html", pkg=pkg %} - {% endblock %} - -{% endblock %} diff --git a/ckanext/switzerland/templates/package/read_base.html b/ckanext/switzerland/templates/package/read_base.html deleted file mode 100644 index 7448a5c37..000000000 --- a/ckanext/switzerland/templates/package/read_base.html +++ /dev/null @@ -1,50 +0,0 @@ -{% ckan_extends %} - -{% set default_group_type = h.default_group_type('group') %} - -{% block links -%} - {{ super() }} - -{% endblock -%} - -{% block head_extras -%} - {{ super() }} - - - - - - -{% endblock -%} - -{% block content_primary_nav %} - {{ h.build_nav_icon(dataset_type ~ '.read', _('Dataset'), id=pkg.name, icon='sitemap') }} - {{ h.build_nav_icon('activity.package_activity', _('Activity Stream'), id=pkg.id if is_activity_archive else pkg.name, icon='clock') }} - - {{ h.build_nav_icon(dataset_type ~ '.groups', h.humanize_entity_type('group', default_group_type, 'content tab') or _('Groups'), id=pkg.name, icon='users') }} -{% endblock %} - -{% block primary_content_inner %} - {% block package_revision_info %} - {% if revision_date %} -
    -

    - {% set timestamp = h.render_datetime(revision_date, with_hours=True) %} - {% set url = h.url_for('dataset.read', id=pkg.name) %} - - {% trans timestamp=timestamp, url=url %}This is an old revision of this dataset, as edited at {{ timestamp }}. It may differ significantly from the current revision.{% endtrans %} -

    -
    - {% endif %} - {% endblock %} -{% endblock %} - -{% block package_organization %} - {% if pkg.organization %} - {% set org = h.get_localized_org(pkg.owner_org) %} - {% snippet "snippets/organization.html", organization=org, has_context_title=true %} - {% endif %} -{% endblock %} - -{% block package_license %} -{% endblock %} diff --git a/ckanext/switzerland/templates/package/resource_edit_base.html b/ckanext/switzerland/templates/package/resource_edit_base.html deleted file mode 100644 index 09f1bfed9..000000000 --- a/ckanext/switzerland/templates/package/resource_edit_base.html +++ /dev/null @@ -1,6 +0,0 @@ -{% ckan_extends %} - -{% block secondary_content %} - {% snippet 'package/snippets/resource_info.html', res=res %} - {% snippet 'package/snippets/resources.html', pkg=pkg, active=res.id %} -{% endblock %} diff --git a/ckanext/switzerland/templates/package/resource_history.html b/ckanext/switzerland/templates/package/resource_history.html new file mode 100644 index 000000000..27b32b3cb --- /dev/null +++ b/ckanext/switzerland/templates/package/resource_history.html @@ -0,0 +1,26 @@ +{% extends "scheming/package/resource_read.html" %} + +{% block action_manage %} +{% endblock action_manage %} + + +{% block resource_content %} + {% block package_archive_notice %} +
    + {% trans url=h.url_for(pkg.type ~ '.read', id=pkg.id) %} + You're currently viewing an old version of this dataset. + Data files may not match the old version of the metadata. + View the current version. + {% endtrans %} +
    + {% endblock %} + {{ super() }} +{% endblock %} + +{% block data_preview %} +{% endblock %} + + +{% block resources_list %} + {% snippet "package/snippets/resources.html", pkg=pkg, active=res.id, action='read', is_activity_archive=true %} +{% endblock %} diff --git a/ckanext/switzerland/templates/package/resource_read.html b/ckanext/switzerland/templates/package/resource_read.html index 669a1501c..e8c455a31 100644 --- a/ckanext/switzerland/templates/package/resource_read.html +++ b/ckanext/switzerland/templates/package/resource_read.html @@ -1,91 +1,13 @@ {% ckan_extends %} -{% block head_extras -%} - {% set description = h.parse_and_localize(res.description) %} - - - - - - - -{% endblock -%} - -{% block resource_content %} - {% block resource_read_title %}

    {{ h.resource_display_name(res) | truncate(50) }}

    {% endblock %} - {% block resource_read_url %} - {% if res.url and h.is_url(res.url) %} -

    {{ _('URL:') }} {{ res.url }}

    - {% elif res.url %} -

    {{ _('URL:') }} {{ res.url }}

    - {% endif %} - {% endblock %} -
    - {% if res.description %} - {{ h.render_description(res) }} - {% endif %} - {% if not res.description and package.notes %} -

    {{ _('From the dataset abstract') }}

    -
    {{ h.markdown_extract(package.get('notes')) }}
    -

    {% trans dataset=package.title, url=h.url_for(package.type ~ '.read', id=package.name) %}Source: {{ dataset }}{% endtrans %} - {% endif %} -

    -
    - {% snippet "package/snippets/terms_of_use.html", pkg=package %} -{% endblock %} - -{% block resource_actions %} - + {{ super() }} {% endblock %} diff --git a/ckanext/switzerland/templates/package/search.html b/ckanext/switzerland/templates/package/search.html index d210a6260..19ce74a0a 100644 --- a/ckanext/switzerland/templates/package/search.html +++ b/ckanext/switzerland/templates/package/search.html @@ -1,13 +1,4 @@ {% ckan_extends %} -{% block subtitle %}Data{% endblock %} - -{% block breadcrumb_content %} -
  • {{ h.nav_link('Data', named_route='%s.search' % dataset_type, highlight_actions = 'new index') }}
  • -{% endblock %} - {% block package_search_results_api %} {% endblock %} - -{% block secondary_content %} -{% endblock %} diff --git a/ckanext/switzerland/templates/package/snippets/additional_info.html b/ckanext/switzerland/templates/package/snippets/additional_info.html deleted file mode 100644 index 1db5af596..000000000 --- a/ckanext/switzerland/templates/package/snippets/additional_info.html +++ /dev/null @@ -1,12 +0,0 @@ -
    -
    -
    -

    {{ _('Additional information') }}

    -
    - {% block package_additional_info %} - {# Content gets rendered in scheming/package/snippets/additional_info.html #} - {% endblock %} -
    -
    -
    -
    diff --git a/ckanext/switzerland/templates/package/snippets/change_item.html b/ckanext/switzerland/templates/package/snippets/change_item.html index 92d5d38ed..0f91fe31a 100644 --- a/ckanext/switzerland/templates/package/snippets/change_item.html +++ b/ckanext/switzerland/templates/package/snippets/change_item.html @@ -3,11 +3,10 @@ {% set changes = h.localize_change_dict( h.compare_pkg_dicts(activity_diff.activities[0].data.package, activity_diff.activities[1].data.package, activity_diff.activities[0].id) ) %} -{% set dataset_type = activity_diff.activities[0].data.package.type %}
      {% for change in changes %} {% snippet "snippets/changes/{}.html".format( - change.type), change=change, dataset_type=dataset_type %} + change.type), change=change, pkg_dict=pkg_dict, dataset_type=activity_diff.activities[1].data.package.type %}
      {% endfor %}
    diff --git a/ckanext/switzerland/templates/package/snippets/description.html b/ckanext/switzerland/templates/package/snippets/description.html deleted file mode 100644 index c3a5f0ebc..000000000 --- a/ckanext/switzerland/templates/package/snippets/description.html +++ /dev/null @@ -1,47 +0,0 @@ -{# -Renders the description of a package - -pkg - A package object that the resources belong to. - -Example: - -{% snippet "package/snippets/description.html", pkg=pkg %} - -#} -
    -
    - {% if pkg.description %} -
    -
    -

    {{ _('Description') }}

    -

    {{ h.render_description(pkg) }}

    -
    -
    - {% endif %} -
    -
    -
    {{ _('Further information') }}
    -
    - {%- snippet 'scheming/display_snippets/relations.html', data=pkg, schema=schema -%} -
    -
    -
    -
    -
    -
    {{ _('Last updated') }}
    -
    - {% if pkg.modified %} - - {{ h.render_datetime(pkg.modified, with_hours=True) }} - - {% else %} - - - {% endif %} -
    -
    -
    -
    - {% snippet "package/snippets/terms_of_use.html", pkg=pkg %} -
    -
    -
    diff --git a/ckanext/switzerland/templates/package/snippets/related_datasets.html b/ckanext/switzerland/templates/package/snippets/related_datasets.html deleted file mode 100644 index de5f62b7b..000000000 --- a/ckanext/switzerland/templates/package/snippets/related_datasets.html +++ /dev/null @@ -1,37 +0,0 @@ -{# -Renders a list of related datasets. - -pkg - A package object that the resources belong to. - -Example: - -{% snippet "package/snippets/related_datasets.html", pkg=pkg %} - -#} -{% if pkg.see_alsos %} - -{% endif %} diff --git a/ckanext/switzerland/templates/package/snippets/resource_item.html b/ckanext/switzerland/templates/package/snippets/resource_item.html index eb1c65216..734d6785f 100644 --- a/ckanext/switzerland/templates/package/snippets/resource_item.html +++ b/ckanext/switzerland/templates/package/snippets/resource_item.html @@ -18,35 +18,28 @@ {% block resource_item_explore_links %} {% block explore_view %} -
  • - - {% if res.has_views %} - - {{ _('Preview') }} - {% else %} - - {{ _('More information') }} - {% endif %} - -
  • + {{ super() }} {% endblock explore_view %} {% if res.url and h.is_url(res.url) %}
  • - - {% if res.has_views or res.url_type == 'upload' %} - - {{ _('Download') }} - {% else %} - - {{ _('Go to resource') }} - {% endif %} - + + {% if res.has_views or res.url_type == 'upload' %} + + {{ _('Download') }} + {% else %} + + {{ _('Go to resource') }} + {% endif %} +
  • {% endif %} {% if can_edit %} -
  • {% link_for _('Edit resource'), named_route=pkg.type ~ '_resource.edit', id=pkg.name, resource_id=res.id, class_='dropdown-item', icon='pencil' %}
  • -{% block resource_item_explore_inner scoped %}{% endblock %} -
  • {% link_for _('Views'), named_route=pkg.type ~ '_resource.views', id=pkg.name, resource_id=res.id, class_='dropdown-item', icon='chart-bar' %}
  • +
  • + + + {{ _('Edit') }} + +
  • {% endif %} {% endblock %} diff --git a/ckanext/switzerland/templates/package/snippets/resource_upload_field.html b/ckanext/switzerland/templates/package/snippets/resource_upload_field.html deleted file mode 100644 index caac2a6d4..000000000 --- a/ckanext/switzerland/templates/package/snippets/resource_upload_field.html +++ /dev/null @@ -1,118 +0,0 @@ -{# -Resource upload form field that allows switching between: - URL <-> Unset <-> File upload (when enabled) - -The "url" field is -New uploaded files are saved as "upload", and "name" field is -updated with the file name if not already set. - -When removing a file upload a special "clear_upload" field is passed - -data - resource form data fields -errors - errors on resource form fields -is_url - true if resource using url (not file upload) -is_upload - true if resource using file upload (not url) -is_upload_enabled - true if site supports file uploads -url_label - label for URL field (default: "URL") -upload_label - label for upload field (default: "File") -menu_label - label for button menu (default: "Data") -placeholder - placeholder text for url field -#} -{% import "macros/form.html" as form %} - -{% set first_button = 'resource-upload-button' if is_upload_enabled else 'resource-link-button' %} - -{% macro remove_button(js='') %} - -{% endmacro %} - -
    - -
    -
    - -
    - {% block url_type_select %} - {% if is_upload_enabled %} - - {% endif %} - - {% endblock %} -
    -
    -
    - - {% block url_type_fields %} - {% if is_upload_enabled %} - -
    - {% block upload_controls %} - {% if is_upload %} - {# for existing uploads we show the file name in a readonly input box #} - -
    -
    - - -
    - {% set existing_name = data.get('url', '').split('/')[-1].split('?')[0].split('#')[0] %} - -
    -
    -
    - {% endif %} -
    - {{ remove_button( - js="$('#field-resource-upload').replaceWith($('#field-resource-upload').val('').clone(true))") }} - {{ form.input( - 'upload', - label=upload_label or _('File'), - id='field-resource-upload', - type='file', - classes=['control-medium']) }} -
    - {% endblock %} -
    - {% endif %} - - -
    - {% block link_controls %} - {{ remove_button( - js="$('#field-resource-url').val('')") }} - {{ form.input( - 'url', - label=url_label or _('URL'), - id='field-resource-url', - type='url', - placeholder=placeholder, - value=data.get('url'), - error=errors.get('url'), - classes=['control-medium']) }} - {% endblock %} -
    - {% endblock %} -
    diff --git a/ckanext/switzerland/templates/package/snippets/terms_of_use.html b/ckanext/switzerland/templates/package/snippets/terms_of_use.html index 70712fdb5..0b7c7d4e7 100644 --- a/ckanext/switzerland/templates/package/snippets/terms_of_use.html +++ b/ckanext/switzerland/templates/package/snippets/terms_of_use.html @@ -1,6 +1,6 @@ -
    -
    {{ _('Terms of use') }}
    -
    + + {{ _('Terms of use') }} + {% if pkg.odpch_license_url %} {% if pkg.odpch_license_name %} {{ pkg.odpch_license_name }} @@ -8,7 +8,7 @@ {{ _('Terms of use') }} {% endif %} {% else %} - {{ _('Terms of use opentransport.swiss') }} + {{ _('Terms of use opentransportdata.swiss') }} {% endif %} -
    -
    + + diff --git a/ckanext/switzerland/templates/page.html b/ckanext/switzerland/templates/page.html deleted file mode 100644 index 912a18d2a..000000000 --- a/ckanext/switzerland/templates/page.html +++ /dev/null @@ -1,151 +0,0 @@ -{% extends "base.html" %} - -{%- block page -%} -
    - - {% block skip %} - - {% endblock %} - - {# - Override the header on a page by page basis by extending this block. If - making sitewide header changes it is preferable to override the header.html - file. - #} - {%- block header %} - {% include "header.html" %} - {% endblock -%} - - {# The content block allows you to replace the content of the page if needed #} - {%- block content %} - {% block maintag %}
    {% endblock %} -
    -
    -
    - - {% include "navigation.html" %} - - {% block main_content %} - {% block flash %} -
    - {% block flash_inner %} - {% for category, message in h.get_flashed_messages(with_categories=true) %} -
    - {{ h.literal(message) }} -
    - {% endfor %} - {% endblock %} -
    - {% endblock %} - - {% block toolbar %} - - {% endblock %} - -
    - - {# - The pre_primary block can be used to add content to before the - rendering of the main content columns of the page. - #} - {% block pre_primary %} - {% endblock %} - - {% block secondary %} - - {% endblock %} - - {% block primary %} -
    - {# - The primary_content block can be used to add content to the page. - This is the main block that is likely to be used within a template. - - Example: - - {% block primary_content %} -

    My page content

    -

    Some content for the page

    - {% endblock %} - #} - {% block primary_content %} -
    - {% block page_header %} - - {% endblock %} -
    - {% if self.page_primary_action() | trim %} -
    - {% block page_primary_action %}{% endblock %} -
    - {% endif %} - {% block primary_content_inner %} - {% endblock %} -
    -
    - {% endblock %} -
    - {% endblock %} -
    - {% endblock %} - - {%- block footer %} - {% include "footer.html" %} - {% endblock -%} - - -
    -
    -
    - {% endblock -%} - - {# - Override the footer on a page by page basis by extending this block. If - making sitewide header changes it is preferable to override the footer.html-u - file. - #} - - -
    -{%- endblock -%} - -{%- block scripts %} - {% asset 'base/main' %} - {% asset 'base/ckan' %} - {% if g.tracking_enabled %} - {% asset 'base/tracking' %} - {% endif %} - {{ super() }} -{% endblock -%} diff --git a/ckanext/switzerland/templates/scheming/display_snippets/fluent_tags.html b/ckanext/switzerland/templates/scheming/display_snippets/fluent_tags.html index 2392939aa..3d247c91e 100644 --- a/ckanext/switzerland/templates/scheming/display_snippets/fluent_tags.html +++ b/ckanext/switzerland/templates/scheming/display_snippets/fluent_tags.html @@ -1,19 +1,19 @@
    - {% set tags = data[field.field_name] %} - {% if tags %} + {% set tags = h.scheming_language_text(data[field.field_name]) %} + {% if tags %} {% block tag_list %} -
      - {% for tag in data[field.field_name] %} - {% set tag_dict = {'keywords_' + h.lang(): tag} %} -
    • +
        + {% for tag in tags %} + {% set tag_dict = {'keywords_' + h.lang(): tag} %} +
      • {{ - h.truncate(tag, 22) }} -
      • + h.url_for(controller='dataset', action='search', **tag_dict) }}">{{ + tag | truncate(22) }} + {% endfor %} -
      +
    {% endblock %} - {% else %} + {% else %} - - {% endif %} -
    \ No newline at end of file + {% endif %} + diff --git a/ckanext/switzerland/templates/scheming/display_snippets/keywords.html b/ckanext/switzerland/templates/scheming/display_snippets/keywords.html deleted file mode 100644 index 2c9b0e8d7..000000000 --- a/ckanext/switzerland/templates/scheming/display_snippets/keywords.html +++ /dev/null @@ -1,15 +0,0 @@ -
      - {# sometimes only the keywords of the current language is in the dict, sometimes all languages #} - {% if h.lang() in data[field.field_name] %} - {% set keywords = data[field.field_name][h.lang()] %} - {% else %} - {% set keywords = data[field.field_name] %} - {% endif %} - {% for tag in keywords %} -
    • - {{ - h.truncate(tag, 22) }} -
    • - {% endfor %} -
    diff --git a/ckanext/switzerland/templates/scheming/form_snippets/image_upload.html b/ckanext/switzerland/templates/scheming/form_snippets/image_upload.html deleted file mode 100644 index 6606f55a6..000000000 --- a/ckanext/switzerland/templates/scheming/form_snippets/image_upload.html +++ /dev/null @@ -1,8 +0,0 @@ -{% import 'macros/form.html' as form %} - -{% set is_upload = data.image_url and not data.image_url.startswith('http') %} -{% set is_url = data.image_url and data.image_url.startswith('http') %} -{{ form.image_upload(data, errors, is_upload_enabled=h.uploads_enabled(), is_url=is_url, is_upload=is_upload, - field_url=field.url_field) }} - -{%- snippet 'scheming/form_snippets/help_text.html', field=field -%} diff --git a/ckanext/switzerland/templates/scheming/package/read.html b/ckanext/switzerland/templates/scheming/package/read.html new file mode 100644 index 000000000..dfa7e2218 --- /dev/null +++ b/ckanext/switzerland/templates/scheming/package/read.html @@ -0,0 +1,14 @@ +{% extends "package/read.html" %} + +{%- set schema = h.scheming_get_dataset_schema(dataset_type) -%} + +{% block package_notes %} +
    + {{ h.render_markdown(h.parse_and_localize(pkg.description)) }} +
    +{% endblock %} + +{% block package_additional_info %} + {% snippet "scheming/package/snippets/additional_info.html", + pkg_dict=pkg, dataset_type=dataset_type, schema=schema %} +{% endblock %} diff --git a/ckanext/switzerland/templates/scheming/package/resource_read.html b/ckanext/switzerland/templates/scheming/package/resource_read.html index 4d876d4e3..254f8a395 100644 --- a/ckanext/switzerland/templates/scheming/package/resource_read.html +++ b/ckanext/switzerland/templates/scheming/package/resource_read.html @@ -1,33 +1,45 @@ -{% extends "package/resource_read.html" %} +{% ckan_extends %} -{%- set exclude_fields = [ - 'name', - 'description', - 'title', - 'url', - 'issued', - 'download_url', - 'rights', - 'license', - ] -%} +{% block head_extras -%} + + {{ g.template_head_end | safe }} -{%- set schema = h.scheming_get_dataset_schema(dataset_type) -%} + {% set description = h.markdown_extract(h.parse_and_localize(res['description']), extract_length=200) if res.description else h.markdown_extract(h.parse_and_localize(package['description']), extract_length=200) %} + + +{% endblock -%} -{% block resource_additional_information_inner %} -{%- set display_items = h.get_resource_display_items(res, exclude_fields, schema) -%} -
    -

    {{ _('Additional Information') }}

    -
    -
    {{ _('Permalink') }}
    -
    {% link_for _('Permalink'), named_route='ogdch_dataset.resource_permalink', id=pkg.name, filename=h.resource_filename(res.url) %}
    - {% for key, field in display_items.items() %} - {% set resource_helper = dict({key: field.value}) %} -
    {{- h.scheming_language_text(field.label) -}}
    -
    - {%- snippet 'scheming/snippets/display_field.html', - field=field, data=resource_helper, schema=schema -%} -
    - {% endfor %} -
    +{% block resource_content %} + {% block resource_read_title %}

    {{ h.resource_display_name(res) | truncate(50) }}

    {% endblock %} + {% block resource_read_url %} + {% if res.url and h.is_url(res.url) %} +

    {{ _('URL:') }} {{ res.url }}

    + {% elif res.url %} +

    {{ _('URL:') }} {{ res.url }}

    + {% endif %} + {% endblock %} +
    + {% if res.description %} + {{ h.render_markdown(h.parse_and_localize(res.description)) }} + {% endif %} + {% if not res.description and package.description %} +

    {{ _('Dataset description:') }}

    +
    {{ h.markdown_extract(h.parse_and_localize(package['description'])) }}
    +

    {% trans dataset=h.get_translated(package, 'title'), url=h.url_for(package.type ~ '.read', id=package.name) %}Source: {{ dataset }}{% endtrans %} + {% endif %}

    {% endblock %} + +{%- block resource_more_items -%} +{%- endblock -%} + +{% block secondary_content %} + + {% block resources_list %} + {% snippet "package/snippets/resources.html", pkg=pkg, active=res.id, action='read' %} + {% endblock %} + + {% block resource_social %} + {% snippet "snippets/social.html" %} + {% endblock %} +{% endblock %} diff --git a/ckanext/switzerland/templates/scheming/package/snippets/additional_info.html b/ckanext/switzerland/templates/scheming/package/snippets/additional_info.html index 88b6a64cd..403d0401c 100644 --- a/ckanext/switzerland/templates/scheming/package/snippets/additional_info.html +++ b/ckanext/switzerland/templates/scheming/package/snippets/additional_info.html @@ -7,21 +7,31 @@ 'description', 'notes', 'tag_string', - 'see_alsos', 'spatial', 'coverage', - 'relations', 'odpch_license_url', 'odpch_license_name', ] -%} {% block package_additional_info %} {%- for field in schema.dataset_fields -%} - {%- if field.field_name not in exclude_fields and field.display_snippet is not none -%} -
    {{ h.scheming_language_text(field.label) }}
    -
    - {%- snippet 'scheming/snippets/display_field.html', field=field, data=pkg_dict, schema=schema -%} -
    + {%- if field.field_name not in exclude_fields + and field.display_snippet is not none -%} + + {{ + h.scheming_language_text(field.label) }} + {%- snippet 'scheming/snippets/display_field.html', + field=field, data=pkg_dict, schema=schema -%} + {%- endif -%} {%- endfor -%} + {% snippet "package/snippets/terms_of_use.html", pkg=pkg_dict %} + {% if h.check_access('package_update',{'id':pkg_dict.id}) %} + + {{ _("State") }} + {{ _(pkg_dict.state) }} + + {% endif %} {% endblock %} diff --git a/ckanext/switzerland/templates/scheming/package/snippets/resource_form.html b/ckanext/switzerland/templates/scheming/package/snippets/resource_form.html deleted file mode 100644 index b32926d91..000000000 --- a/ckanext/switzerland/templates/scheming/package/snippets/resource_form.html +++ /dev/null @@ -1,28 +0,0 @@ -{% extends 'package/snippets/resource_form.html' %} - -{% block errors %} - {%- if errors -%} - {%- set schema = h.scheming_get_dataset_schema(dataset_type) -%} - {%- snippet 'scheming/snippets/errors.html', - errors=errors, fields=schema.resource_fields, schema=schema -%} - {%- endif -%} -{% endblock %} - -{% block basic_fields %} - {%- if not dataset_type -%} -

    - dataset_type not passed to template. your version of CKAN - might not be compatible with ckanext-scheming -

    - {%- endif -%} - {%- set schema = h.scheming_get_dataset_schema(dataset_type) -%} - {%- for field in schema.resource_fields -%} - {%- if field.form_snippet is not none -%} - {%- snippet 'scheming/snippets/form_field.html', - field=field, data=data, errors=errors, schema=schema -%} - {% endif %} - {%- endfor -%} -{% endblock %} - -{% block metadata_fields %} -{% endblock %} diff --git a/ckanext/switzerland/templates/search/search.html b/ckanext/switzerland/templates/search/search.html deleted file mode 100644 index a12258723..000000000 --- a/ckanext/switzerland/templates/search/search.html +++ /dev/null @@ -1,89 +0,0 @@ -{% extends "page.html" %} - -{# - we want the search page to be full-width. since the col classes are on element outside of the primary_content_inner block, - I had to override the secondary block with and the whole primary block with the same code that's in base.html, - except with .col-md-12 -#} -{% block secondary %}{% endblock %} - -{% block breadcrumb %} - -{% endblock %} - -{% block primary %} -
    - {% block primary_content %} -
    -
    - {% if self.page_primary_action() | trim %} -
    - {% block page_primary_action %}{% endblock %} -
    - {% endif %} - {% block primary_content_inner %} -

    {{ _('Search') }}

    -
    -
    - - - - - {% trans %}Search term must be at least 3 characters long{% endtrans %} - -
    - - -
    - {% trans %}An error occured. Please try another search phrase.{% endtrans %} -
    - -
    -

    - - {% trans %}[[ datasetResults.length ]] datasets found for "[[ currentSearchTerm ]]"{% endtrans %} -

    -
    -
    -

    [[ result.title ]]

    -
    [[ result.description ]]
    -
    - - -
    - -

    - - {% trans %}[[ pageResults.length ]] pages found for "[[ currentSearchTerm ]]"{% endtrans %} -

    -
    -
    -

    [[ result.title ]]

    -
    [[[ result.description ]]]
    -
    - -
    -
    -
    - {% endblock %} -
    -
    - {% endblock %} -
    -{% endblock %} - -{%- block scripts %} - {{ super() }} - {% asset 'switzerland/search' %} -{% endblock -%} diff --git a/ckanext/switzerland/templates/snippets/changes/new_resource.html b/ckanext/switzerland/templates/snippets/changes/new_resource.html deleted file mode 100644 index 34479141e..000000000 --- a/ckanext/switzerland/templates/snippets/changes/new_resource.html +++ /dev/null @@ -1,16 +0,0 @@ -{% set pkg_url = h.url_for(dataset_type ~ '.read', id=change.pkg_id) %} -{% set resource_url = h.url_for(dataset_type ~ '_resource.read', id=change.pkg_id, resource_id = change.resource_id, qualified=True) %} - -{% set pkg_link %} -{{ change.title }} -{% endset %} - -{% set resource_link %} -{{ change.resource_name or _('Unnamed resource') }} -{% endset %} - -
  • -

    - {{ _('Added resource {resource_link} to {pkg_link}').format(pkg_link=pkg_link, resource_link=resource_link) }} -

    -
  • diff --git a/ckanext/switzerland/templates/snippets/changes/resource_extras.html b/ckanext/switzerland/templates/snippets/changes/resource_extras.html new file mode 100644 index 000000000..cc5e22e52 --- /dev/null +++ b/ckanext/switzerland/templates/snippets/changes/resource_extras.html @@ -0,0 +1,112 @@ +
  • +

    + {% if change.method == "add_one_value" %} + + {{ _('Added field {key} with value {value} to resource {resource_link} in {pkg_link}').format( + pkg_link = h.nav_link(change.title, named_route='dataset.read', id=change.pkg_id), + resource_link = h.nav_link( + change.resource_name, named_route='dataset_resource.read', id=change.pkg_id, + resource_id=change.resource_id, qualified=True), + key = change.key, + value = change.value + ) }} + + {% elif change.method == "add_one_no_value" %} + + {{ _('Added field {key} to resource {resource_link} in {pkg_link}').format( + pkg_link = h.nav_link(change.title, named_route='dataset.read', id=change.pkg_id), + resource_link = h.nav_link( + change.resource_name, named_route='dataset_resource.read', id=change.pkg_id, + resource_id=change.resource_id, qualified=True), + key = change.key, + ) }} + + {% elif change.method == "add_multiple" %} + + {{ _('Added the following fields to resource {resource_link} in {pkg_link}').format( + pkg_link = h.nav_link(change.title, named_route='dataset.read', id=change.pkg_id), + resource_link = h.nav_link( + change.resource_name, named_route='dataset_resource.read', id=change.pkg_id, + resource_id=change.resource_id, qualified=True) + ) }} +

      + {% for item in change.key_list %} + {% if change.value_list[item] != "" %} + {{ _('{key} with value {value}').format( + key = item, + value = change.value_list[item] + )|safe }} + {% else %} + {{ _('{key}').format( + key = item + )|safe }} + {% endif %} + {% endfor %} +
    + + {% elif change.method == "remove_one" %} + + {{ _('Removed field {key} from resource {resource_link} in {pkg_link}').format( + pkg_link = h.nav_link(change.title, named_route='dataset.read', id=change.pkg_id), + resource_link = h.nav_link( + change.resource_name, named_route='dataset_resource.read', id=change.pkg_id, + resource_id=change.resource_id, qualified=True), + key = change.key + ) }} + + {% elif change.method == "remove_multiple" %} + + {{ _('Removed the following fields from resource {resource_link} in {pkg_link}').format( + pkg_link = h.nav_link(change.title, named_route='dataset.read', id=change.pkg_id), + resource_link = h.nav_link( + change.resource_name, named_route='dataset_resource.read', id=change.pkg_id, + resource_id=change.resource_id, qualified=True) + ) }} +
      + {% for item in change.key_list %} + {{ _('{key}').format( + key = item + )|safe }} + {% endfor %} +
    + + {% elif change.method == "change_value_with_old" %} + + {{ _('Changed value of field {key} of resource {resource_link} to {new_val} (previously {old_val}) in {pkg_link}').format( + pkg_link = h.nav_link(change.title, named_route='dataset.read', id=change.pkg_id), + resource_link = h.nav_link( + change.resource_name, named_route='dataset_resource.read', id=change.pkg_id, + resource_id=change.resource_id, qualified=True), + key = change.key, + new_val = change.new_value, + old_val = change.old_value + ) }} + + {% elif change.method == "change_value_no_old" %} + + {{ _('Changed value of field {key} to {new_val} in resource {resource_link} in {pkg_link}').format( + pkg_link = h.nav_link(change.title, named_route='dataset.read', id=change.pkg_id), + resource_link = h.nav_link( + change.resource_name, named_route='dataset_resource.read', id=change.pkg_id, + resource_id=change.resource_id, qualified=True), + key = change.key, + new_val = change.new_value + ) }} + + {% elif change.method == "change_value_no_new" %} + + {{ _('Removed the value of field {key} in resource {resource_link} in {pkg_link}').format( + pkg_link = h.nav_link(change.title, named_route='dataset.read', id=change.pkg_id), + resource_link = h.nav_link( + change.resource_name, named_route='dataset_resource.read', id=change.pkg_id, + resource_id=change.resource_id, qualified=True), + key = change.key, + new_val = change.new_value + ) }} + {% else %} + + {{ _('No fields were updated. See the metadata diff for more details.') }} + + {% endif %} +

    +
  • diff --git a/ckanext/switzerland/templates/snippets/facet_list.html b/ckanext/switzerland/templates/snippets/facet_list.html index 47b68604d..0ec4c0cf8 100644 --- a/ckanext/switzerland/templates/snippets/facet_list.html +++ b/ckanext/switzerland/templates/snippets/facet_list.html @@ -1,92 +1,39 @@ -{# -Construct a facet module populated with links to filtered results. - -name -The field name identifying the facet field, eg. "tags" - -title -The title of the facet, eg. "Tags", or "Tag Cloud" - -label_function -Renders the human-readable label for each facet value. -If defined, this should be a callable that accepts a `facet_item`. -eg. lambda facet_item: facet_item.display_name.upper() -By default it displays the facet item's display name, which should -usually be good enough - -if_empty -A string, which if defined, and the list of possible facet items is empty, -is displayed in lieu of an empty list. - -count_label -A callable which accepts an integer, and returns a string. This controls -how a facet-item's count is displayed. - -extras -Extra info passed into the add/remove params to make the url - -alternative_url -URL to use when building the necessary URLs, instead of the default -ones returned by url_for. Useful eg for dataset types. - -hide_empty -Do not show facet if there are none, Default: false. - -search_facets -Dictionary with search facets - -#} -{% block facet_list %} - {% set hide_empty = hide_empty or false %} - {% with items = items or h.get_facet_items_dict(name, search_facets) %} - {% if items or not hide_empty %} - {% block facet_list_item %} -
    - {% block facet_list_heading %} -

    - - {% set title = title or h.get_facet_title(name) %} - {{ title }} -

    - {% endblock %} - {% block facet_list_items %} - {% with items = items or h.get_facet_items_dict(name, search_facets) %} - {% if items %} - - - +{% ckan_extends %} + + +{% block facet_list_items %} + {% with items = items or h.get_facet_items_dict(name, search_facets) %} + {% if items %} + + +

    {{ _('There are no {facet_type} that match this search').format(facet_type=title) }}

    + {{ _('Show Only Popular {facet_type}').format(facet_type=title) }} {% endif %} - {% endwith %} - {% endblock %} -
    - {% endblock %} - {% endif %} - {% endwith %} +

    + {% else %} +

    {{ _('There are no {facet_type} that match this search').format(facet_type=title) }}

    + {% endif %} + {% endwith %} {% endblock %} diff --git a/ckanext/switzerland/templates/snippets/home_breadcrumb_item.html b/ckanext/switzerland/templates/snippets/home_breadcrumb_item.html deleted file mode 100644 index 40ac16228..000000000 --- a/ckanext/switzerland/templates/snippets/home_breadcrumb_item.html +++ /dev/null @@ -1,2 +0,0 @@ -{# Used to insert the home icon into a breadcrumb #} -
  • diff --git a/ckanext/switzerland/templates/snippets/job_details.html b/ckanext/switzerland/templates/snippets/job_details.html deleted file mode 100644 index 75f877113..000000000 --- a/ckanext/switzerland/templates/snippets/job_details.html +++ /dev/null @@ -1,79 +0,0 @@ -{# -Displays information for a particular harvest job, including: - - * counts for added, updated, deleted or errored datasets - * table with general details - * table with a summary of the most common errors on this job - -job - dictized harvest job object - -Example: - - {% snippet 'snippets/job_details.html', job=job %} - -#} - -{% set stats = job.stats %} - -{% if job.status == 'Finished' %} -

    - - {% if 'errored' in stats and stats['errored'] > 0 %} - {{ stats['errored'] }} - {% else %} - 0 - {% endif %} - {{ _('errors') }} - - {% for action in ['added', 'updated', 'deleted', 'not modified'] %} - - {% if action in stats and stats[action] > 0 %} - {{ stats[action] }} - {% else %} - 0 - {% endif %} - {{ _(action) }} - - {% endfor %} -

    -{% endif %} - -

    {{ _('Details') }}

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    {{ _('Id') }}{{ job.id }}
    {{ _('Created') }} - - {{ h.render_datetime(job.created, with_hours=True) }} - -
    {{ _('Started') }} - - {{ h.render_datetime(job.gather_started, with_hours=True) }} - -
    {{ _('Finished') }} - - {{ h.render_datetime(job.finished, with_hours=True) }} - -
    {{ _('Status') }}{{ _(job.status) }}
    diff --git a/ckanext/switzerland/templates/snippets/job_error_summary.html b/ckanext/switzerland/templates/snippets/job_error_summary.html deleted file mode 100644 index 9f8947c63..000000000 --- a/ckanext/switzerland/templates/snippets/job_error_summary.html +++ /dev/null @@ -1,32 +0,0 @@ -{# -Displays a table with a summary of the most common errors for a job - -error_summary - List of dicts with message and error_count - -Example: - - {% snippet 'snippets/job_error_summary.html', summary=job.object_error_summary %} - -#} - - - - - - - - - - - - - {% for error in summary %} - - - - - {% endfor %} - -
    {{ _('Count') }}{{ _('Message') }}
    {{ error["error_count"] }}{{ error["message"] | safe }}
    - - diff --git a/ckanext/switzerland/templates/snippets/language_selector.html b/ckanext/switzerland/templates/snippets/language_selector.html deleted file mode 100644 index d304abb8b..000000000 --- a/ckanext/switzerland/templates/snippets/language_selector.html +++ /dev/null @@ -1,8 +0,0 @@ -{% set current_url = request.environ.CKAN_CURRENT_URL %} -{% set current_lang = request.environ.CKAN_LANG %} - -{% for locale in h.get_langs() %} - - {{ locale | upper }} - -{% endfor %} diff --git a/ckanext/switzerland/templates/snippets/license.html b/ckanext/switzerland/templates/snippets/license.html new file mode 100644 index 000000000..3900c978d --- /dev/null +++ b/ckanext/switzerland/templates/snippets/license.html @@ -0,0 +1,3 @@ +{% block license %} + +{% endblock %} diff --git a/ckanext/switzerland/templates/snippets/organization.html b/ckanext/switzerland/templates/snippets/organization.html deleted file mode 100644 index 3bb66fb4a..000000000 --- a/ckanext/switzerland/templates/snippets/organization.html +++ /dev/null @@ -1,12 +0,0 @@ -{% ckan_extends %} - -{% block heading %} -

    {{ h.parse_and_localize(organization.title) }} - {% if organization.state == 'deleted' %} - [{{ _('Deleted') }}] - {% endif %} -

    -{% endblock %} - -{% block description %} -{% endblock %} diff --git a/ckanext/switzerland/templates/snippets/package_item.html b/ckanext/switzerland/templates/snippets/package_item.html index 074531233..91259f86f 100644 --- a/ckanext/switzerland/templates/snippets/package_item.html +++ b/ckanext/switzerland/templates/snippets/package_item.html @@ -1,82 +1,16 @@ -{# -Displays a single of dataset. +{% ckan_extends %} -package - A package to display. -item_class - The class name to use on the list item. -hide_resources - If true hides the resources (default: false). -banner - If true displays a popular banner (default: false). -truncate - The length to trucate the description to (default: 180) -truncate_title - The length to truncate the title to (default: 80). - -Example: - - {% snippet 'snippets/package_item.html', package=datasets[0] %} - -#} {% set truncate = truncate or 180 %} {% set truncate_title = truncate_title or 80 %} -{% set description = h.truncate(package.description, truncate) %} -{% block package_item %} -
  • - {% block content %} -
    - {% block heading %} -

    - {% block heading_private %} - {% if package.private %} - - - {{ _('Private') }} - - {% endif %} - {% endblock %} - {% block heading_title %} - {{ h.link_to(h.truncate(h.dataset_display_name(package), truncate_title), h.url_for('dataset.read', id=package.name)) }} - {% endblock %} - {% block heading_meta %} - {% if package.get('state', '').startswith('draft') %} - {{ _('Draft') }} - {% elif package.get('state', '').startswith('deleted') %} - {{ _('Deleted') }} - {% endif %} - {{ h.popular('recent views', package.tracking_summary.recent, min=10) if package.tracking_summary }} - {% endblock %} -

    - {% endblock %} - {% block groups %} - {% if package.groups %} -

    - {% for group in package.groups %} - {{ h.parse_and_localize(group.display_name) }}{% if not loop.last %}, {% endif %} - {% endfor %} -

    - {% endif %} - {% endblock %} - {% block description %} - {% if description %} -

    {{ h.parse_and_localize(description) }}

    - {% else %} -

    {{ _('This dataset has no description') }}

    - {% endif %} - {% endblock %} -
    - {% block resources %} - {% if package.resources and not hide_resources %} - {% block resources_outer %} -
      - {% block resources_inner %} - {% for format in h.dict_list_reduce(package.resources, 'format') %} -
    • - {% set format_truncated = h.truncate(format, 30) %} - {{ format_truncated.upper() }} -
    • - {% endfor %} - {% endblock %} -
    - {% endblock %} - {% endif %} - {% endblock %} - {% endblock %} -
  • +{% block heading_title %} + {{ h.link_to(h.dataset_display_name(package) | truncate(truncate_title), h.url_for('dataset.read', id=package.name)) }} +{% endblock %} + +{% block notes %} + {% if package.description %} +

    {{ h.parse_and_localize(package.description) | truncate(truncate) }}

    + {% else %} +

    {{ h.humanize_entity_type('package', package.type, 'no description') or _("There is no description for this dataset") }}

    + {% endif %} {% endblock %} diff --git a/ckanext/switzerland/templates/snippets/related.html b/ckanext/switzerland/templates/snippets/related.html deleted file mode 100644 index c2fc9ed81..000000000 --- a/ckanext/switzerland/templates/snippets/related.html +++ /dev/null @@ -1,22 +0,0 @@ -
    -

    {{ _('Related') }}

    -
    - {% if item %} - {% with url = h.url_for('related.list', id=pkg_name) %} - -
    -

    {{ item.title }}

    -

    {{ h.markdown_extract(item.description, 70) }}

    -
    - {% endwith %} - {% else %} -

    {% trans %}No apps, ideas, news stories or images have been - related to this dataset yet.{% endtrans %}

    - {% if h.check_access('related_create') %} -

    {% link_for _('Add Item'), named_route='related.new', id=pkg_name, icon='plus', class_='btn btn-default' %}

    - {% endif %} - {% endif %} -
    -
    diff --git a/ckanext/switzerland/templates/snippets/search_form.html b/ckanext/switzerland/templates/snippets/search_form.html index 9b3b0c7b2..6b8d4c008 100644 --- a/ckanext/switzerland/templates/snippets/search_form.html +++ b/ckanext/switzerland/templates/snippets/search_form.html @@ -1,44 +1,24 @@ {% ckan_extends %} -{% block search_input %}{% endblock %} - {% block search_facets %} {% if facets %}

    {% for field in facets.fields %} - {% set search_facets_items = facets.search.get(field)['items'] %} + {% set search_facets_items = facets.search.get(field)['items'] if facets.search and field in facets.search else [] %} {{ facets.titles.get(field) }}: {% for value in facets.fields[field] %} - {%- if facets.translated_fields and facets.translated_fields.has_key((field, value)) -%} - {{ facets.translated_fields[(field, value)] }} - {%- else -%} - {{ h.parse_and_localize( h.list_dict_filter(search_facets_items, 'name', 'display_name', value) ) }} - {%- endif %} - + {%- if facets.translated_fields and (field,value) in facets.translated_fields -%} + {% set filter_name = h.parse_and_localize(facets.translated_fields[(field,value)]) %} + {%- else -%} + {% set filter_name = h.parse_and_localize(h.list_dict_filter(search_facets_items, 'name', 'display_name', value)) %} + {%- endif %} + {{ filter_name }} + {% endfor %} {% endfor %}

    - {{ _('Filter Results') }} - {% endif %} -{% endblock %} - - -{% block search_sortby %} - {% if sorting %} -
    - - - {% block search_sortby_button %} - - {% endblock %} -
    + {{ _('Filter Results') }} {% endif %} {% endblock %} diff --git a/ckanext/switzerland/templates/snippets/social.html b/ckanext/switzerland/templates/snippets/social.html new file mode 100644 index 000000000..e22bffec8 --- /dev/null +++ b/ckanext/switzerland/templates/snippets/social.html @@ -0,0 +1,6 @@ +{% ckan_extends %} +{% block social_nav %} + +{% endblock %} diff --git a/ckanext/switzerland/templates/snippets/stream.html b/ckanext/switzerland/templates/snippets/stream.html index 3c8dbdd5a..50f44193e 100644 --- a/ckanext/switzerland/templates/snippets/stream.html +++ b/ckanext/switzerland/templates/snippets/stream.html @@ -14,7 +14,8 @@ {% endmacro %} {% macro organization(activity) %} - + {% set group_type = group_type or (activity.data.group.type if (activity.data.group and activity.data.group.type) else 'organization') %} + {{ h.parse_and_localize(activity.data.group.title) if activity.data.group else _('unknown') }} {% endmacro %} @@ -41,7 +42,7 @@ #} {% block activity_stream %} -
      +
        {% set can_show_activity_detail = h.check_access('activity_list', {'id': id, 'include_data': True, 'object_type': object_type}) %} {% for activity in activity_stream %} @@ -57,6 +58,8 @@ }, id=id -%} + {% else %} + {{ _("No activity found for this type") }} {% endfor %}
      {% endblock %} diff --git a/ckanext/switzerland/templates/source/about.html b/ckanext/switzerland/templates/source/about.html deleted file mode 100644 index ac7814112..000000000 --- a/ckanext/switzerland/templates/source/about.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "source/read_base.html" %} - -{% block primary_content_inner %} -
      -

      {{ harvest_source.title or harvest_source.name }}

      - {% if harvest_source.notes %} -

      {{ h.markdown_extract(harvest_source.notes)|urlize }}

      - {% else %} -

      {{ _('There is no description for this harvest source') }}

      - {% endif %} -
      -{% endblock %} diff --git a/ckanext/switzerland/templates/source/job/list.html b/ckanext/switzerland/templates/source/job/list.html deleted file mode 100644 index 508141813..000000000 --- a/ckanext/switzerland/templates/source/job/list.html +++ /dev/null @@ -1,67 +0,0 @@ -{% extends "source/admin_base.html" %} - - -{% block subtitle %}{{ _('Harvest Jobs')}} - {{ super() }}{% endblock %} - -{% block primary_content_inner %} -
      - -

      {{ _('Harvest Jobs') }}

      - - {% if jobs|length == 0 %} -

      {{ _('No jobs yet for this source') }}

      - {% else %} -
        - {% for job in jobs %} -
      • -
        -

        - - {{ _('Job: ') }} {{ job.id }} - - {% if job.status != 'Finished' %} - {{ job.status }} - {% endif %} -

        -

        - {{ _('Started:') }} - - {{ h.render_datetime(job.gather_started, with_hours=True) or _('Not yet') }} - - — - {{ _('Finished:') }} - - {{ h.render_datetime(job.finished, with_hours=True) or _('Not yet') }} - -

        -
        - {% if job.status == 'Finished' %} -
          - {% if 'errored' in job.stats and job.stats['errored'] > 0 %} -
        • - - {{ job.stats['errored'] }} {{ _('errors') }} - -
        • - {% endif %} - {% for action in ['added', 'updated', 'deleted', 'not modified'] %} -
        • - - {% if action in job.stats and job.stats[action] > 0 %} - {{ job.stats[action] }} - {% else %} - 0 - {% endif %} - {{ _(action) }} - -
        • - {% endfor %} -
        - {% endif %} -
      • - {% endfor %} -
      - {% endif %} - -
      -{% endblock %} diff --git a/ckanext/switzerland/templates/source/new_source_form.html b/ckanext/switzerland/templates/source/new_source_form.html deleted file mode 100644 index 96317f9d0..000000000 --- a/ckanext/switzerland/templates/source/new_source_form.html +++ /dev/null @@ -1,5 +0,0 @@ -{% ckan_extends %} - -{% block extra_config %} - {{ form.textarea('config', id='field-config', label=_('Configuration'), value=data.config, error=errors.config, rows=20) }} -{% endblock extra_config %} diff --git a/ckanext/switzerland/templates/user/read_groups.html b/ckanext/switzerland/templates/user/read_groups.html new file mode 100644 index 000000000..fde9d1808 --- /dev/null +++ b/ckanext/switzerland/templates/user/read_groups.html @@ -0,0 +1,31 @@ +{% extends "user/read_base.html" %} + +{% set user = user_dict %} +{% set group_type = h.default_group_type('group') %} + +{% if user.state == 'deleted' %} + {% set groups_available = [] %} +{% else %} + {% set groups_available = h.groups_available(am_member=True, + include_dataset_count=True, + include_member_count=True, + user=user['id']) + %} +{% endif %} + +{% block primary_content_inner %} +

      {{ h.humanize_entity_type('group', group_type, 'facet label') or _('Groups') }}

      + {% if groups_available %} +
      + {% snippet "group/snippets/group_list.html", groups=groups_available, show_capacity=True %} +
      + {% else %} +

      + {% if is_myself %} + {{ h.humanize_entity_type('group', group_type, 'you not member') or _('You are not a member of any groups.') }} + {% else %} + {{ h.humanize_entity_type('group', group_type, 'user not member') or _('User isn\'t a member of any groups.') }} + {% endif %} +

      + {% endif %} +{% endblock %} diff --git a/ckanext/switzerland/templates/user/read_organizations.html b/ckanext/switzerland/templates/user/read_organizations.html new file mode 100644 index 000000000..c4d43f687 --- /dev/null +++ b/ckanext/switzerland/templates/user/read_organizations.html @@ -0,0 +1,31 @@ +{% extends "user/read_base.html" %} + +{% set user = user_dict %} +{% set org_type = h.default_group_type('organization') %} + +{% if user.state == 'deleted' %} + {% set orgs_available = [] %} +{% else %} + {% set orgs_available = h.organizations_available(permission='manage_group', + include_dataset_count=True, + include_member_count=True, + user=user['id']) + %} +{% endif %} + +{% block primary_content_inner %} +

      {{ h.humanize_entity_type('organization', org_type, 'facet label') or _('Organizations') }}

      + {% if orgs_available %} +
      + {% snippet "organization/snippets/organization_list.html", organizations=orgs_available, show_capacity=True %} +
      + {% else %} +

      + {% if is_myself %} + {{ h.humanize_entity_type('organization', org_type, 'you not member') or _('You are not a member of any organizations.') }} + {% else %} + {{ h.humanize_entity_type('organization', org_type, 'user not member') or _('User isn\'t a member of any organizations.') }} + {% endif %} +

      + {% endif %} +{% endblock %} diff --git a/ckanext/switzerland/templates/user/snippets/followee_dropdown.html b/ckanext/switzerland/templates/user/snippets/followee_dropdown.html index 09b460afe..99129e9a7 100644 --- a/ckanext/switzerland/templates/user/snippets/followee_dropdown.html +++ b/ckanext/switzerland/templates/user/snippets/followee_dropdown.html @@ -13,7 +13,7 @@
      @@ -38,7 +38,7 @@