From 19c0006134b5cb53fb7ed51d8f63490f8f7d1761 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Mon, 21 Mar 2016 19:29:19 -0400 Subject: added inline image preview to birdsightings changeform and fixed private gallery pages --- .../admin/birds/birdsighting/change_form.html | 135 +++++++++++++++++++++ .../admin/photos/luxgallery/change_form.html | 4 +- design/templates/archives/gallery_list.html | 10 +- design/templates/details/photo_gallery.html | 13 +- 4 files changed, 148 insertions(+), 14 deletions(-) create mode 100644 design/templates/admin/birds/birdsighting/change_form.html (limited to 'design') diff --git a/design/templates/admin/birds/birdsighting/change_form.html b/design/templates/admin/birds/birdsighting/change_form.html new file mode 100644 index 0000000..31c9914 --- /dev/null +++ b/design/templates/admin/birds/birdsighting/change_form.html @@ -0,0 +1,135 @@ +{% extends "admin/base_site.html" %} +{% load i18n admin_urls admin_static admin_modify %} + +{% block extrahead %}{{ block.super }} + +{{ media }} + + +{% endblock %} + +{% block extrastyle %}{{ block.super }}{% endblock %} + +{% block coltype %}colM{% endblock %} + +{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-form{% endblock %} + +{% if not is_popup %} +{% block breadcrumbs %} + +{% endblock %} +{% endif %} + +{% block content %}
+{% block object-tools %} +{% if change %}{% if not is_popup %} + +{% endif %}{% endif %} +{% endblock %} +
{% csrf_token %}{% block form_top %}{% endblock %} +
+{% if is_popup %}{% endif %} +{% if to_field %}{% endif %} +{% if save_on_top %}{% block submit_buttons_top %}{% submit_row %}{% endblock %}{% endif %} +{% if errors %} +

+ {% if errors|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %} +

+ {{ adminform.form.non_field_errors }} +{% endif %} + +{% block field_sets %} +{% for fieldset in adminform %} + {% include "admin/includes/fieldset.html" %} +{% endfor %} +{% endblock %} + +{% block after_field_sets %}{% endblock %} + +{% block inline_field_sets %} +{% for inline_admin_formset in inline_admin_formsets %} + {% include inline_admin_formset.opts.template %} +{% endfor %} +{% endblock %} + +{% block after_related_objects %}{% endblock %} + +{% block submit_buttons_bottom %}{% submit_row %}{% endblock %} + +{% block admin_change_form_document_ready %} + +{% endblock %} + +{# JavaScript for prepopulated fields #} +{% prepopulated_fields_js %} + +
+
+{% endblock %} diff --git a/design/templates/admin/photos/luxgallery/change_form.html b/design/templates/admin/photos/luxgallery/change_form.html index b0341ce..31c9914 100644 --- a/design/templates/admin/photos/luxgallery/change_form.html +++ b/design/templates/admin/photos/luxgallery/change_form.html @@ -11,8 +11,8 @@ if (!$) { $(function(){ $('#id_images').css('width', '500px').css('height', '400px'); $('#id_images option').each(function(){ - $(this).attr('style', 'background: url({{MEDIA_URL}}images/galleries/thumb/'+$(this).text().split("qq")[1]+') no-repeat; background-size: 120px 80px; height: 80px; padding-left: 120px; line-height: 80px; margin-bottom: 4px;'); - $(this).html($(this).text().split("qq")[0] + ' – '+ $(this).text().split("qq")[1].split("/")[1] ) + $(this).attr('style', 'background: url('+$(this).text().split("qq")[1]+') no-repeat; background-size: 120px 80px; height: 80px; padding-left: 125px; line-height: 80px; margin-bottom: 4px; padding-bottom: 5px;border-bottom: #eee 1px solid;'); + $(this).html($(this).text().split("qq")[0] + ' – edit') }); }); diff --git a/design/templates/archives/gallery_list.html b/design/templates/archives/gallery_list.html index 1ae8696..3f7bd73 100644 --- a/design/templates/archives/gallery_list.html +++ b/design/templates/archives/gallery_list.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} -{% load get_image_size %} +{% load get_image_by_size %} {% load typogrify_tags %} {% load pagination_tags %} @@ -33,10 +33,10 @@