@ -0,0 +1,68 @@ |
|||||||
|
#-*- coding: utf -8-*- |
||||||
|
from cms.plugin_base import CMSPluginBase |
||||||
|
from cms.plugin_pool import plugin_pool |
||||||
|
from models import IndexBlockPlugin, ExtendedTextBlockPlugin, ExtendedBlockPlugin |
||||||
|
from forms import IndexBlockForm, ExtendedBlockForm |
||||||
|
from django.utils.translation import ugettext as _ |
||||||
|
|
||||||
|
|
||||||
|
class CMSIndexBlockPlugin(CMSPluginBase): |
||||||
|
model = IndexBlockPlugin |
||||||
|
form = IndexBlockForm |
||||||
|
name = u'Блок на главной (картинка и текст)' |
||||||
|
render_template = "index_block.html" |
||||||
|
|
||||||
|
def render(self, context, instance, placeholder): |
||||||
|
context.update({ |
||||||
|
'object':instance, |
||||||
|
'placeholder':placeholder |
||||||
|
}) |
||||||
|
return context |
||||||
|
|
||||||
|
|
||||||
|
class CMSExtendedTextBlockPlugin(CMSPluginBase): |
||||||
|
model = ExtendedTextBlockPlugin |
||||||
|
form = ExtendedBlockForm |
||||||
|
name = u'Раскрывающийся блок' |
||||||
|
render_template = "extended_text_block.html" |
||||||
|
|
||||||
|
def render(self, context, instance, placeholder): |
||||||
|
context.update({ |
||||||
|
'object':instance, |
||||||
|
'placeholder':placeholder |
||||||
|
}) |
||||||
|
return context |
||||||
|
|
||||||
|
|
||||||
|
class CMSExtendedBlockPlugin(CMSPluginBase): |
||||||
|
model = ExtendedBlockPlugin |
||||||
|
form = ExtendedBlockForm |
||||||
|
name = u'Раскрывающийся блок с картинкой' |
||||||
|
render_template = "extended_block.html" |
||||||
|
|
||||||
|
def render(self, context, instance, placeholder): |
||||||
|
context.update({ |
||||||
|
'object':instance, |
||||||
|
'placeholder':placeholder |
||||||
|
}) |
||||||
|
return context |
||||||
|
|
||||||
|
|
||||||
|
class CMSSlideshowBlockPlugin(CMSPluginBase): |
||||||
|
model = IndexBlockPlugin |
||||||
|
form = IndexBlockForm |
||||||
|
name = u'Кадр слайдшоу' |
||||||
|
render_template = "slideshow_block.html" |
||||||
|
|
||||||
|
def render(self, context, instance, placeholder): |
||||||
|
context.update({ |
||||||
|
'object':instance, |
||||||
|
'placeholder':placeholder |
||||||
|
}) |
||||||
|
return context |
||||||
|
|
||||||
|
|
||||||
|
plugin_pool.register_plugin(CMSExtendedTextBlockPlugin) |
||||||
|
# plugin_pool.register_plugin(CMSIndexBlockPlugin) |
||||||
|
plugin_pool.register_plugin(CMSExtendedBlockPlugin) |
||||||
|
# plugin_pool.register_plugin(CMSSlideshowBlockPlugin) |
||||||
@ -0,0 +1,27 @@ |
|||||||
|
from django.forms.models import ModelForm |
||||||
|
from .models import IndexBlockPlugin, ExtendedBlockPlugin |
||||||
|
from django import forms |
||||||
|
|
||||||
|
|
||||||
|
class IndexBlockForm(ModelForm): |
||||||
|
#description = forms.CharField() |
||||||
|
|
||||||
|
class Meta: |
||||||
|
model = IndexBlockPlugin |
||||||
|
# widgets = { |
||||||
|
# 'description': TinyMCE(attrs={'cols': 80, 'rows': 10}), |
||||||
|
# } |
||||||
|
exclude = ('page', 'position', 'placeholder', 'language', 'plugin_type') |
||||||
|
|
||||||
|
|
||||||
|
class ExtendedBlockForm(ModelForm): |
||||||
|
#description = forms.CharField() |
||||||
|
|
||||||
|
class Meta: |
||||||
|
model = ExtendedBlockPlugin |
||||||
|
# widgets = { |
||||||
|
# 'description': TinyMCE(attrs={'cols': 80, 'rows': 10}), |
||||||
|
# 'extended_description': TinyMCE(attrs={'cols': 80, 'rows': 10}), |
||||||
|
# } |
||||||
|
exclude = ('page', 'position', 'placeholder', 'language', 'plugin_type') |
||||||
|
|
||||||
@ -0,0 +1,55 @@ |
|||||||
|
# encoding: utf-8 |
||||||
|
import datetime |
||||||
|
from south.db import db |
||||||
|
from south.v2 import SchemaMigration |
||||||
|
from django.db import models |
||||||
|
|
||||||
|
class Migration(SchemaMigration): |
||||||
|
|
||||||
|
def forwards(self, orm): |
||||||
|
|
||||||
|
# Adding model 'IndexBlockPlugin' |
||||||
|
db.create_table('cmsplugin_indexblockplugin', ( |
||||||
|
('cmsplugin_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['cms.CMSPlugin'], unique=True, primary_key=True)), |
||||||
|
('image', self.gf('django.db.models.fields.files.ImageField')(max_length=100)), |
||||||
|
('description', self.gf('django.db.models.fields.TextField')(max_length=60)), |
||||||
|
)) |
||||||
|
db.send_create_signal('index_blocks', ['IndexBlockPlugin']) |
||||||
|
|
||||||
|
|
||||||
|
def backwards(self, orm): |
||||||
|
|
||||||
|
# Deleting model 'IndexBlockPlugin' |
||||||
|
db.delete_table('cmsplugin_indexblockplugin') |
||||||
|
|
||||||
|
|
||||||
|
models = { |
||||||
|
'cms.cmsplugin': { |
||||||
|
'Meta': {'object_name': 'CMSPlugin'}, |
||||||
|
'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), |
||||||
|
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
||||||
|
'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), |
||||||
|
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), |
||||||
|
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), |
||||||
|
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}), |
||||||
|
'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}), |
||||||
|
'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), |
||||||
|
'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}), |
||||||
|
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), |
||||||
|
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}) |
||||||
|
}, |
||||||
|
'cms.placeholder': { |
||||||
|
'Meta': {'object_name': 'Placeholder'}, |
||||||
|
'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}), |
||||||
|
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
||||||
|
'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}) |
||||||
|
}, |
||||||
|
'index_blocks.indexblockplugin': { |
||||||
|
'Meta': {'object_name': 'IndexBlockPlugin', 'db_table': "'cmsplugin_indexblockplugin'", '_ormbases': ['cms.CMSPlugin']}, |
||||||
|
'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}), |
||||||
|
'description': ('django.db.models.fields.TextField', [], {'max_length': '60'}), |
||||||
|
'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
complete_apps = ['index_blocks'] |
||||||
@ -0,0 +1,57 @@ |
|||||||
|
# encoding: utf-8 |
||||||
|
import datetime |
||||||
|
from south.db import db |
||||||
|
from south.v2 import SchemaMigration |
||||||
|
from django.db import models |
||||||
|
|
||||||
|
class Migration(SchemaMigration): |
||||||
|
|
||||||
|
def forwards(self, orm): |
||||||
|
|
||||||
|
# Adding field 'IndexBlockPlugin.title' |
||||||
|
db.add_column('cmsplugin_indexblockplugin', 'title', self.gf('django.db.models.fields.CharField')(default='', max_length=100), keep_default=False) |
||||||
|
|
||||||
|
# Changing field 'IndexBlockPlugin.description' |
||||||
|
db.alter_column('cmsplugin_indexblockplugin', 'description', self.gf('django.db.models.fields.TextField')()) |
||||||
|
|
||||||
|
|
||||||
|
def backwards(self, orm): |
||||||
|
|
||||||
|
# Deleting field 'IndexBlockPlugin.title' |
||||||
|
db.delete_column('cmsplugin_indexblockplugin', 'title') |
||||||
|
|
||||||
|
# Changing field 'IndexBlockPlugin.description' |
||||||
|
db.alter_column('cmsplugin_indexblockplugin', 'description', self.gf('django.db.models.fields.TextField')(max_length=60)) |
||||||
|
|
||||||
|
|
||||||
|
models = { |
||||||
|
'cms.cmsplugin': { |
||||||
|
'Meta': {'object_name': 'CMSPlugin'}, |
||||||
|
'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), |
||||||
|
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
||||||
|
'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), |
||||||
|
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), |
||||||
|
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), |
||||||
|
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}), |
||||||
|
'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}), |
||||||
|
'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), |
||||||
|
'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}), |
||||||
|
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), |
||||||
|
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}) |
||||||
|
}, |
||||||
|
'cms.placeholder': { |
||||||
|
'Meta': {'object_name': 'Placeholder'}, |
||||||
|
'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}), |
||||||
|
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
||||||
|
'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}) |
||||||
|
}, |
||||||
|
'index_blocks.indexblockplugin': { |
||||||
|
'Meta': {'object_name': 'IndexBlockPlugin', 'db_table': "'cmsplugin_indexblockplugin'", '_ormbases': ['cms.CMSPlugin']}, |
||||||
|
'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}), |
||||||
|
'description': ('django.db.models.fields.TextField', [], {}), |
||||||
|
'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), |
||||||
|
'title': ('django.db.models.fields.CharField', [], {'max_length': '100'}) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
complete_apps = ['index_blocks'] |
||||||
@ -0,0 +1,66 @@ |
|||||||
|
# encoding: utf-8 |
||||||
|
import datetime |
||||||
|
from south.db import db |
||||||
|
from south.v2 import SchemaMigration |
||||||
|
from django.db import models |
||||||
|
|
||||||
|
class Migration(SchemaMigration): |
||||||
|
|
||||||
|
def forwards(self, orm): |
||||||
|
|
||||||
|
# Adding model 'ExtendedBlockPlugin' |
||||||
|
db.create_table('cmsplugin_extendedblockplugin', ( |
||||||
|
('cmsplugin_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['cms.CMSPlugin'], unique=True, primary_key=True)), |
||||||
|
('image', self.gf('django.db.models.fields.files.ImageField')(max_length=100)), |
||||||
|
('title', self.gf('django.db.models.fields.CharField')(max_length=100)), |
||||||
|
('description', self.gf('django.db.models.fields.TextField')()), |
||||||
|
('extended_description', self.gf('django.db.models.fields.TextField')()), |
||||||
|
)) |
||||||
|
db.send_create_signal('index_blocks', ['ExtendedBlockPlugin']) |
||||||
|
|
||||||
|
|
||||||
|
def backwards(self, orm): |
||||||
|
|
||||||
|
# Deleting model 'ExtendedBlockPlugin' |
||||||
|
db.delete_table('cmsplugin_extendedblockplugin') |
||||||
|
|
||||||
|
|
||||||
|
models = { |
||||||
|
'cms.cmsplugin': { |
||||||
|
'Meta': {'object_name': 'CMSPlugin'}, |
||||||
|
'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), |
||||||
|
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
||||||
|
'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), |
||||||
|
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), |
||||||
|
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), |
||||||
|
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}), |
||||||
|
'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}), |
||||||
|
'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), |
||||||
|
'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}), |
||||||
|
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), |
||||||
|
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}) |
||||||
|
}, |
||||||
|
'cms.placeholder': { |
||||||
|
'Meta': {'object_name': 'Placeholder'}, |
||||||
|
'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}), |
||||||
|
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
||||||
|
'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}) |
||||||
|
}, |
||||||
|
'index_blocks.extendedblockplugin': { |
||||||
|
'Meta': {'object_name': 'ExtendedBlockPlugin', 'db_table': "'cmsplugin_extendedblockplugin'", '_ormbases': ['cms.CMSPlugin']}, |
||||||
|
'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}), |
||||||
|
'description': ('django.db.models.fields.TextField', [], {}), |
||||||
|
'extended_description': ('django.db.models.fields.TextField', [], {}), |
||||||
|
'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), |
||||||
|
'title': ('django.db.models.fields.CharField', [], {'max_length': '100'}) |
||||||
|
}, |
||||||
|
'index_blocks.indexblockplugin': { |
||||||
|
'Meta': {'object_name': 'IndexBlockPlugin', 'db_table': "'cmsplugin_indexblockplugin'", '_ormbases': ['cms.CMSPlugin']}, |
||||||
|
'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}), |
||||||
|
'description': ('django.db.models.fields.TextField', [], {}), |
||||||
|
'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), |
||||||
|
'title': ('django.db.models.fields.CharField', [], {'max_length': '100'}) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
complete_apps = ['index_blocks'] |
||||||
@ -0,0 +1,72 @@ |
|||||||
|
# -*- coding: utf-8 -*- |
||||||
|
from south.utils import datetime_utils as datetime |
||||||
|
from south.db import db |
||||||
|
from south.v2 import SchemaMigration |
||||||
|
from django.db import models |
||||||
|
|
||||||
|
|
||||||
|
class Migration(SchemaMigration): |
||||||
|
|
||||||
|
def forwards(self, orm): |
||||||
|
# Adding model 'ExtendedTextBlockPlugin' |
||||||
|
db.create_table(u'index_blocks_extendedtextblockplugin', ( |
||||||
|
(u'cmsplugin_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['cms.CMSPlugin'], unique=True, primary_key=True)), |
||||||
|
('title', self.gf('django.db.models.fields.CharField')(max_length=100)), |
||||||
|
('description', self.gf('django.db.models.fields.TextField')()), |
||||||
|
('extended_description', self.gf('django.db.models.fields.TextField')()), |
||||||
|
)) |
||||||
|
db.send_create_signal(u'index_blocks', ['ExtendedTextBlockPlugin']) |
||||||
|
|
||||||
|
|
||||||
|
def backwards(self, orm): |
||||||
|
# Deleting model 'ExtendedTextBlockPlugin' |
||||||
|
db.delete_table(u'index_blocks_extendedtextblockplugin') |
||||||
|
|
||||||
|
|
||||||
|
models = { |
||||||
|
'cms.cmsplugin': { |
||||||
|
'Meta': {'object_name': 'CMSPlugin'}, |
||||||
|
'changed_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), |
||||||
|
'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), |
||||||
|
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
||||||
|
'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), |
||||||
|
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), |
||||||
|
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), |
||||||
|
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}), |
||||||
|
'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}), |
||||||
|
'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), |
||||||
|
'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}), |
||||||
|
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), |
||||||
|
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}) |
||||||
|
}, |
||||||
|
'cms.placeholder': { |
||||||
|
'Meta': {'object_name': 'Placeholder'}, |
||||||
|
'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}), |
||||||
|
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
||||||
|
'slot': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) |
||||||
|
}, |
||||||
|
u'index_blocks.extendedblockplugin': { |
||||||
|
'Meta': {'object_name': 'ExtendedBlockPlugin', '_ormbases': ['cms.CMSPlugin']}, |
||||||
|
u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}), |
||||||
|
'description': ('django.db.models.fields.TextField', [], {}), |
||||||
|
'extended_description': ('django.db.models.fields.TextField', [], {}), |
||||||
|
'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), |
||||||
|
'title': ('django.db.models.fields.CharField', [], {'max_length': '100'}) |
||||||
|
}, |
||||||
|
u'index_blocks.extendedtextblockplugin': { |
||||||
|
'Meta': {'object_name': 'ExtendedTextBlockPlugin', '_ormbases': ['cms.CMSPlugin']}, |
||||||
|
u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}), |
||||||
|
'description': ('django.db.models.fields.TextField', [], {}), |
||||||
|
'extended_description': ('django.db.models.fields.TextField', [], {}), |
||||||
|
'title': ('django.db.models.fields.CharField', [], {'max_length': '100'}) |
||||||
|
}, |
||||||
|
u'index_blocks.indexblockplugin': { |
||||||
|
'Meta': {'object_name': 'IndexBlockPlugin', '_ormbases': ['cms.CMSPlugin']}, |
||||||
|
u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}), |
||||||
|
'description': ('django.db.models.fields.TextField', [], {}), |
||||||
|
'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), |
||||||
|
'title': ('django.db.models.fields.CharField', [], {'max_length': '100'}) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
complete_apps = ['index_blocks'] |
||||||
@ -0,0 +1,81 @@ |
|||||||
|
# -*- coding: utf-8 -*- |
||||||
|
from south.utils import datetime_utils as datetime |
||||||
|
from south.db import db |
||||||
|
from south.v2 import SchemaMigration |
||||||
|
from django.db import models |
||||||
|
|
||||||
|
|
||||||
|
class Migration(SchemaMigration): |
||||||
|
|
||||||
|
def forwards(self, orm): |
||||||
|
# Adding field 'ExtendedTextBlockPlugin.order' |
||||||
|
db.add_column(u'index_blocks_extendedtextblockplugin', 'order', |
||||||
|
self.gf('django.db.models.fields.PositiveIntegerField')(default=1), |
||||||
|
keep_default=False) |
||||||
|
|
||||||
|
|
||||||
|
# Changing field 'ExtendedTextBlockPlugin.extended_description' |
||||||
|
db.alter_column(u'index_blocks_extendedtextblockplugin', 'extended_description', self.gf('djangocms_text_ckeditor.fields.HTMLField')()) |
||||||
|
|
||||||
|
# Changing field 'ExtendedTextBlockPlugin.description' |
||||||
|
db.alter_column(u'index_blocks_extendedtextblockplugin', 'description', self.gf('djangocms_text_ckeditor.fields.HTMLField')()) |
||||||
|
|
||||||
|
def backwards(self, orm): |
||||||
|
# Deleting field 'ExtendedTextBlockPlugin.order' |
||||||
|
db.delete_column(u'index_blocks_extendedtextblockplugin', 'order') |
||||||
|
|
||||||
|
|
||||||
|
# Changing field 'ExtendedTextBlockPlugin.extended_description' |
||||||
|
db.alter_column(u'index_blocks_extendedtextblockplugin', 'extended_description', self.gf('django.db.models.fields.TextField')()) |
||||||
|
|
||||||
|
# Changing field 'ExtendedTextBlockPlugin.description' |
||||||
|
db.alter_column(u'index_blocks_extendedtextblockplugin', 'description', self.gf('django.db.models.fields.TextField')()) |
||||||
|
|
||||||
|
models = { |
||||||
|
'cms.cmsplugin': { |
||||||
|
'Meta': {'object_name': 'CMSPlugin'}, |
||||||
|
'changed_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), |
||||||
|
'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), |
||||||
|
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
||||||
|
'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), |
||||||
|
'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), |
||||||
|
'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), |
||||||
|
'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}), |
||||||
|
'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}), |
||||||
|
'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), |
||||||
|
'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}), |
||||||
|
'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), |
||||||
|
'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}) |
||||||
|
}, |
||||||
|
'cms.placeholder': { |
||||||
|
'Meta': {'object_name': 'Placeholder'}, |
||||||
|
'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}), |
||||||
|
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
||||||
|
'slot': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}) |
||||||
|
}, |
||||||
|
u'index_blocks.extendedblockplugin': { |
||||||
|
'Meta': {'object_name': 'ExtendedBlockPlugin', '_ormbases': ['cms.CMSPlugin']}, |
||||||
|
u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}), |
||||||
|
'description': ('django.db.models.fields.TextField', [], {}), |
||||||
|
'extended_description': ('django.db.models.fields.TextField', [], {}), |
||||||
|
'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), |
||||||
|
'title': ('django.db.models.fields.CharField', [], {'max_length': '100'}) |
||||||
|
}, |
||||||
|
u'index_blocks.extendedtextblockplugin': { |
||||||
|
'Meta': {'object_name': 'ExtendedTextBlockPlugin', '_ormbases': ['cms.CMSPlugin']}, |
||||||
|
u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}), |
||||||
|
'description': ('djangocms_text_ckeditor.fields.HTMLField', [], {}), |
||||||
|
'extended_description': ('djangocms_text_ckeditor.fields.HTMLField', [], {}), |
||||||
|
'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), |
||||||
|
'title': ('django.db.models.fields.CharField', [], {'max_length': '100'}) |
||||||
|
}, |
||||||
|
u'index_blocks.indexblockplugin': { |
||||||
|
'Meta': {'object_name': 'IndexBlockPlugin', '_ormbases': ['cms.CMSPlugin']}, |
||||||
|
u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}), |
||||||
|
'description': ('django.db.models.fields.TextField', [], {}), |
||||||
|
'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), |
||||||
|
'title': ('django.db.models.fields.CharField', [], {'max_length': '100'}) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
complete_apps = ['index_blocks'] |
||||||
@ -0,0 +1,23 @@ |
|||||||
|
from django.db import models |
||||||
|
from cms.models.pluginmodel import CMSPlugin |
||||||
|
from djangocms_text_ckeditor.fields import HTMLField |
||||||
|
|
||||||
|
|
||||||
|
class IndexBlockPlugin(CMSPlugin): |
||||||
|
image = models.ImageField(upload_to="uploads/images/") |
||||||
|
title = models.CharField(max_length=100) |
||||||
|
description = models.TextField() |
||||||
|
|
||||||
|
|
||||||
|
class ExtendedTextBlockPlugin(CMSPlugin): |
||||||
|
order = models.PositiveIntegerField(default=1) |
||||||
|
title = models.CharField(max_length=100) |
||||||
|
description = HTMLField() |
||||||
|
extended_description = HTMLField() |
||||||
|
|
||||||
|
|
||||||
|
class ExtendedBlockPlugin(CMSPlugin): |
||||||
|
image = models.ImageField(upload_to="uploads/images/") |
||||||
|
title = models.CharField(max_length=100) |
||||||
|
description = models.TextField() |
||||||
|
extended_description = models.TextField() |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
{% load thumbnail %} |
||||||
|
<article class='extended-block'> |
||||||
|
<div class='extended-block-img left'> |
||||||
|
{% thumbnail object.image.name "190x132" crop="center" as img %} |
||||||
|
<img src="{{ img.url }}" width="{{ img.width }}" height="{{ img.height }}" {% if picture.alt %}alt="{{ picture.alt }}" {% endif %}{% if picture.longdesc %}title="{{ picture.longdesc }}" {% endif %}/> |
||||||
|
</div> |
||||||
|
<div class='extended-block-text extended-block-toggle'> |
||||||
|
<h3>{{ object.title }}</h3> |
||||||
|
{{ object.description|safe }} |
||||||
|
</div> |
||||||
|
<div class='extended-block-more extended-block-toggle hidden'> |
||||||
|
<h3>{{ object.title }}</h3> |
||||||
|
{{ object.extended_description|safe }} |
||||||
|
</div> |
||||||
|
<div class='clear'></div> |
||||||
|
</article> |
||||||
@ -0,0 +1,17 @@ |
|||||||
|
{% load thumbnail %} |
||||||
|
<article class='extended-block'> |
||||||
|
<div class='extended-block-text'> |
||||||
|
<div class='order left'>{{ object.order }}</div> |
||||||
|
<div class='left text'> |
||||||
|
<h3>{{ object.title }}</h3> |
||||||
|
{{ object.description|safe }} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class='extended-triangle hidden'></div> |
||||||
|
<div class='clear'></div> |
||||||
|
<div class='extended-block-more hidden'> |
||||||
|
<div class="text"> |
||||||
|
{{ object.extended_description|safe }} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</article> |
||||||
@ -0,0 +1,12 @@ |
|||||||
|
{% load thumbnail %} |
||||||
|
<article class='index-block left'> |
||||||
|
<div class='index-block-img'> |
||||||
|
{% thumbnail object.image.name "250x110" crop="center" as img %} |
||||||
|
<img src="{{ img.url }}" width="{{ img.width }}" height="{{ img.height }}" {% if picture.alt %}alt="{{ picture.alt }}" {% endif %}{% if picture.longdesc %}title="{{ picture.longdesc }}" {% endif %}/> |
||||||
|
{% endthumbnail %} |
||||||
|
</div> |
||||||
|
<div class='index-block-text'> |
||||||
|
<h3>{{ object.title }}</h3> |
||||||
|
{{ object.description|safe }} |
||||||
|
</div> |
||||||
|
</article> |
||||||
@ -0,0 +1,10 @@ |
|||||||
|
{% load thumbnail %} |
||||||
|
<li> |
||||||
|
{% thumbnail object.image.name "650x450" crop="center" as img %} |
||||||
|
<img src="{{ img.url }}" width="{{ img.width }}" height="{{ img.height }}" {% if picture.alt %}alt="{{ picture.alt }}" {% endif %}{% if picture.longdesc %}title="{{ picture.longdesc }}" {% endif %}/> |
||||||
|
{% endthumbnail %} |
||||||
|
<div class='index-banner-caption'> |
||||||
|
{% if object.title %}<h1>{{ object.title }}</h1>{% endif %} |
||||||
|
{{ object.description|safe|default:'' }} |
||||||
|
</div> |
||||||
|
</li> |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
""" |
||||||
|
This file demonstrates writing tests using the unittest module. These will pass |
||||||
|
when you run "manage.py test". |
||||||
|
|
||||||
|
Replace this with more appropriate tests for your application. |
||||||
|
""" |
||||||
|
|
||||||
|
from django.test import TestCase |
||||||
|
|
||||||
|
|
||||||
|
class SimpleTest(TestCase): |
||||||
|
def test_basic_addition(self): |
||||||
|
""" |
||||||
|
Tests that 1 + 1 always equals 2. |
||||||
|
""" |
||||||
|
self.assertEqual(1 + 1, 2) |
||||||
@ -0,0 +1 @@ |
|||||||
|
# Create your views here. |
||||||
@ -0,0 +1,332 @@ |
|||||||
|
// Copy+pasted from /static/filer/js/popup_handling.js, because we can't always count on this being loaded.
|
||||||
|
|
||||||
|
(function($) { |
||||||
|
dismissPopupAndReload = function(win) { |
||||||
|
document.location.reload(); |
||||||
|
win.close(); |
||||||
|
}; |
||||||
|
dismissRelatedImageLookupPopup = function(win, chosenId, chosenThumbnailUrl, chosenDescriptionTxt) { |
||||||
|
var name = windowname_to_id(win.name); |
||||||
|
var img_name = name + '_thumbnail_img'; |
||||||
|
var txt_name = name + '_description_txt'; |
||||||
|
var clear_name = name + '_clear'; |
||||||
|
var elem = document.getElementById(name); |
||||||
|
document.getElementById(name).value = chosenId; |
||||||
|
document.getElementById(img_name).src = chosenThumbnailUrl; |
||||||
|
document.getElementById(txt_name).innerHTML = chosenDescriptionTxt; |
||||||
|
document.getElementById(clear_name).style.display = 'inline'; |
||||||
|
win.close(); |
||||||
|
}; |
||||||
|
dismissRelatedFolderLookupPopup = function(win, chosenId, chosenName) { |
||||||
|
var id = windowname_to_id(win.name); |
||||||
|
var id_name = id + '_description_txt'; |
||||||
|
document.getElementById(id).value = chosenId; |
||||||
|
document.getElementById(id_name).innerHTML = chosenName; |
||||||
|
win.close(); |
||||||
|
}; |
||||||
|
})(jQuery); |
||||||
|
|
||||||
|
CKEDITOR.dialog.add( 'filerImageDialog', function ( editor ) { |
||||||
|
dialog = CKEDITOR.dialog.getCurrent(); |
||||||
|
var imageWidth = 0; |
||||||
|
var imageHeight = 0; |
||||||
|
|
||||||
|
function getImageUrl() { |
||||||
|
var url = dialog.getContentElement("tab-basic", "url"); |
||||||
|
var thumb_sel_val = dialog.getContentElement("tab-basic", "thumbnail_option").getValue(); |
||||||
|
if (thumb_sel_val != 0) { |
||||||
|
server_url = '?djangocms_ckeditor_filer_image='+ django.jQuery('#id_image').val() + '&thumb_options=' + thumb_sel_val; |
||||||
|
} else { |
||||||
|
width = dialog.getContentElement("tab-basic", "width").getValue(); |
||||||
|
height = dialog.getContentElement("tab-basic", "height").getValue(); |
||||||
|
server_url = '?djangocms_ckeditor_filer_image='+ django.jQuery('#id_image').val() + '&width=' + width + '&height=' + height; |
||||||
|
} |
||||||
|
django.jQuery.get(server_url, function(data) { |
||||||
|
url.setValue(data.url); |
||||||
|
imageWidth = data.width; |
||||||
|
imageHeight = data.height; |
||||||
|
}); |
||||||
|
} |
||||||
|
return { |
||||||
|
title: 'Filer Image Properties', |
||||||
|
minWidth: 400, |
||||||
|
minHeight: 200, |
||||||
|
|
||||||
|
onShow: function() { |
||||||
|
dialog = CKEDITOR.dialog.getCurrent(); |
||||||
|
var document = this.getElement().getDocument(); |
||||||
|
// document = CKEDITOR.dom.document
|
||||||
|
var id_image = document.getById( 'id_image' ); |
||||||
|
var oldVal = id_image.getValue(); |
||||||
|
|
||||||
|
setInterval(function () { |
||||||
|
if (oldVal != id_image.getValue()) { |
||||||
|
oldVal = id_image.getValue(); |
||||||
|
getImageUrl(); |
||||||
|
} |
||||||
|
}, 1000); |
||||||
|
if ( id_image ) |
||||||
|
id_image.hide(); |
||||||
|
var id_image_clear = document.getById( 'id_image_clear' ); |
||||||
|
|
||||||
|
id_image_clear.on('click', function () { |
||||||
|
id_image.setValue(""); |
||||||
|
id_image.removeAttribute("value"); |
||||||
|
id_image_thumbnail_img = document.getById( 'id_image_thumbnail_img' ); |
||||||
|
id_image_thumbnail_img.setAttribute("src", editor.config.settings.static_url +'/../filer/icons/nofile_48x48.png'); |
||||||
|
id_image_description_txt = document.getById( 'id_image_description_txt' ); |
||||||
|
id_image_description_txt.setHtml(""); |
||||||
|
id_image_clear = document.getById( 'id_image_clear' ); |
||||||
|
id_image_clear.hide(); |
||||||
|
}); |
||||||
|
|
||||||
|
// Get the selection in the editor.
|
||||||
|
var selection = editor.getSelection(); |
||||||
|
|
||||||
|
// Get the element at the start of the selection.
|
||||||
|
var element = selection.getStartElement(); |
||||||
|
|
||||||
|
// Get the <img> element closest to the selection, if any.
|
||||||
|
if ( element ) |
||||||
|
element = element.getAscendant( 'img', true ); |
||||||
|
|
||||||
|
// Create a new <img> element if it does not exist.
|
||||||
|
if ( !element || element.getName() != 'img' ) { |
||||||
|
element = editor.document.createElement( 'img' ); |
||||||
|
|
||||||
|
// Flag the insertion mode for later use.
|
||||||
|
this.insertMode = true; |
||||||
|
} |
||||||
|
else |
||||||
|
this.insertMode = false; |
||||||
|
|
||||||
|
// Store the reference to the <abbr> element in an internal property, for later use.
|
||||||
|
this.element = element; |
||||||
|
|
||||||
|
// Invoke the setup methods of all dialog elements, so they can load the element attributes.
|
||||||
|
if ( !this.insertMode ) |
||||||
|
this.setupContent( this.element ); |
||||||
|
else |
||||||
|
id_image_clear.fire('click'); |
||||||
|
}, |
||||||
|
// This method is invoked once a user clicks the OK button, confirming the dialog.
|
||||||
|
onOk: function() { |
||||||
|
|
||||||
|
// The context of this function is the dialog object itself.
|
||||||
|
// http://docs.ckeditor.com/#!/api/CKEDITOR.dialog
|
||||||
|
var dialog = this; |
||||||
|
|
||||||
|
// Creates a new <abbr> element.
|
||||||
|
var abbr = this.element; |
||||||
|
|
||||||
|
// Invoke the commit methods of all dialog elements, so the <abbr> element gets modified.
|
||||||
|
this.commitContent( abbr ); |
||||||
|
|
||||||
|
// Finally, in if insert mode, inserts the element at the editor caret position.
|
||||||
|
if ( this.insertMode ) |
||||||
|
editor.insertElement( abbr ); |
||||||
|
}, |
||||||
|
|
||||||
|
contents: [ |
||||||
|
{ |
||||||
|
id: 'tab-basic', |
||||||
|
label: 'Basic Settings', |
||||||
|
elements: [ |
||||||
|
{ |
||||||
|
type: 'html', |
||||||
|
html: |
||||||
|
'<div class="field-box field-image">' + |
||||||
|
'<label for="id_image">Image:</label>' + |
||||||
|
'<img alt="no file selected" class="quiet" src="'+ editor.config.settings.static_url +'/../filer/icons/nofile_48x48.png" id="id_image_thumbnail_img">' + |
||||||
|
' <span id="id_image_description_txt"></span>' + |
||||||
|
'<a onclick="return showRelatedObjectLookupPopup(this);" title="Pretraži" id="lookup_id_image" class="related-lookup" href="/admin/filer/folder/last/?t=file_ptr">' + |
||||||
|
'<img width="16" height="16" alt="Pretraži" src="'+ editor.config.settings.static_url +'/../admin/img/icon_searchbox.png">' + |
||||||
|
'</a>' + |
||||||
|
'<img width="10" height="10" style="display: none;" title="Očisti" alt="Očisti" src="'+ editor.config.settings.static_url +'/../admin/img/icon_deletelink.gif" id="id_image_clear">' + |
||||||
|
'<br><input type="text" id="id_image" name="image" class="vForeignKeyRawIdAdminField">' + |
||||||
|
'</div>', |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'text', |
||||||
|
id: 'url', |
||||||
|
label: 'Url', |
||||||
|
setup: function( element ) { |
||||||
|
this.setValue( element.getAttribute( "src" ) ); |
||||||
|
}, |
||||||
|
// Called by the main commitContent call on dialog confirmation.
|
||||||
|
commit: function( element ) { |
||||||
|
element.setAttribute( "src", this.getValue() ); |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'text', |
||||||
|
id: 'caption', |
||||||
|
label: 'Caption', |
||||||
|
setup: function( element ) { |
||||||
|
this.setValue( element.getAttribute( "title" ) ); |
||||||
|
}, |
||||||
|
// Called by the main commitContent call on dialog confirmation.
|
||||||
|
commit: function( element ) { |
||||||
|
element.setAttribute( "title", this.getValue() ); |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'text', |
||||||
|
id: 'alt_text', |
||||||
|
label: 'Alt', |
||||||
|
setup: function( element ) { |
||||||
|
this.setValue( element.getAttribute( "alt" ) ); |
||||||
|
}, |
||||||
|
// Called by the main commitContent call on dialog confirmation.
|
||||||
|
commit: function( element ) { |
||||||
|
element.setAttribute( "alt", this.getValue() ); |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'hbox', |
||||||
|
widths: [ '50%', '50%', ], |
||||||
|
children: [ |
||||||
|
{ |
||||||
|
type: 'checkbox', |
||||||
|
id: 'use_original_image', |
||||||
|
label: 'Use original image', |
||||||
|
setup: function( element ) { |
||||||
|
this.setValue( element.getAttribute( "original_image" ) ); |
||||||
|
}, |
||||||
|
// Called by the main commitContent call on dialog confirmation.
|
||||||
|
commit: function( element ) { |
||||||
|
element.setAttribute( "original_image", this.getValue() ); |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'select', |
||||||
|
id: 'thumbnail_option', |
||||||
|
items : [ ['--- Thumbnail ---',0] ], |
||||||
|
onLoad : function() { |
||||||
|
var element_id = '#' + this.getInputElement().$.id; |
||||||
|
django.jQuery.ajax({ |
||||||
|
type: 'GET', |
||||||
|
url: '?djangocms_ckeditor_filer_thumbnail_options', |
||||||
|
contentType: 'application/json; charset=utf-8', |
||||||
|
dataType: 'json', |
||||||
|
async: false, |
||||||
|
success: function(data) { |
||||||
|
django.jQuery.each(data, function(index, item) { |
||||||
|
django.jQuery(element_id).get(0).options[django.jQuery(element_id).get(0).options.length] = new Option(item.name, item.id); |
||||||
|
}); |
||||||
|
}, |
||||||
|
error:function (xhr, ajaxOptions, thrownError){ |
||||||
|
alert(xhr.status); |
||||||
|
alert(thrownError); |
||||||
|
}
|
||||||
|
}); |
||||||
|
}, |
||||||
|
onChange: function() { |
||||||
|
getImageUrl(); |
||||||
|
}, |
||||||
|
setup: function( element ) { |
||||||
|
this.setValue( element.getAttribute( "thumb_option" ) ); |
||||||
|
}, |
||||||
|
// Called by the main commitContent call on dialog confirmation.
|
||||||
|
commit: function( element ) { |
||||||
|
element.setAttribute( "thumb_option", this.getValue() ); |
||||||
|
} |
||||||
|
}, |
||||||
|
] |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'hbox', |
||||||
|
widths: [ '50%', '50%', ], |
||||||
|
children: [ |
||||||
|
{ |
||||||
|
type: 'text', |
||||||
|
id: 'width', |
||||||
|
label: 'Width', |
||||||
|
onChange: function () { |
||||||
|
if (this.getValue() != "") { |
||||||
|
ratio = this.getValue() / imageWidth; // get ratio for scaling image
|
||||||
|
dialog.getContentElement("tab-basic", "height").setValue(Math.ceil(imageHeight * ratio)); |
||||||
|
} |
||||||
|
|
||||||
|
//getImageUrl();
|
||||||
|
}, |
||||||
|
setup: function( element ) { |
||||||
|
this.setValue( element.getAttribute( "width" ) ); |
||||||
|
}, |
||||||
|
// Called by the main commitContent call on dialog confirmation.
|
||||||
|
commit: function( element ) { |
||||||
|
element.setAttribute( "width", this.getValue() ); |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'text', |
||||||
|
id: 'height', |
||||||
|
label: 'Height', |
||||||
|
onChange: function () { |
||||||
|
getImageUrl(); |
||||||
|
}, |
||||||
|
setup: function( element ) { |
||||||
|
this.setValue( element.getAttribute( "height" ) ); |
||||||
|
}, |
||||||
|
// Called by the main commitContent call on dialog confirmation.
|
||||||
|
commit: function( element ) { |
||||||
|
element.setAttribute( "height", this.getValue() ); |
||||||
|
} |
||||||
|
}, |
||||||
|
] |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'hbox', |
||||||
|
widths: [ '33%', '33%', '33%' ], |
||||||
|
children: [ |
||||||
|
{ |
||||||
|
type: 'checkbox', |
||||||
|
id: 'crop', |
||||||
|
label: 'Crop', |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'checkbox', |
||||||
|
id: 'upscale', |
||||||
|
label: 'Upscale', |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'checkbox', |
||||||
|
id: 'use_autoscale', |
||||||
|
label: 'Autoscale', |
||||||
|
}, |
||||||
|
] |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'select', |
||||||
|
id: 'alignment', |
||||||
|
label : 'Alignment', |
||||||
|
items: [ ["left"], ["right"] ], |
||||||
|
setup: function( element ) { |
||||||
|
this.setValue( element.getAttribute( "align" ) ); |
||||||
|
}, |
||||||
|
// Called by the main commitContent call on dialog confirmation.
|
||||||
|
commit: function( element ) { |
||||||
|
element.setAttribute( "align", this.getValue() ); |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: 'checkbox', |
||||||
|
id: 'target_blank', |
||||||
|
label: 'Target blank',
|
||||||
|
}, |
||||||
|
] |
||||||
|
}, |
||||||
|
{ |
||||||
|
id: 'tab-adv', |
||||||
|
label: 'Advanced Settings', |
||||||
|
elements: [ |
||||||
|
{ |
||||||
|
type: 'text', |
||||||
|
id: 'css_style', |
||||||
|
label: 'CSS', |
||||||
|
}, |
||||||
|
] |
||||||
|
} |
||||||
|
] |
||||||
|
}; |
||||||
|
}); |
||||||
|
After Width: | Height: | Size: 3.5 KiB |
@ -0,0 +1,33 @@ |
|||||||
|
CKEDITOR.plugins.add( 'filerimage', { |
||||||
|
icons: 'filerimage', |
||||||
|
init: function( editor ) { |
||||||
|
editor.addCommand( 'filerImageDialog', new CKEDITOR.dialogCommand( 'filerImageDialog' ) ); |
||||||
|
|
||||||
|
editor.ui.addButton( 'Filer Image', { |
||||||
|
label: 'Insert filer image', |
||||||
|
command: 'filerImageDialog', |
||||||
|
toolbar: 'insert', |
||||||
|
icon: 'filerimage' |
||||||
|
}); |
||||||
|
|
||||||
|
if ( editor.contextMenu ) { |
||||||
|
editor.addMenuGroup( 'Filer' ); |
||||||
|
editor.addMenuItem( 'imageItem', { |
||||||
|
label: 'Edit image', |
||||||
|
icon: this.path + 'icons/filerimage.png', |
||||||
|
command: 'filerImageDialog', |
||||||
|
group: 'Filer' |
||||||
|
}); |
||||||
|
|
||||||
|
editor.contextMenu.addListener( function( element ) { |
||||||
|
if ( element.getAscendant( 'img', true ) ) { |
||||||
|
return { imageItem: CKEDITOR.TRISTATE_OFF }; |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
CKEDITOR.dialog.add( 'filerImageDialog', this.path + 'dialogs/filerImageDialog.js' ); |
||||||
|
|
||||||
|
var dialog = CKEDITOR.dialog.getCurrent(); |
||||||
|
} |
||||||
|
}); |
||||||
@ -0,0 +1,39 @@ |
|||||||
|
<!doctype html> |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<title>Demo a_AvanteLt</title> |
||||||
|
<style> |
||||||
|
@font-face { |
||||||
|
font-family: "a_AvanteLt"; |
||||||
|
src: url('261413575-a_AvanteLt-DemiBold.eot'); |
||||||
|
src: url('261413575-a_AvanteLt-DemiBold.eot?#iefix') format('embedded-opentype'), |
||||||
|
url('261413575-a_AvanteLt-DemiBold.svg#a_AvanteLt') format('svg'), |
||||||
|
url('261413575-a_AvanteLt-DemiBold.woff') format('woff'), |
||||||
|
url('261413575-a_AvanteLt-DemiBold.ttf') format('truetype'); |
||||||
|
font-weight: normal; |
||||||
|
font-style: normal; |
||||||
|
} |
||||||
|
body{ |
||||||
|
font-family: "a_AvanteLt"; |
||||||
|
direction: ltr; |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
|
||||||
|
<p> |
||||||
|
Ea fore firmissimum ab ubi ea illustriora. Qui nisi deserunt cohaerescant. Nam |
||||||
|
legam domesticarum o illum aliquip excepteur et mandaremus e fore litteris ut do |
||||||
|
enim tempor proident. Ullamco quis amet pariatur minim, offendit despicationes |
||||||
|
in fabulas se aut quem tempor, aut mandaremus ad quamquam. Ut velit laboris |
||||||
|
exercitation iis a te dolore sunt quorum. Quamquam philosophari ad ullamco. |
||||||
|
Veniam laboris eruditionem id id velit occaecat eu probant eram varias e duis, |
||||||
|
ut e firmissimum. |
||||||
|
</p> |
||||||
|
<hr /> |
||||||
|
Generated using the @font-face Generator at <a href="http://www.font-face-generator.com">font-face-generator.com</a> |
||||||
|
<hr /> |
||||||
|
<!-- Web Font generated by Web Font gerenator at www.font-face-generator.com --> |
||||||
|
</body> |
||||||
|
</html> |
||||||
@ -0,0 +1,39 @@ |
|||||||
|
<!doctype html> |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8"> |
||||||
|
<title>Demo a_AvanteLt</title> |
||||||
|
<style> |
||||||
|
@font-face { |
||||||
|
font-family: "a_AvanteLt"; |
||||||
|
src: url('332733155-a_AvanteLt-Light.eot'); |
||||||
|
src: url('332733155-a_AvanteLt-Light.eot?#iefix') format('embedded-opentype'), |
||||||
|
url('332733155-a_AvanteLt-Light.svg#a_AvanteLt') format('svg'), |
||||||
|
url('332733155-a_AvanteLt-Light.woff') format('woff'), |
||||||
|
url('332733155-a_AvanteLt-Light.ttf') format('truetype'); |
||||||
|
font-weight: normal; |
||||||
|
font-style: normal; |
||||||
|
} |
||||||
|
body{ |
||||||
|
font-family: "a_AvanteLt"; |
||||||
|
direction: ltr; |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
|
||||||
|
<p> |
||||||
|
Ea fore firmissimum ab ubi ea illustriora. Qui nisi deserunt cohaerescant. Nam |
||||||
|
legam domesticarum o illum aliquip excepteur et mandaremus e fore litteris ut do |
||||||
|
enim tempor proident. Ullamco quis amet pariatur minim, offendit despicationes |
||||||
|
in fabulas se aut quem tempor, aut mandaremus ad quamquam. Ut velit laboris |
||||||
|
exercitation iis a te dolore sunt quorum. Quamquam philosophari ad ullamco. |
||||||
|
Veniam laboris eruditionem id id velit occaecat eu probant eram varias e duis, |
||||||
|
ut e firmissimum. |
||||||
|
</p> |
||||||
|
<hr /> |
||||||
|
Generated using the @font-face Generator at <a href="http://www.font-face-generator.com">font-face-generator.com</a> |
||||||
|
<hr /> |
||||||
|
<!-- Web Font generated by Web Font gerenator at www.font-face-generator.com --> |
||||||
|
</body> |
||||||
|
</html> |
||||||
|
After Width: | Height: | Size: 340 KiB |
@ -0,0 +1,8 @@ |
|||||||
|
@font-face { |
||||||
|
font-family: 'MyriadProRegular'; |
||||||
|
src: url('myriadpro-regular.eot'); |
||||||
|
src: url('myriadpro-regular.eot') format('embedded-opentype'), |
||||||
|
url('myriadpro-regular.woff') format('woff'), |
||||||
|
url('myriadpro-regular.ttf') format('truetype'), |
||||||
|
url('myriadpro-regular.svg#MyriadProRegular') format('svg'); |
||||||
|
} |
||||||
|
After Width: | Height: | Size: 596 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 479 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 972 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 952 B |
|
After Width: | Height: | Size: 906 B |
|
After Width: | Height: | Size: 625 B |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 274 B |
|
After Width: | Height: | Size: 398 B |
|
After Width: | Height: | Size: 373 B |
|
After Width: | Height: | Size: 623 B |
|
After Width: | Height: | Size: 930 B |
|
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,12 @@ |
|||||||
|
{% load menu_tags %} |
||||||
|
|
||||||
|
{% for child in children %} |
||||||
|
<li class="child{% if child.selected %} selected{% endif %}{% if child.ancestor %} ancestor{% endif %}{% if child.sibling %} sibling{% endif %}{% if child.descendant %} descendant{% endif %}"> |
||||||
|
<a href="{{ child.attr.redirect_url|default:child.get_absolute_url }}">111{{ child.get_menu_title }}</a> |
||||||
|
{% if child.children %} |
||||||
|
<ul> |
||||||
|
{% show_menu from_level to_level extra_inactive extra_active template "" "" child %} |
||||||
|
</ul> |
||||||
|
{% endif %} |
||||||
|
</li> |
||||||
|
{% endfor %} |
||||||
@ -0,0 +1,12 @@ |
|||||||
|
{% load menu_tags %} |
||||||
|
|
||||||
|
{% for child in children %} |
||||||
|
<li class="child{% if child.selected %} selected{% endif %}{% if child.ancestor %} ancestor{% endif %}{% if child.sibling %} sibling{% endif %}{% if child.descendant %} descendant{% endif %}"> |
||||||
|
<a href="{{ child.attr.redirect_url|default:child.get_absolute_url }}">111{{ child.get_menu_title }}</a> |
||||||
|
{% if child.children %} |
||||||
|
<ul> |
||||||
|
{% show_menu from_level to_level extra_inactive extra_active template "" "" child %} |
||||||
|
</ul> |
||||||
|
{% endif %} |
||||||
|
</li> |
||||||
|
{% endfor %} |
||||||
@ -0,0 +1,49 @@ |
|||||||
|
{% load menu_tags %} |
||||||
|
|
||||||
|
{% url 'docs_invoice_list' as url_invoice_list %} |
||||||
|
{% url 'docs_faktura_list' as url_faktura_list %} |
||||||
|
{% url 'docs_nakladn_list' as url_nakladn_list %} |
||||||
|
{% url 'docs_aktrabot_list' as url_aktrabot_list %} |
||||||
|
{% url 'docs_platejka_list' as url_platejka_list %} |
||||||
|
{% url 'docs_dover_list' as url_dover_list %} |
||||||
|
{% url 'docs_aktsverki_list' as url_aktsverki_list %} |
||||||
|
|
||||||
|
{% url 'customer_profile_view' as customer_profile_view %} |
||||||
|
{% url 'customer_clients_list' as customer_clients_list %} |
||||||
|
|
||||||
|
{% if user.is_anonymous %} |
||||||
|
{% for child in children|slice:":4" %} |
||||||
|
<li class="child{% if child.selected %} selected{% endif %}{% if child.ancestor %} ancestor{% endif %}{% if child.sibling %} sibling{% endif %}{% if child.descendant %} descendant{% endif %}"> |
||||||
|
<a href="{{ child.attr.redirect_url|default:child.get_absolute_url }}">{{ child.get_menu_title }}</a> |
||||||
|
{% if child.children %} |
||||||
|
<ul> |
||||||
|
{% show_menu from_level to_level extra_inactive extra_active template "" "" child %} |
||||||
|
</ul> |
||||||
|
{% endif %} |
||||||
|
</li> |
||||||
|
{% endfor %} |
||||||
|
{% else %} |
||||||
|
<li class="child{% if request.path == url_invoice_list %} selected{% endif %}"> |
||||||
|
<a href="{{ url_invoice_list }}">СЧЕТА</a> |
||||||
|
</li> |
||||||
|
<li class="child{% if request.path == url_aktrabot_list %} selected{% endif %}"> |
||||||
|
<a href="{{ url_aktrabot_list }}">АКТЫ ВЫПОЛНЕННЫХ РАБОТ</a> |
||||||
|
</li> |
||||||
|
<li class="child{% if request.path == url_faktura_list %} selected{% endif %}"> |
||||||
|
<a href="{{ url_faktura_list }}">СЧЕТА-ФАКТУРЫ</a> |
||||||
|
</li> |
||||||
|
{% endif %} |
||||||
|
<li class=""> |
||||||
|
<a href="#">Другие документы</a> |
||||||
|
{% if child.children %} |
||||||
|
<ul> |
||||||
|
{% show_menu from_level to_level extra_inactive extra_active template "" "" child %} |
||||||
|
</ul> |
||||||
|
{% endif %} |
||||||
|
</li> |
||||||
|
<li class="yellow child{% if request.path == customer_profile_view %} selected{% endif %}"> |
||||||
|
<a href="{{ customer_profile_view }}">МОИ РЕКВИЗИТЫ</a> |
||||||
|
</li> |
||||||
|
<li class="yellow child{% if request.path == customer_clients_list %} selected{% endif %}"> |
||||||
|
<a href="{{ customer_clients_list }}">МОИ КОНТРАГЕНТЫ</a> |
||||||
|
</li> |
||||||