changeset 717:846cf9a06a04

Create css for user_photos gallery template.
author Brian Neal <bgneal@gmail.com>
date Wed, 18 Sep 2013 18:33:52 -0500
parents f68694669023
children bf5340705d0c
files sg101/templates/user_photos/gallery.html user_photos/static/css/user_photos.css
diffstat 2 files changed, 21 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/sg101/templates/user_photos/gallery.html	Tue Sep 17 21:13:31 2013 -0500
+++ b/sg101/templates/user_photos/gallery.html	Wed Sep 18 18:33:52 2013 -0500
@@ -1,6 +1,9 @@
 {% extends 'base.html' %}
 {% load bio_tags %}
 {% block title %}Photo Gallery for {{ gallery_owner.username }}{% endblock %}
+{% block custom_css %}
+<link rel="stylesheet" href="{{ STATIC_URL }}css/user_photos.css" />
+{% endblock %}
 {% block content %}
 
 <h2>Photo Gallery for {{ gallery_owner.username }}</h2>
@@ -26,10 +29,10 @@
    {% if user == gallery_owner %}
       <form action="{% url 'user_photos-delete' %}" method="post">{% csrf_token %}
       {% for photo in photos %}
-         <div style="margin: 1em; display: inline-block; border: 1px solid gray;">
+         <div class="user_photo owner_photo">
             <a href="{{ photo.get_absolute_url }}">
                <img src="{{ photo.thumb_url }}" alt="thumbnail" 
-                  title="{{ photo.upload_date|date }}" style="margin:auto;width:100%" /></a>
+                  title="{{ photo.upload_date|date }}" /></a>
             <br />
             <div class="centered">
             <input type="checkbox" name="photo_id" value="{{ photo.id }}"></input>
@@ -41,7 +44,7 @@
       </form>
    {% else %}
       {% for photo in photos %}
-         <div style="margin: 1em; display: inline;">
+         <div class="user_photo">
             <a href="{{ photo.get_absolute_url }}">
                <img src="{{ photo.thumb_url }}" alt="thumbnail" 
                   title="{{ photo.upload_date|date }}" /></a>
@@ -50,7 +53,7 @@
    {% endif %}
 
    {% if page_obj %}
-      <hr style="margin-top: 1.5em;" />
+      <hr class="footer_divider" />
       {% include 'core/django_pagination.html' %}
    {% endif %}
 {% endif %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/user_photos/static/css/user_photos.css	Wed Sep 18 18:33:52 2013 -0500
@@ -0,0 +1,14 @@
+.user_photo {
+   margin: 1em;
+   display: inline-block;
+}
+.owner_photo {
+   border: 1px solid gray;
+}
+.owner_photo img {
+   margin: auto;
+   width: 100%;
+}
+hr.footer_divider {
+   margin-top: 1.5em;
+}