now shared components are in an application

now var components are in shared
installing widget_tweaks
This commit is contained in:
Qwann 2017-02-21 11:07:36 +01:00
parent d0620a6bf8
commit 6be19a463c
75 changed files with 68 additions and 43 deletions

View file

@ -35,6 +35,7 @@ INSTALLED_APPS = [
'equipment.apps.EquipmentConfig',
'event.apps.EventConfig',
'user.apps.UserConfig',
'shared.apps.SharedConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
@ -43,6 +44,7 @@ INSTALLED_APPS = [
'django.contrib.staticfiles',
'bootstrapform',
'debug_toolbar',
'widget_tweaks',
]
MIDDLEWARE_CLASSES = [
@ -60,13 +62,13 @@ MIDDLEWARE_CLASSES = [
ROOT_URLCONF = 'evenementiel.urls'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'var/static/'),
os.path.join(BASE_DIR, 'shared/static/'),
]
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ["var/templates/", ],
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
@ -74,7 +76,7 @@ TEMPLATES = [
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'var.shared.context_processor',
'shared.shared.context_processor',
],
},
},

View file

@ -0,0 +1,25 @@
{% extends "base.html" %}
{% block sidenav %}
<div class="centered">
<h5 class="centered banner-text">La Nuit 2017</h5>
</div>
<li>
<a href="index.html">
<i class="fa fa-dashboard"></i>
<span>Looool</span>
</a>
</li>
<li class="sub-menu">
<a href="javascript:;" >
<i class="fa fa-desktop"></i>
<span>Prout</span>
</a>
<ul class="sub">
<li><a href="general.html">Lolilol</a></li>
<li><a href="buttons.html">Lorem</a></li>
<li><a href="panels.html">Ipsum</a></li>
</ul>
</li>
{% endblock %}

View file

@ -2,3 +2,4 @@ Django==1.10
Pillow==3.3.0
psycopg2==2.6.2
django-bootstrap-form==3.2.1
django-widget-tweaks

0
shared/__init__.py Normal file
View file

3
shared/admin.py Normal file
View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

5
shared/apps.py Normal file
View file

@ -0,0 +1,5 @@
from django.apps import AppConfig
class SharedConfig(AppConfig):
name = 'shared'

View file

3
shared/models.py Normal file
View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View file

Before

Width:  |  Height:  |  Size: 382 KiB

After

Width:  |  Height:  |  Size: 382 KiB

3
shared/tests.py Normal file
View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
shared/views.py Normal file
View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View file

@ -23,7 +23,7 @@
{% endif %}
{% if user.is_authenticated %}
<li>
<a href="index.html">
<a href="{% url "user:password_change" %}">
<i class="fa fa-dashboard"></i>
<span>Changer de mot de passe</span>
</a>

View file

@ -1,15 +1,18 @@
{% extends "user/base_user.html" %}
{% load widget_tweaks %}
{% load bootstrap %}
{% block page_title %}{{ page_title }}{% endblock %}
{% block content %}
<!-- BASIC FORM ELELEMNTS -->
<div class="row mt">
<div class="col-lg-12">
<div class="row">
<div class="col-lg-12">
<div class="form-panel">
<h4 class="mb"><i class="fa fa-angle-right"></i> Form Elements</h4>
<form class="form-horizontal style-form" method="get">
<h4 class="mb"><i class="fa fa-angle-right"></i> Formulaire</h4>
<form class="form-horizontal style-form" method="post" action="{%block action_name%}{%endblock%}">
{% csrf_token %}
<fieldset>
{% for field in form %}
{% if field.errors %}
<div class="form-group error">
@ -23,7 +26,7 @@
{% else %}
<div class="form-group">
<label class="col-sm-2 control-label">{{ field.label }}</label>
<div class="col-sm-10 controls">{{ field | add_class:"form-control" }}
<div class="col-sm-10 controls">{{ field | attr:"class:form-control" }}
{% if field.help_text %}
<p class="help-inline"><small>{{ field.help_text }}</small></p>
{% endif %}
@ -31,43 +34,20 @@
</div>
{% endif %}
{% endfor %}
<div class="form-group">
<label class="col-sm-2 col-sm-2 control-label">Default</label>
<div class="col-sm-10">
<input type="text" class="form-control">
</fieldset>
<div class="form-action">
<div class=text-right>
<button type="submit" class="btn btn-theme">
{{ button }}
</button>
</div>
{% block extra_form_input %}{% endblock %}
</div>
</form>
</div>
</div><!-- col-lg-12-->
</div><!-- col-lg-12-->
</div><!-- /row -->
<div class="row mt">
<div class="col-lg-12">
<div class="form-panel">
{% if form.errors %}
<p class="text-danger">{% block user_error %}{% endblock %}</p>
{% endif %}
<form class="form-horizontal style-form" method="post" action="{%block action_name%}{%endblock%}">
{% csrf_token %}
<fieldset>
{% for field in form %}
{{ field | bootstrap }}
{% endfor %}
</fieldset>
<div class="form-action">
<button type="submit" class="btn btn-primary pull-right">
{{ button }}
</button>
{% block extra_form_input %}{% endblock %}
</div>
</form>
</div>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
/* Met le focus sur le premier champ input

View file

@ -47,7 +47,7 @@ urlpatterns = [
'subject_template_name': 'subject_password_reset.txt',
'post_reset_redirect': reverse_lazy('user:password_reset_done'),
'extra_context': {
'page_title': 'Demande de nouveau mot de passe',
'page_title': 'Demander un nouveau mot de passe',
'button': 'Envoyer'
},
},

View file

@ -11,5 +11,5 @@ class CreateUser(SuccessMessageMixin, CreateView):
def get_context_data(self, **kwargs):
ctx = super(CreateUser, self).get_context_data(**kwargs)
ctx['button'] = 'Créer'
ctx['sec_title'] = "Création d'utilisateur"
ctx['page_title'] = "Création d'utilisateur"
return ctx