formulario de registro

parent de0c463e
......@@ -42,6 +42,7 @@ INSTALLED_APPS = [
'catalog.apps.CatalogConfig',
'reports.apps.ReportsConfig',
'mail.apps.MailConfig',
'administration.apps.AdministrationConfig',
'django_extensions',
]
......
......@@ -29,5 +29,6 @@ urlpatterns = [
url(r'^accounts/', include('django.contrib.auth.urls')),
#url(r'^accounts/', include('registration')),
url(r'^mail/', include('mail.urls')),
url(r'^administration/', include('administration.urls')),
]
# + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class AdministrationConfig(AppConfig):
name = 'administration'
from django.db import models
# Create your models here.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
body
{
background-color:White;
}
.next{
padding: 0px;
padding-top: 50%;
cursor: pointer;
font-size: 20px;
}
.prev{
padding-left: 20px;
padding-top: 50%;
cursor: pointer;
font-size: 20px;
}
$(document).ready(function () {
$('#example').DataTable
({
language:
{
"sProcessing": "Procesando...",
"sLengthMenu": "Mostrar _MENU_ registros",
"sZeroRecords": "No se encontraron resultados",
"sEmptyTable": "Ningún dato disponible en esta tabla",
"sInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros",
"sInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros",
"sInfoFiltered": "(filtrado de un total de _MAX_ registros)",
"sInfoPostFix": "",
"sSearch": "Buscar:",
"sUrl": "",
"sInfoThousands": ",",
"sLoadingRecords": "Cargando...",
"oPaginate":
{
"sFirst": "Primero",
"sLast": "Último",
"sNext": "Siguiente",
"sPrevious": "Anterior"
},
"oAria":
{
"sSortAscending": ": Activar para ordenar la columna de manera ascendente",
"sSortDescending": ": Activar para ordenar la columna de manera descendente"
}
},
responsive:
{
details:
{
type: 'column',
target: 'tr'
}
},
columnDefs:
[{
className: 'control',
orderable: false,
targets: 0
}],
order: [1, 'asc']
});
});
This diff is collapsed.
from django.test import TestCase
# Create your tests here.
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.Request, name='Dashboard'),
url(r'^update/$', views.update_user, name='update'),
]
\ No newline at end of file
from django.contrib import messages
from django.contrib.auth.models import User
from django.shortcuts import render, redirect
import json
from django.http import HttpResponse, HttpResponseRedirect
# Create your views here.
def Request (request):
if request.user.is_superuser or request.user.is_staff:
user_list = []
for user in User.objects.filter(is_active=False):
user_list.append({
"user_id": user.id,
"username": user.username,
"first_name": user.first_name,
"last_name": user.last_name,
"email": user.email,
"status": user.is_active,
"staff": user.is_staff,
"superuser": user.is_superuser,
})
#messages.success(request, 'your registration is being processed')
return render(request,'dashboard.html',{'users': user_list})
else:
return redirect('../')
#------------------------------------------------------------------------
def update_user(request):
is_active = False
is_staff = False
is_superuser = False
if request.POST.get('is_active') == '1':
is_active = True
if request.POST.get('is_staff') == '1':
is_staff = True
if request.POST.get('is_superuser') == '1':
is_superuser = True
user = User.objects.get(pk=request.POST.get('user_id'))
user.is_active = is_active
user.is_staff = is_staff
user.is_superuser = is_superuser
user.save()
messages.success(request, 'the user was updated')
return HttpResponseRedirect('../')
\ No newline at end of file
......@@ -35,7 +35,8 @@
<!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"><b>G</b>eo</span>
<!-- logo for regular state and mobile devices -->
<span class="logo-lg"><b>Geo</b>int</span>
<span class="logo-lg"><b>Geo</b>int : <b>Rep</b>Sat</span>
</a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top">
......
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