modifications in models an forms for the partners and organisators
add of css blueprint
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/polemictweet/admin.py Thu Feb 14 14:58:12 2013 +0100
@@ -0,0 +1,9 @@
+from django.contrib import admin
+from polemictweet.models import Event, Live, Content, Partner, Group, Organisator
+
+admin.site.register(Event)
+admin.site.register(Live)
+admin.site.register(Content)
+admin.site.register(Partner)
+admin.site.register(Group)
+admin.site.register(Organisator)
\ No newline at end of file
--- a/src/polemictweet/forms.py Wed Feb 13 11:35:25 2013 +0100
+++ b/src/polemictweet/forms.py Thu Feb 14 14:58:12 2013 +0100
@@ -1,13 +1,16 @@
from django import forms
from django.conf import settings
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import ugettext_lazy as _, get_language
from models import Event, Group, Live, Content, Group, Partner
from polemictweet.utils.unique_slug import unique_slugify
-import logging
+from polemictweet.utils.translate_language import get_translation_languages
+class ModelMultipleChoiceFieldPartner(forms.ModelMultipleChoiceField):
+ def label_from_instance(self, obj):
+ return "%s" % obj.name
+
class EventForm(forms.ModelForm):
title = forms.CharField(required=True, label=_('event.title'))
- title_en = forms.CharField(required=False, label=_('event.title'))
group = forms.ModelMultipleChoiceField(Group.objects.all(), widget=forms.HiddenInput, required=False)
description = forms.CharField(widget=forms.Textarea, required=False, label=_('event.description'))
program = forms.CharField(widget=forms.Textarea, required=False, label=_('event.program'))
@@ -19,6 +22,17 @@
event_image = forms.ImageField(required=False, label=_("event.event_image"))
event_logo = forms.ImageField(required=False, label=_("event.event_logo"))
+ def __init__(self, *args, **kwargs):
+ super(EventForm, self).__init__(*args, **kwargs)
+ translation_languages = get_translation_languages()
+ for lang in translation_languages:
+ # generate extra fields in the number specified via extra_fields
+ self.fields['title_{lang}'.format(lang=lang)] = forms.CharField(required=False, label=_('event.title_{lang}'.format(lang=lang)))
+ self.fields['program_{lang}'.format(lang=lang)] = forms.CharField(widget=forms.Textarea, required=False, label=_('event.program_{lang}'.format(lang=lang)))
+ self.fields['description_{lang}'.format(lang=lang)] = forms.CharField(widget=forms.Textarea, required=False, label=_('event.description_{lang}'.format(lang=lang)))
+ self.fields['event_image_{lang}'.format(lang=lang)] = forms.ImageField(required=False, label=_('event.event_image_{lang}'.format(lang=lang)))
+
+
def clean_event_image(self):
event_image = self.cleaned_data['event_image']
@@ -57,12 +71,29 @@
def clean(self):
super(EventForm, self).clean()
+
+ default_language = settings.LANGUAGES[0][0]
+ current_language = get_language().split("-")[0]
+ if current_language!=default_language :
+ default_key_title = 'title_'+default_language
+ default_key_program = 'program_'+default_language
+ default_key_description = 'description_'+default_language
+ default_key_event_image='event_image_'+default_language
+
+ if self.cleaned_data[default_key_title] is None or self.cleaned_data[default_key_title]=='':
+ self.cleaned_data[default_key_title]=self.cleaned_data.get('title')
+ if self.cleaned_data[default_key_program] is None or self.cleaned_data[default_key_program]=='':
+ self.cleaned_data[default_key_program]=self.cleaned_data.get('program')
+ if self.cleaned_data[default_key_description] is None or self.cleaned_data[default_key_description]=='':
+ self.cleaned_data[default_key_description]=self.cleaned_data.get('description')
+ if self.cleaned_data[default_key_event_image] is None or self.cleaned_data[default_key_event_image]=='':
+ self.cleaned_data[default_key_event_image]=self.cleaned_data.get('event_image')
cleaned_data = self.cleaned_data
return cleaned_data
class Meta:
model = Event
- exclude = ("creator_id")
+ exclude = ("creator_id, partners")
class LiveAddForm(forms.ModelForm):
provider = forms.CharField(required = False, initial ='rtmp', label=_('live.provider'))
@@ -81,7 +112,34 @@
display = forms.CharField(required = False, label=_('content.display'))
program = forms.CharField(widget = forms.Textarea, required = False, label=_('content.program'))
url = forms.CharField(required = False, label=_('content.url'))
+ id = forms.IntegerField(required = False, widget=forms.HiddenInput, label=_("content.id") )
+ def __init__(self, *args, **kwargs):
+ super(ContentAddForm, self).__init__(*args, **kwargs)
+
+ translation_languages = get_translation_languages()
+
+ for lang in translation_languages:
+ # generate extra fields in the different languages
+ self.fields['display_{lang}'.format(lang=lang)] = forms.CharField(required=False, label=_('live.title_{lang}'.format(lang=lang)))
+ self.fields['program_{lang}'.format(lang=lang)] = forms.CharField(required=False, label=_('live.program_{lang}'.format(lang=lang)))
+
+ def clean(self):
+ super(ContentAddForm, self).clean()
+
+ default_language = settings.LANGUAGES[0][0]
+ current_language = get_language().split("-")[0]
+ if current_language!=default_language :
+ default_key_display = 'display_'+default_language
+ default_key_program = 'program_'+default_language
+
+ if self.cleaned_data[default_key_display]=='':
+ self.cleaned_data[default_key_display]=self.cleaned_data.get('display')
+ if self.cleaned_data[default_key_program]=='':
+ self.cleaned_data[default_key_program]=self.cleaned_data.get('program')
+ cleaned_data = self.cleaned_data
+ return cleaned_data
+
class Meta:
model = Content
exclude = ("events")
@@ -97,6 +155,16 @@
events = ModelMultipleChoiceFieldEvent(Event.objects.all(), required=False, label=_("group.events"))
slug = forms.SlugField(required = False, widget=forms.HiddenInput, label=_('group.slug'))
+ def __init__(self, *args, **kwargs):
+ super(GroupForm, self).__init__(*args, **kwargs)
+
+ translation_languages = get_translation_languages()
+
+ for lang in translation_languages:
+ # generate extra fields in the different languages
+ self.fields['title_{lang}'.format(lang=lang)] = forms.CharField(required=False, label=_('group.title_{lang}'.format(lang=lang)))
+ self.fields['description_{lang}'.format(lang=lang)] = forms.CharField(required=False, label=_('group.description_{lang}'.format(lang=lang)))
+
def clean_image(self):
image = self.cleaned_data['image']
@@ -112,5 +180,29 @@
slug = unique_slugify(self, slug_str)
return slug
+ def clean(self):
+ super(GroupForm, self).clean()
+
+ default_language = settings.LANGUAGES[0][0]
+ default_key_title = 'title_'+default_language
+ default_key_description = 'description_'+default_language
+ current_language = get_language().split("-")[0]
+ if current_language!=default_language :
+ if self.cleaned_data[default_key_title]=='':
+ self.cleaned_data[default_key_title]=self.cleaned_data.get('title')
+ if self.cleaned_data[default_key_description]=='':
+ self.cleaned_data[default_key_description]=self.cleaned_data.get('description')
+ cleaned_data = self.cleaned_data
+ return cleaned_data
+
class Meta:
- model = Group
\ No newline at end of file
+ model = Group
+
+class PartnerForm(forms.ModelForm):
+ name = forms.CharField(required=True, label=_('partner.name'))
+ url = forms.CharField(required=True, label=_('partner.url'))
+ partner_image = forms.ImageField(required=False, label=_("partner.image"))
+
+ class Meta:
+ model = Partner
+
\ No newline at end of file
--- a/src/polemictweet/models.py Wed Feb 13 11:35:25 2013 +0100
+++ b/src/polemictweet/models.py Thu Feb 14 14:58:12 2013 +0100
@@ -4,7 +4,19 @@
from django.contrib.auth.models import User
from polemictweet.utils.unique_slug import unique_slugify
from sorl.thumbnail import ImageField
-import logging
+
+class Partner(models.Model):
+ name = models.CharField(max_length=1024, verbose_name=_('partner.name'))
+ url = models.CharField(max_length=1024, verbose_name=_('partner.url'))
+ partner_image = ImageField(upload_to="thumbnails/partner/", max_length=200)
+
+ def __unicode__(self):
+ return self.name
+
+class Organisator(models.Model):
+ event = models.ForeignKey('Event', verbose_name=_('organisator.event'))
+ partner = models.ForeignKey('Partner', verbose_name=_('organisator.partner'))
+ orga = models.BooleanField(default = False, verbose_name=_('organisator.orga'))
class Event(models.Model):
@@ -26,12 +38,16 @@
creator = models.ForeignKey(User, blank=True, null=True, verbose_name=_('event.creator'))
event_image = ImageField(upload_to="thumbnails/event/", max_length=200)
event_logo = ImageField(upload_to="thumbnails/logo/", max_length=200)
+ partners = models.ManyToManyField(Partner, through='Organisator', verbose_name=_('event.partners'))
def save(self, *args, **kwargs):
if not self.slug or self.slug == "" :
slug_str = "%s" % (self.title)
self.slug = unique_slugify(self, slug_str)
super(Event, self).save(*args, **kwargs)
+
+ def __unicode__(self):
+ return self.slug
class Live(models.Model):
TYPE_CHOICES = (
@@ -65,6 +81,7 @@
live.save()
return live
+
class Content(models.Model):
display = models.CharField(max_length=1024, null=True, blank=True, verbose_name=_('content.display'))
program = models.TextField(null=True, blank=True, verbose_name=_('content.program'))
@@ -72,15 +89,25 @@
events = models.ManyToManyField(Event)
@staticmethod
- def create_content(display, program, url, events):
- content = Content(display = display, program=program, url=url)
- content.display_fr = display
- content.program_fr = program
- content.save()
- for event in events:
- content.events.add(event)
+ def create_or_change_content(data, events):
+
+ if data['id'] is not None :
+ content = Content.objects.get(id=int(data['id']))
+ else :
+ content = Content(display = data['display'], program=data['program'], url=data['url'])
+ content.save()
+ for event in events:
+ content.events.add(event)
+
+ for field,value in data.items():
+ if field!='id':
+ setattr(content, field, value)
content.save()
+
return content
+
+ def __unicode__(self):
+ return self.display
class Group(models.Model):
title = models.CharField(max_length=1024, null=True, blank=True, verbose_name=_('group.title'))
@@ -94,16 +121,10 @@
slug_str = "%s" % (self.title)
self.slug = unique_slugify(self, slug_str)
super(Group, self).save(*args, **kwargs)
+
+ def __unicode__(self):
+ return self.slug
-class Partner(models.Model):
- name = models.CharField(max_length=1024, verbose_name=_('partner.name'))
- url = models.CharField(max_length=1024, verbose_name=_('partner.url'))
- partner_image = ImageField(upload_to="thumbnails/partner/", max_length=200)
-
-class Organisator(models.Model):
- event = models.ForeignKey('Event', verbose_name=_('organisator.event'))
- partner = models.ForeignKey('Partner', verbose_name=_('organisator.partner'))
- orga = models.BooleanField(verbose_name=_('organisator.orga'))
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/polemictweet/static/css/blueprint/ie.css Thu Feb 14 14:58:12 2013 +0100
@@ -0,0 +1,35 @@
+/* -----------------------------------------------------------------------
+
+
+ Blueprint CSS Framework 0.9
+ http://blueprintcss.org
+
+ * Copyright (c) 2007-Present. See LICENSE for more info.
+ * See README for instructions on how to use Blueprint.
+ * For credits and origins, see AUTHORS.
+ * This is a compressed file. See the sources in the 'src' directory.
+
+----------------------------------------------------------------------- */
+
+/* ie.css */
+body {text-align:center;}
+.container {text-align:left;}
+* html .column, * html .span-1, * html .span-2, * html .span-3, * html .span-4, * html .span-5, * html .span-6, * html .span-7, * html .span-8, * html .span-9, * html .span-10, * html .span-11, * html .span-12, * html .span-13, * html .span-14, * html .span-15, * html .span-16, * html .span-17, * html .span-18, * html .span-19, * html .span-20, * html .span-21, * html .span-22, * html .span-23, * html .span-24 {display:inline;overflow-x:hidden;}
+* html legend {margin:0px -8px 16px 0;padding:0;}
+sup {vertical-align:text-top;}
+sub {vertical-align:text-bottom;}
+html>body p code {*white-space:normal;}
+hr {margin:-8px auto 11px;}
+img {-ms-interpolation-mode:bicubic;}
+.clearfix, .container {display:inline-block;}
+* html .clearfix, * html .container {height:1%;}
+fieldset {padding-top:0;}
+textarea {overflow:auto;}
+input.text, input.title, textarea {background-color:#fff;border:1px solid #bbb;}
+input.text:focus, input.title:focus {border-color:#666;}
+input.text, input.title, textarea, select {margin:0.5em 0;}
+input.checkbox, input.radio {position:relative;top:.25em;}
+form.inline div, form.inline p {vertical-align:middle;}
+form.inline label {position:relative;top:-0.25em;}
+form.inline input.checkbox, form.inline input.radio, form.inline input.button, form.inline button {margin:0.5em 0;}
+button, input.button {position:relative;top:0.25em;}
\ No newline at end of file
Binary file src/polemictweet/static/css/blueprint/plugins/buttons/icons/cross.png has changed
Binary file src/polemictweet/static/css/blueprint/plugins/buttons/icons/key.png has changed
Binary file src/polemictweet/static/css/blueprint/plugins/buttons/icons/tick.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/polemictweet/static/css/blueprint/plugins/buttons/readme.txt Thu Feb 14 14:58:12 2013 +0100
@@ -0,0 +1,32 @@
+Buttons
+
+* Gives you great looking CSS buttons, for both <a> and <button>.
+* Demo: particletree.com/features/rediscovering-the-button-element
+
+
+Credits
+----------------------------------------------------------------
+
+* Created by Kevin Hale [particletree.com]
+* Adapted for Blueprint by Olav Bjorkoy [bjorkoy.com]
+
+
+Usage
+----------------------------------------------------------------
+
+1) Add this plugin to lib/settings.yml.
+ See compress.rb for instructions.
+
+2) Use the following HTML code to place the buttons on your site:
+
+ <button type="submit" class="button positive">
+ <img src="css/blueprint/plugins/buttons/icons/tick.png" alt=""/> Save
+ </button>
+
+ <a class="button" href="/password/reset/">
+ <img src="css/blueprint/plugins/buttons/icons/key.png" alt=""/> Change Password
+ </a>
+
+ <a href="#" class="button negative">
+ <img src="css/blueprint/plugins/buttons/icons/cross.png" alt=""/> Cancel
+ </a>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/polemictweet/static/css/blueprint/plugins/buttons/screen.css Thu Feb 14 14:58:12 2013 +0100
@@ -0,0 +1,97 @@
+/* --------------------------------------------------------------
+
+ buttons.css
+ * Gives you some great CSS-only buttons.
+
+ Created by Kevin Hale [particletree.com]
+ * particletree.com/features/rediscovering-the-button-element
+
+ See Readme.txt in this folder for instructions.
+
+-------------------------------------------------------------- */
+
+a.button, button {
+ display:block;
+ float:left;
+ margin: 0.7em 0.5em 0.7em 0;
+ padding:5px 10px 5px 7px; /* Links */
+
+ border:1px solid #dedede;
+ border-top:1px solid #eee;
+ border-left:1px solid #eee;
+
+ background-color:#f5f5f5;
+ font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
+ font-size:100%;
+ line-height:130%;
+ text-decoration:none;
+ font-weight:bold;
+ color:#565656;
+ cursor:pointer;
+}
+button {
+ width:auto;
+ overflow:visible;
+ padding:4px 10px 3px 7px; /* IE6 */
+}
+button[type] {
+ padding:4px 10px 4px 7px; /* Firefox */
+ line-height:17px; /* Safari */
+}
+*:first-child+html button[type] {
+ padding:4px 10px 3px 7px; /* IE7 */
+}
+button img, a.button img{
+ margin:0 3px -3px 0 !important;
+ padding:0;
+ border:none;
+ width:16px;
+ height:16px;
+ float:none;
+}
+
+
+/* Button colors
+-------------------------------------------------------------- */
+
+/* Standard */
+button:hover, a.button:hover{
+ background-color:#dff4ff;
+ border:1px solid #c2e1ef;
+ color:#336699;
+}
+a.button:active{
+ background-color:#6299c5;
+ border:1px solid #6299c5;
+ color:#fff;
+}
+
+/* Positive */
+body .positive {
+ color:#529214;
+}
+a.positive:hover, button.positive:hover {
+ background-color:#E6EFC2;
+ border:1px solid #C6D880;
+ color:#529214;
+}
+a.positive:active {
+ background-color:#529214;
+ border:1px solid #529214;
+ color:#fff;
+}
+
+/* Negative */
+body .negative {
+ color:#d12f19;
+}
+a.negative:hover, button.negative:hover {
+ background-color:#fbe3e4;
+ border:1px solid #fbc2c4;
+ color:#d12f19;
+}
+a.negative:active {
+ background-color:#d12f19;
+ border:1px solid #d12f19;
+ color:#fff;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/polemictweet/static/css/blueprint/plugins/fancy-type/readme.txt Thu Feb 14 14:58:12 2013 +0100
@@ -0,0 +1,14 @@
+Fancy Type
+
+* Gives you classes to use if you'd like some
+ extra fancy typography.
+
+Credits and instructions are specified above each class
+in the fancy-type.css file in this directory.
+
+
+Usage
+----------------------------------------------------------------
+
+1) Add this plugin to lib/settings.yml.
+ See compress.rb for instructions.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/polemictweet/static/css/blueprint/plugins/fancy-type/screen.css Thu Feb 14 14:58:12 2013 +0100
@@ -0,0 +1,71 @@
+/* --------------------------------------------------------------
+
+ fancy-type.css
+ * Lots of pretty advanced classes for manipulating text.
+
+ See the Readme file in this folder for additional instructions.
+
+-------------------------------------------------------------- */
+
+/* Indentation instead of line shifts for sibling paragraphs. */
+ p + p { text-indent:2em; margin-top:-1.5em; }
+ form p + p { text-indent: 0; } /* Don't want this in forms. */
+
+
+/* For great looking type, use this code instead of asdf:
+ <span class="alt">asdf</span>
+ Best used on prepositions and ampersands. */
+
+.alt {
+ color: #666;
+ font-family: "Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua", Georgia, serif;
+ font-style: italic;
+ font-weight: normal;
+}
+
+
+/* For great looking quote marks in titles, replace "asdf" with:
+ <span class="dquo">“</span>asdf”
+ (That is, when the title starts with a quote mark).
+ (You may have to change this value depending on your font size). */
+
+.dquo { margin-left: -.5em; }
+
+
+/* Reduced size type with incremental leading
+ (http://www.markboulton.co.uk/journal/comments/incremental_leading/)
+
+ This could be used for side notes. For smaller type, you don't necessarily want to
+ follow the 1.5x vertical rhythm -- the line-height is too much.
+
+ Using this class, it reduces your font size and line-height so that for
+ every four lines of normal sized type, there is five lines of the sidenote. eg:
+
+ New type size in em's:
+ 10px (wanted side note size) / 12px (existing base size) = 0.8333 (new type size in ems)
+
+ New line-height value:
+ 12px x 1.5 = 18px (old line-height)
+ 18px x 4 = 72px
+ 72px / 5 = 14.4px (new line height)
+ 14.4px / 10px = 1.44 (new line height in em's) */
+
+p.incr, .incr p {
+ font-size: 10px;
+ line-height: 1.44em;
+ margin-bottom: 1.5em;
+}
+
+
+/* Surround uppercase words and abbreviations with this class.
+ Based on work by Jørgen Arnor Gårdsø Lom [http://twistedintellect.com/] */
+
+.caps {
+ font-variant: small-caps;
+ letter-spacing: 1px;
+ text-transform: lowercase;
+ font-size:1.2em;
+ line-height:1%;
+ font-weight:bold;
+ padding:0 2px;
+}
Binary file src/polemictweet/static/css/blueprint/plugins/link-icons/icons/doc.png has changed
Binary file src/polemictweet/static/css/blueprint/plugins/link-icons/icons/email.png has changed
Binary file src/polemictweet/static/css/blueprint/plugins/link-icons/icons/external.png has changed
Binary file src/polemictweet/static/css/blueprint/plugins/link-icons/icons/feed.png has changed
Binary file src/polemictweet/static/css/blueprint/plugins/link-icons/icons/im.png has changed
Binary file src/polemictweet/static/css/blueprint/plugins/link-icons/icons/pdf.png has changed
Binary file src/polemictweet/static/css/blueprint/plugins/link-icons/icons/visited.png has changed
Binary file src/polemictweet/static/css/blueprint/plugins/link-icons/icons/xls.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/polemictweet/static/css/blueprint/plugins/link-icons/readme.txt Thu Feb 14 14:58:12 2013 +0100
@@ -0,0 +1,18 @@
+Link Icons
+* Icons for links based on protocol or file type.
+
+This is not supported in IE versions < 7.
+
+
+Credits
+----------------------------------------------------------------
+
+* Marc Morgan
+* Olav Bjorkoy [bjorkoy.com]
+
+
+Usage
+----------------------------------------------------------------
+
+1) Add this line to your HTML:
+ <link rel="stylesheet" href="css/blueprint/plugins/link-icons/screen.css" type="text/css" media="screen, projection">
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/polemictweet/static/css/blueprint/plugins/link-icons/screen.css Thu Feb 14 14:58:12 2013 +0100
@@ -0,0 +1,40 @@
+/* --------------------------------------------------------------
+
+ link-icons.css
+ * Icons for links based on protocol or file type.
+
+ See the Readme file in this folder for additional instructions.
+
+-------------------------------------------------------------- */
+
+/* Use this class if a link gets an icon when it shouldn't. */
+body a.noicon {
+ background:transparent none !important;
+ padding:0 !important;
+ margin:0 !important;
+}
+
+/* Make sure the icons are not cut */
+a[href^="http:"], a[href^="mailto:"], a[href^="http:"]:visited,
+a[href$=".pdf"], a[href$=".doc"], a[href$=".xls"], a[href$=".rss"],
+a[href$=".rdf"], a[href^="aim:"] {
+ padding:2px 22px 2px 0;
+ margin:-2px 0;
+ background-repeat: no-repeat;
+ background-position: right center;
+}
+
+/* External links */
+a[href^="http:"] { background-image: url(icons/external.png); }
+a[href^="mailto:"] { background-image: url(icons/email.png); }
+a[href^="http:"]:visited { background-image: url(icons/visited.png); }
+
+/* Files */
+a[href$=".pdf"] { background-image: url(icons/pdf.png); }
+a[href$=".doc"] { background-image: url(icons/doc.png); }
+a[href$=".xls"] { background-image: url(icons/xls.png); }
+
+/* Misc */
+a[href$=".rss"],
+a[href$=".rdf"] { background-image: url(icons/feed.png); }
+a[href^="aim:"] { background-image: url(icons/im.png); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/polemictweet/static/css/blueprint/plugins/rtl/readme.txt Thu Feb 14 14:58:12 2013 +0100
@@ -0,0 +1,10 @@
+RTL
+* Mirrors Blueprint, so it can be used with Right-to-Left languages.
+
+By Ran Yaniv Hartstein, ranh.co.il
+
+Usage
+----------------------------------------------------------------
+
+1) Add this line to your HTML:
+ <link rel="stylesheet" href="css/blueprint/plugins/rtl/screen.css" type="text/css" media="screen, projection">
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/polemictweet/static/css/blueprint/plugins/rtl/screen.css Thu Feb 14 14:58:12 2013 +0100
@@ -0,0 +1,110 @@
+/* --------------------------------------------------------------
+
+ rtl.css
+ * Mirrors Blueprint for left-to-right languages
+
+ By Ran Yaniv Hartstein [ranh.co.il]
+
+-------------------------------------------------------------- */
+
+body .container { direction: rtl; }
+body .column, body .span-1, body .span-2, body .span-3, body .span-4, body .span-5, body .span-6, body .span-7, body .span-8, body .span-9, body .span-10, body .span-11, body .span-12, body .span-13, body .span-14, body .span-15, body .span-16, body .span-17, body .span-18, body .span-19, body .span-20, body .span-21, body .span-22, body .span-23, body .span-24 {
+ float: right;
+ margin-right: 0;
+ margin-left: 10px;
+ text-align:right;
+}
+
+body div.last { margin-left: 0; }
+body table .last { padding-left: 0; }
+
+body .append-1 { padding-right: 0; padding-left: 40px; }
+body .append-2 { padding-right: 0; padding-left: 80px; }
+body .append-3 { padding-right: 0; padding-left: 120px; }
+body .append-4 { padding-right: 0; padding-left: 160px; }
+body .append-5 { padding-right: 0; padding-left: 200px; }
+body .append-6 { padding-right: 0; padding-left: 240px; }
+body .append-7 { padding-right: 0; padding-left: 280px; }
+body .append-8 { padding-right: 0; padding-left: 320px; }
+body .append-9 { padding-right: 0; padding-left: 360px; }
+body .append-10 { padding-right: 0; padding-left: 400px; }
+body .append-11 { padding-right: 0; padding-left: 440px; }
+body .append-12 { padding-right: 0; padding-left: 480px; }
+body .append-13 { padding-right: 0; padding-left: 520px; }
+body .append-14 { padding-right: 0; padding-left: 560px; }
+body .append-15 { padding-right: 0; padding-left: 600px; }
+body .append-16 { padding-right: 0; padding-left: 640px; }
+body .append-17 { padding-right: 0; padding-left: 680px; }
+body .append-18 { padding-right: 0; padding-left: 720px; }
+body .append-19 { padding-right: 0; padding-left: 760px; }
+body .append-20 { padding-right: 0; padding-left: 800px; }
+body .append-21 { padding-right: 0; padding-left: 840px; }
+body .append-22 { padding-right: 0; padding-left: 880px; }
+body .append-23 { padding-right: 0; padding-left: 920px; }
+
+body .prepend-1 { padding-left: 0; padding-right: 40px; }
+body .prepend-2 { padding-left: 0; padding-right: 80px; }
+body .prepend-3 { padding-left: 0; padding-right: 120px; }
+body .prepend-4 { padding-left: 0; padding-right: 160px; }
+body .prepend-5 { padding-left: 0; padding-right: 200px; }
+body .prepend-6 { padding-left: 0; padding-right: 240px; }
+body .prepend-7 { padding-left: 0; padding-right: 280px; }
+body .prepend-8 { padding-left: 0; padding-right: 320px; }
+body .prepend-9 { padding-left: 0; padding-right: 360px; }
+body .prepend-10 { padding-left: 0; padding-right: 400px; }
+body .prepend-11 { padding-left: 0; padding-right: 440px; }
+body .prepend-12 { padding-left: 0; padding-right: 480px; }
+body .prepend-13 { padding-left: 0; padding-right: 520px; }
+body .prepend-14 { padding-left: 0; padding-right: 560px; }
+body .prepend-15 { padding-left: 0; padding-right: 600px; }
+body .prepend-16 { padding-left: 0; padding-right: 640px; }
+body .prepend-17 { padding-left: 0; padding-right: 680px; }
+body .prepend-18 { padding-left: 0; padding-right: 720px; }
+body .prepend-19 { padding-left: 0; padding-right: 760px; }
+body .prepend-20 { padding-left: 0; padding-right: 800px; }
+body .prepend-21 { padding-left: 0; padding-right: 840px; }
+body .prepend-22 { padding-left: 0; padding-right: 880px; }
+body .prepend-23 { padding-left: 0; padding-right: 920px; }
+
+body .border {
+ padding-right: 0;
+ padding-left: 4px;
+ margin-right: 0;
+ margin-left: 5px;
+ border-right: none;
+ border-left: 1px solid #eee;
+}
+
+body .colborder {
+ padding-right: 0;
+ padding-left: 24px;
+ margin-right: 0;
+ margin-left: 25px;
+ border-right: none;
+ border-left: 1px solid #eee;
+}
+
+body .pull-1 { margin-left: 0; margin-right: -40px; }
+body .pull-2 { margin-left: 0; margin-right: -80px; }
+body .pull-3 { margin-left: 0; margin-right: -120px; }
+body .pull-4 { margin-left: 0; margin-right: -160px; }
+
+body .push-0 { margin: 0 18px 0 0; }
+body .push-1 { margin: 0 18px 0 -40px; }
+body .push-2 { margin: 0 18px 0 -80px; }
+body .push-3 { margin: 0 18px 0 -120px; }
+body .push-4 { margin: 0 18px 0 -160px; }
+body .push-0, body .push-1, body .push-2,
+body .push-3, body .push-4 { float: left; }
+
+
+/* Typography with RTL support */
+body h1,body h2,body h3,
+body h4,body h5,body h6 { font-family: Arial, sans-serif; }
+html body { font-family: Arial, sans-serif; }
+body pre,body code,body tt { font-family: monospace; }
+
+/* Mirror floats and margins on typographic elements */
+body p img { float: right; margin: 1.5em 0 1.5em 1.5em; }
+body dd, body ul, body ol { margin-left: 0; margin-right: 1.5em;}
+body td, body th { text-align:right; }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/polemictweet/static/css/blueprint/print.css Thu Feb 14 14:58:12 2013 +0100
@@ -0,0 +1,29 @@
+/* -----------------------------------------------------------------------
+
+
+ Blueprint CSS Framework 0.9
+ http://blueprintcss.org
+
+ * Copyright (c) 2007-Present. See LICENSE for more info.
+ * See README for instructions on how to use Blueprint.
+ * For credits and origins, see AUTHORS.
+ * This is a compressed file. See the sources in the 'src' directory.
+
+----------------------------------------------------------------------- */
+
+/* print.css */
+body {line-height:1.5;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;color:#000;background:none;font-size:10pt;}
+.container {background:none;}
+hr {background:#ccc;color:#ccc;width:100%;height:2px;margin:2em 0;padding:0;border:none;}
+hr.space {background:#fff;color:#fff;visibility:hidden;}
+h1, h2, h3, h4, h5, h6 {font-family:"Helvetica Neue", Arial, "Lucida Grande", sans-serif;}
+code {font:.9em "Courier New", Monaco, Courier, monospace;}
+a img {border:none;}
+p img.top {margin-top:0;}
+blockquote {margin:1.5em;padding:1em;font-style:italic;font-size:.9em;}
+.small {font-size:.9em;}
+.large {font-size:1.1em;}
+.quiet {color:#999;}
+.hide {display:none;}
+a:link, a:visited {background:transparent;font-weight:700;text-decoration:underline;}
+a:link:after, a:visited:after {content:" (" attr(href) ")";font-size:90%;}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/polemictweet/static/css/blueprint/screen.css Thu Feb 14 14:58:12 2013 +0100
@@ -0,0 +1,258 @@
+/* -----------------------------------------------------------------------
+
+
+ Blueprint CSS Framework 0.9
+ http://blueprintcss.org
+
+ * Copyright (c) 2007-Present. See LICENSE for more info.
+ * See README for instructions on how to use Blueprint.
+ * For credits and origins, see AUTHORS.
+ * This is a compressed file. See the sources in the 'src' directory.
+
+----------------------------------------------------------------------- */
+
+/* reset.css */
+html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, nav, section {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;}
+article, aside, dialog, figure, footer, header, hgroup, nav, section {display:block;}
+body {line-height:1.5;}
+table {border-collapse:separate;border-spacing:0;}
+caption, th, td {text-align:left;font-weight:normal;}
+table, td, th {vertical-align:middle;}
+blockquote:before, blockquote:after, q:before, q:after {content:"";}
+blockquote, q {quotes:"" "";}
+a img {border:none;}
+
+/* typography.css */
+html {font-size:100.01%;}
+body {font-size:75%;color:#222;background:#fff;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;}
+h1, h2, h3, h4, h5, h6 {font-weight:normal;color:#111;}
+h1 {font-size:3em;line-height:1;margin-bottom:0.5em;}
+h2 {font-size:2em;margin-bottom:0.75em;}
+h3 {font-size:1.5em;line-height:1;margin-bottom:1em;}
+h4 {font-size:1.2em;line-height:1.25;margin-bottom:1.25em;}
+h5 {font-size:1em;font-weight:bold;margin-bottom:1.5em;}
+h6 {font-size:1em;font-weight:bold;}
+h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {margin:0;}
+p {margin:0 0 1.5em;}
+p img.left {float:left;margin:1.5em 1.5em 1.5em 0;padding:0;}
+p img.right {float:right;margin:1.5em 0 1.5em 1.5em;}
+a:focus, a:hover {color:#000;}
+a {color:#009;text-decoration:underline;}
+blockquote {margin:1.5em;color:#666;font-style:italic;}
+strong {font-weight:bold;}
+em, dfn {font-style:italic;}
+dfn {font-weight:bold;}
+sup, sub {line-height:0;}
+abbr, acronym {border-bottom:1px dotted #666;}
+address {margin:0 0 1.5em;font-style:italic;}
+del {color:#666;}
+pre {margin:1.5em 0;white-space:pre;}
+pre, code, tt {font:1em 'andale mono', 'lucida console', monospace;line-height:1.5;}
+li ul, li ol {margin:0;}
+ul, ol {margin:0 1.5em 1.5em 0;padding-left:3.333em;}
+ul {list-style-type:disc;}
+ol {list-style-type:decimal;}
+dl {margin:0 0 1.5em 0;}
+dl dt {font-weight:bold;}
+dd {margin-left:1.5em;}
+table {margin-bottom:1.4em;width:100%;}
+th {font-weight:bold;}
+thead th {background:#c3d9ff;}
+th, td, caption {padding:4px 10px 4px 5px;}
+tr.even td {background:#e5ecf9;}
+tfoot {font-style:italic;}
+caption {background:#eee;}
+.small {font-size:.8em;margin-bottom:1.875em;line-height:1.875em;}
+.large {font-size:1.2em;line-height:2.5em;margin-bottom:1.25em;}
+.hide {display:none;}
+.quiet {color:#666;}
+.loud {color:#000;}
+.highlight {background:#ff0;}
+.added {background:#060;color:#fff;}
+.removed {background:#900;color:#fff;}
+.first {margin-left:0;padding-left:0;}
+.last {margin-right:0;padding-right:0;}
+.top {margin-top:0;padding-top:0;}
+.bottom {margin-bottom:0;padding-bottom:0;}
+
+/* forms.css */
+label {font-weight:bold;}
+fieldset {padding:1.4em;margin:0 0 1.5em 0;border:1px solid #ccc;}
+legend {font-weight:bold;font-size:1.2em;}
+input[type=text], input[type=password], input.text, input.title, textarea, select {background-color:#fff;border:1px solid #bbb;}
+input[type=text]:focus, input[type=password]:focus, input.text:focus, input.title:focus, textarea:focus, select:focus {border-color:#666;}
+input[type=text], input[type=password], input.text, input.title, textarea, select {margin:0.5em 0;}
+input.text, input.title {width:300px;padding:5px;}
+input.title {font-size:1.5em;}
+textarea {width:390px;height:250px;padding:5px;}
+input[type=checkbox], input[type=radio], input.checkbox, input.radio {position:relative;top:.25em;}
+form.inline {line-height:3;}
+form.inline p {margin-bottom:0;}
+.error, .notice, .success {padding:.8em;margin-bottom:1em;border:2px solid #ddd;}
+.error {background:#FBE3E4;color:#8a1f11;border-color:#FBC2C4;}
+.notice {background:#FFF6BF;color:#514721;border-color:#FFD324;}
+.success {background:#E6EFC2;color:#264409;border-color:#C6D880;}
+.error a {color:#8a1f11;}
+.notice a {color:#514721;}
+.success a {color:#264409;}
+
+/* grid.css */
+.container {width:950px;margin:0 auto;}
+.showgrid {background:url(src/grid.png);}
+.column, .span-1, .span-2, .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9, .span-10, .span-11, .span-12, .span-13, .span-14, .span-15, .span-16, .span-17, .span-18, .span-19, .span-20, .span-21, .span-22, .span-23, .span-24 {float:left;margin-right:10px;}
+.last {margin-right:0;}
+.span-1 {width:30px;}
+.span-2 {width:70px;}
+.span-3 {width:110px;}
+.span-4 {width:150px;}
+.span-5 {width:190px;}
+.span-6 {width:230px;}
+.span-7 {width:270px;}
+.span-8 {width:310px;}
+.span-9 {width:350px;}
+.span-10 {width:390px;}
+.span-11 {width:430px;}
+.span-12 {width:470px;}
+.span-13 {width:510px;}
+.span-14 {width:550px;}
+.span-15 {width:590px;}
+.span-16 {width:630px;}
+.span-17 {width:670px;}
+.span-18 {width:710px;}
+.span-19 {width:750px;}
+.span-20 {width:790px;}
+.span-21 {width:830px;}
+.span-22 {width:870px;}
+.span-23 {width:910px;}
+.span-24 {width:950px;margin-right:0;}
+input.span-1, textarea.span-1, input.span-2, textarea.span-2, input.span-3, textarea.span-3, input.span-4, textarea.span-4, input.span-5, textarea.span-5, input.span-6, textarea.span-6, input.span-7, textarea.span-7, input.span-8, textarea.span-8, input.span-9, textarea.span-9, input.span-10, textarea.span-10, input.span-11, textarea.span-11, input.span-12, textarea.span-12, input.span-13, textarea.span-13, input.span-14, textarea.span-14, input.span-15, textarea.span-15, input.span-16, textarea.span-16, input.span-17, textarea.span-17, input.span-18, textarea.span-18, input.span-19, textarea.span-19, input.span-20, textarea.span-20, input.span-21, textarea.span-21, input.span-22, textarea.span-22, input.span-23, textarea.span-23, input.span-24, textarea.span-24 {border-left-width:1px!important;border-right-width:1px!important;padding-left:5px!important;padding-right:5px!important;}
+input.span-1, textarea.span-1 {width:18px!important;}
+input.span-2, textarea.span-2 {width:58px!important;}
+input.span-3, textarea.span-3 {width:98px!important;}
+input.span-4, textarea.span-4 {width:138px!important;}
+input.span-5, textarea.span-5 {width:178px!important;}
+input.span-6, textarea.span-6 {width:218px!important;}
+input.span-7, textarea.span-7 {width:258px!important;}
+input.span-8, textarea.span-8 {width:298px!important;}
+input.span-9, textarea.span-9 {width:338px!important;}
+input.span-10, textarea.span-10 {width:378px!important;}
+input.span-11, textarea.span-11 {width:418px!important;}
+input.span-12, textarea.span-12 {width:458px!important;}
+input.span-13, textarea.span-13 {width:498px!important;}
+input.span-14, textarea.span-14 {width:538px!important;}
+input.span-15, textarea.span-15 {width:578px!important;}
+input.span-16, textarea.span-16 {width:618px!important;}
+input.span-17, textarea.span-17 {width:658px!important;}
+input.span-18, textarea.span-18 {width:698px!important;}
+input.span-19, textarea.span-19 {width:738px!important;}
+input.span-20, textarea.span-20 {width:778px!important;}
+input.span-21, textarea.span-21 {width:818px!important;}
+input.span-22, textarea.span-22 {width:858px!important;}
+input.span-23, textarea.span-23 {width:898px!important;}
+input.span-24, textarea.span-24 {width:938px!important;}
+.append-1 {padding-right:40px;}
+.append-2 {padding-right:80px;}
+.append-3 {padding-right:120px;}
+.append-4 {padding-right:160px;}
+.append-5 {padding-right:200px;}
+.append-6 {padding-right:240px;}
+.append-7 {padding-right:280px;}
+.append-8 {padding-right:320px;}
+.append-9 {padding-right:360px;}
+.append-10 {padding-right:400px;}
+.append-11 {padding-right:440px;}
+.append-12 {padding-right:480px;}
+.append-13 {padding-right:520px;}
+.append-14 {padding-right:560px;}
+.append-15 {padding-right:600px;}
+.append-16 {padding-right:640px;}
+.append-17 {padding-right:680px;}
+.append-18 {padding-right:720px;}
+.append-19 {padding-right:760px;}
+.append-20 {padding-right:800px;}
+.append-21 {padding-right:840px;}
+.append-22 {padding-right:880px;}
+.append-23 {padding-right:920px;}
+.prepend-1 {padding-left:40px;}
+.prepend-2 {padding-left:80px;}
+.prepend-3 {padding-left:120px;}
+.prepend-4 {padding-left:160px;}
+.prepend-5 {padding-left:200px;}
+.prepend-6 {padding-left:240px;}
+.prepend-7 {padding-left:280px;}
+.prepend-8 {padding-left:320px;}
+.prepend-9 {padding-left:360px;}
+.prepend-10 {padding-left:400px;}
+.prepend-11 {padding-left:440px;}
+.prepend-12 {padding-left:480px;}
+.prepend-13 {padding-left:520px;}
+.prepend-14 {padding-left:560px;}
+.prepend-15 {padding-left:600px;}
+.prepend-16 {padding-left:640px;}
+.prepend-17 {padding-left:680px;}
+.prepend-18 {padding-left:720px;}
+.prepend-19 {padding-left:760px;}
+.prepend-20 {padding-left:800px;}
+.prepend-21 {padding-left:840px;}
+.prepend-22 {padding-left:880px;}
+.prepend-23 {padding-left:920px;}
+.border {padding-right:4px;margin-right:5px;border-right:1px solid #eee;}
+.colborder {padding-right:24px;margin-right:25px;border-right:1px solid #eee;}
+.pull-1 {margin-left:-40px;}
+.pull-2 {margin-left:-80px;}
+.pull-3 {margin-left:-120px;}
+.pull-4 {margin-left:-160px;}
+.pull-5 {margin-left:-200px;}
+.pull-6 {margin-left:-240px;}
+.pull-7 {margin-left:-280px;}
+.pull-8 {margin-left:-320px;}
+.pull-9 {margin-left:-360px;}
+.pull-10 {margin-left:-400px;}
+.pull-11 {margin-left:-440px;}
+.pull-12 {margin-left:-480px;}
+.pull-13 {margin-left:-520px;}
+.pull-14 {margin-left:-560px;}
+.pull-15 {margin-left:-600px;}
+.pull-16 {margin-left:-640px;}
+.pull-17 {margin-left:-680px;}
+.pull-18 {margin-left:-720px;}
+.pull-19 {margin-left:-760px;}
+.pull-20 {margin-left:-800px;}
+.pull-21 {margin-left:-840px;}
+.pull-22 {margin-left:-880px;}
+.pull-23 {margin-left:-920px;}
+.pull-24 {margin-left:-960px;}
+.pull-1, .pull-2, .pull-3, .pull-4, .pull-5, .pull-6, .pull-7, .pull-8, .pull-9, .pull-10, .pull-11, .pull-12, .pull-13, .pull-14, .pull-15, .pull-16, .pull-17, .pull-18, .pull-19, .pull-20, .pull-21, .pull-22, .pull-23, .pull-24 {float:left;position:relative;}
+.push-1 {margin:0 -40px 1.5em 40px;}
+.push-2 {margin:0 -80px 1.5em 80px;}
+.push-3 {margin:0 -120px 1.5em 120px;}
+.push-4 {margin:0 -160px 1.5em 160px;}
+.push-5 {margin:0 -200px 1.5em 200px;}
+.push-6 {margin:0 -240px 1.5em 240px;}
+.push-7 {margin:0 -280px 1.5em 280px;}
+.push-8 {margin:0 -320px 1.5em 320px;}
+.push-9 {margin:0 -360px 1.5em 360px;}
+.push-10 {margin:0 -400px 1.5em 400px;}
+.push-11 {margin:0 -440px 1.5em 440px;}
+.push-12 {margin:0 -480px 1.5em 480px;}
+.push-13 {margin:0 -520px 1.5em 520px;}
+.push-14 {margin:0 -560px 1.5em 560px;}
+.push-15 {margin:0 -600px 1.5em 600px;}
+.push-16 {margin:0 -640px 1.5em 640px;}
+.push-17 {margin:0 -680px 1.5em 680px;}
+.push-18 {margin:0 -720px 1.5em 720px;}
+.push-19 {margin:0 -760px 1.5em 760px;}
+.push-20 {margin:0 -800px 1.5em 800px;}
+.push-21 {margin:0 -840px 1.5em 840px;}
+.push-22 {margin:0 -880px 1.5em 880px;}
+.push-23 {margin:0 -920px 1.5em 920px;}
+.push-24 {margin:0 -960px 1.5em 960px;}
+.push-1, .push-2, .push-3, .push-4, .push-5, .push-6, .push-7, .push-8, .push-9, .push-10, .push-11, .push-12, .push-13, .push-14, .push-15, .push-16, .push-17, .push-18, .push-19, .push-20, .push-21, .push-22, .push-23, .push-24 {float:right;position:relative;}
+.prepend-top {margin-top:1.5em;}
+.append-bottom {margin-bottom:1.5em;}
+.box {padding:1.5em;margin-bottom:1.5em;background:#E5ECF9;}
+hr {background:#ddd;color:#ddd;clear:both;float:none;width:100%;height:.1em;margin:0 0 1.45em;border:none;}
+hr.space {background:#fff;color:#fff;visibility:hidden;}
+.clearfix:after, .container:after {content:"\0020";display:block;height:0;clear:both;visibility:hidden;overflow:hidden;}
+.clearfix, .container {display:block;}
+.clear {clear:both;}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/polemictweet/static/css/create_event.css Thu Feb 14 14:58:12 2013 +0100
@@ -0,0 +1,37 @@
+.partner_selector{
+ max-height: 200px;
+ min-height: 200px;
+ width: 15%;
+ float: left;
+ position : relative;
+ margin-left: 10px;
+}
+
+.multiple_choice_box{
+ border: 1px solid #B8B8B8;
+ max-height: 200px;
+ min-height: 200px;
+ width: 15%;
+
+}
+
+.multiple_choice_box td{
+ vertical-align: baseline;
+ border: none;
+}
+
+.multiple_choice_box .ui-selected {
+ background-color: #EDEDED;
+}
+
+.choice_button{
+ position : relative;
+ float: left;
+ margin-left: 10px;
+}
+
+.multiple_choice_box{
+ height: 150px;
+ width: 150px;
+}
+
--- a/src/polemictweet/static/js/add_content.js Wed Feb 13 11:35:25 2013 +0100
+++ b/src/polemictweet/static/js/add_content.js Thu Feb 14 14:58:12 2013 +0100
@@ -2,38 +2,49 @@
var number_form = parseInt($j('#id_' + init_prefix + '-TOTAL_FORMS').val());
var links_display = document.getElementsByName('displayTranslateDisplay');
var links_program = document.getElementsByName('displayTranslateProgram');
+ var translations_display=document.getElementsByName("translate_display");
+
for(var i=0;i<number_form;i++){
- links_display[i].onclick = function (e){
- display_translate_display(i);
+ links_display[i].onclick = function(){
+ current_display = translations_display[i-1].style.display;
+ if (current_display == "block"){
+ translations_display[i-1].style.display = "none";
}
- links_program[i].onclick = function (e){
+ else{
+ translations_display[i-1].style.display = "block";
+ }
+ }
+ links_program[i].onclick = function(){
display_translate_program(i);
}
}
}
function init_events(){
- $j(".delete-row").hide()
- change_display_functions();
-
+
+ //change_display_functions();
+ var number_form = parseInt($j('#id_' + init_prefix + '-TOTAL_FORMS').val());
+ if(number_form<2){
+ $j(".delete-row").hide();
+ }
var translations_display=document.getElementsByName("translate_display");
var translations_program=document.getElementsByName("translate_program");
- id_nb_form = "#id_" + init_prefix + "-TOTAL_FORMS";
+ /*id_nb_form = "#id_" + init_prefix + "-TOTAL_FORMS";
for(var k=0;k<translations_display.length;k++){
translations_display[k].style.display="none";
translations_program[k].style.display="none";
}
- $j(".delete-row").bind('click', function() { change_display_functions() } );
+ $j(".delete-row").bind('click', function() { change_display_functions() } );*/
$j(".add-row").click(function() {
- change_display_functions();
+ //change_display_functions();
var number_form = parseInt($j('#id_' + init_prefix + '-TOTAL_FORMS').val())-1;
- var translations_display=document.getElementsByName("translate_display");
+ /*var translations_display=document.getElementsByName("translate_display");
var translations_program=document.getElementsByName("translate_program");
translations_display[number_form].style.display = "none";
- translations_program[number_form].style.display = "none";
+ translations_program[number_form].style.display = "none";*/
$j(".delete-row").show();
tinyMCE.init({
mode: "textareas",
@@ -58,23 +69,23 @@
function display_translate_display(nb_form){
var translations_display=document.getElementsByName("translate_display");
- current = translations_display[nb_form-1].style.display
+ current = translations_display[nb_form].style.display
if (current == "block"){
- translations_display[nb_form-1].style.display = "none";
+ translations_display[nb_form].style.display = "none";
}
else{
- translations_display[nb_form-1].style.display = "block";
+ translations_display[nb_form].style.display = "block";
}
}
function display_translate_program(nb_form){
var translations_program=document.getElementsByName("translate_program");
- current = translations_program[nb_form-1].style.display
+ current = translations_program[nb_form].style.display
if (current == "block"){
- translations_program[nb_form-1].style.display = "none";
+ translations_program[nb_form].style.display = "none";
}
else{
- translations_program[nb_form-1].style.display = "block";
+ translations_program[nb_form].style.display = "block";
}
}
--- a/src/polemictweet/static/js/event.js Wed Feb 13 11:35:25 2013 +0100
+++ b/src/polemictweet/static/js/event.js Thu Feb 14 14:58:12 2013 +0100
@@ -19,5 +19,63 @@
$j("#displayTranslateEventImage").click(function(){
$j("#translate_event_image").slideToggle("fast");
});
+
+ $j("#selectpartners").click(function () {
+ var selection = $j("#elemslistcontainer .ui-selected");
+ $j("#selectedpartnercontainer").append(selection);
+ $j("#elemslistcontainer").remove(".ui-selected");
-}
\ No newline at end of file
+ selection.each(function () {
+ var id_item = $j("input",$j(this)).val();
+ $j("#partners_event").append('<input type="hidden" name="partners" value="' + id_item + '"/>');
+ });
+ });
+
+ $j("#removepartners").click(function () {
+ var selection = $j("#selectedpartnercontainer .ui-selected");
+ $j("#elemslistcontainer").append(selection);
+ $j("#selectedpartnercontainer").remove(".ui-selected");
+
+ selection.each(function () {
+ var id_item = $j("input",$j(this)).val();
+ $j("#partners_event input[value=" + id_item + "]").remove();
+ });
+
+ });
+
+ $j("#selectorganisator").click(function () {
+ var selection = $j("#selectedpartnercontainer .ui-selected");
+ $j("#selectedorganisatorcontainer").append(selection);
+ $j("#selectedpartnercontainer").remove(".ui-selected");
+
+ selection.each(function () {
+ var id_item = $j("input",$j(this)).val();
+ $j("#organisators_event").append('<input type="hidden" name="organisators" value="' + id_item + '"/>');
+ $j("#partners_event input[value=" + id_item + "]").remove();
+ });
+
+ });
+
+ $j("#removeorganisator").click(function () {
+ var selection = $j("#selectedorganisatorcontainer .ui-selected");
+ $j("#selectedpartnercontainer").append(selection);
+ $j("#selectedorganisatorcontainer").remove(".ui-selected");
+
+ selection.each(function () {
+ var id_item = $j("input",$j(this)).val();
+ $j("#organisators_event input[value=" + id_item + "]").remove();
+ $j("#partners_event").append('<input type="hidden" name="partners" value="' + id_item + '"/>');
+ });
+
+ });
+
+}
+
+$('#add').click(function() {
+ return !$('#select1 option:selected').remove().appendTo('#select2');
+ });
+ $('#remove').click(function() {
+ return !$('#select2 option:selected').remove().appendTo('#select1');
+ });
+
+
--- a/src/polemictweet/templates/create_event.html Wed Feb 13 11:35:25 2013 +0100
+++ b/src/polemictweet/templates/create_event.html Thu Feb 14 14:58:12 2013 +0100
@@ -2,10 +2,17 @@
{% load i18n %}
{% load thumbnail %}
+ {% block css_import %}
+ <link rel="stylesheet" href="{{STATIC_URL}}css/create_event.css" />
+
+ {% endblock %}
{% block js_import %}
<script type="text/javascript" src="{{STATIC_URL}}js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="{{STATIC_URL}}js/jquery.min.js"></script>
<script type="text/javascript" src="{{STATIC_URL}}js/jquery.qtip.min.js"></script>
+ <script type="text/javascript" src="{{STATIC_URL}}js/jquery-ui.min.js"></script>
+ <script type="text/javascript" src="{{STATIC_URL}}js/jquery.textchange.min.js"></script>
+
<script type="text/javascript" src="{{STATIC_URL}}js/jquery.formset.js"></script>
<script type="text/javascript" src="{{STATIC_URL}}js/event.js"></script>
{% endblock %}
@@ -30,7 +37,6 @@
theme_advanced_buttons1 : "save,newdocument,bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,search,replace,bullist,numlist,outdent,indent,blockquote,undo,redo,link,unlink,anchor,cleanup,help,code,insertdate,inserttime,preview,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,hr,removeformat,visualaid,sub,sup,charmap,emotions,iespell,advhr,ltr,rtl,fullscreen",
- //theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,styleprops,spellchecker,cite,abbr,acronym,del,ins,attribs,visualchars,nonbreaking,template,blockquote",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
@@ -38,7 +44,21 @@
});
$j(document).ready(function(){
- init_events()
+ init_events();
+
+ $j("#elemslistcontainer").selectable({
+ filter: ".shareline",
+ });
+
+ $j("#selectedpartnercontainer").selectable({
+ filter: ".shareline",
+ });
+
+ $j("#selectedorganisatorcontainer").selectable({
+ filter: ".shareline",
+ });
+
+
});
document.onkeypress = stopRKey;
@@ -68,8 +88,8 @@
<div id="eventformfields" class="span-18 last">
<div>{{ event_form.title.errors }}{{ event_form.title.label_tag }}{{event_form.title}}</div>
- <div>{{ event_form.title_en.errors }}{{ event_form.title_en.label_tag }}{{event_form.title_en}}</div>
- <!-- <a id="displayTranslateTitle" class="translateTitle">
+
+ <a id="displayTranslateTitle" class="translateTitle">
<span class="title">{% trans "Add translations" %}</span>
</a>
<div id="translate_title">
@@ -80,7 +100,7 @@
</div>
{% endfor %}
</div>
- -->
+
<div>{{ event_form.description.errors }}{{ event_form.description.label_tag }}{{event_form.description}}</div>
<a id="displayTranslateDescription" class="translateDescription">
<span class="title">{% trans "Add translations" %}</span>
@@ -115,11 +135,6 @@
</div>
<table id="chooseeventpicturecontainer" >
- <!-- <tr>
- <td class="leftcolumn">
- {% trans "Current event picture" %}
- </td>
- </tr> -->
<tr>
<td class="leftcolumn">
{% trans "Upload a new picture" %}<br/> (JPG, PNG, < 1 Mo)
@@ -147,12 +162,7 @@
{% trans "choose an image for the organisator" %}
</div>
- <table id="chooseeventpicturecontainer" >
- <!-- <tr>
- <td class="leftcolumn">
- {% trans "Current event picture" %}
- </td>
- </tr> -->
+ <table id="chooseeventpicturecontainer">
<tr>
<td class="leftcolumn">
{% trans "Upload a new picture" %}<br/> (JPG, PNG, < 1 Mo)
@@ -174,11 +184,84 @@
{% endif %}
{% endfor %}
</select>
- </div>
+ </div>
+ <div>
+ <label for="id_partners">{% trans "add partners and organisators to your event" %}</label></br>
+ </div>
+ </br>
+
+ <div id="sharecontainer">
+ <div class="partner_selector">
+
+ <label for="id_partners">{% trans "All partners" %}</label></br>
+
+
+ <table id="elemslistcontainer" class="multiple_choice_box">
+ {% for partner in partners %}
+ {% if partner not in old_partners and partner not in old_organisators %}
+ <tr class="shareline">
+ <td>{{ partner.name }}</td>
+ <input type="hidden" value="{{ partner.id }}"/>
+ </tr>
+ {% endif %}
+ {% endfor %}
+ </table>
+ </div>
+ <div id="selectors_partner" class="choice_button">
+ <a href="#" id="selectpartners">{% trans "select partners" %}</a><br />
+ <a href="#" id="removepartners">{% trans "remove partners" %}</a>
+ </div>
+
+ <div class="partner_selector">
+ <label for="id_partners_event">{% trans "Partners" %}</label></br>
+
+ <table id="selectedpartnercontainer" class="multiple_choice_box">
+ {% for partner in old_partners %}
+ <tr class="shareline">
+ <td>{{ partner.name }}</td>
+ <input type="hidden" value="{{ partner.id }}"/>
+ </tr>
+ {% endfor %}
+ </table>
+ </div>
+
+ <div id="selectors_organisator" class="choice_button">
+ <a href="#" id="selectorganisator">{% trans "select organisators" %}</a><br />
+ <a href="#" id="removeorganisator">{% trans "remove organisators" %}</a>
+ </div>
+ <div class="partner_selector">
+ <label for="id_partners_event">{% trans "Organisators" %}</label></br>
+
+ <table id="selectedorganisatorcontainer" class="multiple_choice_box">
+ {% for organisator in old_organisators %}
+ <tr class="shareline">
+ <td>{{ organisator.name }}</td>
+ <input type="hidden" value="{{ organisator.id }}"/>
+ </tr>
+ {% endfor %}
+ </table>
+ </div>
+ </div>
+
+ <div id="partners_event">
+ {% for partner in old_partners %}
+ <input type="hidden" value="{{ partner.id }}" name="partners"/>
+ {% endfor %}
+
+ </div>
+
+ <div id="organisators_event">
+ {% for organisator in old_organisators %}
+ <input type="hidden" value="{{ organisator.id }}" name="organisators" />
+ {% endfor %}
+ </div>
+
</div>
-
- <div id="submitevent" class="span-18 last">
- <div id="submitevent-buttons" class="span-8 last">
+ </br>
+
+
+ <div id="submitevent">
+ <div id="submitevent-buttons">
<button type="submit" value="close" name="submit_button" id="submit_button_close">{% trans 'close_cancel' %}</button>
<button type="submit" value="write" name="submit_button" id="submit_button_write">{% trans "write" %}</button>
</div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/polemictweet/templates/create_partner.html Thu Feb 14 14:58:12 2013 +0100
@@ -0,0 +1,74 @@
+{% extends "polemictweet_base.html" %}
+{% load i18n %}
+{% load thumbnail %}
+
+ {% block js_import %}
+ <script type="text/javascript" src="{{STATIC_URL}}js/jquery.min.js"></script>
+ <script type="text/javascript" src="{{STATIC_URL}}js/jquery.qtip.min.js"></script>
+ <script type="text/javascript" src="{{STATIC_URL}}js/jquery.formset.js"></script>
+ <script type="text/javascript" src="{{STATIC_URL}}js/add_live.js"></script>
+ {% endblock %}
+ {% block js_declaration %}
+ <script type="text/javascript">
+
+ // the function stopRKey prevents from the validation of the form if the user tape enter button while entering a field
+ var $j = jQuery.noConflict();
+
+ function stopRKey(evt) {
+ var evt = (evt) ? evt : ((event) ? event : null);
+ var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
+ if ((evt.keyCode == 13) && (node.type=="text")) {return false;}
+ }
+
+ document.onkeypress = stopRKey;
+
+
+ </script>
+
+
+ </script>
+ {% endblock %}
+ {% block content %}
+ {{ event_form.errors }}
+
+ <div id="add_live_event" class="span-18 last">
+ <div class="projectseventstitle">{% trans "Create a new partner" %}</div>
+
+ <form action="{{ create_partner_action }}" enctype="multipart/form-data" id="my_form" method="POST" enctype="multipart/form-data" >
+ {% csrf_token %}
+ <div class="createpartnerform">
+ <div id="createpartnerformhidden">
+ <input type="hidden" name="form_status" value="{{form_status}}" id="partner_form_status" />
+ {% for hidden in partner_form.hidden_fields %}
+ {{ hidden }}
+ {% endfor %}
+ </div>
+ <div id="createpartnerformfields" class="span-18 last">
+ <div>{{ partner_form.name.errors }}{{ partner_form.name.label_tag }}{{partner_form.name}}</div>
+ <div>{{ partner_form.url.errors }}{{ partner_form.url.label_tag }}{{partner_form.url}}</div>
+
+ <table id="choosepartnerpicturecontainer" >
+
+ <tr>
+ <td class="leftcolumn">
+ {% trans "Upload a new picture" %}<br/> (JPG, PNG, < 1 Mo)
+ </td>
+ <td>
+ <div>{{ partner_form.partner_image.errors }}{{partner_form.partner_image.label_tag}}{{partner_form.partner_image}}</div>
+ </td>
+ </tr>
+ </table>
+
+ </div>
+ </div>
+
+ <div id="submitevent" class="span-18 last">
+ <div id="submitevent-buttons" class="span-8 last">
+ <button type="submit" value="close" name="submit_button" id="submit_button_close">{% trans 'close_cancel' %}</button>
+ <button type="submit" value="write" name="submit_button" id="submit_button_write">{% trans "write" %}</button>
+ </div>
+ </div>
+
+ </form>
+ </div>
+ {% endblock %}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/polemictweet/utils/translate_language.py Thu Feb 14 14:58:12 2013 +0100
@@ -0,0 +1,12 @@
+from django.conf import settings
+from django.utils.translation import get_language
+
+def get_translation_languages() :
+ current_language = get_language().split("-")[0]
+ all_languages = settings.LANGUAGES
+ translation_languages = []
+
+ for l in all_languages:
+ if l[0] != current_language:
+ translation_languages.append(l[0])
+ return translation_languages
\ No newline at end of file