]> git.parisson.com Git - mezzo.git/commitdiff
begin organization models, fix gulp dir config, fix doc
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 4 Jul 2016 10:05:35 +0000 (12:05 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 4 Jul 2016 10:05:35 +0000 (12:05 +0200)
README.rst
app/organization/migrations/0001_initial.py [new file with mode: 0644]
app/organization/models.py
gulpfile.js

index 02fc06f732ba7abd102c16decc14775209d28386..9a1b487c030c93ab88e008693fffa916c9ef4258 100644 (file)
@@ -10,9 +10,9 @@ Install
 
 For easier development and production workflow, it has been dockerized including Django, Mezzanine, MariaDB and Nginx.
 
-On Linux, first install `Git <http://git-scm.com/downloads>`_, `Docker engine <https://docs.docker.com/installation/>`_ and `docker-compose <https://docs.docker.com/compose/install/>`_ and open a terminal.
+On Linux, first install Git_, Docker-engine_ and docker-compose_ and open a terminal.
 
-On MacOSX or Windows install the `Docker Toolbox <https://www.docker.com/products/docker-toolbox>`_ and open a Docker Quickstart Terminal.
+On MacOSX or Windows install the Docker-Toolbox_ and open a Docker Quickstart Terminal.
 
 Then run these commands::
 
@@ -65,29 +65,30 @@ Work with gulp
 Gulp allow to compile scss to css, concatenate js files and has a watcher, who do this tasks on file change.
 Gulp require nodejs installed on your computer to work.
 
-- 1. Install gulp globally:
-__If you have previously installed a version of gulp globally, please run `npm rm --global gulp`
-to make sure your old version doesn't collide with gulp-cli.__
+1. Install gulp globally:
 
-```
-$ npm install --global gulp-cli
-```
+  If you have previously installed a version of gulp globally, please run `npm rm --global gulp`
+  to make sure your old version doesn't collide with gulp-cli::
 
-- 2. Install gulp dependancies
+    npm install --global gulp-cli
 
-```
-$ npm install
-```
+2. Install gulp dependancies::
 
-- 3. Run gulp:
+    npm install
+
+3. Run gulp::
+
+    gulp [task]
 
-```sh
-$ gulp [task]
-```
 
 Paths
-============
+======
 
 - `app/templates` : Main templates
 - `app/festival/templates` : Personal templates
 - `app/festival/static` : Static files
+
+.. _Git: http://git-scm.com/downloads
+.. _Docker-engine: https://docs.docker.com/installation/
+.. _docker-compose: https://docs.docker.com/compose/install/
+.. _Docker-Toolbox: https://www.docker.com/products/docker-toolbox
diff --git a/app/organization/migrations/0001_initial.py b/app/organization/migrations/0001_initial.py
new file mode 100644 (file)
index 0000000..5c77c28
--- /dev/null
@@ -0,0 +1,168 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-07-04 10:05
+from __future__ import unicode_literals
+
+from django.conf import settings
+from django.db import migrations, models
+import django.db.models.deletion
+import mezzanine.core.fields
+import mezzanine.utils.models
+
+
+class Migration(migrations.Migration):
+
+    initial = True
+
+    dependencies = [
+        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+        ('sites', '0002_alter_domain_unique'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Activity',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('date_begin', models.DateField(blank=True, null=True, verbose_name='begin date')),
+                ('date_end', models.DateField(blank=True, null=True, verbose_name='end date')),
+                ('role', models.CharField(blank=True, max_length=512, verbose_name='role')),
+                ('work', models.TextField(blank=True, verbose_name='work')),
+            ],
+        ),
+        migrations.CreateModel(
+            name='Department',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('name', models.CharField(max_length=512, verbose_name='name')),
+                ('description', models.TextField(blank=True, verbose_name='description')),
+                ('domain', models.CharField(blank=True, max_length=255, verbose_name='domain')),
+                ('weaving_class', models.CharField(blank=True, max_length=64, verbose_name='weaving class')),
+            ],
+            options={
+                'verbose_name': 'department',
+            },
+        ),
+        migrations.CreateModel(
+            name='Link',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('url', models.URLField(verbose_name='URL')),
+            ],
+        ),
+        migrations.CreateModel(
+            name='LinkType',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('name', models.CharField(max_length=256, verbose_name='Name')),
+                ('slug', models.SlugField(blank=True, help_text='Use this field to define a simple identifier that can be used to style the different link types (i.e. assign social media icons to them)', max_length=256, verbose_name='Slug')),
+                ('ordering', models.PositiveIntegerField(blank=True, null=True, verbose_name='Ordering')),
+            ],
+            options={
+                'ordering': ['ordering'],
+            },
+        ),
+        migrations.CreateModel(
+            name='Organization',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('name', models.CharField(max_length=512, verbose_name='name')),
+                ('description', models.TextField(blank=True, verbose_name='description')),
+                ('address', models.TextField(blank=True, verbose_name='description')),
+                ('postalcode', models.CharField(blank=True, max_length=16, verbose_name='domain')),
+                ('country', models.CharField(blank=True, max_length=255, verbose_name='domain')),
+                ('url', models.URLField(blank=True, max_length=512, verbose_name='URL')),
+            ],
+            options={
+                'verbose_name': 'organization',
+            },
+        ),
+        migrations.CreateModel(
+            name='OrganizationType',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('type', models.CharField(max_length=255, verbose_name='type')),
+            ],
+            options={
+                'verbose_name': 'organization type',
+            },
+        ),
+        migrations.CreateModel(
+            name='Person',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('keywords_string', models.CharField(blank=True, editable=False, max_length=500)),
+                ('title', models.CharField(max_length=500, verbose_name='Title')),
+                ('slug', models.CharField(blank=True, help_text='Leave blank to have the URL auto-generated from the title.', max_length=2000, null=True, verbose_name='URL')),
+                ('_meta_title', models.CharField(blank=True, help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title')),
+                ('description', models.TextField(blank=True, verbose_name='Description')),
+                ('gen_description', models.BooleanField(default=True, help_text='If checked, the description will be automatically generated from content. Uncheck if you want to manually set a custom description.', verbose_name='Generate description')),
+                ('created', models.DateTimeField(editable=False, null=True)),
+                ('updated', models.DateTimeField(editable=False, null=True)),
+                ('status', models.IntegerField(choices=[(1, 'Draft'), (2, 'Published')], default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status')),
+                ('publish_date', models.DateTimeField(blank=True, db_index=True, help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from')),
+                ('expiry_date', models.DateTimeField(blank=True, help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on')),
+                ('short_url', models.URLField(blank=True, null=True)),
+                ('in_sitemap', models.BooleanField(default=True, verbose_name='Show in sitemap')),
+                ('content', mezzanine.core.fields.RichTextField(verbose_name='Content')),
+                ('person_title', models.CharField(blank=True, choices=[('Dr', 'Dr'), ('Prof', 'Prof'), ('Prof Dr', 'Prof Dr')], max_length=16, verbose_name='title')),
+                ('first_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='first name')),
+                ('last_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='last name')),
+                ('bio', mezzanine.core.fields.RichTextField(blank=True, verbose_name='biography')),
+                ('photo', mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='photo')),
+                ('photo_credits', models.CharField(blank=True, max_length=255, null=True, verbose_name='photo credits')),
+                ('photo_alignment', models.CharField(blank=True, choices=[('left', 'left'), ('right', 'right')], default='left', max_length=32, verbose_name='photo alignment')),
+                ('photo_description', models.TextField(blank=True, verbose_name='photo description')),
+                ('photo_featured', mezzanine.core.fields.FileField(blank=True, max_length=1024, verbose_name='photo featured')),
+                ('photo_featured_credits', models.CharField(blank=True, max_length=255, null=True, verbose_name='photo featured credits')),
+                ('organization', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='organization.Organization', verbose_name='organization')),
+                ('site', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to='sites.Site')),
+                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='user')),
+            ],
+            options={
+                'abstract': False,
+            },
+            bases=(models.Model, mezzanine.utils.models.AdminThumbMixin),
+        ),
+        migrations.CreateModel(
+            name='Team',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('name', models.CharField(max_length=512, verbose_name='name')),
+                ('description', models.TextField(blank=True, verbose_name='description')),
+                ('department', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='organization.Department', verbose_name='department')),
+            ],
+            options={
+                'abstract': False,
+            },
+        ),
+        migrations.AddField(
+            model_name='organization',
+            name='organization_type',
+            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='organization.OrganizationType', verbose_name='organization type'),
+        ),
+        migrations.AddField(
+            model_name='link',
+            name='link_type',
+            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organization.LinkType', verbose_name='Link type'),
+        ),
+        migrations.AddField(
+            model_name='link',
+            name='person',
+            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organization.Person', verbose_name='Person'),
+        ),
+        migrations.AddField(
+            model_name='department',
+            name='organization',
+            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organization.Organization', verbose_name='organization'),
+        ),
+        migrations.AddField(
+            model_name='activity',
+            name='person',
+            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='organization.Person', verbose_name='person'),
+        ),
+        migrations.AddField(
+            model_name='activity',
+            name='teams',
+            field=models.ManyToManyField(to='organization.Team', verbose_name='teams'),
+        ),
+    ]
index cb75a72ecbbdb3ef068c5b8285fbab1601f68e24..baf62e8adf00f3ac72a8a20b7e41ca97920a6f8f 100644 (file)
@@ -58,9 +58,11 @@ class BaseNameModel(models.Model):
 class Organization(BaseNameModel):
     """(Organization description)"""
 
