Commit 6bd27a08 authored by Nicolas Ballet's avatar Nicolas Ballet
Browse files

Merged

parents 239ff2c9 9ba3fc31
Pipeline #1683 canceled with stages
env/
/static
__pycache__
gala/settings.py
/media
/scripts
.DS_Store
db.sqlite3
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-06 20:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='page',
options={'ordering': ('order',)},
),
migrations.AddField(
model_name='page',
name='order',
field=models.PositiveIntegerField(db_index=True, default=0, editable=False),
preserve_default=False,
),
]
from django.db import models
from ordered_model.models import OrderedModel
from blog.snippets import SlugUnique
from django.core.urlresolvers import reverse
from markdownx.models import MarkdownxField
class Article(models.Model):
"""Classe article"""
title = models.CharField(max_length=100, verbose_name="Titre")
slug = models.SlugField(unique=True, max_length=150, editable=False)
content = MarkdownxField(verbose_name="Contenu")
published = models.BooleanField(default=False, verbose_name="Publication")
date = models.DateTimeField(auto_now_add=True, auto_now=False,
verbose_name="Date de parution")
def __str__(self):
return self.title
def save(self, *args, **kwargs):
SlugUnique.unique_slugify(self, self.title)
super(Article, self).save(*args, **kwargs)
def get_absolute_url(self):
return reverse('article', args=[self.slug])
class Page(OrderedModel):
"""Page standart"""
title = models.CharField(max_length=100, verbose_name="Titre")
slug = models.SlugField(unique=True, max_length=150, editable=False)
content = MarkdownxField(verbose_name="Contenu")
published = models.BooleanField(default=False, verbose_name="Publication")
date = models.DateTimeField(auto_now_add=True, auto_now=False,
verbose_name="Date de parution")
class Meta(OrderedModel.Meta):
ordering = ('order',)
def __str__(self):
return self.title
def save(self, *args, **kwargs):
SlugUnique.unique_slugify(self, self.title)
super(Page, self).save(*args, **kwargs)
def get_absolute_url(self):
return reverse('page', args=[self.slug])
......@@ -5,5 +5,4 @@
<br><br>
<h2 class="titre-principal">{{article.title}}</h2>
<article>{{article.content|markdown:"trusted"}}</article>
{% endblock %}
<div class="navbar navbar-default" id="footer">
<div class="container-fluid">
<div class="container">
<p class="navbar-text">Copyright © Bartuccio Antoine 2016 – Tous droits réservés</p>
<p class="navbar-text"></p>
</div>
</div>
</div>
\ No newline at end of file
<div class="row">
<!--<div class="row">
<div class="col-md-offset-2 col-md-8 col-md-offset-2">
<a target="_blank" href="https://www.youtube.com/channel/UCCovZ5tiZnfAwkR-NP7uBmw" rel="nofollow">
<div class="socialBloc youtube">
<div align="center" class="row">
<i class="fa fa-youtube fa-2x"></i>
</div>
</div>
</a>
</div>
</div>-->
{# <div class="row"> #}
{# <div class="col-md-offset-2 col-md-8 col-md-offset-2"> #}
<a target="_blank" href="https://twitter.com/ConvTroll" rel="nofollow">
<div class="socialBloc twitter">
<div align="center" class="row">
<i class="fa fa-twitter fa-2x"></i>
</div>
</div>
</a>
{# </div> #}
{# </div> #}
{# <div class="row"> #}
{# <div class="col-md-offset-2 col-md-8 col-md-offset-2"> #}
<a target="_blank" href="https://www.facebook.com/convTroll" rel="nofollow">
<div class="socialBloc facebook">
<div align="center" class="row">
<i class="fa fa-facebook fa-2x"></i>
</div>
</div>
</a>
{# </div> #}
{# </div> #}
</div>
\ No newline at end of file
"""
Django settings for gala project.
Generated by 'django-admin startproject' using Django 1.9.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
import re
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'ap@otw(elp&dv_ya(5uhlzj9j8pynx*^8y2ds)2&d3jv589(4x'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'blog',
'markdownx',
'markdown_deux',
'ordered_model',
]
MIDDLEWARE_CLASSES = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'gala.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(BASE_DIR, 'templates'),
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'gala.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/
LANGUAGE_CODE = 'fr-FR'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/
STATIC_URL = '/gala/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
MEDIA_URL = '/gala/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
from markdown_deux.conf.settings import MARKDOWN_DEUX_DEFAULT_STYLE
MARKDOWN_DEUX_STYLES = {
"default": MARKDOWN_DEUX_DEFAULT_STYLE,
"trusted": {
"extras": {
"code-friendly": None,
},
# Allow raw HTML (WARNING: don't use this for user-generated
# Markdown for your site!).
"safe_mode": False,
},
# Here is what http://code.activestate.com/recipes/ currently uses.
"recipe": {
"extras": {
"code-friendly": None,
},
"safe_mode": "escape",
"link_patterns": [
# Transform "Recipe 123" in a link.
(re.compile(r"recipe\s+#?(\d+)\b", re.I),
r"http://code.activestate.com/recipes/\1/"),
],
"extras": {
"code-friendly": None,
"pyshell": None,
"demote-headers": 3,
"link-patterns": None,
# `class` attribute put on `pre` tags to enable using
# <http://code.google.com/p/google-code-prettify/> for syntax
# highlighting.
"html-classes": {"pre": "prettyprint"},
"cuddled-lists": None,
"footnotes": None,
"header-ids": None,
},
"safe_mode": "escape",
}
}
# Markdownify
MARKDOWNX_MARKDOWNIFY_FUNCTION = 'markdownx.utils.markdownify' # Default function that compiles markdown using defined extensions. Using custom function can allow you to pre-process or post-process markdown text. See below for more info.
# Markdown extensions
MARKDOWNX_MARKDOWN_EXTENSIONS = [
'markdown.extensions.extra',
'markdown.extensions.nl2br',
'markdown.extensions.smarty',
]
MARKDOWNX_MARKDOWN_EXTENSION_CONFIGS = {} # Configuration object for used markdown extensions
# Markdown urls
MARKDOWNX_URLS_PATH = '/markdownx/markdownify/' # URL that returns compiled markdown text.
MARKDOWNX_UPLOAD_URLS_PATH = '/markdownx/upload/' # URL that accepts file uploads, returns markdown notation of the image.
# Media path
MARKDOWNX_MEDIA_PATH = 'markdownx/' # Path, where images will be stored in MEDIA_ROOT folder
# Image
MARKDOWNX_UPLOAD_MAX_SIZE = 52428800 # 50MB - maximum file size
MARKDOWNX_UPLOAD_CONTENT_TYPES = ['image/jpeg', 'image/png'] # Acceptable file content types
MARKDOWNX_IMAGE_MAX_SIZE = {'size': (500, 500), 'quality': 90,} # Different options describing final image processing: size, compression etc. See below for more info.
# Editor
MARKDOWNX_EDITOR_RESIZABLE = True # Update editor's height to inner content height while typing
\ No newline at end of file
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gala.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
{% load staticfiles %}
{% load set_var %}
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title> XXIIIe Convention du Troll Penché</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link href="{% static "blog/css/base.css" %}" rel="stylesheet">
<link href="{% static "blog/css/nav.css" %}" rel="stylesheet">
<script src="https://use.fontawesome.com/e7e3959afc.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
</head>
<body>
<div class="row">
<div class="col-xs-1 col-md-3 col-lg-3">
<div class="hidden-xs hidden-sm hidden-md">
<img class="img-responsive logo" id="logo-mini" src="{% static "blog/img/troll.png"%}">
</div>
</div>
<div class = "col-xs-12 col-md-6 col-lg-6 main-title">
<h1><em>Convention du Troll Penché</em></h1>
</div>
<div class="col-xs-10 col-md-3 col-lg-3">
{# Bannière #}
<div class="row-fluid hidden-lg">
<img class="img-responsive logo" id="logo-mobile" src="{% static "blog/img/troll.png"%}">
</div>
<div class="visible-lg-inline">
{# <img class="img-responsive logo" src="{% static "blog/img/banderole.jpg" %}"> #}
</div>
</div>
</div>
<div class="row">
{# Liens sociaux desktop #}
<div class="col-md-1 col-sm-1">
{# <div class="hidden-sm hidden-xs"> #}
{# <div class="social-mini"> #}
{# {% include "blog/media.html" %} #}
{# </div> #}
{# </div> #}
</div>
{# contenu #}
<div class="col-xs-offset-1 col-sm-offset-0 col-md-10 col-xs-10">
<div class="container-fluid content">
<div class="row">
{% include "blog/nav.html" %}
</div>
<div class="row-fluid" id="content">
{% block body %}
{% endblock %}
</div>
<br><br>
<div class="row credit">
{% include "blog/credits.html" %}
</div>
</div>
{# Liens sociaux mobile #}
<div class="container-fluid social-mobile">
<br>
{% include "blog/media.html" %}
</div>
</div>
</div>
<footer>
<script
src="https://code.jquery.com/jquery-2.2.4.min.js"
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous">
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous">
</script>
</footer>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment