Anonymous avatar Anonymous committed cd2eb13 Merge

Merge

Comments (0)

Files changed (8)

gnocchi/cms/admin.py

 
     class Media:
         js = (
-            'ckeditor/ckeditor.js',
+            os.path.join(settings.CKEDITOR, 'ckeditor.js'),
             'gnocchi/ckeditor_page.js',
             'gnocchi/admin_list_reorder.js',
         )

gnocchi/cms/locale/sv_SE/LC_MESSAGES/django.po

+# Swedish translation of 
+# Copyright (C) 2012.
+# This file is distributed under the same license as gnocchi-cms.
+# Alexander Nordlund <deep.alexander@gmail.com>, 2012.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: gnocchi-cms 3ffc2366c782\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-07-03 11:56+0200\n"
+"PO-Revision-Date: 2012-07-03 11:59+0100\n"
+"Last-Translator: Alexander Nordlund <deep.alexander@gmail.com>\n"
+"Language-Team: Alexander Nordlund <deep.alexander@gmail.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Swedish\n"
+"X-Poedit-Country: SWEDEN\n"
+
+#: .\models.py:32
+msgid "template"
+msgstr "mall"
+
+#: .\models.py:33
+msgid "templates"
+msgstr "mallar"
+
+#: .\models.py:67
+msgid "page"
+msgstr "sida"
+
+#: .\models.py:68
+msgid "pages"
+msgstr "sidor"
+
+#: .\models.py:146
+msgid "fragment"
+msgstr "fragment"
+
+#: .\models.py:147
+msgid "fragments"
+msgstr "fragment"
+
+#: .\models.py:179
+msgid "style sheet"
+msgstr "stilmall"
+
+#: .\models.py:180
+msgid "style sheets"
+msgstr "stilmallar"
+
+#: .\models.py:222
+msgid "context variable"
+msgstr "innehålls variabel"
+
+#: .\models.py:223
+msgid "context variables"
+msgstr "innehålls variabler"
+

gnocchi/cms/models.py

 
 from gnocchi.tools.attr import AttrHelper
 
+# Translations
+from django.utils.translation import ugettext_lazy as _
+
 #
 # DB stored templates
 #
     content = models.TextField()
 
     class Meta:
+        verbose_name = _('template')
+        verbose_name_plural = _('templates')
         ordering = ('path',)
     def __unicode__(self):
         return self.path
     order = models.PositiveIntegerField(default=0)
 
     class Meta:
+        verbose_name = _('page')
+        verbose_name_plural = _('pages')
         unique_together = (
             ('parent', 'path',),
         )
     name = models.CharField(max_length=200)
     content = models.TextField(blank=True)
     class Meta:
+        verbose_name = _('fragment')
+        verbose_name_plural = _('fragments')
         unique_together = (
             ('page', 'name',)
         )
     name = models.SlugField()
     description = models.CharField(max_length=1024, blank=True)
     content = models.TextField(blank=True)
-
+    class Meta:
+        verbose_name = _('style sheet')
+        verbose_name_plural = _('style sheets')
     def __unicode__(self):
         return u'[%s] %s' % (self.name, self.description,)
     def get_absolute_url(self):
     description = models.CharField(max_length=200, blank=True)
     type = models.CharField(max_length=32, choices = TYPE_CHOICES)
     value = models.CharField(max_length=1024)
-
+    class Meta:
+        verbose_name = _('context variable')
+        verbose_name_plural = _('context variables')
     def clean(self):
         try:
             self.get_value()

gnocchi/cms/settings.py

     STATIC_URL = settings.MEDIA_URL
 CODEMIRROR = getattr(settings, 'CODEMIRROR',
     os.path.join(STATIC_URL, 'codemirror'))
-WYMEDITOR = getattr(settings, 'WYMEDITOR',
-    os.path.join(STATIC_URL, 'wymeditor'))
+CKEDITOR = getattr(settings, 'CKEDITOR',
+    os.path.join(STATIC_URL, 'ckeditor'))
 
 # For Context Variables
 CV_NAMESPACE = getattr(settings, 'CV_NAMESPACE', 'cv')

gnocchi/cms/static/gnocchi/ckeditor_page.js

 django.jQuery(document).ready(function () {
-	if ( CKEDITOR === undefined ) { return; }
-	CKEDITOR.replace('id_content', {
-		shiftEnterMode: CKEDITOR.ENTER_BR
-	});
+	try {
+		CKEDITOR.replace('id_content', {
+			shiftEnterMode: CKEDITOR.ENTER_BR
+		});
+	} catch (err) {}
 });
 

gnocchi/cms/static/gnocchi/codemirror_stylesheet.js

 django.jQuery(document).ready(function () {
-	if( CodeMirror === undefined ) { return; }
-	editor = CodeMirror.fromTextArea(document.getElementById('id_content'), {
-		lineNumbers: true,
-		mode: 'text/css'
-	});
-	django.jQuery('#id_content').after('<button type="button" class="button" title="Reindent" onClick="reindent();">Reindent</button>');
+	try {
+		editor = CodeMirror.fromTextArea(document.getElementById('id_content'), {
+			lineNumbers: true,
+			lineWrapping: true,
+			autoClearEmptyLines: true,
+			matchBrackets: true,
+			mode: 'text/css'
+		});
+		django.jQuery('#id_content').after('<button type="button" class="button" title="Reindent" onClick="reindent();">Reindent</button>');
+	} catch (err) {}
 });

gnocchi/cms/static/gnocchi/codemirror_template.js

 django.jQuery(document).ready(function () {
-	if( CodeMirror === undefined ) { return; }
-	editor = CodeMirror.fromTextArea(document.getElementById('id_content'), {
-		lineNumbers: true,
-		mode: 'text/html'
-	});
-	django.jQuery('#id_content').after('<button type="button" class="button" title="Reindent" onClick="reindent();">Reindent</button>');
+	try {
+		editor = CodeMirror.fromTextArea(document.getElementById('id_content'), {
+			lineNumbers: true,
+			lineWrapping: true,
+			autoClearEmptyLines: true,
+			matchBrackets: true,
+			mode: 'text/html'
+		});
+		django.jQuery('#id_content').after('<button type="button" class="button" title="Reindent" onClick="reindent();">Reindent</button>');
+	} catch (err) {}
 });
     include_package_data = True,
     namespace_packages = ['gnocchi',],
     package_data = {
-        'gnocchi.cms': ['static/gnocchi/*',]
+        'gnocchi.cms': ['static/gnocchi/*','locale/*/LC_MESSAGES/*']
     },
     zip_safe = False,
     classifiers = [
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.