diff --git a/.dockerignore b/.dockerignore index 2a6b170..a46ba90 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,3 +3,4 @@ settings_local.py *.ged /tmp /files +/data diff --git a/.gitignore b/.gitignore index e584585..3457a16 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,8 @@ pip-log.txt *d3.*.js /files/ +/data/ *.ged +docker-compose-prd.yml settings_local.py /tmp diff --git a/Dockerfile b/Dockerfile index 2438e1f..ebedaa5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,8 @@ FROM python:2.7 COPY ./ /app/ WORKDIR /app/ -RUN pip install -r reqs.pip +RUN pip install -r reqs.frozen.pip +RUN mkdir -p /static && python manage.py collectstatic -c --noinput RUN adduser --disabled-password --gecos '' gedgo RUN chown -R gedgo:gedgo /app diff --git a/gedgo/__init__.py b/gedgo/__init__.py index ae6f887..9e11c72 100644 --- a/gedgo/__init__.py +++ b/gedgo/__init__.py @@ -3,5 +3,8 @@ redis = None if hasattr(settings, 'GEDGO_REDIS_SERVER'): - redis = Redis.StrictRedis(host=settings.GEDGO_REDIS_SERVER) - redis.ping() + try: + redis = Redis.StrictRedis(host=settings.GEDGO_REDIS_SERVER) + redis.ping() + except Exception as e: + print e diff --git a/gedgo/gedcom_update.py b/gedgo/gedcom_update.py index a6ab291..035c46e 100644 --- a/gedgo/gedcom_update.py +++ b/gedgo/gedcom_update.py @@ -43,7 +43,7 @@ def update(g, file_name, verbose=True): __process_Note(entry, g) note_counter += 1 - if (index + 1) % 100 == 0: + if verbose and (index + 1) % 100 == 0: print ' ... %d / %d' % (index + 1, len(entries)) if verbose: diff --git a/gedgo/migrations/0002_auto_20180120_1030.py b/gedgo/migrations/0002_auto_20180120_1030.py index 53936d8..d36c655 100644 --- a/gedgo/migrations/0002_auto_20180120_1030.py +++ b/gedgo/migrations/0002_auto_20180120_1030.py @@ -29,6 +29,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='document', name='docfile', - field=models.FileField(upload_to=b'gedcom'), + field=models.FileField(upload_to=b'uploads'), ), ] diff --git a/gedgo/models/document.py b/gedgo/models/document.py index 302ffa6..6210889 100644 --- a/gedgo/models/document.py +++ b/gedgo/models/document.py @@ -8,7 +8,7 @@ class Meta: title = models.CharField(max_length=40, null=True, blank=True) description = models.TextField(null=True, blank=True) - docfile = models.FileField(upload_to='gedcom') + docfile = models.FileField(upload_to='uploads') last_updated = models.DateTimeField(auto_now_add=True) gedcom = models.ForeignKey('Gedcom', null=True, blank=True) diff --git a/gedgo/static/styles/style-default.css b/gedgo/static/styles/style-default.css index 1164e3f..273e3bf 100644 --- a/gedgo/static/styles/style-default.css +++ b/gedgo/static/styles/style-default.css @@ -120,15 +120,17 @@ path { } #worker-section { - min-height: 75px; - + min-height: 150px; } #worker-section p { margin-top: 5px; } -#worker-status { +#worker-status-icon { + display: block; + margin-left: auto; + margin-right: auto; width: 80px; font-size: 40px; color: #fff; @@ -138,6 +140,6 @@ path { border-radius: 10px; /* future proofing */ } -#worker-status span { +#worker-status-icon span { margin-top: 10px; } diff --git a/gedgo/storages.py b/gedgo/storages.py index 413337a..dc15f8c 100644 --- a/gedgo/storages.py +++ b/gedgo/storages.py @@ -108,9 +108,11 @@ def resize_thumb(file_, size='w128h128', crop=None): im.save(output, 'JPEG') return output - research_storage = import_string(settings.GEDGO_RESEARCH_FILE_STORAGE)( location=settings.GEDGO_RESEARCH_FILE_ROOT) gedcom_storage = import_string(settings.GEDGO_GEDCOM_FILE_STORAGE)( location=settings.GEDGO_GEDCOM_FILE_ROOT) + +documentary_storage = import_string(settings.GEDGO_DOCUMENTARY_STORAGE)( + location=settings.GEDGO_DOCUMENTARY_ROOT) diff --git a/gedgo/templates/default/base.html b/gedgo/templates/default/base.html index d3cfc30..f9874a5 100644 --- a/gedgo/templates/default/base.html +++ b/gedgo/templates/default/base.html @@ -5,7 +5,7 @@ - + {% block headappend %}{% endblock %}
diff --git a/gedgo/templates/default/blogpost.html b/gedgo/templates/default/blogpost.html index b1295cf..cb4ca30 100644 --- a/gedgo/templates/default/blogpost.html +++ b/gedgo/templates/default/blogpost.html @@ -5,13 +5,17 @@ {% endblock %} {% block leftsidebar %} -{% if post.tagged_photos.all %} - {% for photo in post.tagged_photos.all %} - - - - {% endfor %} -{% endif %} +Posted: {{ post.created }}
+ + + {% if post.tagged_photos.exists %} +Worker is currently availabe to process gedcoms!
"); + $('#worker-status').html("Worker is currently availabe to process gedcoms!
"); } else { el.addClass('bg-danger'); st.addClass('glyphicon glyphicon-remove'); - $('#worker-section').append("Worker is currently offline, so gedcom uploads cannot be processed.
"); + $('#worker-status').html("Worker is currently offline, so gedcom uploads cannot be processed.
"); } }); diff --git a/gedgo/templates/default/documentary_by_id.html b/gedgo/templates/default/documentary_by_id.html index 8723a7e..f103ced 100644 --- a/gedgo/templates/default/documentary_by_id.html +++ b/gedgo/templates/default/documentary_by_id.html @@ -8,17 +8,19 @@{{ documentary.description }}