-    address = models.TextField(_('description'), blank=True)
-    domain = models.CharField(_('domain'), max_length=255, blank=True)
     organization_type = models.ForeignKey('OrganizationType', verbose_name=_('organization type'), blank=True, null=True, on_delete=models.SET_NULL)
+    address = models.TextField(_('description'), blank=True)
+    postalcode = models.CharField(_('domain'), max_length=16, blank=True)
+    country = models.CharField(_('domain'), max_length=255, blank=True)
+    url = models.URLField(_('URL'), max_length=512, blank=True)
 
     def __unicode__(self):
         return self.name
@@ -86,6 +88,7 @@ class Department(BaseNameModel):
 
     organization = models.ForeignKey('Organization', verbose_name=_('organization'))
     domain = models.CharField(_('domain'), max_length=255, blank=True)
+    weaving_class = models.CharField(_('weaving class'), max_length=64, blank=True)
 
     def __unicode__(self):
         return self.name
@@ -107,7 +110,7 @@ class Person(Displayable, RichText, AdminThumbMixin):
     """(Person description)"""
 
     user = models.ForeignKey(User, verbose_name=_('user'), blank=True, null=True, on_delete=models.SET_NULL)
-    person_title = models.CharField(_('Title'), max_length=16, choices=TITLE_CHOICES, blank=True)
+    person_title = models.CharField(_('title'), max_length=16, choices=TITLE_CHOICES, blank=True)
     first_name = models.CharField(_('first name'), max_length=255, blank=True, null=True)
     last_name = models.CharField(_('last name'), max_length=255, blank=True, null=True)
     organization = models.ForeignKey('Organization', verbose_name=_('organization'), blank=True, null=True, on_delete=models.SET_NULL)
