Skip to content

Commit

Permalink
Merge branch 'master' of ssh://githany/projects/content/GIT/ella
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Fiala committed Feb 18, 2010
2 parents e598271 + 63a2d0c commit ae169b0
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 39 deletions.
19 changes: 10 additions & 9 deletions ella/ellaexports/timeline.py
Expand Up @@ -16,7 +16,7 @@
from ella.ellaexports import models
from ella.ellaexports.managers import ExportItemizer
from ella.utils import remove_diacritical
from ella.newman import utils
from ella.newman import utils, widgets

DATETIME_FORMAT = models.DATETIME_FORMAT
TIME_FORMAT = models.TIME_FORMAT
Expand Down Expand Up @@ -47,11 +47,11 @@ def get_export_choice_form():
timerange = get_timerange()

class ExportChoiceForm(forms.Form):
export_slug = forms.ChoiceField(choices=exports)
export_slug = forms.ChoiceField(label=_('Export'), choices=exports)
#range_from = forms.ChoiceField(choices=timerange)
#range_to = forms.ChoiceField(choices=timerange)
range_from = forms.DateTimeField()
range_to = forms.DateTimeField()
range_from = forms.DateTimeField(label=_('From'), widget=widgets.DateTimeWidget)
range_to = forms.DateTimeField(label=_('To'), widget=widgets.DateTimeWidget)
log.debug('Form generated')
return ExportChoiceForm

Expand Down Expand Up @@ -149,14 +149,15 @@ def timeline_view(request, extra_context=None):
'export': export,
#'timeline_table': reformat_list_for_table(items),
'timeline_data': items,
'title': 'Timeline for "%s" (%s-%s)' % (slug, range_from, range_to)
})
template_paths = [
'newman/exports/timeline.html',
'newman/ellaexports/timeline.html',
]
if export:
template_paths.append('exports/%s/timeline.html' % export.category.path)
template_paths.append('newman/exports/%s/timeline.html' % export.category.path)
template_paths.append('exports/timeline.html')
template_paths.append('ellaexports/%s/timeline.html' % export.category.path)
template_paths.append('newman/ellaexports/%s/timeline.html' % export.category.path)
template_paths.append('ellaexports/timeline.html')
return render_to_response(
template_paths,
cx
Expand All @@ -183,7 +184,7 @@ def timeline_insert_append_view(request, **kwargs):
Inserts/appends export element before/after an item (via ExportPosition and ExportMeta).
Keyword arguments:
@param id_item Existing Publishable object placed after new inserted item.
@param id_item Existing Publishable object placed after new inserted item.
@param position ExportPosition object's position.
@param id_export Export object id.
@param id_publishable Chosen Publishable object to be associated with new ExportMeta object.
Expand Down
7 changes: 4 additions & 3 deletions ella/newman/forms.py
@@ -1,10 +1,11 @@
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.forms.widgets import CheckboxSelectMultiple
from django.contrib.contenttypes.models import ContentType

from ella.core.cache.utils import get_cached_list
from ella.core.models import Category
from ella.newman.models import DenormalizedCategoryUserRole, AdminUserDraft
from django.contrib.contenttypes.models import ContentType
from ella.newman import widgets

class DraftForm(forms.Form):
Expand Down Expand Up @@ -33,10 +34,10 @@ def __init__(self, data=None, user=None, **kwargs):

def init_form(self, user):
if user.is_superuser:
cats = Category.objects.filter(tree_parent__isnull=True)
cats = get_cached_list(Category, tree_parent__isnull=True)
else:
category_ids = DenormalizedCategoryUserRole.objects.root_categories_by_user(user)
cats = Category.objects.filter(pk__in=category_ids)
cats = get_cached_list(Category, pk__in=category_ids)
choices = ()
for c in cats:
choices += (c.pk, c.__unicode__(),),
Expand Down
8 changes: 4 additions & 4 deletions ella/newman/templates/newman/base.html
Expand Up @@ -2,8 +2,8 @@
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE|default:"cs" }}" xml:lang="{{ LANGUAGE_CODE|default:"cs" }}">
<head>
<title>{% trans 'Ella administration' %}</title>
<link rel="stylesheet" type="text/css" href="{{ NEWMAN_MEDIA_URL }}css/base.css?{{ VERSION }}" />
<link rel="stylesheet" type="text/css" href="{{ NEWMAN_MEDIA_URL }}css/top-navi.css?{{ VERSION }}" />
<link rel="stylesheet" type="text/css" href="{{ NEWMAN_MEDIA_URL }}css/base.css" />
<link rel="stylesheet" type="text/css" href="{{ NEWMAN_MEDIA_URL }}css/top-navi.css" />
<link rel="shortcut icon" href="{{ NEWMAN_MEDIA_URL }}ico/favicon.ico" type="image/x-icon" />
<script type="text/javascript">
var MEDIA_URL = '{{ NEWMAN_MEDIA_URL }}';
Expand Down Expand Up @@ -61,8 +61,8 @@
<script type="text/javascript" src="{% url newman:jsi18n %}"></script>
<script type="text/javascript" src="{{ NEWMAN_MEDIA_URL }}js/json2-min.js"></script>
<script type="text/javascript" src="{{ NEWMAN_MEDIA_URL }}jquery/jquery-1.3.2.js"></script>
<script type="text/javascript" src="{{ NEWMAN_MEDIA_URL }}js/kobayashi.js?{{ VERSION }}"></script>
<script type="text/javascript" src="{{ NEWMAN_MEDIA_URL }}js/newman.js?{{ VERSION }}"></script>
<script type="text/javascript" src="{{ NEWMAN_MEDIA_URL }}js/kobayashi.js"></script>
<script type="text/javascript" src="{{ NEWMAN_MEDIA_URL }}js/newman.js"></script>
<script type="text/javascript" src="{{ NEWMAN_MEDIA_URL }}jquery/jquery-ui.js"></script>
{% endif %}

