Anonymous avatar Anonymous committed 1efdc24

multiply fixes

Comments (0)

Files changed (10)

 from imagestore.models import Image, Category
 
 class CategoryAdmin(admin.ModelAdmin):
-    fieldsets = ((None, {'fields': ['slug', 'title']}),)
+    fieldsets = ((None, {'fields': ['slug', 'title', 'order']}),)
     prepopulated_fields = {'slug': ('title',)}
-    list_display = ('title',)
+    list_display = ('title', 'slug', 'order')
 
 admin.site.register(Category, CategoryAdmin)
 
 class ImageAdmin(admin.ModelAdmin):
-    fieldsets = ((None, {'fields': ['title', 'slug', 'image', 'author', 'description', 'tags', 'category']}),)
+    fieldsets = ((None, {'fields': ['title', 'slug', 'image', 'author', 'description', 'order', 'tags', 'category']}),)
     prepopulated_fields = {'slug': ('title',)}
-    list_display = ('id', 'title', 'slug', 'author', 'tags')
+    list_display = ('id', 'order', 'title', 'slug', 'author', 'tags')
 
 admin.site.register(Image, ImageAdmin)

locale/ru/LC_MESSAGES/django.po

 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-07-14 18:49+0400\n"
+"POT-Creation-Date: 2009-07-15 18:22+0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 msgid "Order"
 msgstr "Порядок"
 
-#: models.py:35
+#: models.py:35 models.py:46
 msgid "Image"
 msgstr "Изображение"
 
     author = models.ForeignKey(Person, null=False, blank=False, verbose_name=_('Author'))
     order = models.IntegerField(_('Order'), null=False)
     image = ImageWithThumbnailsField(
+        verbose_name = _('Image'),
         upload_to='imagestore',
         thumbnail={'size': (100, 100)},
         extra_thumbnails={

templates/imagestore/author-list.html

+{% load i18n %}
+<div class="author-list">
+    <h1>{% trans "Our photographers" %}</h1>
+    <ul>
+    {% for author in author_list %}
+    <li><a href="{% url imagestore-author slug=author.slug %}">{{ author.get_full_name }}</a></li>
+    {% endfor %}
+    </ul>
+</div>
+

templates/imagestore/author.html

 {% endblock breadcrumb %}
 
 {% block sidebar %}
+    {% include "imagestore/author-list.html" %}
 {% endblock sidebar %}
 
 {% block content %}

templates/imagestore/category.html

 {% endblock breadcrumb %}
 
 {% block sidebar %}
-<div class="author-list">
-    <h1>{% trans "Our photographers" %}</h1>
-    <ul>
-    {% for author in author_list %}
-    <li><a href="{% url imagestore-author slug=author.slug %}">{{ author.get_full_name }}</a></li>
-    {% endfor %}
-    </ul>
-</div>
+    {% include "imagestore/author-list.html" %}
 {% endblock sidebar %}
 
 {% block content %}

templates/imagestore/image-list.html

+{% load i18n %}
 {% if is_paginated %}
     <div class="pagination">
         <span class="step-links spaced">

templates/imagestore/image.html

 
 {% block title %}{% trans "Gallery" %} - {{ image.title|escape }}{% endblock %}
 
+{% comment %}
+{% block head %}
+    <script type="text/javascript">
+    $(document).ready(function(){ 
+            $('#imageboard').css('background','#E8E8E8');
+            $('#imageboard').css('padding','10px');
+            })
+    </script>
+{% endblock %}
+{% endcomment %}
+
 {% block breadcrumb %}
 <div id="breadcrumb">
     <a href="{% url imagestore-category-list %}"> {% trans "Gallery" %}</a> &gt; &gt;
 </div>
  
 
-
+<div id="imageboard">
 <div id="current-image">
     <img class="gallery-image"  src="{{ image.image.extra_thumbnails.display }}">
 </div>
 <div id="adata">
-    {% trans "Photographer" %}: {{ image.author.get_full_name }} {% if image.author.is_premium %}<span class="premium-author">{% trans "only premium package" %}</span> {% endif %}
+    {% trans "Photographer" %}: <a href="{% url imagestore-author slug=image.author.slug %}">{{ image.author.get_full_name }}</a> {% if image.author.is_premium %}<span class="premium-author">{% trans "only premium package" %}</span> {% endif %}
+</div>
 </div>
 {% endblock %}
 from django.conf.urls.defaults import *
-from imagestore.views import image
 
 
 images = url(
 from imagestore.models import Image, Category
 from persons.models import Person
 from django.http import Http404
-from django.shortcuts import render_to_response get_object_or_404
+from django.shortcuts import render_to_response, get_object_or_404
 from django.views.generic.list_detail import object_list
 from django.template import RequestContext
 from django.conf import settings
 
 
-IMAGESTORE_ON_PAGE = settings.getattr(IMAGESTORE_ON_PAGE, 12)
+IMAGESTORE_ON_PAGE = getattr(settings, 'IMAGESTORE_ON_PAGE', 12)
 
 def category(request, slug, *args, **kwargs):
     category = get_object_or_404(Category, slug=slug)
     kwargs['template_object_name'] = 'images'
     kwargs['paginate_by'] = IMAGESTORE_ON_PAGE
     kwargs['template_name'] = 'imagestore/category.html'
-    kwargs['extra_context'] = {'category': category, 'authors': author_list}
+    kwargs['extra_context'] = {'category': category, 'author_list': authors}
     return object_list(request, *args, **kwargs)
 
 def author(request, slug, *args, **kwargs):
-    author = get_object_or_404(Persons, slug=slug)
+    author = get_object_or_404(Person, slug=slug)
+    authors = Person.objects.all().order_by('order')
     kwargs['queryset'] = Image.objects.filter(author=author).order_by('order', 'id')
     kwargs['template_object_name'] = 'images'
     kwargs['paginate_by'] = IMAGESTORE_ON_PAGE
     kwargs['template_name'] = 'imagestore/author.html'
-    kwargs['extra_context'] = {'author': author}
+    kwargs['extra_context'] = {'author': author, 'author_list': authors}
     return object_list(request, *args, **kwargs)
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.