Changeset 633:97f997bee4d2


Ignore:
Timestamp:
23/06/12 18:10:45 (11 months ago)
Author:
nicoechaniz <nicoechaniz@…>
Branch:
default
rebase_source:
49f9ef093fa7f906e34e53746183468c471d694e
Message:

partial frontend edit implementation

Location:
cyclope
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cyclope/admin.py

    r525 r633  
    3434from django.contrib.contenttypes.models import ContentType 
    3535from django.contrib.comments.admin import CommentsAdmin 
     36from django.http import HttpResponseRedirect 
    3637 
    3738from feincms.admin import editor 
     
    7374        ) 
    7475 
     76    def response_change(self, request, obj): 
     77        if '_frontend' in request.REQUEST: 
     78            return HttpResponseRedirect(obj.get_absolute_url()) 
     79        return super(BaseContentAdmin, self).response_change(request, obj) 
    7580 
     81    def response_add(self, request, obj, post_url_continue='../%s/'): 
     82        if '_frontend' in request.REQUEST: 
     83            return HttpResponseRedirect(obj.get_absolute_url()) 
     84        return super(UserAdmin, self).response_add(request, obj, post_url_continue) 
     85 
     86 
     87         
    7688from django.utils.functional import update_wrapper 
    7789 
  • cyclope/apps/articles/templates/articles/article_detail.html

    r628 r633  
    55{% block content %} 
    66{% alias article as 'current_object' %} 
     7 
     8{% alias perms.articles.change_article as 'user_has_edit_perm' %} 
     9 
    710<div class="content-view article detail article-detail"> 
    811 
  • cyclope/core/collections/templates/collections/category_contents_base.html

    r626 r633  
    44 
    55{% block content %} 
     6 
     7  {% if perms.collections.add_categorization %} 
     8  <div class="category_add_content"> 
     9    <a href="{% url category-default category.slug %}">Add content</a> 
     10    <ul class="content_types"> 
     11      {% for c_type in category.collection.content_types.all %} 
     12      <li> 
     13        <a href="/admin/{{ c_type.app_label }}/{{ c_type.model }}/add?_frontend=1" class="add_content add_{{ c_type.model }}"> 
     14          {{ c_type.name.capitalize }} 
     15        </a> 
     16      </li> 
     17      {% endfor %} 
     18    </ul> 
     19  </div> 
     20  {% endif %} 
     21 
    622  {% if view_options.navigation == "TOP" %} 
    723    {% include 'collections/hierarchycal_navigation_block.html' %} 
  • cyclope/templates/cyclope/content_tools_block.html

    r404 r633  
    44  <div class="tools meta-content"> 
    55    <ul> 
    6       <li class="first"><a href="javascript:window.print()" class="print">{% trans "Print" %}</a></li> 
     6      <li class="first"><a href="javascript:window.print()" class="print">{% trans "Print" %}</a> 
     7      </li> 
    78      {% if current_object.allow_comments == 'YES' or current_object.allow_comments == 'SITE' and CYCLOPE_SITE_SETTINGS.allow_comments == 'YES' %} 
    8         {% if comment_count %} 
    9         <li> 
    10           <a href="#comments" class="comments_link">{% trans "Comments" %} ({{ comment_count }})</a> 
    11         </li> 
    12         {% endif %} 
     9      {% if comment_count %} 
     10      <li> 
     11        <a href="#comments" class="comments_link">{% trans "Comments" %} ({{ comment_count }})</a> 
     12      </li> 
     13      {% endif %} 
     14      {% endif %} 
     15      {% if user_has_edit_perm %} 
     16      <li> 
     17        <a href="/admin/{{ current_object.get_app_label }}/{{ current_object.get_object_name }}/{{current_object.pk }}?_frontend=1" class="edit_link"> 
     18          {% trans "Edit" %} 
     19        </a> 
     20      </li> 
    1321      {% endif %} 
    1422    </ul> 
Note: See TracChangeset for help on using the changeset viewer.