Expand Down
@@ -1,15 +1,31 @@
{% extends "newman/change_list.html" %}
{% load newman_list admin_list %}


{% block content %}
{% block breadcrumbs %}
{% if not is_popup %}
<div class="breadcrumbs">
<div style="float: left;">
<a href="{% url newman:index %}#">{% trans "Home" %}</a>
&rsaquo; TODO: view has not app_label in context</a>
&rsaquo; TODO: view has not title (eg. Timeline for 'blabla' export range X-Y)
</div>
</div>
{% endif %}
{% endblock %}
{% block content_toolbar_left %}
<form action="/newman/exports/export/timeline/" method="get" class="js-form">
<ul>
{{ export_form.as_ul }}
<li><a id="id-send-timeline" class="js-submit icn btn ok">{% trans "Send" %}</a></li>
{{ export_form.export_slug.label }}: {{ export_form.export_slug }}
{{ export_form.range_from.label }}: {{ export_form.range_from }}
{{ export_form.range_to.label }}: {{ export_form.range_to }}
<a id="id-send-timeline" class="js-submit icn btn ok">{% trans "Send" %}</a>
<ul>
</form>

{% endblock %}
{% block content_toolbar_right %}{% endblock %}


{% block content %}

<div id="id-modal-dialog" class="noscreen service-module">
<div id="id-publishable-dialog" class="service-module-in" style="height: 40px; overflow: auto; position: fixed; top:200px; left: 100px;">
<label for="id_publishable_suggest" style="float: left;">{% trans 'Publishable object' %}: </label>
Expand Down Expand Up @@ -44,20 +60,20 @@
<p>{{ cell }}</p>
{% if cell.pk %}
<div class="timeline-item-navigation noscreen">
{% comment %}<span
id="{{ forloop.counter0 }};{{ cell.pk }};{{ export.pk }};{{ cell.column_date_from }}"
{% comment %}<span
id="{{ forloop.counter0 }};{{ cell.pk }};{{ export.pk }};{{ cell.column_date_from }}"
class="edit"
>{% trans "Edit" %}</span>
<span
id=""
>{% trans "Edit" %}</span>
<span
id=""
class="delete"
>{% trans "Delete" %}</span>{% endcomment %}
<span
id="{{ forloop.counter0 }};{{ cell.pk }};{{ export.pk }};{{ cell.column_date_from }}"
<span
id="{{ forloop.counter0 }};{{ cell.pk }};{{ export.pk }};{{ cell.column_date_from }}"
class="append"
>{% trans "Append" %}</span>
<span
id="{{ forloop.counter0 }};{{ cell.pk }};{{ export.pk }};{{ cell.column_date_from }}"
<span
id="{{ forloop.counter0 }};{{ cell.pk }};{{ export.pk }};{{ cell.column_date_from }}"
class="insert"
>{% trans "Insert" %}</span>
{# newmanurl newman:exports_export_timeline_insert id_item=cell.pk,id_export=export.pk,position=forloop.counter #}
Expand Down Expand Up @@ -94,10 +110,12 @@ <h1> {{ NEWMAN_MEDIA_URL }} </h1>
{{ block.super }}
<script type="text/javascript">
request_media(MEDIA_URL + 'jquery/jquery-ui.js');
request_media(MEDIA_URL + 'jquery/jquery-urldecode-encode.js?{{ VERSION }}');
request_media(MEDIA_URL + 'jquery/jquery-urldecode-encode.js');
request_media(MEDIA_URL + 'jquery/jquery-ui-smoothness.css');
request_media(MEDIA_URL + 'js/generic.suggest.js?{{ VERSION }}');
request_media(MEDIA_URL + 'css/generic.suggest.css?{{ VERSION }}');
request_media(MEDIA_URL + 'css/datetime.css');
request_media(MEDIA_URL + 'js/datetime.js');
request_media(MEDIA_URL + 'js/generic.suggest.js');
request_media(MEDIA_URL + 'css/generic.suggest.css');
</script>

<!-- timeline scripting -->
Expand Down
7 changes: 4 additions & 3 deletions ella/newman/templates/newman/newman-index.html
Expand Up @@ -112,6 +112,7 @@ <h4>{% trans p.publishable.content_type.name %}: {{ p.publishable.title }}</h4>

<div class="hpcol" style="width: 25%;">

{% cache 30 'nm-hp-lastlog' user %}
<div class="hpbox lastlog">
<h3><span>{% trans "Last edited objects" %}</span></h3>
<div class="cnt">
Expand Down Expand Up @@ -142,6 +143,7 @@ <h4>
{% endif %}
</div>
</div>
{% endcache %}

</div>
<!-- Last changelist filters state -->
Expand All @@ -160,9 +162,8 @@ <h4>

{% cache 300 'nm-hp-js' %}
<script type="text/javascript">
request_media('{{ NEWMAN_MEDIA_URL }}css/dashboard.css?{{ VERSION }}');
request_media('{{ NEWMAN_MEDIA_URL }}jquery/jquery-ui-smoothness.css?{{ VERSION }}');
request_media('{{ NEWMAN_MEDIA_URL }}jquery/jquery-ui.js?{{ VERSION }}');
request_media('{{ NEWMAN_MEDIA_URL }}css/dashboard.css');
request_media('{{ NEWMAN_MEDIA_URL }}jquery/jquery-ui-smoothness.css');

var pubYear = '{{ publishable_lookup_fields.year }}';
var pubMonth = '{{ publishable_lookup_fields.month }}';
Expand Down
Expand Up @@ -107,7 +107,7 @@
{% if media %}
<script type="text/javascript">
{% for m in media %}
request_media('{{ m }}?{{ VERSION }}');
request_media('{{ m }}');
{% endfor %}
</script>
{% endif %}
Expand Down
1 change: 0 additions & 1 deletion ella/newman/widgets.py
Expand Up @@ -13,7 +13,6 @@
from django.utils.text import truncate_words
from django.contrib.contenttypes.models import ContentType

from ella.newman.utils import get_newman_url
from ella.core.models import Listing
from ella.photos.models import Photo
from djangomarkup.widgets import RichTextAreaWidget
Expand Down

0 comments on commit ae169b0

Please sign in to comment.