@@ -143,7 +146,7 @@ class LinkType(models.Model):
       special order.
     """
 
-    name=models.CharField(max_length=256, verbose_name=_('Name'))
+    name = models.CharField(max_length=256, verbose_name=_('Name'))
     slug = models.SlugField(max_length=256, verbose_name=_('Slug'), help_text=_(
             'Use this field to define a simple identifier that can be used'
             ' to style the different link types (i.e. assign social media'
index 34f8e4bd0f04963e5c9f5f8fe68ede5080859ec0..e687c1ddb7aa5aad0e9c60ee13838e728a748e16 100644 (file)
@@ -16,14 +16,12 @@ var gulp         = require('gulp');
 /**
  * Paths
  */
-var scssSrc = 'app/festival/static/scss/',
-    jsSrc   = 'app/festival/static/js/',
-    cssDist = 'app/festival/static/css/',
+var scssSrc = 'app/static/scss/',
+    jsSrc   = 'app/static/js/',
+    cssDist = 'app/static/css/',
     cssDjango = 'data/static/css/';
 
 
-
-
 /**
  * Environnement
  */
@@ -110,4 +108,4 @@ gulp.task('default', ['css', 'jsLibs'], function () {
 // Build tasks
 gulp.task( "build", [ 'envProduction', 'css'], function () {
     console.log("Build complete !");
-});
\ No newline at end of file
+});