diff --git a/MANIFEST.in b/MANIFEST.in index 21bead8..42dd8dc 100755 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,5 @@ include README.rst include LICENSE -recursive-include geokey_extension/templates * +recursive-include geokey_sapelli/static * +recursive-include geokey_sapelli/templates * recursive-exclude travis * diff --git a/geokey_sapelli/helper/project_mapper.py b/geokey_sapelli/helper/project_mapper.py index 9d43f5d..0e98666 100644 --- a/geokey_sapelli/helper/project_mapper.py +++ b/geokey_sapelli/helper/project_mapper.py @@ -43,9 +43,7 @@ def create_implicit_fields(category, stores_end_time=False): def create_project(sapelli_project_info, user, sap_file_path=None): geokey_project = Project.create( name = sapelli_project_info.get('display_name'), - description = ('Sapelli project id: %s;\nSapelli project fingerprint: %s;' % ( - sapelli_project_info.get('sapelli_id'), - sapelli_project_info.get('sapelli_fingerprint'))), + description = '', isprivate = True, everyone_contributes = EVERYONE_CONTRIB.false, creator = user diff --git a/geokey_sapelli/migrations/0015_remove_automatic_descriptions.py b/geokey_sapelli/migrations/0015_remove_automatic_descriptions.py new file mode 100644 index 0000000..8425233 --- /dev/null +++ b/geokey_sapelli/migrations/0015_remove_automatic_descriptions.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +def remove_automatic_descriptions(apps, schema_editor): + SapelliProject = apps.get_model('geokey_sapelli', 'SapelliProject') + for sapelli_project in SapelliProject.objects.all(): + auto_descr = 'Sapelli project id: %s;\nSapelli project fingerprint: %s;' % ( + sapelli_project.sapelli_id, + sapelli_project.sapelli_fingerprint) + if sapelli_project.geokey_project.description == auto_descr: + sapelli_project.geokey_project.description = '' + sapelli_project.geokey_project.save() + + +class Migration(migrations.Migration): + + dependencies = [ + ('geokey_sapelli', '0014_fix_everyone_contributes'), + ] + + operations = [ + migrations.RunPython(remove_automatic_descriptions), + ] diff --git a/geokey_sapelli/static/lib/js-cookie/js.cookie.min.js b/geokey_sapelli/static/lib/js-cookie/js.cookie.min.js new file mode 100644 index 0000000..e5ea49e --- /dev/null +++ b/geokey_sapelli/static/lib/js-cookie/js.cookie.min.js @@ -0,0 +1,2 @@ +/*! js-cookie v2.0.4 | MIT */ +!function(a){if("function"==typeof define&&define.amd)define(a);else if("object"==typeof exports)module.exports=a();else{var b=window.Cookies,c=window.Cookies=a();c.noConflict=function(){return window.Cookies=b,c}}}(function(){function a(){for(var a=0,b={};a1){if(f=a({path:"/"},d.defaults,f),"number"==typeof f.expires){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*f.expires),f.expires=h}try{g=JSON.stringify(e),/^[\{\[]/.test(g)&&(e=g)}catch(i){}return e=encodeURIComponent(String(e)),e=e.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),b=encodeURIComponent(String(b)),b=b.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),b=b.replace(/[\(\)]/g,escape),document.cookie=[b,"=",e,f.expires&&"; expires="+f.expires.toUTCString(),f.path&&"; path="+f.path,f.domain&&"; domain="+f.domain,f.secure?"; secure":""].join("")}b||(g={});for(var j=document.cookie?document.cookie.split("; "):[],k=/(%[0-9A-Z]{2})+/g,l=0;lSapelli projects {% for sapelli_project in sapelli_projects %}
  • {{ sapelli_project.geokey_project.name }}

    - {% if sapelli_project.geokey_project.description %} -

    {{sapelli_project.geokey_project.description|linebreaks}}

    - {% endif %} +

    + {% if sapelli_project.geokey_project.description %} + {{sapelli_project.geokey_project.description|linebreaks}} + {% else %} +
    + {% endif %} +

    + Info Upload data {% if sapelli_project.sap_path %} Download SAP @@ -62,6 +67,54 @@

    + {% endif %} {% endfor %}
  • diff --git a/setup.py b/setup.py index e1ef850..062c648 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages # Change geokey_sapelli version here (and here alone!): -VERSION_PARTS = (0, 6, 3) +VERSION_PARTS = (0, 6, 4) name = 'geokey-sapelli' version = '.'.join(map(str, VERSION_PARTS))