Author: gabriel.walt
Date: Tue Apr 28 04:38:11 2009
New Revision: 485
Modified:
branches/electron/pages/admin/__init__.py
branches/electron/pages/admin/forms.py
branches/electron/pages/context_processors.py
branches/electron/pages/locale/fr/LC_MESSAGES/django.mo
branches/electron/pages/locale/fr/LC_MESSAGES/django.po
branches/electron/pages/media/pages/css/pages.css
branches/electron/pages/media/pages/javascript/change_form.js
branches/electron/pages/media/pages/javascript/change_list.js
branches/electron/pages/templates/admin/pages/page/change_form.html
branches/electron/pages/templates/admin/pages/page/change_list.html
branches/electron/pages/templates/admin/pages/page/includes/fieldset.html
branches/electron/pages/templates/admin/pages/page/widgets/autocompletetaginput.html
branches/electron/pages/templates/admin/pages/page/widgets/markituphtml.html
branches/electron/pages/templates/admin/pages/page/widgets/markitupmarkdown.html
branches/electron/pages/templates/admin/pages/page/widgets/richtextarea.html
branches/electron/pages/templates/admin/pages/page/widgets/tinymce.html
branches/electron/pages/templates/admin/pages/page/widgets/wymeditor.html
branches/electron/pages/templates/pages/content.html
branches/electron/pages/templates/pages/revisions.html
branches/electron/pages/templates/pages/traduction_helper.html
branches/electron/pages/templatetags/pages_tags.py
Log:
initial commit for electron branch
Modified: branches/electron/pages/admin/__init__.py
==============================================================================
--- branches/electron/pages/admin/__init__.py (original)
+++ branches/electron/pages/admin/__init__.py Tue Apr 28 04:38:11 2009
@@ -13,15 +13,13 @@
from pages import settings
from pages.models import Page, Content
-from pages.utils import get_template_from_request,
has_page_add_permission, \
- get_language_from_request
+from pages.utils import get_template_from_request,
has_page_add_permission, get_language_from_request
from pages.admin import widgets
from pages.utils import get_placeholders
from pages.admin.forms import PageForm
from pages.admin.utils import get_connected_models
-from pages.admin.views import traduction, get_content, sub_menu, \
- change_status, modify_content
+from pages.admin.views import traduction, get_content, sub_menu,
change_status, modify_content
class PageAdmin(admin.ModelAdmin):
@@ -52,12 +50,11 @@
fieldsets = (
(_('General'), {
'fields': general_fields,
- 'classes': ('sidebar',),
+ 'classes': ('module-general', 'sidebar',),
}),
(_('Options'), {
'fields': normal_fields,
- 'classes': ('sidebar', 'clear'),
- 'description': _('Note: This page reloads if you change the
selection'),
+ 'classes': ('module-options', 'clearfix',),
}),
)
@@ -76,6 +73,8 @@
)]
def __call__(self, request, url):
+ print request.GET
+
# Delegate to the appropriate method, based on the URL.
if url is None:
return self.list_pages(request)
@@ -171,7 +170,10 @@
if placeholder.name not in self.mandatory_placeholders:
placeholder_fieldsets.append(placeholder.name)
- additional_fieldsets.append((_('Content'), {'fields':
placeholder_fieldsets}))
+ additional_fieldsets.append((_('Content'), {
+ 'fields': placeholder_fieldsets,
+ 'classes': ('module-content',),
+ }))
# deactived for now, create bugs with page with same slug title
connected_fieldsets = []
@@ -297,7 +299,7 @@
extra_context = {
'placeholders': get_placeholders(template),
'language': get_language_from_request(request),
- 'traduction_language': settings.PAGE_LANGUAGES,
+ 'traduction_language': [l for l in settings.PAGE_LANGUAGES
if Content.objects.get_content(obj, l[0], "title")],
'page': obj,
}
return super(PageAdmin, self).change_view(request, object_id,
extra_context)
Modified: branches/electron/pages/admin/forms.py
==============================================================================
--- branches/electron/pages/admin/forms.py (original)
+++ branches/electron/pages/admin/forms.py Tue Apr 28 04:38:11 2009
@@ -10,23 +10,20 @@
title = forms.CharField(
label=_('Title'),
widget=forms.TextInput(),
- help_text=_('The default title')
)
slug = forms.CharField(
label=_('Slug'),
widget=forms.TextInput(),
- help_text=_('The part of the title that is used in permalinks')
+ help_text=_('The slug will be used to create the page URL, it must
be unique among the other pages of the same level.')
)
language = forms.ChoiceField(
label=_('Language'),
choices=settings.PAGE_LANGUAGES,
- help_text=_('The current language of the content fields.'),
)
template = forms.ChoiceField(
required=False,
label=_('Template'),
choices=settings.PAGE_TEMPLATES,
- help_text=_('The template used to render the content.')
)
target = forms.IntegerField(required=False, widget=forms.HiddenInput)
@@ -66,7 +63,7 @@
raise forms.ValidationError(_('A sibiling with
this slug already exists at the targeted position'))
if position == 'first-child':
if slug in [sibling.slug() for sibling in
target.get_children()]:
- raise forms.ValidationError(_('A children with
this slug already exists at the targeted position'))
+ raise forms.ValidationError(_('A child with
this slug already exists at the targeted position'))
else:
if self.instance.id:
if slug in [sibling.slug() for sibling in
self.instance.get_siblings().exclude(id=self.instance.id)]:
Modified: branches/electron/pages/context_processors.py
==============================================================================
--- branches/electron/pages/context_processors.py (original)
+++ branches/electron/pages/context_processors.py Tue Apr 28 04:38:11 2009
@@ -4,4 +4,7 @@
"""
Adds media-related context variables to the context.
"""
- return {'PAGES_MEDIA_URL': settings.PAGES_MEDIA_URL}
+ return {
+ 'PAGES_MEDIA_URL': settings.PAGES_MEDIA_URL,
+ 'PAGE_USE_SITE_ID': settings.PAGE_USE_SITE_ID
+ }
Modified: branches/electron/pages/locale/fr/LC_MESSAGES/django.mo
==============================================================================
Binary files. No diff available.
Modified: branches/electron/pages/locale/fr/LC_MESSAGES/django.po
==============================================================================
--- branches/electron/pages/locale/fr/LC_MESSAGES/django.po (original)
+++ branches/electron/pages/locale/fr/LC_MESSAGES/django.po Tue Apr 28
04:38:11 2009
@@ -118,7 +118,7 @@
#: models.py:274
msgid "language"
-msgstr "Langage"
+msgstr "langue"
#: models.py:275
msgid "body"
@@ -178,7 +178,7 @@
#: admin/forms.py:21
msgid "Language"
-msgstr "Langage"
+msgstr "Langue"
#: admin/forms.py:23
msgid "The current language of the content fields."
@@ -226,7 +226,7 @@
#: templates/admin/pages/page/change_form.html:31
msgid "Language:"
-msgstr "Langage:"
+msgstr "Langue:"
#: templates/admin/pages/page/change_list.html:3
msgid "List of pages"
@@ -295,7 +295,7 @@
#: templates/pages/revisions.html:8
msgid "DATETIME_FORMAT"
-msgstr "%d %m %Y"
+msgstr "d.m.Y"
#: templates/pages/traduction_helper.html:4
msgid "Wanted language has not been translated yet."
Modified: branches/electron/pages/media/pages/css/pages.css
==============================================================================
--- branches/electron/pages/media/pages/css/pages.css (original)
+++ branches/electron/pages/media/pages/css/pages.css Tue Apr 28 04:38:11
2009
@@ -1,19 +1,19 @@
/* specific CSS for the django page admin application */
-.change-list tr{
+.change-list tr {
padding-left:1.5em;
}
-.change-list .move-target-container{
+.change-list .move-target-container {
display:none;
float:right;
}
-.change-list .table-selected .move-target-container{
+.change-list .table-selected .move-target-container {
display:block;
}
-.change-list .table-selected .selected .move-target-container{
+.change-list .table-selected .selected .move-target-container {
display:none;
}
@@ -25,7 +25,7 @@
background:#fff;
}
-.change-list table td input{
+.change-list table td input {
margin-top:-1px;
margin-bottom:1px;
}
@@ -62,15 +62,8 @@
list-style-type:none;
}
-#traduction-helper-content {
- margin-top:1em;
- background:#ffc;
- padding:1em;
- display:none;
- overflow:hidden;
-}
-.expand-collapse span{
+.expand-collapse span {
font-family: monospace;
font-size:16px;
margin:2px 4px;
@@ -92,11 +85,7 @@
display: none;
}
-.sidebar {
- width: 24em;
- float: left;
- margin-right: 1em;
-}
+/* **** */
.sidebar div.description {
margin: 5px;
@@ -158,4 +147,145 @@
.ac_over {
background-color: #999;
color: white;
+}
+
+/* change-form page =========================================== */
+
+/* Global */
+.change-form .sidebar {
+ width: 288px;
+ clear: left;
+ float: left;
+ margin-right: 1em;
+}
+.change-form label {
+ line-height: 20px;
+}
+.change-form .sidebar input,
+.change-form .sidebar select {
+ width: 150px;
+}
+.change-form .sidebar p.help,
+.change-form .sidebar .form-row p.help {
+ margin-left: 0;
+ padding: 0;
+}
+
+/* Title */
+.module-general .title label {
+ padding-top: 0;
+}
+.module-general .title input {
+ width: 256px;
+ font-size: 16px;
+}
+
+/* Options */
+.change-form .module-options .form-row {
+ float: left;
+ width: 33.3333%;
+ margin-right: -1px;
+ padding: 0;
+ border-bottom: none;
+ border-right: 1px solid #eee;
+}
+.change-form .module-options .form-row div {
+ padding: 8px 12px;
+}
+.change-form .module-options select {
+ width: 150px;
+}
+.change-form .module-options .redirect_to {
+ border-right: none;
+}
+
+/* Content */
+.change-form .module-content .form-row {
+ position: relative;
+}
+.change-form .module-content .revisions {
+ position: absolute;
+ top: 8px;
+ right: 12px;
+ width: 150px;
+}
+.change-form .module-content .wym_skin_django {
+ padding: 0;
+}
+.change-form .module-content .wym_area_top {
+ margin-right: 155px;
+}
+.change-form .module-content .ui-resizable-handle {
+ cursor: s-resize;
+}
+
+/* Translation helper */
+.change-form .module-translation-helper #translation-helper-content {
+ overflow: hidden;
+ display: none;
+}
+.change-form .module-translation-helper .translation-helper-title {
+ margin-top: 1em !important;
+}
+.change-form .module-translation-helper .translation-helper-placeholder {
+ overflow: auto;
+ max-height: 400px;
+ padding: 1em;
+ background: #ffc;
+}
+.change-form .module-translation-helper .translation-helper-placeholder p,
+.change-form .module-translation-helper .translation-helper-placeholder h1,
+.change-form .module-translation-helper .translation-helper-placeholder h2,
+.change-form .module-translation-helper .translation-helper-placeholder h3,
+.change-form .module-translation-helper .translation-helper-placeholder h4,
+.change-form .module-translation-helper .translation-helper-placeholder h5,
+.change-form .module-translation-helper .translation-helper-placeholder h6,
+.change-form .module-translation-helper .translation-helper-placeholder
pre {
+ margin: 0 0 5px !important; padding: 0;
+ line-height: 12px;
+ text-transform: none;
+ color: black; background: none;
+}
+.change-form .module-translation-helper .translation-helper-placeholder
blockquote {
+ margin: 0 0 5px;
+ line-height: 12px;
+ color: black; background: none;
+}
+.change-form .module-translation-helper .translation-helper-placeholder h1,
+.change-form .module-translation-helper .translation-helper-placeholder h2,
+.change-form .module-translation-helper .translation-helper-placeholder h3,
+.change-form .module-translation-helper .translation-helper-placeholder h4,
+.change-form .module-translation-helper .translation-helper-placeholder h5,
+.change-form .module-translation-helper .translation-helper-placeholder h6
{ font-weight: bold; }
+.change-form .module-translation-helper .translation-helper-placeholder h1
{ font-size: 20px; line-height: 22px; }
+.change-form .module-translation-helper .translation-helper-placeholder h2
{ font-size: 18px; line-height: 20px; }
+.change-form .module-translation-helper .translation-helper-placeholder h3
{ font-size: 16px; line-height: 18px; }
+.change-form .module-translation-helper .translation-helper-placeholder h4
{ font-size: 14px; line-height: 16px; }
+.change-form .module-translation-helper .translation-helper-placeholder h5
{ font-size: 12px; line-height: 14px; }
+.change-form .module-translation-helper .translation-helper-placeholder h6
{ font-size: 11px; line-height: 13px; }
+
+/* Submit */
+.change-form .submit-row {
+ clear: both;
+}
+
+
+/* clearfix =========================================== */
+
+.clearfix:after {
+ content: ".";
+ display: block;
+ clear: both;
+ visibility: hidden;
+ line-height: 0;
+ height: 0;
+}
+.clearfix {
+ display: inline-block;
+}
+html[xmlns] .clearfix {
+ display: block;
+}
+* html .clearfix {
+ height: 1%;
}
Modified: branches/electron/pages/media/pages/javascript/change_form.js
==============================================================================
--- branches/electron/pages/media/pages/javascript/change_form.js
(original)
+++ branches/electron/pages/media/pages/javascript/change_form.js Tue Apr
28 04:38:11 2009
@@ -1,76 +1,105 @@
-$(document).ready(function() {
- // Confirm language and template change if page is not saved
- $.each(["language", "template"], function(i, label) {
- var select = $('#id_'+label);
- if (select.length > 0) {
- var index = select[0].selectedIndex;
- select.change(function() {
- if (this.selectedIndex != index) {
- var array = window.location.href.split('?');
- var query = $.query.set(label,
this.options[this.selectedIndex].value).toString();
- var question = gettext("Are you sure you want to
change the %(field_name)s without saving the page first?")
- var answer = confirm(interpolate(question, {
- field_name: select.prev().text().slice(0,-1),
- }, true));
- if (answer) {
- window.location.href = array[0]+query;
- } else {
- this.selectedIndex = index;
- }
- }
- });
+$(function() {
+ // Hide form rows containing only hidden inputs
+ $('.form-row').each(function() {
+ if (!$('p, label, select, input:not([type=hidden])', this).length)
{
+ $(this).hide();
}
});
- titleelem = document.getElementById("id_title")
- if (titleelem)
- titleelem.focus();
- var template = $.query.get('template');
- if(template) {
- $('#id_template').find("option").each(function() {
- this.selected = false;
- if (template==this.value)
- this.selected = true;
- })
- }
- $("#id_slug").change(function() { this._changed = true; });
+
+ // Focus the title
+ $('#id_title').focus();
+
+ // Automatically update the slug when typing the title
+ var slug_auto = true;
+ var slug = $("#id_slug").change(function() {
+ slug_auto && (slug_auto = false);
+ });
$("#id_title").keyup(function() {
- var e = $("#id_slug")[0];
- if (!e._changed) {
- e.value = URLify(this.value, 64);
- }
+ slug_auto && slug.val(URLify(this.value, 64));
});
- $('#traduction-helper-select').change(function() {
+
+ // Translation helper
+ $('#translation-helper-select').change(function() {
var index = this.selectedIndex;
- if(index == 0) {
- $('#traduction-helper-content').hide(); return;
+ if (index) {
+ var array = window.location.href.split('?');
+ $.get(array[0]+'traduction/'+this.options[index].value+'/',
function(html) {
+ $('#translation-helper-content').html(html).show();
+ });
+ } else {
+ $('#translation-helper-content').hide();
}
- var array = window.location.href.split('?');
- $.get(array[0]+'traduction/'+this.options[index].value+'/',
function(html) {
- $('#traduction-helper-content').html(html);
- $('#traduction-helper-content').show();
- });
});
- $('.revisions-list a').click( function() {
- var link = this;
- $.get(this.href, function(html) {
- $('a', $(link).parent().parent()).removeClass('selected');
- $(link).addClass('selected');
- var form_row = $(link).parents('.form-row')[0];
- if($('a.disable', form_row).length) {
- $('iframe',
form_row)[0].contentWindow.document.getElementsByTagName("body")[0].innerHTML
= html;
- } else {
- var formrow_textarea = $('textarea', form_row);
- formrow_textarea.attr('value', html);
- // support for WYMeditor
- if (WYMeditor) {
- $(WYMeditor.INSTANCES).each(function(i, wym) {
- if (formrow_textarea.attr('id') ===
wym._element.attr('id')) {
- wym.html(html);
- }
- });
- }
+
+ // Select the appropriate template option
+ var template = $.query.get('template');
+ if (template) {
+ $('#id_template option').each(function() {
+ if (template == this.value) {
+ $(this).attr('selected', true);
+ return false;
}
});
+ }
+
+ // Confirm language and template change if page is not saved
+ $.each(['language', 'template'], function(i, label) {
+ var select = $('#id_'+label);
+ if (select.length) {
+ select.change(function() {
+ var href = window.location.href.split('?');
+ var query = $.query.set(label, select.val()).toString();
+ window.location.href = href[0]+query;
+ });
+ }
+ });
+
+ // Disable the page content if the page is a redirection
+ var redirect = $('#id_redirect_to').change(update_redirect);
+ var affected =
$('.form-row:has(#id_language), .form-row:has(#id_template), .module-content
.form-row')
+ .each(function () {
+ var element = $(this).css('position', 'relative');
+ $('<div class="overlay"></div>').css({
+ 'position': 'absolute',
+ 'display': 'none',
+ 'opacity': '0',
+ 'top': '0',
+ 'left': '0',
+ 'height': element.height(),
+ 'width': element.width()
+ }).appendTo(element);
+ });
+ function update_redirect() {
+ if (redirect.val()) {
+ affected.css('opacity', '0.5').find('.overlay').show();
+ } else {
+ affected.css('opacity', '1').find('.overlay').hide();
+ }
+ }
+ update_redirect();
+
+ // Content revision selector
+ $('.revisions').change(function () {
+ var select = $(this);
+ var val = select.val();
+ if (val) {
+ $.get(val, function (html) {
+ var formrow = select.parents('.form-row');
+ if ($('a.disable', formrow).length) {
+ $('iframe',
formrow)[0].contentWindow.document.getElementsByTagName("body")[0].innerHTML
= html;
+ } else {
+ var formrow_textarea = $('textarea',
formrow).val(html);
+ // support for WYMeditor
+ if (WYMeditor) {
+ $(WYMeditor.INSTANCES).each(function (i, wym) {
+ if (formrow_textarea.attr('id') ===
wym._element.attr('id')) {
+ wym.html(html);
+ }
+ });
+ }
+ }
+ });
+ }
return false;
});
});
Modified: branches/electron/pages/media/pages/javascript/change_list.js
==============================================================================
--- branches/electron/pages/media/pages/javascript/change_list.js
(original)
+++ branches/electron/pages/media/pages/javascript/change_list.js Tue Apr
28 04:38:11 2009
@@ -50,8 +50,7 @@
$('a.expanded').each(function() {
col.push(this.id.substring(1));
});
- // expire in 12 days
- $.cookie('tree_expanded', col.join(','), {"expires":12});
+ $.cookie('tree_expanded', col.join(','), { 'expires': 12 }); //
expire in 12 days
}
function remove_children(id) {
Modified:
branches/electron/pages/templates/admin/pages/page/change_form.html
==============================================================================
--- branches/electron/pages/templates/admin/pages/page/change_form.html
(original)
+++ branches/electron/pages/templates/admin/pages/page/change_form.html Tue
Apr 28 04:38:11 2009
@@ -1,6 +1,7 @@
{% extends "admin/change_form.html" %}
{% load i18n admin_modify adminmedia pages_tags %}
-{% block title %}{% trans "Change a page" %}{% endblock %}
+
+{% block title %}{% trans "Edit" %}{% endblock %}
{% block extrahead %}{{ block.super }}
<script type="text/javascript" src="{%
admin_media_prefix %}js/urlify.js"></script>
@@ -10,41 +11,47 @@
{% block content %}
<!-- Content -->
<div id="content-main">
-
-{% block object-tools %}
-{% if change %}{% if not is_popup %}
- <ul class="object-tools">
- {% if has_absolute_url %}<li><a href="{{ page.get_absolute_url }}"
class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%}
- </ul>
-{% endif %}{% endif %}
-{% endblock %}
-
-<form action="?language={{ request.GET.language }}{%if
request.GET.target %}&target={{ request.GET.target }}{%
endif %}&{%if request.GET.target %}position={{ request.GET.position
}}{% endif %}" method="post" id="page_form">
-{% for fieldset in adminform %}
- {% include "admin/pages/page/includes/fieldset.html" %}
-{% endfor %}
-<br class="clear" />
-{% if not add %}
-<div><fieldset class="module aligned ">
- <h2>{% trans "Translation helper" %}</h2>
- <div class="form-row">
- <label for="traduction-helper-select" class="required">{%
trans "Language:" %}</label>
- <select id="traduction-helper-select">
- <option value="" selected="selected">------</option>
- {% for lang in traduction_language %}
- <option value="{{ lang.0 }}">{{ lang.1 }}</option>
- {% endfor %}
- </select>
- <div id="traduction-helper-content"></div>
- </div>
-</fieldset>
+ {% block object-tools %}
+ {% if change and not is_popup %}
+ <ul class="object-tools">
+ {% if has_absolute_url %}<li><a href="{{
page.get_absolute_url }}" class="viewsitelink">{% trans "View on
site" %}</a></li>{% endif %}
+ </ul>
+ {% endif %}
+ {% endblock %}
+
+ <form id="page_form" action="?language={{ request.GET.language }}{%if
request.GET.target %}&target={{ request.GET.target }}{%
endif %}&{%if request.GET.target %}position={{ request.GET.position
}}{% endif %}" method="post">
+ {% for fieldset in adminform %}
+ {% include "admin/pages/page/includes/fieldset.html" %}
+
+ {% if forloop.first and not add %}
+ <div><fieldset class="module module-translation-helper
aligned sidebar">
+ <h2>{% trans "Translation helper" %}</h2>
+ <div class="form-row">
+ <label for="translation-helper-select"
class="required">{% trans "Language:" %}</label>
+ <select id="translation-helper-select">
+ <option value=""
selected="selected">---------</option>
+ {% for lang in traduction_language %}
+ <option value="{{ lang.0 }}">{{ lang.1
}}</option>
+ {% endfor %}
+ </select>
+ <div id="translation-helper-content"></div>
+ </div>
+ </fieldset></div>
+ {% endif %}
+ {% endfor %}
+
+ {% submit_row %}
+ </form>
</div>
-{% endif %}
-
-{% submit_row %}
-</div>
-</form>
-
-<br class="clear" />
+<script type="text/javascript" charset="utf-8">
+<!--
+(function() {
+ /* Hide the Sites options if not needed */
+ {% if not PAGE_USE_SITE_ID %}
+ $('.form-row.sites').hide();
+ {% endif %}
+})();
+-->
+</script>
<!-- END Content -->
{% endblock %}
Modified:
branches/electron/pages/templates/admin/pages/page/change_list.html
==============================================================================
--- branches/electron/pages/templates/admin/pages/page/change_list.html
(original)
+++ branches/electron/pages/templates/admin/pages/page/change_list.html Tue
Apr 28 04:38:11 2009
@@ -1,6 +1,8 @@
{% extends "admin/change_list.html" %}
{% load adminmedia admin_list i18n pages_tags %}
+
{% block title %}{% trans "List of pages" %}{% endblock %}
+
{% block bodyclass %}change-list{% endblock %}
{% if not is_popup %}{% block breadcrumbs %}
@@ -11,6 +13,7 @@
{% endblock %}{% endif %}
{% block coltype %}flex{% endblock %}
+
{% block extrahead %}{{ block.super }}
<link rel="stylesheet" type="text/css" href="{{ PAGES_MEDIA_URL
}}css/rte.css" />
<link rel="stylesheet" type="text/css" href="{{ PAGES_MEDIA_URL
}}css/pages.css" />
Modified:
branches/electron/pages/templates/admin/pages/page/includes/fieldset.html
==============================================================================
---
branches/electron/pages/templates/admin/pages/page/includes/fieldset.html
(original)
+++
branches/electron/pages/templates/admin/pages/page/includes/fieldset.html
Tue Apr 28 04:38:11 2009
@@ -1,7 +1,7 @@
{% load i18n pages_tags %}
<fieldset class="module aligned {{ fieldset.classes }}">
- {% if fieldset.name %}<h2>{{ fieldset.name }}</h2>{% endif %}
- {% if fieldset.description %}<div class="description">{{
fieldset.description|safe }}</div>{% endif %}
+ {% if fieldset.name %}<h2>{{ fieldset.name }}</h2>{% endif %}
+ {% if fieldset.description %}<div class="description">{{
fieldset.description|safe }}</div>{% endif %}
{% for line in fieldset %}
<div class="form-row{% if line.errors %} errors{% endif %} {% for
field in line %}{{ field.field.name }} {% endfor %} ">
Modified:
branches/electron/pages/templates/admin/pages/page/widgets/autocompletetaginput.html
==============================================================================
---
branches/electron/pages/templates/admin/pages/page/widgets/autocompletetaginput.html
(original)
+++
branches/electron/pages/templates/admin/pages/page/widgets/autocompletetaginput.html
Tue Apr 28 04:38:11 2009
@@ -1,4 +1,5 @@
<script type="text/javascript">
+<!--
jQuery("#id_{{ name }}").autocomplete({{ tags|safe }}, {
width: 150,
max: 10,
@@ -10,4 +11,5 @@
matchContains: true,
autoFill: true,
});
+-->
</script>
Modified:
branches/electron/pages/templates/admin/pages/page/widgets/markituphtml.html
==============================================================================
---
branches/electron/pages/templates/admin/pages/page/widgets/markituphtml.html
(original)
+++
branches/electron/pages/templates/admin/pages/page/widgets/markituphtml.html
Tue Apr 28 04:38:11 2009
@@ -1,4 +1,6 @@
<script type="text/javascript">
+<!--
// mySettings is defined in markitup/sets/default/set.js
$('#id_{{ name }}').markItUp(mySettings);
+-->
</script>
Modified:
branches/electron/pages/templates/admin/pages/page/widgets/markitupmarkdown.html
==============================================================================
---
branches/electron/pages/templates/admin/pages/page/widgets/markitupmarkdown.html
(original)
+++
branches/electron/pages/templates/admin/pages/page/widgets/markitupmarkdown.html
Tue Apr 28 04:38:11 2009
@@ -1,4 +1,6 @@
<script type="text/javascript">
+<!--
// mySettings is defined in markitup/sets/markdown/set.js
$('#id_{{ name }}').markItUp(mySettings);
+-->
</script>
Modified:
branches/electron/pages/templates/admin/pages/page/widgets/richtextarea.html
==============================================================================
---
branches/electron/pages/templates/admin/pages/page/widgets/richtextarea.html
(original)
+++
branches/electron/pages/templates/admin/pages/page/widgets/richtextarea.html
Tue Apr 28 04:38:11 2009
@@ -1,8 +1,10 @@
<script type="text/javascript">
+<!--
if(window.$) {
$(document).ready(function() {
if($.fn.rte)
$('#id_{{ name }}').rte('{{ PAGES_MEDIA_URL
}}/css/rte.css', '{{ PAGES_MEDIA_URL }}images/');
});
}
+-->
</script>
Modified:
branches/electron/pages/templates/admin/pages/page/widgets/tinymce.html
==============================================================================
--- branches/electron/pages/templates/admin/pages/page/widgets/tinymce.html
(original)
+++ branches/electron/pages/templates/admin/pages/page/widgets/tinymce.html
Tue Apr 28 04:38:11 2009
@@ -1,4 +1,5 @@
<script type="text/javascript">
+<!--
tinyMCE.init({
mode : "exact",
elements : "id_{{name}}",
@@ -9,4 +10,5 @@
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left"
});
+-->
</script>
Modified:
branches/electron/pages/templates/admin/pages/page/widgets/wymeditor.html
==============================================================================
---
branches/electron/pages/templates/admin/pages/page/widgets/wymeditor.html
(original)
+++
branches/electron/pages/templates/admin/pages/page/widgets/wymeditor.html
Tue Apr 28 04:38:11 2009
@@ -1,5 +1,6 @@
{% load mptt_tags %}
<script type="text/javascript">
+<!--
jQuery('#id_{{ name }}').wymeditor({
lang: '{{ language }}',
skin: 'django',
@@ -79,4 +80,5 @@
}
}
});
- </script>
+-->
+</script>
Modified: branches/electron/pages/templates/pages/content.html
==============================================================================
--- branches/electron/pages/templates/pages/content.html (original)
+++ branches/electron/pages/templates/pages/content.html Tue Apr 28
04:38:11 2009
@@ -1 +1 @@
-{{ content }}
+{{ content|safe }}
Modified: branches/electron/pages/templates/pages/revisions.html
==============================================================================
--- branches/electron/pages/templates/pages/revisions.html (original)
+++ branches/electron/pages/templates/pages/revisions.html Tue Apr 28
04:38:11 2009
@@ -1,12 +1,9 @@
{% load i18n %}
{% if revisions %}
- <div class="revisions">
- <h4>{% trans "Revisions" %}</h4>
-
- <ul class="revisions-list">
+ <select class="revisions">
+ <option value="" selected="selected">Revisions</option>
{% for revision in revisions %}
- <li><a href="./get-content/{{ revision.id }}/" {% if
forloop.first %} class="selected"{% endif %}>{{ revision.creation_date|
date:_("DATETIME_FORMAT") }}</a></li>
+ <option value="./get-content/{{ revision.id }}/">{{
revision.creation_date|date:_("DATETIME_FORMAT") }}</option>
{% endfor %}
- </ul>
- </div>
+ </select>
{% endif %}
Modified: branches/electron/pages/templates/pages/traduction_helper.html
==============================================================================
--- branches/electron/pages/templates/pages/traduction_helper.html
(original)
+++ branches/electron/pages/templates/pages/traduction_helper.html Tue Apr
28 04:38:11 2009
@@ -4,8 +4,7 @@
<strong>{% trans "Wanted language has not been translated
yet." %}</strong></p>
{% else %}
{% for p in placeholders %}
- <h4>{{ p.name }}</h4>
- <div style="clear:both">{% show_content page p.name lang %}</div>
- <br />
+ <h4 class="translation-helper-title">{{ p.name }}</h4>
+ <div class="translation-helper-placeholder">{% show_content page
p.name lang 0 %}</div>
{% endfor %}
{% endif %}
Modified: branches/electron/pages/templatetags/pages_tags.py
==============================================================================
--- branches/electron/pages/templatetags/pages_tags.py (original)
+++ branches/electron/pages/templatetags/pages_tags.py Tue Apr 28 04:38:11
2009
@@ -58,7 +58,7 @@
return page.has_page_permission(request)
register.filter(has_permission)
-def get_content(context, page, content_type, lang):
+def get_content(context, page, content_type, lang, fallback=True):
request = context.get('request', False)
if not request or not page:
return ''
@@ -75,12 +75,12 @@
page = c[0].page
else:
''
- c = Content.objects.get_content(page, lang, content_type, True)
+ c = Content.objects.get_content(page, lang, content_type, fallback)
if c:
return c
return ''
-def show_content(context, page, content_type, lang=None):
+def show_content(context, page, content_type, lang=None, fallback=True):
"""Display a content type from a page.
eg: {% show_content page_object "title" %}
@@ -93,8 +93,9 @@
page -- the page object
args -- content_type used by a placeholder
lang -- the wanted language (default None, use the request object to
know)
+ fallback -- use fallback content
"""
- return {'content':get_content(context, page, content_type, lang)}
+ return {'content':get_content(context, page, content_type, lang,
fallback)}
show_content = register.inclusion_tag('pages/content.html',
takes_context=True)(show_content)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---