Skip to content

Commit

Permalink
v0.6.4:
Browse files Browse the repository at this point in the history
- sapelli_project_list.html: new info dialogue;
- no longer generating automatic descriptions on newly uploaded Sapelli projects, also added migration to remove them from existing ones;
- added js-cookie/js.cookie.min.js library (so we can remove it again from geokey);
- fixed MANIFEST.in paths.

Signed-off-by: Matthias Stevens <matthias.stevens@gmail.com>
  • Loading branch information
mstevens83 committed Dec 24, 2015
1 parent cb6f5a2 commit 49a600c
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 8 deletions.
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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 *
4 changes: 1 addition & 3 deletions geokey_sapelli/helper/project_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions geokey_sapelli/migrations/0015_remove_automatic_descriptions.py
Original file line number Diff line number Diff line change
@@ -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),
]
2 changes: 2 additions & 0 deletions geokey_sapelli/static/lib/js-cookie/js.cookie.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 56 additions & 3 deletions geokey_sapelli/templates/sapelli_project_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ <h3 class="header">Sapelli projects</h3>
{% for sapelli_project in sapelli_projects %}
<li>
<h4>{{ sapelli_project.geokey_project.name }}</h4>
{% if sapelli_project.geokey_project.description %}
<p>{{sapelli_project.geokey_project.description|linebreaks}}</p>
{% endif %}
<p>
{% if sapelli_project.geokey_project.description %}
{{sapelli_project.geokey_project.description|linebreaks}}
{% else %}
<br/>
{% endif %}
</p>
<h4>
<a href="" class="label label-info" data-toggle="modal" data-target="#info-dialog-{{ sapelli_project.geokey_project.id }}">Info</a>
<a href="{% url 'geokey_sapelli:data_csv_upload' sapelli_project.geokey_project.id %}" class="label label-info">Upload data</a>
{% if sapelli_project.sap_path %}
<a href="{% url 'geokey_sapelli:sap_download_api' sapelli_project.geokey_project.id %}" class="label label-info">Download SAP</a>
Expand Down Expand Up @@ -62,6 +67,54 @@ <h4 style="padding-top: 0.25em;">
</div>
</div>
</div>
<div class="modal fade" id="info-dialog-{{ sapelli_project.geokey_project.id }}" tabindex="-1" role="dialog" aria-labelledby="infoDialogLabel-{{ sapelli_project.geokey_project.id }}" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" title="Hide code">&times;</button>
<h6 class="item-info">Sapelli project</h6>
<h4 id="infoDialogLabel-{{ sapelli_project.geokey_project.id }}" class="modal-title">{{ sapelli_project.geokey_project.name }}</h4>
</div>
<div class="modal-body">
<table class="table-striped">
<tbody>
<tr>
<td><b>Name:&nbsp;</b></td>
<td>{{ sapelli_project.name }}</td>
</tr>
<tr>
<td><b>Variant:&nbsp;</b></td>
<td>{% if sapelli_project.variant %}{{ sapelli_project.variant }}{% endif %}</td>
</tr>
<tr>
<td><b>Version:&nbsp;</b></td>
<td>{{ sapelli_project.version }}</td>
</tr>
<tr>
<td><b>Geokey ID:&nbsp;</b></td>
<td>{{ sapelli_project.geokey_project.id }}</td>
</tr>
<tr>
<td><b>Sapelli ID:&nbsp;</b></td>
<td>{{ sapelli_project.sapelli_id }}</td>
</tr>
<tr>
<td><b>Fingerprint:&nbsp;</b></td>
<td>{{ sapelli_project.sapelli_fingerprint }}</td>
</tr>
<tr>
<td><b>Model ID:&nbsp;</b></td>
<td>{{ sapelli_project.sapelli_model_id }}</td>
</tr>
</tbody>
</table>
<h4 style="padding-top: 0.25em; text-align: center">
<a href="" class="label label-info" onClick="$('#info-dialog-' + projectID).modal('hide'); return false;">Close</a>
</h4>
</div>
</div>
</div>
</div>
{% endif %}
{% endfor %}
<li>
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 49a600c

Please sign in to comment.