# HG changeset patch # User raph # Date 1265902090 -3600 # Node ID 0c01050f9717f894ad39de8f7dee88698e0d9f86 # Parent 4ec5ae89a7b07505e3be880385168a786692dfa4 add logo in settings / fix static file settings diff -r 4ec5ae89a7b0 -r 0c01050f9717 src/cm/context_processors.py --- a/src/cm/context_processors.py Wed Feb 10 14:34:08 2010 +0100 +++ b/src/cm/context_processors.py Thu Feb 11 16:28:10 2010 +0100 @@ -9,7 +9,8 @@ 'SITE_URL' : settings.SITE_URL, 'CLIENT_DEBUG' : settings.CLIENT_DEBUG, 'YUI_VERSION' : settings.YUI_VERSION, - 'CONF': ApplicationConfiguration + 'CONF': ApplicationConfiguration, + 'CM_MEDIA_PREFIX' : settings.CM_MEDIA_PREFIX, } diff -r 4ec5ae89a7b0 -r 0c01050f9717 src/cm/media/css/base.css --- a/src/cm/media/css/base.css Wed Feb 10 14:34:08 2010 +0100 +++ b/src/cm/media/css/base.css Thu Feb 11 16:28:10 2010 +0100 @@ -416,17 +416,16 @@ text-align:right; } -#sopinspacelink:hover { +#comentlink:hover { color:#EB5700; text-decoration:underline; } -#sopinspacelink, #sopinspacelink:visited { +#comentlink, #comentlink:visited { color:#EB5700; text-decoration:none; } - .ui-widget-content { border-left:0; border-right:0; @@ -437,14 +436,17 @@ color:#00F; } -ul.navlinks li { - display:inline; - list-style-image:none; - list-style-position:outside; - list-style-type:none; - padding:0 0.5em 0 0; +.footlinks { + padding-top: 10px; +} + +.navlinks { + padding:0em 0.5em 0 0; white-space:nowrap; } +.navright { + float:right; +} a.title { color:#000; diff -r 4ec5ae89a7b0 -r 0c01050f9717 src/cm/media/img/logo-co-ment-100.png Binary file src/cm/media/img/logo-co-ment-100.png has changed diff -r 4ec5ae89a7b0 -r 0c01050f9717 src/cm/media/img/logo-co-ment-150.png Binary file src/cm/media/img/logo-co-ment-150.png has changed diff -r 4ec5ae89a7b0 -r 0c01050f9717 src/cm/media/img/logo-co-ment-200.png Binary file src/cm/media/img/logo-co-ment-200.png has changed diff -r 4ec5ae89a7b0 -r 0c01050f9717 src/cm/media/img/logo-co-ment-50.png Binary file src/cm/media/img/logo-co-ment-50.png has changed diff -r 4ec5ae89a7b0 -r 0c01050f9717 src/cm/media/img/logo-co-ment-75.png Binary file src/cm/media/img/logo-co-ment-75.png has changed diff -r 4ec5ae89a7b0 -r 0c01050f9717 src/cm/migrations/0008_nullable_text_version_in_attachements.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cm/migrations/0008_nullable_text_version_in_attachements.py Thu Feb 11 16:28:10 2010 +0100 @@ -0,0 +1,183 @@ + +from south.db import db +from django.db import models +from cm.models import * + +class Migration: + + def forwards(self, orm): + db.alter_column('cm_attachment', 'text_version', models.ForeignKey(TextVersion, null=True), explicit_name=False) + + + def backwards(self, orm): + "Write your backwards migration here" + db.alter_column('cm_attachment', 'text_version', models.ForeignKey(TextVersion, null=True), explicit_name=False) + + + models = { + 'auth.group': { + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'unique_together': "(('content_type', 'codename'),)"}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '75'}) + }, + 'cm.activity': { + 'comment': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['cm.Comment']", 'null': 'True', 'blank': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'ip': ('django.db.models.fields.IPAddressField', [], {'default': 'None', 'max_length': '15', 'null': 'True', 'blank': 'True'}), + 'originator_user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'originator_activity'", 'null': 'True', 'blank': 'True', 'to': "orm['auth.User']"}), + 'text': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['cm.Text']", 'null': 'True', 'blank': 'True'}), + 'text_version': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['cm.TextVersion']", 'null': 'True', 'blank': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '30'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}) + }, + 'cm.attachment': { + 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), + 'data': ('django.db.models.fields.files.FileField', [], {'max_length': '1000'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), + 'text_version': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.TextVersion']"}) + }, + 'cm.comment': { + 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), + 'content': ('django.db.models.fields.TextField', [], {}), + 'content_html': ('django.db.models.fields.TextField', [], {}), + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'end_offset': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'end_wrapper': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'format': ('django.db.models.fields.CharField', [], {'default': "'markdown'", 'max_length': '20'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'id_key': ('django.db.models.fields.CharField', [], {'default': "'5GZbbULRf6X'", 'max_length': '20', 'db_index': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), + 'modified': ('django.db.models.fields.DateTimeField', [], {}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'reply_to': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Comment']", 'null': 'True', 'blank': 'True'}), + 'start_offset': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'start_wrapper': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'max_length': '16'}), + 'tags': ('tagging.fields.TagField', [], {}), + 'text_version': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.TextVersion']"}), + 'title': ('django.db.models.fields.TextField', [], {}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}) + }, + 'cm.configuration': { + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.TextField', [], {}), + 'raw_value': ('django.db.models.fields.TextField', [], {}) + }, + 'cm.email': { + 'bcc': ('django.db.models.fields.TextField', [], {}), + 'body': ('django.db.models.fields.TextField', [], {}), + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'from_email': ('django.db.models.fields.TextField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'message': ('django.db.models.fields.TextField', [], {}), + 'subject': ('django.db.models.fields.TextField', [], {}), + 'to': ('django.db.models.fields.TextField', [], {}) + }, + 'cm.notification': { + 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), + 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), + 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'text': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Text']", 'null': 'True', 'blank': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}) + }, + 'cm.role': { + 'anon': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {}), + 'global_scope': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']"}) + }, + 'cm.text': { + 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), + 'last_text_version': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'related_text'", 'null': 'True', 'to': "orm['cm.TextVersion']"}), + 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'private_feed_key': ('django.db.models.fields.CharField', [], {'null': 'True', 'default': 'None', 'max_length': '20', 'blank': 'True', 'unique': 'True', 'db_index': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'max_length': '16'}), + 'title': ('django.db.models.fields.TextField', [], {}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}) + }, + 'cm.textversion': { + 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), + 'content': ('django.db.models.fields.TextField', [], {}), + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'email': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'format': ('django.db.models.fields.CharField', [], {'default': "'markdown'", 'max_length': '20'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), + 'mod_posteriori': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), + 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'note': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'tags': ('tagging.fields.TagField', [], {'max_length': '1000'}), + 'text': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Text']"}), + 'title': ('django.db.models.fields.TextField', [], {}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}) + }, + 'cm.userprofile': { + 'adminkey': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), + 'allow_contact': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_email_error': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'is_suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'is_temp': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}), + 'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'preferred_language': ('django.db.models.fields.CharField', [], {'default': "'en'", 'max_length': '2'}), + 'tags': ('tagging.fields.TagField', [], {'max_length': '1000'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'}) + }, + 'cm.userrole': { + 'Meta': {'unique_together': "(('role', 'user', 'text'),)"}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'role': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Role']", 'null': 'True', 'blank': 'True'}), + 'text': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cm.Text']", 'null': 'True', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'unique_together': "(('app_label', 'model'),)", 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + } + } + + complete_apps = ['cm'] diff -r 4ec5ae89a7b0 -r 0c01050f9717 src/cm/models.py --- a/src/cm/models.py Wed Feb 10 14:34:08 2010 +0100 +++ b/src/cm/models.py Thu Feb 11 16:28:10 2010 +0100 @@ -386,6 +386,12 @@ return self.get(key=key).value except Configuration.DoesNotExist: return DEFAULT_CONF.get(key, default_value) + + def del_key(self, key): + try: + self.get(key=key).delete() + except Configuration.DoesNotExist: + return None def set_key(self, key, value): conf, created = self.get_or_create(key=key) @@ -396,7 +402,18 @@ change_role_model(value) def __getitem__(self, key): - return self.get_key(key, None) + if not key.startswith('f_'): + return self.get_key(key, None) + else: + return getattr(self,key)() + + def f_get_logo_url(self): + key = self.get_key('workspace_logo_file_key', None) + if key: + attach = Attachment.objects.get(key=key) + return attach.data.url + else: + return None import base64 @@ -428,7 +445,7 @@ class Attachment(KeyModel): data = models.FileField(upload_to="attachments/%Y/%m/%d/", max_length=1000) - text_version = models.ForeignKey(TextVersion) + text_version = models.ForeignKey(TextVersion, null=True) objects = AttachmentManager() diff -r 4ec5ae89a7b0 -r 0c01050f9717 src/cm/templates/site/dashboard.html --- a/src/cm/templates/site/dashboard.html Wed Feb 10 14:34:08 2010 +0100 +++ b/src/cm/templates/site/dashboard.html Thu Feb 11 16:28:10 2010 +0100 @@ -45,12 +45,12 @@
+
{% blocktrans %}user {{ user }} awaits approval{% endblocktrans %}
+
{% blocktrans %}approve{% endblocktrans %}/{% blocktrans %}refuse{% endblocktrans %} {% blocktrans %}membership{% endblocktrans %}
-->
-
-
-
-
-
-
+
+
+
+
+
+
-
-
+
+
-
-
-
+
+
+
+
diff -r 4ec5ae89a7b0 -r 0c01050f9717 src/cm/templates/site/macros/text_actions.html
--- a/src/cm/templates/site/macros/text_actions.html Wed Feb 10 14:34:08 2010 +0100
+++ b/src/cm/templates/site/macros/text_actions.html Thu Feb 11 16:28:10 2010 +0100
@@ -1,6 +1,6 @@
{% load i18n %}
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
+
{% if CLIENT_DEBUG %}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
{% else %}
-
+
{% endif %}
diff -r 4ec5ae89a7b0 -r 0c01050f9717 src/cm/templates/site/text_view_frame.html
--- a/src/cm/templates/site/text_view_frame.html Wed Feb 10 14:34:08 2010 +0100
+++ b/src/cm/templates/site/text_view_frame.html Thu Feb 11 16:28:10 2010 +0100
@@ -10,9 +10,9 @@
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
-
+
-
+
{% if CLIENT_DEBUG %}
-
-
-
+
+
+
{% else %}
-
+
{% endif %}
-
-
+
+
@@ -111,8 +111,8 @@
-
-
+
+
+
+
@@ -44,7 +44,7 @@
Y.Coment = Coment;
}, '0.0.1');
-YUI({base:"{{ MEDIA_URL }}js/lib/yui/{{ YUI_VERSION }}/build/", timeout: 10000}).use("coment",function (Y) {
+YUI({base:"{{ CM_MEDIA_PREFIX }}js/lib/yui/{{ YUI_VERSION }}/build/", timeout: 10000}).use("coment",function (Y) {
Y.log('in here') ;
var coment = new Y.Coment() ;
coment.fun() ;
diff -r 4ec5ae89a7b0 -r 0c01050f9717 src/cm/urls.py
--- a/src/cm/urls.py Wed Feb 10 14:34:08 2010 +0100
+++ b/src/cm/urls.py Thu Feb 11 16:28:10 2010 +0100
@@ -128,9 +128,9 @@
if settings.DEBUG:
urlpatterns += patterns('',
- (r'^themedia/(?P