Revision 52abca01

b/cloudcms/admin.py
37 37

  
38 38

  
39 39
class ApplicationAdmin(admin.ModelAdmin):
40
    raw_id_fields = ('logo', )
40
    raw_id_fields = ('logo', 'favicon')
41 41

  
42 42

  
43 43
admin.site.register(models.Application, ApplicationAdmin)
b/cloudcms/migrations/0005_auto__add_field_application_favicon.py
1
# encoding: utf-8
2
import datetime
3
from south.db import db
4
from south.v2 import SchemaMigration
5
from django.db import models
6

  
7
class Migration(SchemaMigration):
8
    
9
    def forwards(self, orm):
10
        
11
        # Adding field 'Application.favicon'
12
        db.add_column('cloudcms_application', 'favicon', self.gf('feincms.module.medialibrary.fields.MediaFileForeignKey')(blank=True, related_name='as_favicon', null=True, to=orm['medialibrary.MediaFile']), keep_default=False)
13
    
14
    
15
    def backwards(self, orm):
16
        
17
        # Deleting field 'Application.favicon'
18
        db.delete_column('cloudcms_application', 'favicon_id')
19
    
20
    
21
    models = {
22
        'cloudcms.application': {
23
            'Meta': {'object_name': 'Application'},
24
            'app_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
25
            'code': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
26
            'extra_styles': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
27
            'facebook_username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
28
            'favicon': ('feincms.module.medialibrary.fields.MediaFileForeignKey', [], {'blank': 'True', 'related_name': "'as_favicon'", 'null': 'True', 'to': "orm['medialibrary.MediaFile']"}),
29
            'footer_bottom': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
30
            'footer_top': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
31
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
32
            'index_url': ('django.db.models.fields.CharField', [], {'default': "'/'", 'max_length': '255'}),
33
            'linked_in_username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
34
            'logo': ('feincms.module.medialibrary.fields.MediaFileForeignKey', [], {'to': "orm['medialibrary.MediaFile']", 'null': 'True', 'blank': 'True'}),
35
            'show_twitter_feed_on_top': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
36
            'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
37
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
38
            'twitter_username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'})
39
        },
40
        'medialibrary.category': {
41
            'Meta': {'object_name': 'Category'},
42
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
43
            'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['medialibrary.Category']"}),
44
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '150', 'db_index': 'True'}),
45
            'title': ('django.db.models.fields.CharField', [], {'max_length': '200'})
46
        },
47
        'medialibrary.mediafile': {
48
            'Meta': {'object_name': 'MediaFile'},
49
            'categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['medialibrary.Category']", 'null': 'True', 'blank': 'True'}),
50
            'copyright': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
51
            'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
52
            'file': ('django.db.models.fields.files.FileField', [], {'max_length': '255'}),
53
            'file_size': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
54
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
55
            'type': ('django.db.models.fields.CharField', [], {'max_length': '12'})
56
        },
57
        'sites.site': {
58
            'Meta': {'object_name': 'Site', 'db_table': "'django_site'"},
59
            'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
60
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
61
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
62
        }
63
    }
64
    
65
    complete_apps = ['cloudcms']
b/cloudcms/models.py
49 49
            help_text="The title of the application")
50 50

  
51 51
    logo = MediaFileForeignKey(MediaFile, blank=True, null=True)
52
    favicon = MediaFileForeignKey(MediaFile, blank=True, null=True,
53
            related_name="as_favicon")
52 54
    site = models.ForeignKey(sites_models.Site)
53 55
    app_url = models.URLField(help_text="The url of the application UI (not "\
54 56
            "the cms", verify_exists=False, blank=True, null=True)
b/cloudcms/templates/cms/base.html
27 27
  {% endblock %}
28 28
  
29 29
  {% block favicons %}
30
  <link rel="shortcut icon" href="">
31
  <link rel="apple-touch-icon" href="">
30
  <link rel="shortcut icon" href="{{ APP.favicon.get_absolute_url }}">
31
  <link rel="apple-touch-icon" href="{{ APP.favicon.get_absolute_url }}">
32 32
  {% endblock favicons %}
33 33

  
34 34
  {% block css %}

Also available in: Unified diff