Changeset 499:778418d5eabf


Ignore:
Timestamp:
02/07/11 21:30:54 (23 months ago)
Author:
Santiago Piccinini (SAn) <piccinini.santiago@…>
Branch:
default
Children:
500:1d7694b67246, 502:deeaa7cb57d5
Message:

Added show_title, show_description, show_image and navigation view_options to category teaser list options. Also restructured categories templates.

Location:
cyclope/core/collections
Files:
1 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • cyclope/core/collections/frontend_views.py

    r451 r499  
    3737from cyclope.core.collections.models import Collection, Category, Categorization 
    3838 
    39  
    4039class CategoryRootItemsList(frontend.FrontendView): 
    4140    """A flat list view of the root members for a Category. 
     
    5150        categorizations_list = category.categorizations.all() 
    5251        template = "collections/category_root_items_list.html" 
    53         req_context['categorizations'] = categorizations_list 
     52        req_context.update({"categorizations": categorizations_list, 
     53                            "category": category}) 
    5454        t = loader.get_template(template) 
    5555        return t.render(req_context) 
     
    5858 
    5959class TeaserListOptions(forms.Form): 
     60    show_title = forms.BooleanField(label=_("Show title"), initial=True, required=False) 
     61    show_description = forms.BooleanField(label=_("Show description"), initial=True, required=False) 
     62    show_image = forms.BooleanField(label=_("Show image"), initial=True, required=False) 
    6063    items_per_page = forms.IntegerField(label=_('Items per page'), min_value=1, 
    6164                                        initial=cyc_settings.CYCLOPE_PAGINATION['TEASER'],) 
     
    6871    traverse_children = forms.BooleanField(label=_("Include descendant's elements"), 
    6972                                                    initial=False, required=False) 
     73    navigation = forms.ChoiceField(label=_('Show navigation'), 
     74                              choices=(("TOP", _(u"Top")), 
     75                                       ("BOTTOM", _(u"Bottom")), 
     76                                       ("DISABLED", _(u"Disabled"))), 
     77                              initial="TOP") 
     78 
     79 
    7080 
    7181class CategoryDefaultList(frontend.FrontendView): 
     
    118128                                          reverse=reverse) 
    119129            paginator = Paginator(categorizations_list, options["items_per_page"]) 
    120             template = self.template 
    121130 
    122131        elif sort_by == "ALPHABETIC": 
    123132            paginator = NamePaginator(categorizations_list, on="content_object.name", 
    124                                       per_page=self.items_per_page) 
    125             template = "collections/category_alphabetical_teaser_list.html" 
     133                                      per_page=options["items_per_page"]) 
    126134 
    127135        page = cyclope.utils.get_page(paginator, request) 
     
    132140                            'inline_view_name': self.inline_view_name, 
    133141                            'simplified_view': options["simplified"]}) 
    134         t = loader.get_template(template) 
     142        t = loader.get_template(self.template) 
    135143        return t.render(req_context) 
    136144 
     
    245253                               'has_children': has_children,}) 
    246254            return context 
    247              
     255 
    248256        nested_list = [] 
    249257        for child in base_category.get_children(): 
  • cyclope/core/collections/templates/collections/category_labeled_icon_list.html

    r234 r499  
    1 {% extends host_template %} 
     1{% extends 'collections/category_contents_base.html' %} 
    22 
    33{% load i18n cyclope_utils %} 
    44 
    5 {% block content %} 
    6  
    7 {% include 'collections/hierarchycal_navigation_block.html' %} 
     5{% block category_content %} 
    86 
    97  {% comment %} 
     
    2927  <br class="clear" /> 
    3028 
    31 <!--  <div class="pagEspacio"></div> --> 
    32   {% if page %} 
    33     {% include 'cyclope/pagination_block.html' %} 
    34   {% endif %} 
    35  
    3629{% endblock %} 
  • cyclope/core/collections/templates/collections/category_root_items_list.html

    r492 r499  
    1 {% extends host_template %} 
     1{% extends 'collections/category_contents_base.html' %} 
    22 
    3 {% block content %} 
     3{% block category_content %} 
    44 
    55{% comment %} 
     
    1717</ul> 
    1818</div> 
    19 {% endblock content%} 
     19{% endblock category_content %} 
  • cyclope/core/collections/templates/collections/category_teaser_list.html

    r491 r499  
    1 {% extends host_template %} 
     1{% extends 'collections/category_contents_base.html' %} 
    22 
    33{% load i18n cyclope_utils fb_versions %} 
    44 
    5 {% block content %} 
    6  
    7 {% include 'collections/hierarchycal_navigation_block.html' %} 
    8  
    9 {% if category.description %} 
    10 <div class="collection_teaser">{% if category.image %} 
    11 <img class="image" src="{% version category.image.path 'small' %}" border="0"/> 
    12 {% endif %} 
    13 <div class="summary"> 
    14   {{ category.description|smart_style }} 
    15 </div> 
    16 </div> 
    17 {% else %} 
    18  
    19 {% if category.image %} 
    20 <div class="collection_teaser"> 
    21 <img class="image" src="{% version category.image.path 'small' %}" border="0"/> 
    22 </div> 
    23 {% endif %} 
    24  
    25 {% endif %} 
     5{% block category_content %} 
    266 
    277  {% comment %} 
     
    4828  {% endfor %} 
    4929 
    50   {% if page %} 
    51     {% include 'cyclope/pagination_block.html' %} 
    52   {% endif %} 
    53  
    5430{% endblock %} 
  • cyclope/core/collections/templates/collections/hierarchycal_navigation_block.html

    r482 r499  
     1 
    12{% if category.collection.visible %} 
    23 
     
    1920  {% endif%} 
    2021 
    21 <div class="category_title"> 
    22   <h1 class="title"> 
    23     <a href="{% url category-default category.slug %}">{{ category.name }}</a> 
    24   </h1> 
    25 </div> 
    26  
    2722{% endif %} 
Note: See TracChangeset for help on using the changeset viewer.