carga a git
This commit is contained in:
2025-04-10 02:16:51 -06:00
parent 5d6ca7ca2b
commit 1054783d6a
304 changed files with 112800 additions and 0 deletions

BIN
BASE FINAL.mwb Normal file

Binary file not shown.

BIN
BASE FINAL.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

29
SERVER.txt Normal file
View File

@@ -0,0 +1,29 @@
.\cdsalud\Scripts\activate
.\cdsalud\scripts\activate.ps1
& s:/CDSALUD/cdsalud/Scripts/Activate.ps1
pip3 install django
pip3 install django-crispy-forms
pip3 install django-ckeditor
pip3 install Pillow
pip3 install mysqlclient
pip3 install django-mysql
pip3 install django-tinymce
pip3 install xhtml2pdf
pip3 install django-model-utils
pip3 install openpyxl
python manage.py makemigrations
python manage.py migrate
python manage.py migrate auth
python manage.py runserver 0.0.0.0:9000
django-admin startproject mysite
python manage.py startapp
mxsigco1_cdsalud
jU4sc%KUMj8&

4
acceso.bat Normal file
View File

@@ -0,0 +1,4 @@
timeout /t 10 /nobreak
python manage.py runserver 0.0.0.0:9003

1032
acceso.sql Normal file

File diff suppressed because it is too large Load Diff

0
accesoqr/__init__.py Normal file
View File

16
accesoqr/asgi.py Normal file
View File

@@ -0,0 +1,16 @@
"""
ASGI config for accesoqr project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'accesoqr.settings')
application = get_asgi_application()

211
accesoqr/settings.py Normal file
View File

@@ -0,0 +1,211 @@
"""
Django settings for accesoqr project.
Generated by 'django-admin startproject' using Django 4.0.5.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
from django.contrib.messages import constants as message_constants
import os
from pathlib import Path
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-tp%ys0z!$2o!_ounq%r*mest7yqsa6ok6#j5hwy!pi(3jo2d$8'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '192.168.1.200', '192.168.1.201', '192.168.1.202', '192.168.1.70', 'server.mxsig.com.mx']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'crispy_forms',
'ckeditor',
'tinymce',
'xhtml2pdf',
'principal',
'autenticacion',
'universidad',
'laboratorios',
'perfil',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'accesoqr.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ['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 = 'accesoqr.wsgi.application'
# Database
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': os.getenv("DB_ENGINE", default=""),
'NAME': os.getenv("DB_NAME", default=""),
'USER': os.getenv("DB_USER", default=""),
'PASSWORD': os.getenv("DB_PASSWORD", default=""),
'HOST': os.getenv("DB_HOST", default=""),
'PORT': os.getenv("DB_PORT", default=""),
}
}
# Password validation
# https://docs.djangoproject.com/en/4.0/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/4.0/topics/i18n/
LANGUAGE_CODE = 'es-MX'
TIME_ZONE = 'America/Mexico_City'
USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.0/howto/static-files/
STATIC_URL = 'static/'
MEDIA_URL = 'images/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
]
MEDIA_ROOT = os.path.join(BASE_DIR, 'static/images')
# Default primary key field type
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
CRISPY_TEMPLATE_PACK = 'bootstrap4'
MESSAGE_TAGS = {
message_constants.DEBUG: 'debug',
message_constants.INFO: 'info',
message_constants.SUCCESS: 'success',
message_constants.WARNING: 'warning',
message_constants.ERROR: 'danger',
}
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = 'acceso.qr.uptap@gmail.com'
EMAIL_HOST_PASSWORD = '****************'
CKEDITOR_CONFIGS = {
'default': {
'toolbar': None,
}
}
TINYMCE_DEFAULT_CONFIG = {
'height': 360,
'width': 1120,
'cleanup_on_startup': True,
'custom_undo_redo_levels': 20,
'selector': 'textarea',
'theme': 'silver',
'plugins': '''
textcolor save link image media preview codesample contextmenu
table code lists fullscreen insertdatetime nonbreaking
contextmenu directionality searchreplace wordcount visualblocks
visualchars code fullscreen autolink lists charmap print hr
anchor pagebreak
''',
'toolbar1': '''
fullscreen preview bold italic underline | fontselect,
fontsizeselect | forecolor backcolor | alignleft alignright |
aligncenter alignjustify | indent outdent | bullist numlist table |
| link image media | codesample |
''',
'toolbar2': '''
visualblocks visualchars |
charmap hr pagebreak nonbreaking anchor | code |
''',
'contextmenu': 'formats | link image',
'menubar': True,
'statusbar': True,
}

66
accesoqr/urls.py Normal file
View File

@@ -0,0 +1,66 @@
"""accesoqr URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf import settings
from django.contrib.auth import views as auth_views
from django.conf.urls.static import static
from principal.views import inicio
from autenticacion.views import VistaRegistro, salir, acceder, usuarios, userupdate
from laboratorios.views import scan, user, lcomputo, LCscan, LCcheckIng, LCscanS, Updatesalida
from perfil.views import Perfil, alta_perfil, mail, ActualizarPerfil
urlpatterns = [
path('admin/', admin.site.urls),
path('tinymce/', include('tinymce.urls')),
path('', inicio, name='index'),
path('acceder/', acceder, name='acceder'),
path('registro/', VistaRegistro.as_view(), name='registro'),
path('usuarios/', usuarios, name='usuarios'),
path('usuarios/actualizar/<int:id>', userupdate, name='userupdate'),
path('salir/', salir, name='salir'),
path('perfil/', Perfil, name='perfil'),
path('alta_perfil/', alta_perfil, name='altaperfil'),
path('actualizaperfil/<int:id>', ActualizarPerfil, name='actualizaperfil'),
path('mailqr/', mail, name='mailqr'),
path('scan/', scan, name='scan'),
path('user/', user, name='user'),
path('laboratorios/<int:id>', lcomputo, name='laboratorios'),
path('lcscan/<int:id>', LCscan, name='lcscan'),
path('lcchecking/<int:id>', LCcheckIng, name='lcchecking'),
path('lcscanS/<int:idlab>/<int:id>', LCscanS, name='lcscanS'),
path('updatesalida/<int:idlab>/<int:id>', Updatesalida, name='updatesalida'),
path('reset_password/', auth_views.PasswordResetView.as_view(template_name="password_reset.html"), name="reset_password"),
path('reset_password_sent/', auth_views.PasswordResetDoneView.as_view(template_name="password_reset_sent.html"), name="password_reset_done"),
path('reset/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(template_name="password_reset_form.html"), name="password_reset_confirm"),
path('reset_password_complete/', auth_views.PasswordResetCompleteView.as_view(template_name="password_reset_done.html"), name="password_reset_complete"),
]
urlpatterns += staticfiles_urlpatterns()
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

16
accesoqr/wsgi.py Normal file
View File

@@ -0,0 +1,16 @@
"""
WSGI config for accesoqr project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'accesoqr.settings')
application = get_wsgi_application()

View File

3
autenticacion/admin.py Normal file
View File

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

5
autenticacion/apps.py Normal file
View File

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

36
autenticacion/forms.py Normal file
View File

@@ -0,0 +1,36 @@
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from .models import perfil
class UserForm(UserCreationForm):
first_name = forms.CharField()
last_name = forms.CharField()
class Meta:
model = User
fields = ('first_name','last_name', 'username', 'email', 'password1' ,'password2' )
class Formperfil(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(Formperfil, self).__init__(*args, **kwargs)
self.fields['key'].widget.attrs['readonly'] = True
self.fields["key"].widget = forms.HiddenInput()
self.fields['usuario'].widget.attrs['readonly'] = True
self.fields["usuario"].widget = forms.HiddenInput()
class Meta:
model = perfil
fields = ('usuario', 'matricula', 'cuatrimestre', 'grupo', 'direccion', 'genero', 'telefono', 'tipo', 'id_carrera', 'foto', 'key')
class FormperfilEnv(forms.ModelForm):
class Meta:
model = perfil
fields = ('matricula', 'cuatrimestre', 'grupo', 'direccion', 'genero', 'telefono', 'tipo', 'id_carrera', 'foto')

View File

@@ -0,0 +1,41 @@
# Generated by Django 4.0.5 on 2022-06-27 13:26
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('universidad', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='perfil',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('matricula', models.CharField(max_length=50, unique=True, verbose_name='Matricula ó CURP')),
('cuatrimestre', models.CharField(blank=True, max_length=2, null=True, verbose_name='Cuatrimestre')),
('grupo', models.CharField(choices=[('A', 'A'), ('B', 'B'), ('C', 'C'), ('D', 'D')], default='A', max_length=1, verbose_name='Grupo')),
('direccion', models.CharField(blank=True, max_length=250, null=True, verbose_name='Domicilio')),
('telefono', models.CharField(blank=True, max_length=15, null=True, verbose_name='Telefono')),
('genero', models.CharField(choices=[('Estudiante', 'Estudiante'), ('Docente', 'Docente'), ('Administrativo', 'Administrativo'), ('Visitante', 'Visitante')], default='Estudiante', max_length=20, verbose_name='Genero')),
('foto', models.ImageField(blank=True, upload_to='foto/')),
('qr', models.ImageField(blank=True, upload_to='qr/')),
('fecha_alta', models.DateField(auto_now_add=True, verbose_name='Fecha alta')),
('fecha_actualizacion', models.DateField(auto_now=True, verbose_name='Fecha de Actualización')),
('id_carrera', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='universidad.carrera', verbose_name='Carrera')),
('usuario', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'perfil',
'verbose_name_plural': 'perfiles',
'ordering': ['matricula'],
},
),
]

View File

@@ -0,0 +1,23 @@
# Generated by Django 4.0.5 on 2022-07-19 04:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('autenticacion', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='perfil',
name='tipo',
field=models.CharField(choices=[('Estudiante', 'Estudiante'), ('Docente', 'Docente'), ('Administrativo', 'Administrativo'), ('Visitante', 'Visitante')], default='Estudiante', max_length=20, verbose_name='Genero'),
),
migrations.AlterField(
model_name='perfil',
name='genero',
field=models.CharField(choices=[('M', 'M'), ('F', 'F')], default='M', max_length=1, verbose_name='Genero'),
),
]

View File

@@ -0,0 +1,23 @@
# Generated by Django 4.0.5 on 2022-07-19 06:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('autenticacion', '0002_perfil_tipo_alter_perfil_genero'),
]
operations = [
migrations.AddField(
model_name='perfil',
name='key',
field=models.CharField(blank=True, max_length=250, null=True, verbose_name='Key'),
),
migrations.AlterField(
model_name='perfil',
name='tipo',
field=models.CharField(choices=[('Estudiante', 'Estudiante'), ('Docente', 'Docente'), ('Administrativo', 'Administrativo'), ('Visitante', 'Visitante')], default='Estudiante', max_length=20, verbose_name='Tipo'),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 4.0.5 on 2022-07-23 23:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('autenticacion', '0003_perfil_key_alter_perfil_tipo'),
]
operations = [
migrations.AlterField(
model_name='perfil',
name='cuatrimestre',
field=models.IntegerField(default=0, verbose_name='Cuatrimestre'),
),
]

View File

@@ -0,0 +1,20 @@
# Generated by Django 4.0.5 on 2022-07-24 00:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('universidad', '0002_ncuatrimestre'),
('autenticacion', '0004_alter_perfil_cuatrimestre'),
]
operations = [
migrations.AlterField(
model_name='perfil',
name='cuatrimestre',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='universidad.ncuatrimestre', verbose_name='Cuatrimestre'),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 4.0.5 on 2022-07-24 00:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('autenticacion', '0005_alter_perfil_cuatrimestre'),
]
operations = [
migrations.AlterField(
model_name='perfil',
name='cuatrimestre',
field=models.CharField(choices=[('0', '0'), ('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8'), ('9', '9'), ('10', '10')], default=0, max_length=2, verbose_name='Cuatrimestre'),
),
]

View File

59
autenticacion/models.py Normal file
View File

@@ -0,0 +1,59 @@
from django.db import models
from django.contrib.auth.models import User
import os
from tinymce import models as tinymce_models
from model_utils import Choices
import qrcode
from io import BytesIO
from django.core.files import File
from PIL import Image, ImageDraw
from universidad.models import carrera
# Create your models here.
class perfil(models.Model):
TIPO = Choices('Estudiante', 'Docente', 'Administrativo', 'Visitante')
GENERO = Choices('M', 'F')
GRU = Choices('A','B','C','D')
CUATRI = Choices('0','1','2','3','4','5','6','7','8','9','10')
usuario = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True)
matricula = models.CharField(max_length=50, unique=True, null=False, blank=False, verbose_name='Matricula ó CURP')
cuatrimestre = models.CharField(choices=CUATRI, default=0, max_length=2, verbose_name='Cuatrimestre')
grupo = models.CharField(choices=GRU, default=GRU.A, max_length=1, verbose_name='Grupo')
direccion = models.CharField(max_length=250, null=True, blank=True, verbose_name='Domicilio')
genero = models.CharField(choices=GENERO, default=GENERO.M, max_length=1, verbose_name='Genero')
telefono = models.CharField(max_length=15, null=True, blank=True, verbose_name='Telefono')
tipo = models.CharField(choices=TIPO, default=TIPO.Estudiante, max_length=20, verbose_name='Tipo')
id_carrera = models.ForeignKey(carrera, on_delete=models.CASCADE, null=False, blank=False, verbose_name='Carrera')
foto = models.ImageField(upload_to='foto/', blank=True)
qr = models.ImageField(upload_to='qr/', blank=True)
fecha_alta = models.DateField(auto_now_add=True, verbose_name='Fecha alta')
fecha_actualizacion = models.DateField(auto_now=True, verbose_name='Fecha de Actualización')
key = models.CharField(max_length=250, null=True, blank=True, verbose_name='Key')
def delete(self, *args, **kwargs):
if os.path.isfile(self.foto.path):
os.remove(self.foto.path)
super(perfil, self).delete(*args, **kwargs)
def __str__(self):
return self.matricula
def save(self, *args, **kwargs):
data = self.key
key = ''.join(ch for ch in data if ch.isalnum())
qr_image = qrcode.make(key)
qr_offset = Image.new('RGB',(480, 480),'white')
qr_offset.paste(qr_image)
files_name = f'{self.matricula}qr.png'
stream = BytesIO()
qr_offset.save(stream, 'PNG')
self.qr.save(files_name, File(stream), save=False)
qr_offset.close()
super().save(*args, **kwargs)
class Meta:
verbose_name = 'perfil'
verbose_name_plural = 'perfiles'
ordering = ['matricula']

3
autenticacion/tests.py Normal file
View File

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

76
autenticacion/views.py Normal file
View File

@@ -0,0 +1,76 @@
from django.shortcuts import render, redirect, get_object_or_404
from django.views.generic import View
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.models import User
from django.contrib import messages
from django.contrib.auth import login, logout, authenticate
from .forms import UserForm
from django.contrib.auth.decorators import login_required
def acceder(request):
if request.method == "POST":
form = AuthenticationForm(request, data=request.POST)
if form.is_valid():
nombre_usuario = form.cleaned_data.get("username")
password = form.cleaned_data.get("password")
usuario = authenticate(username=nombre_usuario, password=password)
if usuario is not None:
login(request, usuario)
messages.success(request, F"Bienvenid@ de nuevo {nombre_usuario}")
return redirect("index")
else:
messages.error(request, "Los datos son incorrectos")
else:
messages.error(request, "Los datos son incorrectos")
form = AuthenticationForm()
return render(request, "acceder.html", {"form": form})
# Create your views here.
class VistaRegistro(View):
def get(self, request):
form = UserForm()
return render(request, "registro.html", {"form": form})
def post(self, request):
form = UserForm(request.POST)
if form.is_valid():
post = form.save(commit=False)
post.save()
return redirect("index")
else:
for field, items in form.errors.items():
for item in items:
messages.error(request, '{}: {}'.format(field, item))
return render(request, "registro.html", {"form": form})
def salir(request):
logout(request)
messages.success(request, F"Tu sesion se ha cerrado correctamente")
return redirect("index")
def usuarios(request):
datos = User.objects.all()
return render(request, 'usuarios.html', {"datos": datos})
@login_required(login_url='/acceder')
def userupdate(request, id):
instance= get_object_or_404(User, pk=id)
form = UserForm(request.POST or None, instance=instance)
context= {'form': form}
if form.is_valid():
obj= form.save(commit= False)
obj.save()
messages.success(request, "El usuario fue actualizado")
return redirect("usuarios")
else:
context= {'form': form, 'error': 'Error al actualizar'}
return render(request,'usuariosupdate.html' , context)

BIN
base.mwb Normal file

Binary file not shown.

BIN
base.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

0
laboratorios/__init__.py Normal file
View File

3
laboratorios/admin.py Normal file
View File

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

6
laboratorios/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class LaboratoriosConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'laboratorios'

29
laboratorios/forms.py Normal file
View File

@@ -0,0 +1,29 @@
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from .models import lab, labComputo
class Formlab(forms.ModelForm):
class Meta:
model = lab
fields = ('usuario', 'id_lab', 'id_asig', 'id_area', 'id_mat', 'uso')
class FormlabEnv(forms.ModelForm):
class Meta:
model = lab
fields = ('id_asig', 'id_area', 'id_mat', 'uso')
class FormlabComputo(forms.ModelForm):
class Meta:
model = labComputo
fields = ('usuario', 'id_lab', 'id_asig', 'id_area', 'id_mat', 'uso')
class FormlabComputoEnv(forms.ModelForm):
class Meta:
model = labComputo
fields = ('id_asig', 'id_area', 'id_mat', 'uso')

View File

@@ -0,0 +1,40 @@
# Generated by Django 4.0.5 on 2022-06-27 13:26
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('universidad', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='lab',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('uso', models.CharField(choices=[('Practica', 'Practica'), ('Clase', 'Clase'), ('Libre', 'Libre')], default='Clase', max_length=10, verbose_name='Tipo de Uso')),
('foto', models.ImageField(blank=True, upload_to='foto/')),
('entrada', models.DateField(auto_now_add=True, verbose_name='Entrada')),
('salida', models.DateField(auto_now_add=True, verbose_name='Salida')),
('fecha_alta', models.DateField(auto_now_add=True, verbose_name='Fecha alta')),
('fecha_actualizacion', models.DateField(auto_now=True, verbose_name='Fecha de Actualización')),
('id_area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='universidad.area', verbose_name='Area')),
('id_asig', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='universidad.asignatura', verbose_name='Asignatura')),
('id_lab', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='universidad.laboratorio', verbose_name='Laboratorio')),
('id_mat', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='universidad.material', verbose_name='Material')),
('usuario', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'laboratorio',
'verbose_name_plural': 'laboratorios',
'ordering': ['-entrada'],
},
),
]

View File

@@ -0,0 +1,68 @@
# Generated by Django 4.0.5 on 2022-07-22 12:25
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('universidad', '0001_initial'),
('laboratorios', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='lab',
options={'ordering': ['-entrada'], 'verbose_name': 'Laboratorio de automatización', 'verbose_name_plural': 'Laboratorio de automatización'},
),
migrations.AlterField(
model_name='lab',
name='id_area',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='universidad.area', verbose_name='Area'),
),
migrations.AlterField(
model_name='lab',
name='id_asig',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='universidad.asignatura', verbose_name='Asignatura'),
),
migrations.AlterField(
model_name='lab',
name='id_lab',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='universidad.laboratorio', verbose_name='Laboratorio'),
),
migrations.AlterField(
model_name='lab',
name='id_mat',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='universidad.material', verbose_name='Material'),
),
migrations.AlterField(
model_name='lab',
name='salida',
field=models.DateField(auto_now=True, verbose_name='Salida'),
),
migrations.CreateModel(
name='labComputo',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('uso', models.CharField(choices=[('Practica', 'Practica'), ('Clase', 'Clase'), ('Libre', 'Libre')], default='Clase', max_length=10, verbose_name='Tipo de Uso')),
('foto', models.ImageField(blank=True, upload_to='foto/')),
('entrada', models.DateField(auto_now_add=True, verbose_name='Entrada')),
('salida', models.DateField(auto_now=True, verbose_name='Salida')),
('fecha_alta', models.DateField(auto_now_add=True, verbose_name='Fecha alta')),
('fecha_actualizacion', models.DateField(auto_now=True, verbose_name='Fecha de Actualización')),
('id_area', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='universidad.area', verbose_name='Area')),
('id_asig', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='universidad.asignatura', verbose_name='Asignatura')),
('id_lab', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='universidad.laboratorio', verbose_name='Laboratorio')),
('id_mat', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='universidad.material', verbose_name='Material')),
('usuario', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'Laboratorio de cómputo y redes',
'verbose_name_plural': 'Laboratorio de cómputo y redes',
'ordering': ['-entrada'],
},
),
]

View File

@@ -0,0 +1,33 @@
# Generated by Django 4.0.5 on 2022-07-23 08:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('laboratorios', '0002_alter_lab_options_alter_lab_id_area_and_more'),
]
operations = [
migrations.AlterField(
model_name='labcomputo',
name='entrada',
field=models.DateTimeField(auto_now_add=True, verbose_name='Entrada'),
),
migrations.AlterField(
model_name='labcomputo',
name='fecha_actualizacion',
field=models.DateTimeField(auto_now=True, verbose_name='Fecha de Actualización'),
),
migrations.AlterField(
model_name='labcomputo',
name='fecha_alta',
field=models.DateTimeField(auto_now_add=True, verbose_name='Fecha alta'),
),
migrations.AlterField(
model_name='labcomputo',
name='salida',
field=models.DateTimeField(auto_now=True, verbose_name='Salida'),
),
]

View File

@@ -0,0 +1,21 @@
# Generated by Django 4.0.5 on 2022-07-23 23:52
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('laboratorios', '0003_alter_labcomputo_entrada_and_more'),
]
operations = [
migrations.AlterModelOptions(
name='lab',
options={'ordering': ['-entrada'], 'verbose_name': 'Laboratorio', 'verbose_name_plural': 'Laboratorios'},
),
migrations.AlterModelOptions(
name='labcomputo',
options={'ordering': ['-entrada'], 'verbose_name': 'Laboratorio', 'verbose_name_plural': 'Laboratorios'},
),
]

View File

@@ -0,0 +1,17 @@
# Generated by Django 4.0.5 on 2022-07-24 22:10
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('laboratorios', '0004_alter_lab_options_alter_labcomputo_options'),
]
operations = [
migrations.AlterModelOptions(
name='labcomputo',
options={'ordering': ['-id'], 'verbose_name': 'Laboratorio', 'verbose_name_plural': 'Laboratorios'},
),
]

View File

62
laboratorios/models.py Normal file
View File

@@ -0,0 +1,62 @@
from django.db import models
from django.contrib.auth.models import User
import os
from model_utils import Choices
from universidad.models import laboratorio, asignatura, area, material
# Create your models here.
class lab(models.Model):
USO = Choices('Practica', 'Clase', 'Libre')
usuario = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True)
id_lab = models.ForeignKey(laboratorio, on_delete=models.CASCADE, null=True, blank=True, verbose_name='Laboratorio')
id_asig = models.ForeignKey(asignatura, on_delete=models.CASCADE, null=True, blank=True, verbose_name='Asignatura')
id_area = models.ForeignKey(area, on_delete=models.CASCADE, null=True, blank=True, verbose_name='Area')
id_mat = models.ForeignKey(material, on_delete=models.CASCADE, null=True, blank=True, verbose_name='Material')
uso = models.CharField(choices=USO, default=USO.Clase, max_length=10, verbose_name='Tipo de Uso')
foto = models.ImageField(upload_to='foto/', blank=True)
entrada = models.DateField(auto_now_add=True, verbose_name='Entrada')
salida = models.DateField(auto_now=True, verbose_name='Salida')
fecha_alta = models.DateField(auto_now_add=True, verbose_name='Fecha alta')
fecha_actualizacion = models.DateField(auto_now=True, verbose_name='Fecha de Actualización')
def delete(self, *args, **kwargs):
if os.path.isfile(self.foto.path):
os.remove(self.foto.path)
super(User, self).delete(*args, **kwargs)
def __str__(self):
return self.entrada
class Meta:
verbose_name = 'Laboratorio'
verbose_name_plural = 'Laboratorios'
ordering = ['-entrada']
class labComputo(models.Model):
USO = Choices('Practica', 'Clase', 'Libre')
usuario = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True)
id_lab = models.ForeignKey(laboratorio, on_delete=models.CASCADE, null=True, blank=True, verbose_name='Laboratorio')
id_asig = models.ForeignKey(asignatura, on_delete=models.CASCADE, null=True, blank=True, verbose_name='Asignatura')
id_area = models.ForeignKey(area, on_delete=models.CASCADE, null=True, blank=True, verbose_name='Area')
id_mat = models.ForeignKey(material, on_delete=models.CASCADE, null=True, blank=True, verbose_name='Material')
uso = models.CharField(choices=USO, default=USO.Clase, max_length=10, verbose_name='Tipo de Uso')
foto = models.ImageField(upload_to='foto/', blank=True)
entrada = models.DateTimeField(auto_now_add=True, verbose_name='Entrada')
salida = models.DateTimeField(auto_now=True, verbose_name='Salida')
fecha_alta = models.DateTimeField(auto_now_add=True, verbose_name='Fecha alta')
fecha_actualizacion = models.DateTimeField(auto_now=True, verbose_name='Fecha de Actualización')
def delete(self, *args, **kwargs):
if os.path.isfile(self.foto.path):
os.remove(self.foto.path)
super(User, self).delete(*args, **kwargs)
def __str__(self):
return self.entrada
class Meta:
verbose_name = 'Laboratorio'
verbose_name_plural = 'Laboratorios'
ordering = ['-id']

3
laboratorios/tests.py Normal file
View File

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

79
laboratorios/views.py Normal file
View File

@@ -0,0 +1,79 @@
from django.contrib import messages
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from datetime import datetime
from .models import lab, labComputo
from autenticacion.models import perfil
from universidad.models import carrera, asignatura, area, material, laboratorio
from .forms import FormlabComputoEnv, FormlabComputo
# Create your views here.
def scan(request):
return render(request, 'scan.html')
def user(request):
return render(request, 'user.html')
def lcomputo(request, id):
if request.method == "POST":
form = FormlabComputo(request.POST)
if form.is_valid():
post = form.save(commit=False)
post.save()
messages.success(request, f"El registro se ha creado o actualizado correctamente")
return redirect('laboratorios', id)
else:
for field, items in form.errors.items():
for item in items:
messages.error(request, '{}: {}'.format(field, item))
datos = labComputo.objects.filter(id_lab_id=id)
perfils = perfil.objects.all()
users = User.objects.all()
labos = laboratorio.objects.get(id=id)
asigs = asignatura.objects.all()
areas = area.objects.all()
mates = material.objects.all()
return render(request, 'laboratorios.html', {"datos": datos, "perfils": perfils, "users": users, "labos": labos, "asigs": asigs, "areas": areas, "mates": mates})
def LCscan(request, id):
idlab = id
return render(request, 'LCscan.html', {"idlab": idlab})
def LCcheckIng(request, id):
idlab = id
key = request.POST.get("key")
datos = perfil.objects.get(key=key)
user = User.objects.get(id=datos.usuario_id)
form = FormlabComputoEnv()
return render(request, 'LCcheckIng.html', {"datos": datos, "form": form, "user": user, "idlab": idlab})
def LCscanS(request, idlab, id):
idlabx = idlab
idx = id
return render(request, 'LCscanS.html', {"idlabx": idlabx, "idx": idx})
def Updatesalida(request, idlab, id ):
key = request.POST.get("key")
datosuser = perfil.objects.get(key=key)
datoslab = labComputo.objects.get(id=id)
idlabx = idlab
idx= id
date = datetime.now()
if datosuser.usuario_id == datoslab.usuario_id:
update = labComputo.objects.values('salida').filter(id=idx).update(salida=date)
return redirect('laboratorios', idlabx)
return redirect('laboratorios', idlabx)

22
manage.py Normal file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'accesoqr.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()

0
perfil/__init__.py Normal file
View File

7
perfil/admin.py Normal file
View File

@@ -0,0 +1,7 @@
from django.contrib import admin
from autenticacion.models import perfil
# Register your models here.
admin.site.register(perfil)

6
perfil/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class PerfilConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'perfil'

View File

7
perfil/models.py Normal file
View File

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

3
perfil/tests.py Normal file
View File

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

105
perfil/views.py Normal file
View File

@@ -0,0 +1,105 @@
import os
from django.conf import settings
from django.template import Context
from django.template.loader import get_template
from xhtml2pdf import pisa
from django.contrib.staticfiles import finders
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http.response import HttpResponse
from django.views import View
from django.views.generic import ListView
from datetime import datetime
from django.core.mail import EmailMultiAlternatives
from autenticacion.models import perfil
from autenticacion.forms import Formperfil, FormperfilEnv
from universidad.models import carrera
# Create your views here. post.usuario = request.user
@login_required(login_url='/acceder')
def Perfil(request):
id = request.user.id
form = perfil.objects.get(usuario_id=id)
user = User.objects.get(id=id)
datos = carrera.objects.get(id=form.id_carrera_id)
count = perfil.objects.filter(usuario_id=form.usuario_id).count()
return render(request, 'perfil.html', {"form": form, "user": user, "datos": datos, "count": count})
@login_required(login_url='/acceder')
def ActualizarPerfil(request, id):
data = request.user.password + str(request.user.id)
key = ''.join(ch for ch in data if ch.isalnum())
update = perfil.objects.values('key').filter(usuario_id=request.user.id).update(key=key)
instance= get_object_or_404(perfil, pk=id)
form = Formperfil(request.POST or None, instance=instance)
context= {'form': form}
if form.is_valid():
obj= form.save(commit= False)
obj.save()
messages.success(request, "El perfil fue actualizado")
return redirect("perfil")
else:
context= {'form': form, 'error': 'Error al actualizar'}
return render(request,'actualizar_perfil.html' , context)
@login_required(login_url='/acceder')
def alta_perfil(request):
if request.method == "POST":
form = Formperfil(request.POST, request.FILES)
if form.is_valid():
post = form.save(commit=False)
post.save()
folio = form.cleaned_data.get("matricula")
messages.success(request, f"El registro {folio} se ha creado o actualizado correctamente")
return redirect("index")
else:
for field, items in form.errors.items():
for item in items:
messages.error(request, '{}: {}'.format(field, item))
user = request.user.id
if perfil.objects.filter(usuario_id=user).exists():
messages.success(request, f"El registro ya existe")
return redirect("perfil")
user = request.user
data = user.password
key = ''.join(ch for ch in data if ch.isalnum())
form = FormperfilEnv()
return render(request, "alta_perfil.html", {"form": form, "user": user, "key": key})
@login_required(login_url='/acceder')
def mail(request):
if request.method == "POST":
id = request.POST.get("id")
form = perfil.objects.get(usuario_id=id)
user = User.objects.get(id=id)
subject = 'Codigo QR'
template = get_template('email.html')
content = template.render({
'form': form,
})
message = EmailMultiAlternatives(subject,
'',
settings.EMAIL_HOST_USER,
[user.email])
message.attach_alternative(content, 'text/html')
message.send()
messages.success(request, f"El Correo con el codigo QR ha sido enviado")
return redirect("perfil")
else:
for field, items in form.errors.items():
for item in items:
messages.error(request, '{}: {}'.format(field, item))

0
principal/__init__.py Normal file
View File

3
principal/admin.py Normal file
View File

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

6
principal/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class PrincipalConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'principal'

View File

3
principal/models.py Normal file
View File

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

3
principal/tests.py Normal file
View File

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

5
principal/views.py Normal file
View File

@@ -0,0 +1,5 @@
from django.shortcuts import render
# Create your views here.
def inicio(request):
return render(request, 'index.html')

7
static/assets/css/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
static/assets/css/chartist.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,290 @@
@font-face {
font-family: 'icomoon';
src:url('../fonts/icomoon/icomoon.eot?-rdnm34');
src:url('../fonts/icomoon/icomoon.eot?#iefix-rdnm34') format('embedded-opentype'),
url('../fonts/icomoon/icomoon.woff?-rdnm34') format('woff'),
url('../fonts/icomoon/icomoon.ttf?-rdnm34') format('truetype'),
url('../fonts/icomoon/icomoon.svg?-rdnm34#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
div.cs-skin-elastic {
background: transparent;
font-size: 1.5em;
font-weight: 700;
color: #5b8583;
}
@media screen and (max-width: 30em) {
div.cs-skin-elastic { font-size: 1em; }
}
.cs-skin-elastic > span {
background-color: #fff;
z-index: 100;
}
.cs-skin-elastic > span::after {
font-family: 'icomoon';
content: '\e005';
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.cs-skin-elastic .cs-options {
overflow: visible;
background: transparent;
opacity: 1;
visibility: visible;
padding-bottom: 1.25em;
pointer-events: none;
}
.cs-skin-elastic.cs-active .cs-options {
pointer-events: auto;
}
.cs-skin-elastic .cs-options > ul::before {
content: '';
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
-webkit-transform: scale3d(1,0,1);
transform: scale3d(1,0,1);
background: #fff;
-webkit-transform-origin: 50% 0%;
transform-origin: 50% 0%;
-webkit-transition: -webkit-transform 0.3s;
transition: transform 0.3s;
}
.cs-skin-elastic.cs-active .cs-options > ul::before {
-webkit-transform: scale3d(1,1,1);
transform: scale3d(1,1,1);
-webkit-transition: none;
transition: none;
-webkit-animation: expand 0.6s ease-out;
animation: expand 0.6s ease-out;
}
.cs-skin-elastic .cs-options ul li {
opacity: 0;
-webkit-transform: translate3d(0,-25px,0);
transform: translate3d(0,-25px,0);
-webkit-transition: opacity 0.15s, -webkit-transform 0.15s;
transition: opacity 0.15s, transform 0.15s;
}
.cs-skin-elastic.cs-active .cs-options ul li {
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
opacity: 1;
-webkit-transition: none;
transition: none;
-webkit-animation: bounce 0.6s ease-out;
animation: bounce 0.6s ease-out;
}
/* Optional delays (problematic in IE 11/Win) */
/*
.cs-skin-elastic.cs-active .cs-options ul li:first-child {
-webkit-animation-delay: 0.1s;
animation-delay: 0.1s;
}
.cs-skin-elastic.cs-active .cs-options ul li:nth-child(2) {
-webkit-animation-delay: 0.15s;
animation-delay: 0.15s;
}
.cs-skin-elastic.cs-active .cs-options ul li:nth-child(3) {
-webkit-animation-delay: 0.2s;
animation-delay: 0.2s;
}
.cs-skin-elastic.cs-active .cs-options ul li:nth-child(4) {
-webkit-animation-delay: 0.25s;
animation-delay: 0.25s;
}
/* with more items, more delays declarations are needed */
.cs-skin-elastic .cs-options span {
background-repeat: no-repeat;
background-position: 1.5em 50%;
background-size: 2em auto;
padding: 0.8em 1em 0.8em 4em;
}
.cs-skin-elastic .cs-options span:hover,
.cs-skin-elastic .cs-options li.cs-focus span,
.cs-skin-elastic .cs-options .cs-selected span {
color: #1e4c4a;
}
.cs-skin-elastic .cs-options .cs-selected span::after {
content: '';
}
.cs-skin-elastic .cs-options li.flag-france span {
background-image: url(../img/france.svg);
}
.cs-skin-elastic .cs-options li.flag-brazil span {
background-image: url(../img/brazil.svg);
}
.cs-skin-elastic .cs-options li.flag-safrica span {
background-image: url(../img/south-africa.svg);
}
.cs-skin-elastic .cs-options li.flag-argentina span {
background-image: url(../img/argentina.svg);
}
@-webkit-keyframes expand {
0% { -webkit-transform: scale3d(1,0,1); }
25% { -webkit-transform: scale3d(1,1.2,1); }
50% { -webkit-transform: scale3d(1,0.85,1); }
75% { -webkit-transform: scale3d(1,1.05,1) }
100% { -webkit-transform: scale3d(1,1,1); }
}
@keyframes expand {
0% { -webkit-transform: scale3d(1,0,1); transform: scale3d(1,0,1); }
25% { -webkit-transform: scale3d(1,1.2,1); transform: scale3d(1,1.2,1); }
50% { -webkit-transform: scale3d(1,0.85,1); transform: scale3d(1,0.85,1); }
75% { -webkit-transform: scale3d(1,1.05,1); transform: scale3d(1,1.05,1); }
100% { -webkit-transform: scale3d(1,1,1); transform: scale3d(1,1,1); }
}
@-webkit-keyframes bounce {
0% { -webkit-transform: translate3d(0,-25px,0); opacity:0; }
25% { -webkit-transform: translate3d(0,10px,0); }
50% { -webkit-transform: translate3d(0,-6px,0); }
75% { -webkit-transform: translate3d(0,2px,0); }
100% { -webkit-transform: translate3d(0,0,0); opacity: 1; }
}
@keyframes bounce {
0% { -webkit-transform: translate3d(0,-25px,0); transform: translate3d(0,-25px,0); opacity:0; }
25% { -webkit-transform: translate3d(0,10px,0); transform: translate3d(0,10px,0); }
50% { -webkit-transform: translate3d(0,-6px,0); transform: translate3d(0,-6px,0); }
75% { -webkit-transform: translate3d(0,2px,0); transform: translate3d(0,2px,0); }
100% { -webkit-transform: translate3d(0,0,0); transform: translate3d(0,0,0); opacity: 1; }
}
/* Default custom select styles */
div.cs-select {
display: inline-block;
vertical-align: middle;
position: relative;
text-align: left;
background: #f1f2f7;
z-index: 100;
width: 100%;
max-width: 80px;
margin-left: 25px;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
div.cs-select:focus {
outline: none; /* For better accessibility add a style for this in your skin */
}
.cs-select select {
display: none;
}
.cs-select span {
display: block;
position: relative;
cursor: pointer;
padding: 9px 15px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* Placeholder and selected option */
.cs-select > span::after,
.cs-select .cs-selected span::after {
speak: none;
position: absolute;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.cs-select > span::after {
content: "\f107";
font-family: 'Fontawesome';
right: 1em;
}
.cs-select .cs-selected span::after {
content: '\2713';
margin-left: 1em;
}
.cs-select.cs-active > span::after {
-webkit-transform: translateY(-50%) rotate(180deg);
transform: translateY(-50%) rotate(180deg);
}
div.cs-active {
z-index: 200;
}
/* Options */
.cs-select .cs-options {
position: absolute;
overflow: hidden;
width: 100%;
background: #f1f2f7;
visibility: hidden;
}
.cs-select.cs-active .cs-options {
visibility: visible;
}
.cs-select ul {
list-style: none;
margin: 0;
padding: 0;
width: 100%;
}
.cs-select ul span {
padding: 5px 15px;
}
.cs-select ul li {
display: block;
}
.cs-select ul li.cs-focus span {
background-color: #ddd;
}
/* Optgroup and optgroup label */
.cs-select li.cs-optgroup ul {
padding-left: 1em;
}
.cs-select li.cs-optgroup > span {
cursor: default;
}

1
static/assets/css/flag-icon.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
static/assets/css/jqvmap.min.css vendored Normal file
View File

@@ -0,0 +1 @@
.jqvmap-label,.jqvmap-pin{pointer-events:none}.jqvmap-label{position:absolute;display:none;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;background:#292929;color:#fff;font-family:sans-serif,Verdana;font-size:smaller;padding:3px}.jqvmap-zoomin,.jqvmap-zoomout{position:absolute;left:10px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;background:#000;padding:3px;color:#fff;width:10px;height:10px;cursor:pointer;line-height:10px;text-align:center}.jqvmap-zoomin{top:10px}.jqvmap-zoomout{top:30px}.jqvmap-region{cursor:pointer}.jqvmap-ajax_response{width:100%;height:500px}

9
static/assets/css/normalize.min.css vendored Normal file
View File

@@ -0,0 +1,9 @@
/**
* Minified by jsDelivr using clean-css v4.2.0.
* Original file: /npm/normalize.css@8.0.0/normalize.css
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */
html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}
/*# sourceMappingURL=/sm/e2c72a7351d5a2d33ec71a2eb3499dd01b2a301cd447575f6051b1315bb20a11.map */

File diff suppressed because one or more lines are too long

2506
static/assets/css/style.css Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by Fontastic.me</metadata>
<defs>
<font id="icomoon" horiz-adv-x="512">
<font-face font-family="icomoon" units-per-em="512" ascent="480" descent="-32"/>
<missing-glyph horiz-adv-x="512" />
<glyph unicode="&#57344;" d="M256 459c6 0 11-2 15-7 4-4 6-9 6-15l0-332 113 113c4 4 9 6 15 6 6 0 12-2 16-6 4-4 6-9 6-15 0-6-2-11-6-16l-150-149c-4-4-9-6-15-6-6 0-11 2-15 6l-149 149c-5 5-7 10-7 16 0 6 2 11 6 15 4 4 10 6 16 6 6 0 11-2 15-6l113-113 0 332c0 6 2 11 6 15 4 5 9 7 15 7z"/>
<glyph unicode="&#57349;" d="M26 290c0 5 2 9 5 13l48 47c3 3 7 5 12 5 5 0 10-2 13-5l152-152 152 152c3 3 8 5 13 5 5 0 9-2 12-5l48-47c3-4 5-8 5-13 0-5-2-10-5-13l-212-212c-4-4-8-6-13-6-5 0-9 2-13 6l-212 212c-3 3-5 8-5 13z"/>
<glyph unicode="&#57350;" d="M114 261c0 2 0 4 2 6l15 14c2 2 4 3 6 3 3 0 5-1 7-3l112-112 112 112c2 2 4 3 7 3 2 0 5-1 7-3l14-14c2-2 3-4 3-6 0-3-1-5-3-7l-133-133c-2-2-4-3-7-3-2 0-5 1-6 3l-134 133c-2 2-2 4-2 7z m0 109c0 3 0 5 2 7l15 14c2 2 4 3 6 3 3 0 5-1 7-3l112-112 112 112c2 2 4 3 7 3 2 0 5-1 7-3l14-14c2-2 3-4 3-7 0-2-1-4-3-6l-133-133c-2-2-4-3-7-3-2 0-5 1-6 3l-134 133c-2 2-2 4-2 6z"/>
<glyph unicode="&#57351;" d="M114 297c0 3 0 5 2 7l15 14c2 2 4 3 6 3 3 0 5-1 7-3l112-112 112 112c2 2 4 3 7 3 2 0 5-1 7-3l14-14c2-2 3-4 3-7 0-2-1-5-3-6l-133-134c-2-1-4-2-7-2-2 0-5 1-6 2l-134 134c-2 1-2 4-2 6z"/>
<glyph unicode="&#57352;" d="M503 343l-160 160c-8 8-20 11-31 8-5-1-11-4-15-8-3-4-6-9-8-14-7-23-19-43-38-62-25-25-57-43-91-63-36-21-74-43-104-74-26-26-44-55-55-89-3-11 0-23 8-32l160-160c8-8 20-11 31-8 5 1 11 4 15 8 3 4 6 8 8 14 7 23 19 43 38 62 25 25 57 43 91 63 36 21 74 43 104 74 26 26 44 55 55 89 3 11 0 23-8 32z m-311-311c-53 53-107 107-160 160 45 147 243 141 288 288 53-53 107-107 160-160-45-147-243-141-288-288z m121 242c-5 4-10 7-16 8-5 2-10 2-16 2-5 0-10-2-16-4-5-2-10-4-16-7-8 10-17 20-26 29 4 4 8 5 12 6 3 0 7-1 10-2 3 0 7-1 9-2 3 0 6 0 8 2 2 2 4 5 4 8 0 3-1 6-4 9-3 4-7 6-12 7-5 1-10 1-15 0-5-1-10-3-15-6-4-3-8-5-10-8-2 1-3 2-4 3-1 1-2 2-4 2-2 0-3-1-4-3-1-1-2-2-2-4 0-2 1-3 2-4 1-1 2-2 3-3-4-5-7-10-10-16-2-6-4-11-5-17 0-6 0-11 2-15 2-5 5-9 10-13 7-6 16-9 26-8 11 0 22 3 33 10 10-11 19-22 29-32-4-4-8-6-11-6-3-1-6-1-8 0-3 1-5 2-7 3-2 2-4 3-6 4-2 1-5 2-7 2-2 0-4-1-7-3-2-3-4-5-4-8 0-3 2-6 4-9 3-4 7-6 11-8 4-2 9-3 14-4 6 0 11 1 17 3 6 2 12 6 18 12 2-3 5-6 8-8 1-1 3-2 4-2 2 1 4 1 5 3 1 1 1 3 1 4 0 2-1 3-2 4-3 3-5 5-8 7 5 6 8 12 11 19 3 6 5 12 5 17 1 6 0 11-1 15-2 5-5 9-10 13z m-89-11c-5 0-9 1-12 4-2 2-3 4-4 6 0 2 0 4 0 6 0 3 1 5 2 8 1 2 3 5 5 7 8-8 16-17 25-26-7-3-12-5-16-5z m75-32c-1-3-3-5-5-7-9 9-18 19-27 29 2 1 5 2 7 3 3 1 6 2 8 2 3 1 5 1 8 0 3-1 5-2 7-4 3-3 4-5 5-7 0-3 0-6 0-8-1-3-2-6-3-8z m-64-74l0 0c-10-8-19-16-28-25-9-8-17-18-24-27l-11-15 0 0c-2-3-1-7 1-10 4-3 9-3 12 0 0 1 1 1 1 2l10 14c7 8 14 17 22 25 9 9 17 16 27 24l0 0c1 0 1 0 1 0 3 3 3 8 0 12-3 3-7 3-11 0z m59 232c-8-9-17-16-27-24 0 0-1 0-2-1-3-3-3-8 0-11 3-3 8-3 12-1l0 0c10 8 19 16 28 25 9 9 17 18 24 27l11 15 0 0c2 4 2 8-1 11-3 4-8 4-11 0-1 0-1-1-2-2l-10-14c-7-9-14-17-22-25z"/>
<glyph unicode="&#57353;" d="M472 176l-43 0c-1 4-2 8-3 11l77 39c8 4 11 13 7 21-4 8-13 11-21 7l-73-36c-28 60-89 102-160 102-86 0-158-62-173-144l-43 0c-22 0-40-18-40-40 0-8 3-15 8-21l56-63 0-12c0-22 18-40 40-40l304 0c22 0 40 18 40 40l0 12 56 63c5 6 8 13 8 21 0 22-18 40-40 40z m-59 0l-9 0 8 4c0-1 0-3 1-4z m-157 128c64 0 120-38 145-93l-14-8c-23 50-73 85-131 85-69 0-126-48-140-112l-17 0c15 73 80 128 157 128z m73-128c-12 28-40 48-73 48-33 0-61-20-73-48l-17 0c13 37 48 64 90 64 39 0 73-24 88-58l-12-6z m-73 16c-14 0-27-6-36-16l-19 0c11 19 31 32 55 32 24 0 44-13 55-32l-20 0c-8 10-21 16-35 16z m0 64c-51 0-93-34-107-80l-17 0c14 55 64 96 124 96 52 0 97-31 117-76l-15-7c-17 39-56 67-102 67z m160-192l0-24c0-4-4-8-8-8l-304 0c-4 0-8 4-8 8l0 24-64 72c0 4 4 8 8 8l432 0c4 0 8-4 8-8z m-288 261c0 0 0-1 0-1 0 0 0 0 0 0 1-2 4-4 7-4 4 0 8 4 8 8 0 1 0 1 0 2 0 0 0 0 0 0-6 14-1 30 6 47 8 18 16 38 7 58-1 3-4 5-7 5-5 0-8-4-8-8 0-1 0-2 0-3 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 6-15 0-29-7-46-8-18-16-38-8-58 0 0 1 0 1 0z m194 2c1 0 1 0 1 0l0 0c1-3 4-5 7-5 4 0 8 4 8 8 0 1 0 2-1 2 1 0 1 1 0 1-6 14 0 29 7 46 8 18 16 38 7 58-1 3-4 5-7 5-5 0-8-3-8-8 0 0 0-1 0-2 0 0 0 0 0 0 0 0 0 0 0 0 0-1 0-1 0-1 7-14 1-29-6-46-8-18-16-37-8-57 0-1 0-1 0-1z m-82 70c0 0 0-1 0-1 0 0 0 0 0 0 2-2 4-4 8-4 4 0 8 4 8 8 0 1-1 1-1 2 0 0 0 0 0 0-6 14 0 30 7 47 8 18 16 38 7 58-1 3-4 5-8 5-4 0-7-4-7-8 0-1 0-2 0-3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7-15 0-29-7-46-7-18-15-38-7-58 0 0 0 0 0 0z"/>
<glyph unicode="&#57354;" d="M467 428c-58 57-151 58-211 4-60 54-153 53-211-4-60-60-60-156 0-215 17-17 177-175 177-175 19-19 49-19 68 0 0 0 175 173 177 175 60 59 60 155 0 215z m-23-192l-177-175c-6-7-16-7-22 0l-177 175c-47 46-47 122 0 169 45 45 118 47 166 4l22-20 22 20c48 43 121 41 166-4 47-47 47-123 0-169z m-296 156c0 0 0 0 0 0-38 0-68-30-68-68 0-4 4-8 8-8 4 0 8 4 8 8l0 0c0 29 23 52 52 52l0 0c4 0 8 4 8 8 0 4-4 8-8 8z"/>
<glyph unicode="&#57355;" d="M256 352c-71 0-128-57-128-128 0-71 57-128 128-128 71 0 128 57 128 128 0 71-57 128-128 128z m73-190c-35-41-95-45-135-11-41 35-45 95-11 135 35 41 95 45 135 11 41-35 45-95 11-135z m-73 126c-35 0-64-29-64-64l0 0c0-4 4-8 8-8 4 0 8 4 8 8l0 0c0 26 21 48 48 48 4 0 8 4 8 8 0 4-4 8-8 8z m216 79l-69 12-22 55c-8 18-25 30-45 30l-160 0c-20 0-37-12-45-30l-22-55-69-12c-23-4-40-23-40-47l0-240c0-26 22-48 48-48l416 0c26 0 48 22 48 48l0 240c0 24-17 43-40 47z m8-287c0-9-7-16-16-16l-416 0c-9 0-16 7-16 16l0 240c0 8 6 14 13 16l87 14 29 72c3 6 8 10 15 10l160 0c7 0 12-4 15-10l29-72 87-14c7-2 13-8 13-16z"/>
<glyph unicode="&#57356;" d="M500 409l-80 64c-6 5-13 7-20 7l-288 0c-7 0-14-2-20-7l-80-64c-10-8-15-22-10-35l32-96c3-10 10-17 20-20 3-1 7-2 10-2 6 0 11 1 16 4l0-196c0-18 14-32 32-32l288 0c18 0 32 14 32 32l0 196c5-3 10-4 16-4 4 0 7 1 10 2 10 3 17 10 20 20l32 96c5 13 0 27-10 35z m-184 39c-9-19-32-32-60-32-28 0-51 13-60 32z m132-160l-48 32 0-256-288 0 0 256-48-32-32 96 80 64 67 0c9-28 40-48 77-48 37 0 68 20 77 48l67 0 80-64z"/>
<glyph unicode="&#57357;" d="M176 48l-176 176 80 83 112-107 248 248 72-72z"/>
<glyph unicode="&#57358;" d="M227 182c-2-2-6-4-9-4-3 0-7 2-9 4l-56 56 18 18 47-47 125 126 17-18z"/>
<glyph unicode="&#57359;" d="M475 128l0-37c0-5-1-9-5-12-4-4-8-6-13-6l-402 0c-5 0-9 2-13 6-4 3-5 7-5 12l0 37c0 5 1 9 5 13 4 3 8 5 13 5l402 0c5 0 9-2 13-5 4-4 5-8 5-13z m0 146l0-36c0-5-1-10-5-13-4-4-8-6-13-6l-402 0c-5 0-9 2-13 6-4 3-5 8-5 13l0 36c0 5 1 10 5 13 4 4 8 6 13 6l402 0c5 0 9-2 13-6 4-3 5-8 5-13z m0 147l0-37c0-5-1-9-5-13-4-3-8-5-13-5l-402 0c-5 0-9 2-13 5-4 4-5 8-5 13l0 37c0 5 1 9 5 12 4 4 8 6 13 6l402 0c5 0 9-2 13-6 4-3 5-7 5-12z"/>
<glyph unicode="&#57360;" d="M267 128l0 171c42-2 85 20 85 64l0 42c0 10-1 22-6 22-5 0-10-5-15-11l-32-32-32 36c-4 4-6 7-11 7-5 0-7-3-11-7l-32-36-32 32c-5 6-10 11-15 11-5 0-6-12-6-22l0-42c0-44 43-66 85-64l0-171c-21 43-85 107-149 85 0 0 53-128 160-128 107 0 160 128 160 128-64 22-128-42-149-85z"/>
<glyph unicode="&#57361;" d="M402 201c0-5-2-9-5-13l-128-128c-4-3-8-5-13-5-5 0-9 2-13 5l-128 128c-3 4-5 8-5 13 0 5 2 9 5 13 4 4 8 5 13 5l256 0c5 0 9-1 13-5 3-4 5-8 5-13z m0 110c0-5-2-9-5-13-4-4-8-5-13-5l-256 0c-5 0-9 1-13 5-3 4-5 8-5 13 0 5 2 9 5 13l128 128c4 3 8 5 13 5 5 0 9-2 13-5l128-128c3-4 5-8 5-13z"/>
<glyph unicode="&#57362;" d="M402 311c0-5-2-9-5-13l-128-128c-4-4-8-5-13-5-5 0-9 1-13 5l-128 128c-3 4-5 8-5 13 0 5 2 9 5 13 4 3 8 5 13 5l256 0c5 0 9-2 13-5 3-4 5-8 5-13z"/>
<glyph unicode="&#57363;" d="M235 459c-11 0-11-11-11-11l0-96c0 0 0-11-11-11-10 0-10 11-10 11l0 96c0 0 0 11-11 11-11 0-11-11-11-11l0-96c0 0 0-11-10-11-11 0-11 11-11 11l0 96c0 0 0 11-11 11-10 0-10-11-10-11l0-128c0-11 5-21 16-32 10-11 5-21 5-32l0-32-5-139c-1-10 13-32 34-32 22 0 29 22 28 32l-14 139 0 32c0 10 5 21 16 32 10 10 26 21 26 32l0 128c0 0 0 11-10 11z m64-32c-11-22-11-75-11-96l0-107c0-11 11-21 21-21l22 0 0-128c0-11 10-22 21-22 11 0 21 11 21 22l0 384c-21 0-61-5-74-32z"/>
<glyph unicode="&#57364;" d="M21 469l0-448 448 0 0 448z m405-149l-106 0 0 107 106 0z m0-128l-106 0 0 107 106 0z m0-128l-106 0 0 107 106 0z m-362 107l107 0 0-107-107 0z m0 128l107 0 0-107-107 0z m0 128l107 0 0-107-107 0z m234-107l-106 0 0 107 106 0 0-107z m0-128l-106 0 0 107 106 0 0-107z m-106-21l106 0 0-107-106 0z"/>
<glyph unicode="&#57365;" d="M119 375c0 10-3 18-10 25-6 6-14 10-24 10-9 0-17-4-24-10-6-7-10-15-10-25 0-9 4-17 10-24 7-6 15-10 24-10 10 0 18 4 24 10 7 7 10 15 10 24z m285-153c0-10-3-18-10-24l-131-131c-7-7-15-10-24-10-9 0-17 3-24 10l-191 191c-6 6-12 15-17 27-5 11-7 21-7 31l0 111c0 9 3 17 10 24 7 6 15 10 24 10l111 0c9 0 20-3 31-7 12-5 21-11 27-17l191-191c7-7 10-15 10-24z m102 0c0-10-3-18-9-24l-131-131c-7-7-15-10-25-10-6 0-11 1-15 4-4 2-9 6-15 12l126 125c6 6 10 14 10 24 0 9-4 17-10 24l-191 191c-7 6-16 12-27 17-11 4-22 7-31 7l59 0c10 0 20-3 32-7 11-5 20-11 27-17l191-191c6-7 9-15 9-24z"/>
<glyph unicode="&#57345;" d="M256 459c6 0 11-2 15-7 4-4 6-9 6-15l0-170 171 0c6 0 11-2 15-7 4-4 6-9 6-15 0-6-2-11-6-15-4-4-9-6-15-6l-171 0 0-171c0-6-2-11-6-15-4-4-9-6-15-6-6 0-11 2-15 6-4 4-6 9-6 15l0 171-171 0c-6 0-11 2-15 6-4 4-6 9-6 15 0 6 2 11 6 15 4 5 9 7 15 7l171 0 0 170c0 6 2 11 6 15 4 5 9 7 15 7z"/>
<glyph unicode="&#57347;" d="M426 134c0-7-3-14-8-19l-39-39c-5-5-12-8-20-8-7 0-14 3-19 8l-84 84-84-84c-5-5-12-8-19-8-8 0-15 3-20 8l-39 39c-5 5-8 12-8 19 0 8 3 14 8 20l84 84-84 84c-5 5-8 12-8 19 0 8 3 14 8 20l39 38c5 6 12 8 20 8 7 0 14-2 19-8l84-84 84 84c5 6 12 8 19 8 8 0 15-2 20-8l39-38c5-6 8-12 8-20 0-7-3-14-8-19l-84-84 84-84c5-6 8-12 8-20z"/>
</font></defs></svg>

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Binary file not shown.

View File

10
static/assets/js/Chart.bundle.min.js vendored Normal file

File diff suppressed because one or more lines are too long

7
static/assets/js/bootstrap.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
/**
* Minified by jsDelivr using UglifyJS v3.4.1.
* Original file: /npm/chartist-plugin-legend@0.6.2/chartist-plugin-legend.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
!function(t,s){"function"==typeof define&&define.amd?define(["chartist"],function(e){return t.returnExportsGlobal=s(e)}):"object"==typeof exports?module.exports=s(require("chartist")):t["Chartist.plugins.legend"]=s(t.Chartist)}(this,function(n){"use strict";var t={className:"",classNames:!1,removeAll:!1,legendNames:!1,clickable:!0,onClick:null,position:"top"};return n.plugins=n.plugins||{},n.plugins.legend=function(u){function f(e,t){return e-t}if(u&&u.position){if(!("top"===u.position||"bottom"===u.position||u.position instanceof HTMLElement))throw Error("The position you entered is not a valid position");if(u.position instanceof HTMLElement){var e=u.position;delete u.position}}return u=n.extend({},t,u),e&&(u.position=e),function(l){var e=l.container.querySelector(".ct-legend");if(e&&e.parentNode.removeChild(e),u.clickable){var t=l.data.series.map(function(e,t){return"object"!=typeof e&&(e={value:e}),e.className=e.className||l.options.classNames.series+"-"+n.alphaNumerate(t),e});l.data.series=t}var o=document.createElement("ul"),s=l instanceof n.Pie;o.className="ct-legend",l instanceof n.Pie&&o.classList.add("ct-legend-inside"),"string"==typeof u.className&&0<u.className.length&&o.classList.add(u.className),l.options.width&&(o.style.cssText="width: "+l.options.width+"px;margin: 0 auto;");var r=[],c=l.data.series.slice(0),i=l.data.series,d=s&&l.data.labels&&l.data.labels.length;if(d){var p=l.data.labels.slice(0);i=l.data.labels}i=u.legendNames||i;var a=Array.isArray(u.classNames)&&u.classNames.length===i.length;i.forEach(function(e,t){var s=document.createElement("li");s.className="ct-series-"+t,a&&(s.className+=" "+u.classNames[t]),s.setAttribute("data-legend",t),s.textContent=e.name||e,o.appendChild(s)}),l.on("created",function(e){if(u.position instanceof HTMLElement)u.position.insertBefore(o,null);else switch(u.position){case"top":l.container.insertBefore(o,l.container.childNodes[0]);break;case"bottom":l.container.insertBefore(o,null)}}),u.clickable&&o.addEventListener("click",function(e){var t=e.target;if(t.parentNode===o&&t.hasAttribute("data-legend")){e.preventDefault();var s=parseInt(t.getAttribute("data-legend")),i=r.indexOf(s);if(-1<i)r.splice(i,1),t.classList.remove("inactive");else if(u.removeAll)r.push(s),t.classList.add("inactive");else if(1<l.data.series.length)r.push(s),t.classList.add("inactive");else r=[],Array.prototype.slice.call(o.childNodes).forEach(function(e){e.classList.remove("inactive")});var a=c.slice(0);if(d)var n=p.slice(0);r.sort(f).reverse(),r.forEach(function(e){a.splice(e,1),d&&n.splice(e,1)}),u.onClick&&u.onClick(l,e),l.data.series=a,d&&(l.data.labels=n),l.update()}})}},n.plugins.legend});
//# sourceMappingURL=/sm/d9b6e7e5dd3ae068eedc2e2b6df5e6ac436656d1104243b6982be9cd6795b213.map

10
static/assets/js/chartist.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,514 @@
( function ( $ ) {
"use strict";
// Flot Charts
$.plot("#flotBar1", [{
data: [[0, 3], [2, 8], [4, 5], [6, 13],[8,5], [10,7],[12,4], [14,6]],
bars: {
show: true,
lineWidth: 0,
fillColor: '#85c988'
}
}], {
grid: {
show: false,
hoverable: true
}
});
$.plot("#flotBar2", [{
data: [[0, 3], [2, 8], [4, 5], [6, 13],[8,5], [10,7],[12,4], [14,6]],
bars: {
show: true,
lineWidth: 0,
fillColor: '#f58f8d'
}
}], {
grid: {
show: false
}
});
var plot = $.plot($('#flotLine1'),[{
data: [[0, 1], [1, 3], [2,6], [3, 5], [4, 7], [5, 8], [6, 10]],
color: '#fff'
}],
{
series: {
lines: {
show: false
},
splines: {
show: true,
tension: 0.4,
lineWidth: 2
//fill: 0.4
},
shadowSize: 0
},
points: {
show: false,
},
legend: {
noColumns: 1,
position: 'nw'
},
grid: {
hoverable: true,
clickable: true,
show: false
},
yaxis: {
min: 0,
max: 10,
color: '#eee',
font: {
size: 10,
color: '#6a7074'
}
},
xaxis: {
color: '#eee',
font: {
size: 10,
color: '#6a7074'
}
}
});
var plot = $.plot($('#flotLine2'),[{
data: [[0, 8], [1, 5], [2,7], [3, 8], [4, 7], [5, 10], [6, 8], [7, 5], [8, 8], [9, 6], [10, 4]],
label: 'New Data Flow',
color: '#42a5f5'
}],
{
series: {
lines: {
show: false
},
splines: {
show: true,
tension: 0.4,
lineWidth: 1,
fill: 0.25
},
shadowSize: 0
},
points: {
show: false
},
legend: {
show: false
},
grid: {
show: false
}
});
var plot = $.plot($('#flotLine3'),[{
data: [[0, 8], [1, 5], [2,7], [3, 8], [4, 7], [5, 10], [6, 8], [7, 5], [8, 8], [9, 6], [10, 4]],
label: 'New Data Flow',
color: '#ffa726'
}],
{
series: {
lines: {
show: false
},
splines: {
show: true,
tension: 0.4,
lineWidth: 1,
fill: 0.25
},
shadowSize: 0
},
points: {
show: false
},
legend: {
show: false
},
grid: {
show: false
}
});
var plot = $.plot($('#flotLine4'),[{
data: [[0, 8], [1, 5], [2,7], [3, 8], [4, 7], [5, 10], [6, 8], [7, 5], [8, 8], [9, 6], [10, 4]],
label: 'New Data Flow',
color: '#5c6bc0'
}],
{
series: {
lines: {
show: false
},
splines: {
show: true,
tension: 0.4,
lineWidth: 1,
fill: 0.25
},
shadowSize: 0
},
points: {
show: false
},
legend: {
show: false
},
grid: {
show: false
}
});
var newCust = [[0, 3], [1, 5], [2,4], [3, 7], [4, 9], [5, 3], [6, 6], [7, 4], [8, 10]];
var plot = $.plot($('#flotLine5'),[{
data: newCust,
label: 'New Data Flow',
color: '#fff'
}],
{
series: {
lines: {
show: true,
lineColor: '#fff',
lineWidth: 1
},
points: {
show: true,
fill: true,
fillColor: "#ffffff",
symbol: "circle",
radius: 3
},
shadowSize: 0
},
points: {
show: true,
},
legend: {
show: false
},
grid: {
show: false
}
});
/**************** PIE CHART *******************/
var piedata = [
{ label: "Desktop visits", data: [[1,32]], color: '#5c6bc0'},
{ label: "Tab visits", data: [[1,33]], color: '#ef5350'},
{ label: "Mobile visits", data: [[1,35]], color: '#66bb6a'}
];
$.plot('#flotPie1', piedata, {
series: {
pie: {
show: true,
radius: 1,
innerRadius: 0.4,
label: {
show: true,
radius: 2/3,
threshold: 1
},
stroke: {
width: 0.1
}
}
},
grid: {
hoverable: true,
clickable: true
}
});
// Real Time Chart
var data = [], totalPoints = 50;
function getRandomData() {
if (data.length > 0)
data = data.slice(1);
while (data.length < totalPoints) {
var prev = data.length > 0 ? data[data.length - 1] : 50,
y = prev + Math.random() * 10 - 5;
if (y < 0) {
y = 0;
} else if (y > 100) {
y = 100;
}
data.push(y);
}
var res = [];
for (var i = 0; i < data.length; ++i) {
res.push([i, data[i]])
}
return res;
}
// Set up the control widget
var updateInterval = 1000;
var plot5 = $.plot('#flotRealtime2', [ getRandomData() ], {
colors: ['#5c6bc0'],
series: {
// label: 'Upload',
lines: {
show: true,
lineWidth: 0,
fill: 0.9
},
shadowSize: 0 // Drawing is faster without shadows
},
grid: {
show: false
},
xaxis: {
color: '#eee',
font: {
size: 10,
color: '#6a7074'
}
},
yaxis: {
min: 0,
max: 100,
color: '#eee',
font: {
size: 10,
color: '#6a7074'
}
}
});
function update_plot5() {
plot5.setData([getRandomData()]);
plot5.draw();
setTimeout(update_plot5, updateInterval);
}
update_plot5();
// Traffic Chart
if ($('#traffic-chart').length) {
var chart = new Chartist.Line('#traffic-chart', {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
series: [
[13000, 18000, 35000, 18000, 25000, 26000, 22000, 20000, 18000, 35000, 18000, 25000],
[15000, 23000, 15000, 30000, 20000, 31000, 15000, 15000, 23000, 15000, 30000, 20000],
[25000, 15000, 38000, 25500, 15000, 22500, 30000, 25000, 15000, 38000, 25500, 15000]
]
}, {
low: 0,
showArea: true,
showLine: false,
showPoint: false,
fullWidth: true,
axisX: {
showGrid: true
}
});
chart.on('draw', function(data) {
if(data.type === 'line' || data.type === 'area') {
data.element.animate({
d: {
begin: 2000 * data.index,
dur: 2000,
from: data.path.clone().scale(1, 0).translate(0, data.chartRect.height()).stringify(),
to: data.path.clone().stringify(),
easing: Chartist.Svg.Easing.easeOutQuint
}
});
}
});
}
/* Gauge Chart */
var g1;
document.addEventListener("DOMContentLoaded", function(event) {
g1 = new JustGage({
id: "g1",
value: 72,
//title: "Completed",
fill: '#ffa726',
symbol: '%',
min: 0,
max: 100,
donut: true,
gaugeWidthScale: 0.4,
counter: true,
hideInnerShadow: true
});
});
/* Sparkline Tab Charts */
$('#sparklinedash, #sparklinedash6, #sparklinedash11').sparkline([ 0, 5, 6, 10, 9, 12, 4, 9], {
type: 'bar',
height: '30',
barWidth: '5',
disableHiddenCheck: true,
resize: true,
barSpacing: '2',
barColor: '#42a5f5'
});
$('#sparklinedash2, #sparklinedash7, #sparklinedash12').sparkline([ 0, 5, 6, 10, 9, 12, 4, 9], {
type: 'bar',
height: '30',
barWidth: '5',
resize: true,
barSpacing: '2',
barColor: '#ef5350'
});
$('#sparklinedash3, #sparklinedash8, #sparklinedash13').sparkline([ 0, 5, 6, 10, 9, 12, 4, 9], {
type: 'bar',
height: '30',
barWidth: '5',
resize: true,
barSpacing: '2',
barColor: '#66bb6a'
});
$('#sparklinedash4, #sparklinedash9, #sparklinedash14').sparkline([ 0, 5, 6, 10, 9, 12, 4, 9], {
type: 'bar',
height: '30',
barWidth: '5',
resize: true,
barSpacing: '2',
barColor: '#5c6bc0'
});
$('#sparklinedash5, #sparklinedash10, #sparklinedash15').sparkline([ 0, 5, 6, 10, 9, 12, 4, 9], {
type: 'bar',
height: '30',
barWidth: '5',
resize: true,
barSpacing: '2',
barColor: '#ffa726'
});
// Chartist
var ctx = document.getElementById('area_chart').getContext('2d');
var chart = new Chart(ctx, {
// The type of chart we want to create
type: 'line',
// The data for our dataset
data: {
labels: ["Jan", "Feb", "Mar", "Jun", "Jul", "Aug", "Sep"],
datasets: [{
label: "My First dataset",
backgroundColor: 'transparent',
borderColor: '#4fabf5',
pointBackgroundColor: "#ffffff",
data: [5000, 2700, 8500, 5500, 4500, 4900, 3000]
},
{
label: "My Second dataset",
backgroundColor: 'rgba(230,240,244,.5)',
borderColor: '#6ebe73',
pointBackgroundColor: "#ffffff",
data: [5500, 2900, 7000, 3500, 5000, 3300, 4800 ]
},
{
label: "My Third dataset",
backgroundColor: 'transparent',
borderColor: '#5c6bc0',
pointBackgroundColor: "#ffffff",
data: [2700, 7000, 3500, 6900, 2600, 6500, 2200]
}]
},
// Configuration options go here
options: {
maintainAspectRatio: true,
legend: {
display: false
},
scales: {
xAxes: [{
display: true
}],
yAxes: [{
display: true,
gridLines: {
zeroLineColor: '#e8e9ef',
color: '#e8e9ef',
drawBorder: true
}
}]
},
elements: {
line: {
tension: 0.00001,
borderWidth: 1
},
point: {
radius: 4,
hitRadius: 10,
hoverRadius: 4,
borderWidth: 2
}
}
}
});
})( jQuery );
/*Knob*/
if (Gauge) {
var opts = {
lines: 12, // The number of lines to draw
angle: 0, // The length of each line
lineWidth: 0.05, // The line thickness
pointer: {
length: .75, // The radius of the inner circle
strokeWidth: 0.03, // The rotation offset
color: '#000' // Fill color
},
limitMax: 'true', // If true, the pointer will not go past the end of the gauge
colorStart: '#42a5f5', // Colors
colorStop: '#42a5f5', // just experiment with them
strokeColor: '#fbfbfc', // to see which ones work best for you
generateGradient: true
};
var target = document.getElementById('g2'); // your canvas element
var gauge = new Gauge(target).setOptions(opts); // create sexy gauge!
gauge.maxValue = 3000; // set max gauge value
gauge.animationSpeed = 32; // set animation speed (32 is default value)
gauge.set(1150); // set actual value
//gauge.setTextField(document.getElementById("gauge-textfield"));
}

View File

@@ -0,0 +1,14 @@
[LocalizedFileNames]
chartist-plugin-legend.min.js=@chartist-plugin-legend.min.js,0
Chart.bundle.min.js=@Chart.bundle.min.js,0
chartist.min.js=@chartist.min.js,0
jquery.matchHeight.min.js=@jquery.matchHeight.min.js,0
bootstrap.min.js=@bootstrap.min.js,0
popper.min.js=@popper.min.js,0
jquery.min.js=@jquery.min.js,0
jquery.simpleWeather.min.js=@jquery.simpleWeather.min.js,0
fullcalendar.min.js=@fullcalendar.min.js,0
moment.min.js=@moment.min.js,0
jquery.flot.pie.min.js=@jquery.flot.pie.min.js,0
jquery.flot.spline.min.js=@jquery.flot.spline.min.js,0
jquery.flot.min.js=@jquery.flot.min.js,0

12
static/assets/js/fullcalendar.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,418 @@
( function ( $ ) {
"use strict";
//Team chart
var ctx = document.getElementById( "team-chart" );
ctx.height = 150;
var myChart = new Chart( ctx, {
type: 'line',
data: {
labels: [ "2012", "2013", "2014", "2015", "2016", "2017", "2018" ],
type: 'line',
defaultFontFamily: 'Montserrat',
datasets: [ {
data: [ 0, 7, 3, 5, 2, 8, 6 ],
label: "Expense",
backgroundColor: 'rgba(0,200,155,.35)',
borderColor: 'rgba(0,200,155,0.60)',
borderWidth: 3.5,
pointStyle: 'circle',
pointRadius: 5,
pointBorderColor: 'transparent',
pointBackgroundColor: 'rgba(0,200,155,0.60)',
},
{
data: [ 0, 6, 3, 4, 3, 7, 10 ],
label: "Profit",
backgroundColor: 'rgba(0,194,146,.25)',
borderColor: 'rgba(0,194,146,0.5)',
borderWidth: 3.5,
pointStyle: 'circle',
pointRadius: 5,
pointBorderColor: 'transparent',
pointBackgroundColor: 'rgba(0,194,146,0.5)',
}, ]
},
options: {
responsive: true,
tooltips: {
mode: 'index',
titleFontSize: 12,
titleFontColor: '#000',
bodyFontColor: '#000',
backgroundColor: '#fff',
titleFontFamily: 'Montserrat',
bodyFontFamily: 'Montserrat',
cornerRadius: 3,
intersect: false,
},
legend: {
display: false,
position: 'top',
labels: {
usePointStyle: true,
fontFamily: 'Montserrat',
},
},
scales: {
xAxes: [ {
display: true,
gridLines: {
display: false,
drawBorder: false
},
scaleLabel: {
display: false,
labelString: 'Month'
}
} ],
yAxes: [ {
display: true,
gridLines: {
display: false,
drawBorder: false
},
scaleLabel: {
display: true,
labelString: 'Value'
}
} ]
},
title: {
display: false,
}
}
} );
//Sales chart
var ctx = document.getElementById( "sales-chart" );
ctx.height = 150;
var myChart = new Chart( ctx, {
type: 'line',
data: {
labels: [ "2012", "2013", "2014", "2015", "2016", "2017", "2018" ],
type: 'line',
defaultFontFamily: 'Montserrat',
datasets: [ {
label: "Foods",
data: [ 0, 30, 15, 110, 50, 63, 120 ],
backgroundColor: 'transparent',
borderColor: 'rgba(220,53,69,0.75)',
borderWidth: 3,
pointStyle: 'circle',
pointRadius: 5,
pointBorderColor: 'transparent',
pointBackgroundColor: 'rgba(220,53,69,0.75)',
}, {
label: "Electronics",
data: [ 0, 50, 40, 80, 35, 99, 80 ],
backgroundColor: 'transparent',
borderColor: 'rgba(40,167,69,0.75)',
borderWidth: 3,
pointStyle: 'circle',
pointRadius: 5,
pointBorderColor: 'transparent',
pointBackgroundColor: 'rgba(40,167,69,0.75)',
} ]
},
options: {
responsive: true,
tooltips: {
mode: 'index',
titleFontSize: 12,
titleFontColor: '#000',
bodyFontColor: '#000',
backgroundColor: '#fff',
titleFontFamily: 'Montserrat',
bodyFontFamily: 'Montserrat',
cornerRadius: 3,
intersect: false,
},
legend: {
display: false,
labels: {
usePointStyle: true,
fontFamily: 'Montserrat',
},
},
scales: {
xAxes: [ {
display: true,
gridLines: {
display: false,
drawBorder: false
},
scaleLabel: {
display: false,
labelString: 'Month'
}
} ],
yAxes: [ {
display: true,
gridLines: {
display: false,
drawBorder: false
},
scaleLabel: {
display: true,
labelString: 'Value'
}
} ]
},
title: {
display: false,
text: 'Normal Legend'
}
}
} );
//line chart
var ctx = document.getElementById( "lineChart" );
ctx.height = 150;
var myChart = new Chart( ctx, {
type: 'line',
data: {
labels: [ "January", "February", "March", "April", "May", "June", "July" ],
datasets: [
{
label: "My First dataset",
borderColor: "rgba(0,0,0,.09)",
borderWidth: "1",
backgroundColor: "rgba(0,0,0,.07)",
data: [ 20, 47, 35, 43, 65, 45, 35 ]
},
{
label: "My Second dataset",
borderColor: "rgba(0, 194, 146, 0.9)",
borderWidth: "1",
backgroundColor: "rgba(0, 194, 146, 0.5)",
pointHighlightStroke: "rgba(26,179,148,1)",
data: [ 16, 32, 18, 27, 42, 33, 44 ]
}
]
},
options: {
responsive: true,
tooltips: {
mode: 'index',
intersect: false
},
hover: {
mode: 'nearest',
intersect: true
}
}
} );
//bar chart
var ctx = document.getElementById( "barChart" );
// ctx.height = 200;
var myChart = new Chart( ctx, {
type: 'bar',
data: {
labels: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul" ],
datasets: [
{
label: "My First dataset",
data: [ 65, 59, 80, 81, 56, 55, 45 ],
borderColor: "rgba(0, 194, 146, 0.9)",
borderWidth: "0",
backgroundColor: "rgba(0, 194, 146, 0.5)"
},
{
label: "My Second dataset",
data: [ 28, 48, 40, 19, 86, 27, 76 ],
borderColor: "rgba(0,0,0,0.09)",
borderWidth: "0",
backgroundColor: "rgba(0,0,0,0.07)"
}
]
},
options: {
scales: {
yAxes: [ {
ticks: {
beginAtZero: true
}
} ]
}
}
} );
//radar chart
var ctx = document.getElementById( "radarChart" );
ctx.height = 160;
var myChart = new Chart( ctx, {
type: 'radar',
data: {
labels: [ [ "Eating", "Dinner" ], [ "Drinking", "Water" ], "Sleeping", [ "Designing", "Graphics" ], "Coding", "Cycling", "Running" ],
datasets: [
{
label: "My First dataset",
data: [ 65, 70, 66, 45, 5, 55, 40 ],
borderColor: "rgba(0, 194, 146, 0.6)",
borderWidth: "1",
backgroundColor: "rgba(0, 194, 146, 0.4)"
},
{
label: "My Second dataset",
data: [ 28, 5, 55, 19, 63, 27, 68 ],
borderColor: "rgba(0, 194, 146, 0.7",
borderWidth: "1",
backgroundColor: "rgba(0, 194, 146, 0.5)"
}
]
},
options: {
legend: {
position: 'top'
},
scale: {
ticks: {
beginAtZero: true
}
}
}
});
//pie chart
var ctx = document.getElementById( "pieChart" );
ctx.height = 300;
var myChart = new Chart( ctx, {
type: 'pie',
data: {
datasets: [ {
data: [ 45, 25, 20, 10 ],
backgroundColor: [
"rgba(0, 194, 146,0.9)",
"rgba(0, 194, 146,0.7)",
"rgba(0, 194, 146,0.5)",
"rgba(0,0,0,0.07)"
],
hoverBackgroundColor: [
"rgba(0, 194, 146,0.9)",
"rgba(0, 194, 146,0.7)",
"rgba(0, 194, 146,0.5)",
"rgba(0,0,0,0.07)"
]
} ],
labels: [
"green",
"green",
"green"
]
},
options: {
responsive: true
}
} );
//doughut chart
var ctx = document.getElementById( "doughutChart" );
ctx.height = 150;
var myChart = new Chart( ctx, {
type: 'doughnut',
data: {
datasets: [ {
data: [ 35, 40, 20, 5 ],
backgroundColor: [
"rgba(0, 194, 146,0.9)",
"rgba(0, 194, 146,0.7)",
"rgba(0, 194, 146,0.5)",
"rgba(0,0,0,0.07)"
],
hoverBackgroundColor: [
"rgba(0, 194, 146,0.9)",
"rgba(0, 194, 146,0.7)",
"rgba(0, 194, 146,0.5)",
"rgba(0,0,0,0.07)"
]
} ],
labels: [
"green",
"green",
"green",
"green"
]
},
options: {
responsive: true
}
} );
//polar chart
var ctx = document.getElementById( "polarChart" );
ctx.height = 150;
var myChart = new Chart( ctx, {
type: 'polarArea',
data: {
datasets: [ {
data: [ 15, 18, 10, 7, 19],
backgroundColor: [
"rgba(0, 194, 146,0.9)",
"rgba(0, 194, 146,0.8)",
"rgba(0, 194, 146,0.7)",
"rgba(0,0,0,0.2)",
"rgba(0, 194, 146,0.5)"
]
} ],
labels: [
"green",
"green",
"green",
"green"
]
},
options: {
responsive: true
}
} );
// single bar chart
var ctx = document.getElementById( "singelBarChart" );
ctx.height = 150;
var myChart = new Chart( ctx, {
type: 'bar',
data: {
labels: [ "Sun", "Mon", "Tu", "Wed", "Th", "Fri", "Sat" ],
datasets: [
{
label: "My First dataset",
data: [ 55, 50, 75, 80, 56, 55, 60 ],
borderColor: "rgba(0, 194, 146, 0.9)",
borderWidth: "0",
backgroundColor: "rgba(0, 194, 146, 0.5)"
}
]
},
options: {
scales: {
yAxes: [ {
ticks: {
beginAtZero: true
}
} ]
}
}
} );
} )( jQuery );

View File

@@ -0,0 +1,53 @@
(function ($) {
// "use strict";
/* Data Table
-------------*/
$('#bootstrap-data-table').DataTable({
lengthMenu: [[10, 20, 50, -1], [10, 20, 50, "All"]],
});
$('#bootstrap-data-table-export').DataTable({
dom: 'lBfrtip',
lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]],
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$('#row-select').DataTable( {
initComplete: function () {
this.api().columns().every( function () {
var column = this;
var select = $('<select class="form-control"><option value=""></option></select>')
.appendTo( $(column.footer()).empty() )
.on( 'change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search( val ? '^'+val+'$' : '', true, false )
.draw();
} );
column.data().unique().sort().each( function ( d, j ) {
select.append( '<option value="'+d+'">'+d+'</option>' )
} );
} );
}
} );
})(jQuery);

View File

@@ -0,0 +1,379 @@
(function($){
"use strict"; // Start of use strict
var SufeeAdmin = {
cpuLoad: function(){
var data = [],
totalPoints = 300;
function getRandomData() {
if ( data.length > 0 )
data = data.slice( 1 );
// Do a random walk
while ( data.length < totalPoints ) {
var prev = data.length > 0 ? data[ data.length - 1 ] : 50,
y = prev + Math.random() * 10 - 5;
if ( y < 0 ) {
y = 0;
} else if ( y > 100 ) {
y = 100;
}
data.push( y );
}
// Zip the generated y values with the x values
var res = [];
for ( var i = 0; i < data.length; ++i ) {
res.push( [ i, data[ i ] ] )
}
return res;
}
// Set up the control widget
var updateInterval = 30;
$( "#updateInterval" ).val( updateInterval ).change( function () {
var v = $( this ).val();
if ( v && !isNaN( +v ) ) {
updateInterval = +v;
if ( updateInterval < 1 ) {
updateInterval = 1;
} else if ( updateInterval > 3000 ) {
updateInterval = 3000;
}
$( this ).val( "" + updateInterval );
}
} );
var plot = $.plot( "#cpu-load", [ getRandomData() ], {
series: {
shadowSize: 0 // Drawing is faster without shadows
},
yaxis: {
min: 0,
max: 100
},
xaxis: {
show: false
},
colors: [ "#00c292" ],
grid: {
color: "transparent",
hoverable: true,
borderWidth: 0,
backgroundColor: 'transparent'
},
tooltip: true,
tooltipOpts: {
content: "Y: %y",
defaultTheme: false
}
} );
function update() {
plot.setData( [ getRandomData() ] );
// Since the axes don't change, we don't need to call plot.setupGrid()
plot.draw();
setTimeout( update, updateInterval );
}
update();
},
lineFlot: function(){
var sin = [],
cos = [];
for ( var i = 0; i < 10; i += 0.1 ) {
sin.push( [ i, Math.sin( i ) ] );
cos.push( [ i, Math.cos( i ) ] );
}
var plot = $.plot( "#flot-line", [
{
data: sin,
label: "sin(x)"
},
{
data: cos,
label: "cos(x)"
}
], {
series: {
lines: {
show: true
},
points: {
show: true
}
},
yaxis: {
min: -1.2,
max: 1.2
},
colors: [ "#00c292", "#F44336" ],
grid: {
color: "#fff",
hoverable: true,
borderWidth: 0,
backgroundColor: 'transparent'
},
tooltip: true,
tooltipOpts: {
content: "'%s' of %x.1 is %y.4",
shifts: {
x: -65,
y: 25
}
}
} );
},
pieFlot: function(){
var data = [
{
label: " Data 1",
data: 2,
color: "#8fc9fb"
},
{
label: " Data 2",
data: 4,
color: "#007BFF"
},
{
label: " Data 3",
data: 7,
color: "#00c292"
},
{
label: " Data 4",
data: 15,
color: "#F44336"
},
{
label: " Data 5",
data: 10,
color: "#32c39f"
}
];
var plotObj = $.plot( $( "#flot-pie" ), data, {
series: {
pie: {
show: true,
radius: 1,
label: {
show: false,
}
}
},
grid: {
hoverable: true
},
tooltip: {
show: true,
content: "%p.0%, %s, n=%n", // show percentages, rounding to 2 decimal places
shifts: {
x: 20,
y: 0
},
defaultTheme: false
}
} );
},
line2Flot: function(){
// first chart
var chart1Options = {
series: {
lines: {
show: true
},
points: {
show: true
}
},
xaxis: {
mode: "time",
timeformat: "%m/%d",
minTickSize: [ 1, "day" ]
},
grid: {
hoverable: true
},
legend: {
show: false
},
grid: {
color: "#fff",
hoverable: true,
borderWidth: 0,
backgroundColor: 'transparent'
},
tooltip: {
show: true,
content: "y: %y"
}
};
var chart1Data = {
label: "chart1",
color: "#007BFF",
data: [
[ 1354521600000, 6322 ],
[ 1354840000000, 6340 ],
[ 1355223600000, 6368 ],
[ 1355306400000, 6374 ],
[ 1355487300000, 6388 ],
[ 1355571900000, 6400 ]
]
};
$.plot( $( "#chart1" ), [ chart1Data ], chart1Options );
},
barFlot: function(){
// second chart
var flotBarOptions = {
series: {
bars: {
show: true,
barWidth: 43200000
}
},
xaxis: {
mode: "time",
timeformat: "%m/%d",
minTickSize: [ 1, "day" ]
},
grid: {
hoverable: true
},
legend: {
show: false
},
grid: {
color: "#fff",
hoverable: true,
borderWidth: 0,
backgroundColor: 'transparent'
},
tooltip: {
show: true,
content: "x: %x, y: %y"
}
};
var flotBarData = {
label: "flotBar",
color: "#007BFF",
data: [
[ 1354921600000, 1000 ],
[ 1355040000000, 1500 ],
[ 1355223600000, 2000 ],
[ 1355306400000, 2500 ],
[ 1355487300000, 3000 ],
[ 1355571900000, 4000 ]
]
};
$.plot( $( "#flotBar" ), [ flotBarData ], flotBarOptions );
},
plotting: function(){
var d1 = [ [ 20, 20 ], [ 30, 34 ], [ 42, 60 ], [ 54, 20 ], [ 80, 90 ] ];
//flot options
var options = {
legend: {
show: false
},
series: {
label: "Curved Lines Test",
curvedLines: {
active: true,
nrSplinePoints: 20
}
},
grid: {
color: "#fff",
hoverable: true,
borderWidth: 0,
backgroundColor: 'transparent'
},
tooltip: {
show: true,
content: "%s | x: %x; y: %y"
},
yaxes: [ {
min: 10,
max: 90
}, {
position: 'right'
} ]
};
//plotting
$.plot( $( "#flotCurve" ), [
{
data: d1,
lines: {
show: true,
fill: true,
fillColor: "rgba(0,123,255,.15)",
lineWidth: 3
},
//curve the line (old pre 1.0.0 plotting function)
curvedLines: {
apply: true,
show: true,
fill: true,
fillColor: "rgba(0,123,255,.15)",
}
}, {
data: d1,
points: {
show: true,
fill: true,
fillColor: "rgba(0,123,255,.15)",
}
}
], options );
}
};
$(document).ready(function() {
SufeeAdmin.cpuLoad();
SufeeAdmin.lineFlot();
SufeeAdmin.pieFlot();
SufeeAdmin.line2Flot();
SufeeAdmin.barFlot();
SufeeAdmin.plotting();
});
})(jQuery);

View File

@@ -0,0 +1,193 @@
!function($) {
"use strict";
var CalendarApp = function() {
this.$body = $("body")
this.$modal = $('#event-modal'),
this.$event = ('#external-events div.external-event'),
this.$calendar = $('#calendar'),
this.$saveCategoryBtn = $('.save-category'),
this.$categoryForm = $('#add-category form'),
this.$extEvents = $('#external-events'),
this.$calendarObj = null
};
/* on drop */
CalendarApp.prototype.onDrop = function (eventObj, date) {
var $this = this;
// retrieve the dropped element's stored Event Object
var originalEventObject = eventObj.data('eventObject');
var $categoryClass = eventObj.attr('data-class');
// we need to copy it, so that multiple events don't have a reference to the same object
var copiedEventObject = $.extend({}, originalEventObject);
// assign it the date that was reported
copiedEventObject.start = date;
if ($categoryClass)
copiedEventObject['className'] = [$categoryClass];
// render the event on the calendar
$this.$calendar.fullCalendar('renderEvent', copiedEventObject, true);
// is the "remove after drop" checkbox checked?
if ($('#drop-remove').is(':checked')) {
// if so, remove the element from the "Draggable Events" list
eventObj.remove();
}
},
/* on click on event */
CalendarApp.prototype.onEventClick = function (calEvent, jsEvent, view) {
var $this = this;
var form = $("<form></form>");
form.append("<label>Change event name</label>");
form.append("<div class='input-group'><input class='form-control' type=text value='" + calEvent.title + "' /><span class='input-group-btn'><button type='submit' class='btn btn-success waves-effect waves-light'><i class='fa fa-check'></i> Save</button></span></div>");
$this.$modal.modal({
backdrop: 'static'
});
$this.$modal.find('.delete-event').show().end().find('.save-event').hide().end().find('.modal-body').empty().prepend(form).end().find('.delete-event').unbind('click').click(function () {
$this.$calendarObj.fullCalendar('removeEvents', function (ev) {
return (ev._id == calEvent._id);
});
$this.$modal.modal('hide');
});
$this.$modal.find('form').on('submit', function () {
calEvent.title = form.find("input[type=text]").val();
$this.$calendarObj.fullCalendar('updateEvent', calEvent);
$this.$modal.modal('hide');
return false;
});
},
/* on select */
CalendarApp.prototype.onSelect = function (start, end, allDay) {
var $this = this;
$this.$modal.modal({
backdrop: 'static'
});
var form = $("<form></form>");
form.append("<div class='row'></div>");
form.find(".row")
.append("<div class='col-md-6'><div class='form-group'><label class='control-label'>Event Name</label><input class='form-control' placeholder='Insert Event Name' type='text' name='title'/></div></div>")
.append("<div class='col-md-6'><div class='form-group'><label class='control-label'>Category</label><select class='form-control' name='category'></select></div></div>")
.find("select[name='category']")
.append("<option value='bg-danger'>Danger</option>")
.append("<option value='bg-success'>Success</option>")
.append("<option value='bg-dark'>Dark</option>")
.append("<option value='bg-primary'>Primary</option>")
.append("<option value='bg-pink'>Pink</option>")
.append("<option value='bg-info'>Info</option>")
.append("<option value='bg-warning'>Warning</option></div></div>");
$this.$modal.find('.delete-event').hide().end().find('.save-event').show().end().find('.modal-body').empty().prepend(form).end().find('.save-event').unbind('click').click(function () {
form.submit();
});
$this.$modal.find('form').on('submit', function () {
var title = form.find("input[name='title']").val();
var beginning = form.find("input[name='beginning']").val();
var ending = form.find("input[name='ending']").val();
var categoryClass = form.find("select[name='category'] option:checked").val();
if (title !== null && title.length != 0) {
$this.$calendarObj.fullCalendar('renderEvent', {
title: title,
start:start,
end: end,
allDay: false,
className: categoryClass
}, true);
$this.$modal.modal('hide');
}
else{
alert('You have to give a title to your event');
}
return false;
});
$this.$calendarObj.fullCalendar('unselect');
},
CalendarApp.prototype.enableDrag = function() {
//init events
$(this.$event).each(function () {
// create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)
// it doesn't need to have a start or end
var eventObject = {
title: $.trim($(this).text()) // use the element's text as the event title
};
// store the Event Object in the DOM element so we can get to it later
$(this).data('eventObject', eventObject);
// make the event draggable using jQuery UI
$(this).draggable({
zIndex: 999,
revert: true, // will cause the event to go back to its
revertDuration: 0 // original position after the drag
});
});
}
/* Initializing */
CalendarApp.prototype.init = function() {
this.enableDrag();
/* Initialize the calendar */
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
var form = '';
var today = new Date($.now());
var defaultEvents = [{
title: 'Hey!',
start: new Date($.now() + 158000000),
className: 'bg-dark'
}, {
title: 'See John Deo',
start: today,
end: today,
className: 'bg-danger'
}, {
title: 'Buy a Theme',
start: new Date($.now() + 338000000),
className: 'bg-primary'
}];
var $this = this;
$this.$calendarObj = $this.$calendar.fullCalendar({
slotDuration: '00:15:00', /* If we want to split day time each 15minutes */
minTime: '08:00:00',
maxTime: '19:00:00',
defaultView: 'month',
handleWindowResize: true,
height: $(window).height() - 200,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
events: defaultEvents,
editable: true,
droppable: true, // this allows things to be dropped onto the calendar !!!
eventLimit: true, // allow "more" link when too many events
selectable: true,
drop: function(date) { $this.onDrop($(this), date); },
select: function (start, end, allDay) { $this.onSelect(start, end, allDay); },
eventClick: function(calEvent, jsEvent, view) { $this.onEventClick(calEvent, jsEvent, view); }
});
//on new event
this.$saveCategoryBtn.on('click', function(){
var categoryName = $this.$categoryForm.find("input[name='category-name']").val();
var categoryColor = $this.$categoryForm.find("select[name='category-color']").val();
if (categoryName !== null && categoryName.length != 0) {
$this.$extEvents.append('<div class="external-event bg-' + categoryColor + '" data-class="bg-' + categoryColor + '" style="position: relative;"><i class="fa fa-move"></i>' + categoryName + '</div>')
$this.enableDrag();
}
});
},
//init CalendarApp
$.CalendarApp = new CalendarApp, $.CalendarApp.Constructor = CalendarApp
}(window.jQuery),
//initializing CalendarApp
function($) {
"use strict";
$.CalendarApp.init()
}(window.jQuery);

View File

@@ -0,0 +1,246 @@
(function($){
var map;
$(document).ready(function(){
map = new GMaps({
el: '#basic-map',
lat: -12.043333,
lng: -77.028333,
zoomControl : true,
zoomControlOpt: {
style : 'SMALL',
position: 'TOP_LEFT'
},
panControl : false,
streetViewControl : false,
mapTypeControl: false,
overviewMapControl: false
});
});
var map, infoWindow;
$(document).ready(function(){
infoWindow = new google.maps.InfoWindow({});
map = new GMaps({
el: '#map-2',
zoom: 11,
lat: 41.850033,
lng: -87.6500523
});
map.loadFromFusionTables({
query: {
select: '\'Geocodable address\'',
from: '1mZ53Z70NsChnBMm-qEYmSDOvLXgrreLTkQUvvg'
},
suppressInfoWindows: true,
events: {
click: function(point){
infoWindow.setContent('You clicked here!');
infoWindow.setPosition(point.latLng);
infoWindow.open(map.map);
}
}
});
});
var map, rectangle, polygon, circle;
$(document).ready(function(){
map = new GMaps({
el: '#map-3',
lat: -12.043333,
lng: -77.028333
});
var bounds = [[-12.030397656836609,-77.02373871559225],[-12.034804866577001,-77.01154422636042]];
rectangle = map.drawRectangle({
bounds: bounds,
strokeColor: '#BBD8E9',
strokeOpacity: 1,
strokeWeight: 3,
fillColor: '#BBD8E9',
fillOpacity: 0.6
});
var paths = [[-12.040397656836609,-77.03373871559225],[-12.040248585302038,-77.03993927003302],[-12.050047116528843,-77.02448169303511],[-12.044804866577001,-77.02154422636042]];
polygon = map.drawPolygon({
paths: paths,
strokeColor: '#25D359',
strokeOpacity: 1,
strokeWeight: 3,
fillColor: '#25D359',
fillOpacity: 0.6
});
var lat = -12.040504866577001;
var lng = -77.02024422636042;
circle = map.drawCircle({
lat: lat,
lng: lng,
radius: 350,
strokeColor: '#432070',
strokeOpacity: 1,
strokeWeight: 3,
fillColor: '#432070',
fillOpacity: 0.6
});
for(var i in paths){
bounds.push(paths[i]);
}
var b = [];
for(var i in bounds){
latlng = new google.maps.LatLng(bounds[i][0], bounds[i][1]);
b.push(latlng);
}
for(var i in paths){
latlng = new google.maps.LatLng(paths[i][0], paths[i][1]);
b.push(latlng);
}
map.fitLatLngBounds(b);
});
var map;
$(document).ready(function(){
map = new GMaps({
el: '#map-4',
lat: -12.043333,
lng: -77.028333
});
//locations request
map.getElevations({
locations : [[-12.040397656836609,-77.03373871559225], [-12.050047116528843,-77.02448169303511], [-12.044804866577001,-77.02154422636042]],
callback : function (result, status){
if (status == google.maps.ElevationStatus.OK) {
for (var i in result){
map.addMarker({
lat: result[i].location.lat(),
lng: result[i].location.lng(),
title: 'Marker with InfoWindow',
infoWindow: {
content: '<p>The elevation is '+result[i].elevation+' in meters</p>'
}
});
}
}
}
});
});
var map;
$(document).ready(function(){
var map = new GMaps({
el: '#map-5',
lat: -12.043333,
lng: -77.028333
});
GMaps.geolocate({
success: function(position){
map.setCenter(position.coords.latitude, position.coords.longitude);
},
error: function(error){
alert('Geolocation failed: '+error.message);
},
not_supported: function(){
alert("Your browser does not support geolocation");
},
always: function(){
alert("Done!");
}
});
});
var map, infoWindow;
$(document).ready(function(){
infoWindow = new google.maps.InfoWindow({});
map = new GMaps({
el: '#map-6',
zoom: 12,
lat: 40.65,
lng: -73.95
});
map.loadFromKML({
url: 'https://api.flickr.com/services/feeds/geo/?g=322338@N20&lang=en-us&format=feed-georss',
suppressInfoWindows: true,
events: {
click: function(point){
infoWindow.setContent(point.featureData.infoWindowHtml);
infoWindow.setPosition(point.latLng);
infoWindow.open(map.map);
}
}
});
});
var map;
$(function () {
map = new GMaps({
el: "#map-7",
lat: -12.043333,
lng: -77.028333,
zoom: 3
});
map.addLayer('weather', {
clickable: false
});
map.addLayer('clouds');
});
map = new GMaps({
el: '#map-8',
zoom: 16,
lat: -12.043333,
lng: -77.028333,
click: function(e){
alert('click');
},
dragend: function(e){
alert('dragend');
}
});
})(jQuery);

View File

@@ -0,0 +1,100 @@
(function($){
"use strict"; // Start of use strict
$(function() {
"use strict";
// Just the defaults.
$("span.pie").peity("pie",{
width: '50',
height: '50'
})
$('span.donut').peity('donut',{
width: '50',
height: '50'
})
$(".peity-line").peity("line",{
width: '300',
height: '100'
})
$(".bar").peity("bar",{
width: '300',
height: '100'
})
$(".bar-colours-1").peity("bar", {
fill: ["red", "green", "blue"],
width: '100',
height: '100'
})
$(".bar-colours-2").peity("bar", {
fill: function(value) {
return value > 0 ? "green" : "red"
},
width: '100',
height: '100'
})
$(".bar-colours-3").peity("bar", {
fill: function(_, i, all) {
var g = parseInt((i / all.length) * 255)
return "rgb(255, " + g + ", 0)"
},
width: '100',
height: '100'
})
$(".pie-colours-1").peity("pie", {
fill: ["cyan", "magenta", "yellow", "black"],
width: '100',
height: '100'
})
$(".pie-colours-2").peity("pie", {
fill: function(_, i, all) {
var g = parseInt((i / all.length) * 255)
return "rgb(255, " + g + ", 0)"
},
width: '100',
height: '100'
})
// Using data attributes
$(".data-attributes span").peity("donut")
// Evented example.
$("select").change(function() {
var text = $(this).val() + "/" + 5
$(this)
.siblings("span.graph")
.text(text)
.change()
$("#notice").text("Chart updated: " + text)
}).change()
$("span.graph").peity("pie")
// Updating charts.
var updatingChart = $(".updating-chart").peity("line", { width: "100%",height:100 })
setInterval(function() {
var random = Math.round(Math.random() * 10)
var values = updatingChart.text().split(",")
values.shift()
values.push(random)
updatingChart
.text(values.join(","))
.change()
}, 1000)
})
})(jQuery);

View File

@@ -0,0 +1,223 @@
( function ( $ ) {
"use strict";
jQuery( '#vmap' ).vectorMap( {
map: 'world_en',
backgroundColor: null,
color: '#ffffff',
hoverOpacity: 0.7,
selectedColor: '#1de9b6',
enableZoom: true,
showTooltip: true,
values: sample_data,
scaleColors: [ '#1de9b6', '#03a9f5' ],
normalizeFunction: 'polynomial'
} );
jQuery( '#vmap2' ).vectorMap( {
map: 'dz_fr',
color: '#007BFF',
borderColor: '#fff',
backgroundColor: '#fff',
borderOpacity: 1,
enableZoom: true,
showTooltip: true
} );
jQuery( '#vmap3' ).vectorMap( {
map: 'argentina_en',
color: '#007BFF',
borderColor: '#fff',
backgroundColor: '#fff',
onRegionClick: function ( element, code, region ) {
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
alert( message );
}
} );
jQuery( '#vmap4' ).vectorMap( {
map: 'brazil_br',
color: '#007BFF',
borderColor: '#fff',
backgroundColor: '#fff',
onRegionClick: function ( element, code, region ) {
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
alert( message );
}
} );
jQuery( '#vmap5' ).vectorMap( {
map: 'france_fr',
color: '#007BFF',
borderColor: '#fff',
backgroundColor: '#fff',
enableZoom: true,
showTooltip: true
} );
jQuery( '#vmap6' ).vectorMap( {
map: 'germany_en',
color: '#007BFF',
borderColor: '#fff',
backgroundColor: '#fff',
onRegionClick: function ( element, code, region ) {
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
alert( message );
}
} );
jQuery( '#vmap7' ).vectorMap( {
map: 'greece',
color: '#007BFF',
borderColor: '#fff',
backgroundColor: '#fff',
onRegionClick: function ( element, code, region ) {
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
alert( message );
}
} );
jQuery( '#vmap8' ).vectorMap( {
map: 'iran_ir',
onRegionClick: function ( element, code, region ) {
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
alert( message );
}
} );
jQuery( '#vmap9' ).vectorMap( {
map: 'iraq',
color: '#007BFF',
borderColor: '#fff',
backgroundColor: '#fff',
onRegionClick: function ( element, code, region ) {
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
alert( message );
}
} );
jQuery( '#vmap10' ).vectorMap( {
map: 'russia_en',
color: '#007BFF',
borderColor: '#fff',
backgroundColor: '#fff',
hoverOpacity: 0.7,
selectedColor: '#999999',
enableZoom: true,
showTooltip: true,
scaleColors: [ '#C8EEFF', '#006491' ],
normalizeFunction: 'polynomial'
} );
jQuery( '#vmap11' ).vectorMap( {
map: 'tunisia',
color: '#007BFF',
borderColor: '#fff',
backgroundColor: '#fff',
onRegionClick: function ( element, code, region ) {
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
alert( message );
}
} );
jQuery( '#vmap12' ).vectorMap( {
map: 'europe_en',
color: '#007BFF',
borderColor: '#fff',
backgroundColor: '#fff',
enableZoom: true,
showTooltip: true
} );
jQuery( '#vmap13' ).vectorMap( {
map: 'usa_en',
color: '#007BFF',
borderColor: '#fff',
backgroundColor: '#fff',
enableZoom: true,
showTooltip: true,
selectedColor: null,
hoverColor: null,
colors: {
mo: '#001BFF',
fl: '#001BFF',
or: '#001BFF'
},
onRegionClick: function ( event, code, region ) {
event.preventDefault();
}
} );
jQuery( '#vmap14' ).vectorMap( {
map: 'turkey',
color: '#007BFF',
borderColor: '#fff',
backgroundColor: '#fff',
onRegionClick: function ( element, code, region ) {
var message = 'You clicked "' + region + '" which has the code: ' + code.toUpperCase();
alert( message );
}
} );
} )( jQuery );
var map;
jQuery( document ).ready( function () {
// Store currentRegion
var currentRegion = 'fl';
// List of Regions we'll let clicks through for
var enabledRegions = [ 'mo', 'fl', 'or' ];
map = jQuery( '#vmap15' ).vectorMap( {
map: 'usa_en',
color: '#007BFF',
borderColor: '#fff',
backgroundColor: '#fff',
enableZoom: true,
showTooltip: true,
selectedColor: '#001BFF',
selectedRegions: [ 'fl' ],
hoverColor: null,
colors: {
mo: '#001BFF',
fl: '#001BFF',
or: '#001BFF'
},
onRegionClick: function ( event, code, region ) {
// Check if this is an Enabled Region, and not the current selected on
if ( enabledRegions.indexOf( code ) === -1 || currentRegion === code ) {
// Not an Enabled Region
event.preventDefault();
} else {
// Enabled Region. Update Newly Selected Region.
currentRegion = code;
}
},
onRegionSelect: function ( event, code, region ) {
console.log( map.selectedRegions );
},
onLabelShow: function ( event, label, code ) {
if ( enabledRegions.indexOf( code ) === -1 ) {
event.preventDefault();
}
}
} );
} );

View File

@@ -0,0 +1,140 @@
(function ($) {
//"use strict";
function loadWeather(location, woeid) {
$.simpleWeather({
location: location,
woeid: woeid,
unit: 'f',
success: function (weather) {
html = '<div class="top">';
html += '<i class="wi wi-yahoo-' + weather.code + '"></i>';
html += '<div class="currently">' + weather.currently + '</div>';
html += '<div class="updates">' + weather.forecast[0].day + ', ' + weather.forecast[0].date+ '</div>';
html += '</div>';
html += '<div class="middle">';
html += '<div class="city">' + weather.city + ' <span> '+ weather.region + '</span></div>';
html += '<div class="temp">' + weather.alt.temp + '<span>&deg;C</span> </div>';
html += '</div>';
html += '<div class="nextdays">';
html += '<div class="days day2"><span class="d">' + weather.forecast[1].day + '</span> <span class="h">' + weather.forecast[1].alt.high + '&deg; </span> <span class="h">' + weather.forecast[1].alt.low + '&deg; </div>';
html += '<div class="days day3"><span class="d">' + weather.forecast[2].day + '</span> <span class="h">' + weather.forecast[2].alt.high + '&deg; </span> <span class="h">' + weather.forecast[2].alt.low + '&deg; </div>';
html += '<div class="days day4"><span class="d">' + weather.forecast[3].day + '</span> <span class="h">' + weather.forecast[3].alt.high + '&deg; </span> <span class="h">' + weather.forecast[3].alt.low + '&deg; </div>';
html += '<div class="days day5"><span class="d">' + weather.forecast[4].day + '</span> <span class="h">' + weather.forecast[4].alt.high + '&deg; </span> <span class="h">' + weather.forecast[4].alt.low + '&deg; </div>';
html += '<div class="days day1"><span class="d">' + weather.forecast[5].day + '</span> <span class="h">' + weather.forecast[5].alt.high + '&deg; </span> <span class="h">' + weather.forecast[5].alt.low + '&deg; </div>';
html += '</div>';
$("#weather-one").html(html);
},
error: function (error) {
$("#weather-one").html('<p>' + error + '</p>');
}
});
}
// init
loadWeather('New York City', '');
})(jQuery);
(function ($) {
//"use strict";
function loadWeather(location, woeid) {
$.simpleWeather({
location: location,
woeid: woeid,
unit: 'f',
success: function (weather) {
html = '<i class="wi wi-yahoo-' + weather.code + '"></i><h2> ' + weather.temp + '&deg;' + weather.units.temp + '</h2>';
html += '<div class="city">' + weather.city + ', ' + weather.region + '</div>';
html += '<div class="currently">' + weather.currently + '</div>';
html += '<div class="celcious">' + weather.alt.temp + '&deg;C</div>';
$("#weather-two").html(html);
},
error: function (error) {
$("#weather-two").html('<p>' + error + '</p>');
}
});
}
// init
loadWeather('New York City', '');
})(jQuery);
(function ($) {
//"use strict";
function loadWeather(location, woeid) {
$.simpleWeather({
location: location,
woeid: woeid,
unit: 'f',
success: function (weather) {
html = '<i class="wi wi-yahoo-' + weather.code + '"></i><h2> ' + weather.temp + '&deg;' + weather.units.temp + '</h2>';
html += '<div class="city">' + weather.city + ', ' + weather.region + '</div>';
html += '<div class="currently">' + weather.currently + '</div>';
html += '<div class="celcious">' + weather.alt.temp + '&deg;C</div>';
$("#weather-three").html(html);
},
error: function (error) {
$("#weather-three").html('<p>' + error + '</p>');
}
});
}
// init
loadWeather('Sydney', '');
})(jQuery);
(function ($) {
//"use strict";
function loadWeather(location, woeid) {
$.simpleWeather({
location: location,
woeid: woeid,
unit: 'f',
success: function (weather) {
html = '<i class="wi wi-yahoo-' + weather.code + '"></i><h2> ' + weather.temp + '&deg;' + weather.units.temp + '</h2>';
html += '<div class="city">' + weather.city + ', ' + weather.region + '</div>';
html += '<div class="currently">' + weather.currently + '</div>';
html += '<div class="celcious">' + weather.alt.temp + '&deg;C</div>';
$("#weather-four").html(html);
},
error: function (error) {
$("#weather-four").html('<p>' + error + '</p>');
}
});
}
// init
loadWeather('New York', '');
})(jQuery);

8
static/assets/js/jquery.flot.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
!function(a){"use strict";function b(a,b,c,d,e,f,g){var j,k,l,m,n,o,p,q,h=Math.pow,i=Math.sqrt;return j=i(h(c-a,2)+h(d-b,2)),k=i(h(e-c,2)+h(f-d,2)),l=g*j/(j+k),m=g-l,n=c+l*(a-e),o=d+l*(b-f),p=c-m*(a-e),q=d-m*(b-f),[n,o,p,q]}function d(b,c,d,e,f){var g=a.color.parse(f);g.a="number"==typeof e?e:.3,g.normalize(),g=g.toString(),c.beginPath(),c.moveTo(b[0][0],b[0][1]);for(var h=b.length,i=0;h>i;i++)c[b[i][3]].apply(c,b[i][2]);c.stroke(),c.lineWidth=0,c.lineTo(b[h-1][0],d),c.lineTo(b[0][0],d),c.closePath(),e!==!1&&(c.fillStyle=g,c.fill())}function e(a,b,d,e){(void 0===b||"bezier"!==b&&"quadratic"!==b)&&(b="quadratic"),b+="CurveTo",0==c.length?c.push([d[0],d[1],e.concat(d.slice(2)),b]):"quadraticCurveTo"==b&&2==d.length?(e=e.slice(0,2).concat(d),c.push([d[0],d[1],e,b])):c.push([d[2],d[3],e.concat(d.slice(2)),b])}function f(f,g,h){if(h.splines.show===!0){var k,l,m,i=[],j=h.splines.tension||.5,n=h.datapoints.points,o=h.datapoints.pointsize,p=f.getPlotOffset(),q=n.length,r=[];if(c=[],4>q/o)return a.extend(h.lines,h.splines),void 0;for(k=0;q>k;k+=o)l=n[k],m=n[k+1],null==l||l<h.xaxis.min||l>h.xaxis.max||m<h.yaxis.min||m>h.yaxis.max||r.push(h.xaxis.p2c(l)+p.left,h.yaxis.p2c(m)+p.top);for(q=r.length,k=0;q-2>k;k+=2)i=i.concat(b.apply(this,r.slice(k,k+6).concat([j])));for(g.save(),g.strokeStyle=h.color,g.lineWidth=h.splines.lineWidth,e(g,"quadratic",r.slice(0,4),i.slice(0,2)),k=2;q-3>k;k+=2)e(g,"bezier",r.slice(k,k+4),i.slice(2*k-2,2*k+2));e(g,"quadratic",r.slice(q-2,q),[i[2*q-10],i[2*q-9],r[q-4],r[q-3]]),d(c,g,f.height()+10,h.splines.fill,h.color),g.restore()}}var c=[];a.plot.plugins.push({init:function(a){a.hooks.drawSeries.push(f)},options:{series:{splines:{show:!1,lineWidth:2,tension:.5,fill:!1}}},name:"spline",version:"0.8.2"})}(jQuery);

View File

@@ -0,0 +1,8 @@
/**
* Minified by jsDelivr using UglifyJS v3.4.4.
* Original file: /npm/jquery-match-height@0.7.2/dist/jquery.matchHeight.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(l){var n=-1,a=-1,h=function(t){return parseFloat(t)||0},c=function(t){var e=l(t),n=null,a=[];return e.each(function(){var t=l(this),e=t.offset().top-h(t.css("margin-top")),o=0<a.length?a[a.length-1]:null;null===o?a.push(t):Math.floor(Math.abs(n-e))<=1?a[a.length-1]=o.add(t):a.push(t),n=e}),a},p=function(t){var e={byRow:!0,property:"height",target:null,remove:!1};return"object"==typeof t?l.extend(e,t):("boolean"==typeof t?e.byRow=t:"remove"===t&&(e.remove=!0),e)},u=l.fn.matchHeight=function(t){var e=p(t);if(e.remove){var o=this;return this.css(e.property,""),l.each(u._groups,function(t,e){e.elements=e.elements.not(o)}),this}return this.length<=1&&!e.target||(u._groups.push({elements:this,options:e}),u._apply(this,e)),this};u.version="0.7.2",u._groups=[],u._throttle=80,u._maintainScroll=!1,u._beforeUpdate=null,u._afterUpdate=null,u._rows=c,u._parse=h,u._parseOptions=p,u._apply=function(t,e){var i=p(e),o=l(t),n=[o],a=l(window).scrollTop(),r=l("html").outerHeight(!0),s=o.parents().filter(":hidden");return s.each(function(){var t=l(this);t.data("style-cache",t.attr("style"))}),s.css("display","block"),i.byRow&&!i.target&&(o.each(function(){var t=l(this),e=t.css("display");"inline-block"!==e&&"flex"!==e&&"inline-flex"!==e&&(e="block"),t.data("style-cache",t.attr("style")),t.css({display:e,"padding-top":"0","padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})}),n=c(o),o.each(function(){var t=l(this);t.attr("style",t.data("style-cache")||"")})),l.each(n,function(t,e){var o=l(e),a=0;if(i.target)a=i.target.outerHeight(!1);else{if(i.byRow&&o.length<=1)return void o.css(i.property,"");o.each(function(){var t=l(this),e=t.attr("style"),o=t.css("display");"inline-block"!==o&&"flex"!==o&&"inline-flex"!==o&&(o="block");var n={display:o};n[i.property]="",t.css(n),t.outerHeight(!1)>a&&(a=t.outerHeight(!1)),e?t.attr("style",e):t.css("display","")})}o.each(function(){var t=l(this),e=0;i.target&&t.is(i.target)||("border-box"!==t.css("box-sizing")&&(e+=h(t.css("border-top-width"))+h(t.css("border-bottom-width")),e+=h(t.css("padding-top"))+h(t.css("padding-bottom"))),t.css(i.property,a-e+"px"))})}),s.each(function(){var t=l(this);t.attr("style",t.data("style-cache")||null)}),u._maintainScroll&&l(window).scrollTop(a/r*l("html").outerHeight(!0)),this},u._applyDataApi=function(){var o={};l("[data-match-height], [data-mh]").each(function(){var t=l(this),e=t.attr("data-mh")||t.attr("data-match-height");o[e]=e in o?o[e].add(t):t}),l.each(o,function(){this.matchHeight(!0)})};var i=function(t){u._beforeUpdate&&u._beforeUpdate(t,u._groups),l.each(u._groups,function(){u._apply(this.elements,this.options)}),u._afterUpdate&&u._afterUpdate(t,u._groups)};u._update=function(t,e){if(e&&"resize"===e.type){var o=l(window).width();if(o===n)return;n=o}t?-1===a&&(a=setTimeout(function(){i(e),a=-1},u._throttle)):i(e)},l(u._applyDataApi);var t=l.fn.on?"on":"bind";l(window)[t]("load",function(t){u._update(!1,t)}),l(window)[t]("resize orientationchange",function(t){u._update(!0,t)})});
//# sourceMappingURL=/sm/b4cfb12116f687afdd35ab790d38b199ddbb3bc498bfed1cecd28dc238e65261.map

4
static/assets/js/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
/*! simpleWeather v3.1.0 - http://simpleweatherjs.com */
!function(t){"use strict";function e(t,e){return"f"===t?Math.round(5/9*(e-32)):Math.round(1.8*e+32)}t.extend({simpleWeather:function(i){i=t.extend({location:"",woeid:"",unit:"f",success:function(t){},error:function(t){}},i);var o=new Date,n="https://query.yahooapis.com/v1/public/yql?format=json&rnd="+o.getFullYear()+o.getMonth()+o.getDay()+o.getHours()+"&diagnostics=true&callback=?&q=";if(""!==i.location){var r="";r=/^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/.test(i.location)?"("+i.location+")":i.location,n+='select * from weather.forecast where woeid in (select woeid from geo.places(1) where text="'+r+'") and u="'+i.unit+'"'}else{if(""===i.woeid)return i.error("Could not retrieve weather due to an invalid location."),!1;n+="select * from weather.forecast where woeid="+i.woeid+' and u="'+i.unit+'"'}return t.getJSON(encodeURI(n),function(t){if(null!==t&&null!==t.query&&null!==t.query.results&&"Yahoo! Weather Error"!==t.query.results.channel.description){var o,n=t.query.results.channel,r={},s=["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW","N"],a="https://s.yimg.com/os/mit/media/m/weather/images/icons/l/44d-100567.png";r.title=n.item.title,r.temp=n.item.condition.temp,r.code=n.item.condition.code,r.todayCode=n.item.forecast[0].code,r.currently=n.item.condition.text,r.high=n.item.forecast[0].high,r.low=n.item.forecast[0].low,r.text=n.item.forecast[0].text,r.humidity=n.atmosphere.humidity,r.pressure=n.atmosphere.pressure,r.rising=n.atmosphere.rising,r.visibility=n.atmosphere.visibility,r.sunrise=n.astronomy.sunrise,r.sunset=n.astronomy.sunset,r.description=n.item.description,r.city=n.location.city,r.country=n.location.country,r.region=n.location.region,r.updated=n.item.pubDate,r.link=n.item.link,r.units={temp:n.units.temperature,distance:n.units.distance,pressure:n.units.pressure,speed:n.units.speed},r.wind={chill:n.wind.chill,direction:s[Math.round(n.wind.direction/22.5)],speed:n.wind.speed},n.item.condition.temp<80&&n.atmosphere.humidity<40?r.heatindex=-42.379+2.04901523*n.item.condition.temp+10.14333127*n.atmosphere.humidity-.22475541*n.item.condition.temp*n.atmosphere.humidity-6.83783*Math.pow(10,-3)*Math.pow(n.item.condition.temp,2)-5.481717*Math.pow(10,-2)*Math.pow(n.atmosphere.humidity,2)+1.22874*Math.pow(10,-3)*Math.pow(n.item.condition.temp,2)*n.atmosphere.humidity+8.5282*Math.pow(10,-4)*n.item.condition.temp*Math.pow(n.atmosphere.humidity,2)-1.99*Math.pow(10,-6)*Math.pow(n.item.condition.temp,2)*Math.pow(n.atmosphere.humidity,2):r.heatindex=n.item.condition.temp,"3200"==n.item.condition.code?(r.thumbnail=a,r.image=a):(r.thumbnail="https://s.yimg.com/zz/combo?a/i/us/nws/weather/gr/"+n.item.condition.code+"ds.png",r.image="https://s.yimg.com/zz/combo?a/i/us/nws/weather/gr/"+n.item.condition.code+"d.png"),r.alt={temp:e(i.unit,n.item.condition.temp),high:e(i.unit,n.item.forecast[0].high),low:e(i.unit,n.item.forecast[0].low)},"f"===i.unit?r.alt.unit="c":r.alt.unit="f",r.forecast=[];for(var m=0;m<n.item.forecast.length;m++)o=n.item.forecast[m],o.alt={high:e(i.unit,n.item.forecast[m].high),low:e(i.unit,n.item.forecast[m].low)},"3200"==n.item.forecast[m].code?(o.thumbnail=a,o.image=a):(o.thumbnail="https://s.yimg.com/zz/combo?a/i/us/nws/weather/gr/"+n.item.forecast[m].code+"ds.png",o.image="https://s.yimg.com/zz/combo?a/i/us/nws/weather/gr/"+n.item.forecast[m].code+"d.png"),r.forecast.push(o);i.success(r)}else i.error("There was a problem retrieving the latest weather information.")}),this}})}(jQuery);

90
static/assets/js/main.js Normal file
View File

@@ -0,0 +1,90 @@
$.noConflict();
jQuery(document).ready(function($) {
"use strict";
[].slice.call( document.querySelectorAll( 'select.cs-select' ) ).forEach( function(el) {
new SelectFx(el);
});
jQuery('.selectpicker').selectpicker;
$('.search-trigger').on('click', function(event) {
event.preventDefault();
event.stopPropagation();
$('.search-trigger').parent('.header-left').addClass('open');
});
$('.search-close').on('click', function(event) {
event.preventDefault();
event.stopPropagation();
$('.search-trigger').parent('.header-left').removeClass('open');
});
$('.equal-height').matchHeight({
property: 'max-height'
});
// var chartsheight = $('.flotRealtime2').height();
// $('.traffic-chart').css('height', chartsheight-122);
// Counter Number
$('.count').each(function () {
$(this).prop('Counter',0).animate({
Counter: $(this).text()
}, {
duration: 3000,
easing: 'swing',
step: function (now) {
$(this).text(Math.ceil(now));
}
});
});
// Menu Trigger
$('#menuToggle').on('click', function(event) {
var windowWidth = $(window).width();
if (windowWidth<1010) {
$('body').removeClass('open');
if (windowWidth<760){
$('#left-panel').slideToggle();
} else {
$('#left-panel').toggleClass('open-menu');
}
} else {
$('body').toggleClass('open');
$('#left-panel').removeClass('open-menu');
}
});
$(".menu-item-has-children.dropdown").each(function() {
$(this).on('click', function() {
var $temp_text = $(this).children('.dropdown-toggle').html();
$(this).children('.sub-menu').prepend('<li class="subtitle">' + $temp_text + '</li>');
});
});
// Load Resize
$(window).on("load resize", function(event) {
var windowWidth = $(window).width();
if (windowWidth<1010) {
$('body').addClass('small-device');
} else {
$('body').removeClass('small-device');
}
});
});

8
static/assets/js/moment.min.js vendored Normal file

File diff suppressed because one or more lines are too long

5
static/assets/js/popper.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
var sample_data = {"af":"16.63","al":"11.58","dz":"158.97","ao":"85.81","ag":"1.1","ar":"351.02","am":"8.83","au":"1219.72","at":"366.26","az":"52.17","bs":"7.54","bh":"21.73","bd":"105.4","bb":"3.96","by":"52.89","be":"461.33","bz":"1.43","bj":"6.49","bt":"1.4","bo":"19.18","ba":"16.2","bw":"12.5","br":"2023.53","bn":"11.96","bg":"44.84","bf":"8.67","bi":"1.47","kh":"11.36","cm":"21.88","ca":"1563.66","cv":"1.57","cf":"2.11","td":"7.59","cl":"199.18","cn":"5745.13","co":"283.11","km":"0.56","cd":"12.6","cg":"11.88","cr":"35.02","ci":"22.38","hr":"59.92","cy":"22.75","cz":"195.23","dk":"304.56","dj":"1.14","dm":"0.38","do":"50.87","ec":"61.49","eg":"216.83","sv":"21.8","gq":"14.55","er":"2.25","ee":"19.22","et":"30.94","fj":"3.15","fi":"231.98","fr":"2555.44","ga":"12.56","gm":"1.04","ge":"11.23","de":"3305.9","gh":"18.06","gr":"305.01","gd":"0.65","gt":"40.77","gn":"4.34","gw":"0.83","gy":"2.2","ht":"6.5","hn":"15.34","hk":"226.49","hu":"132.28","is":"12.77","in":"1430.02","id":"695.06","ir":"337.9","iq":"84.14","ie":"204.14","il":"201.25","it":"2036.69","jm":"13.74","jp":"5390.9","jo":"27.13","kz":"129.76","ke":"32.42","ki":"0.15","kr":"986.26","undefined":"5.73","kw":"117.32","kg":"4.44","la":"6.34","lv":"23.39","lb":"39.15","ls":"1.8","lr":"0.98","ly":"77.91","lt":"35.73","lu":"52.43","mk":"9.58","mg":"8.33","mw":"5.04","my":"218.95","mv":"1.43","ml":"9.08","mt":"7.8","mr":"3.49","mu":"9.43","mx":"1004.04","md":"5.36","mn":"5.81","me":"3.88","ma":"91.7","mz":"10.21","mm":"35.65","na":"11.45","np":"15.11","nl":"770.31","nz":"138","ni":"6.38","ne":"5.6","ng":"206.66","no":"413.51","om":"53.78","pk":"174.79","pa":"27.2","pg":"8.81","py":"17.17","pe":"153.55","ph":"189.06","pl":"438.88","pt":"223.7","qa":"126.52","ro":"158.39","ru":"1476.91","rw":"5.69","ws":"0.55","st":"0.19","sa":"434.44","sn":"12.66","rs":"38.92","sc":"0.92","sl":"1.9","sg":"217.38","sk":"86.26","si":"46.44","sb":"0.67","za":"354.41","es":"1374.78","lk":"48.24","kn":"0.56","lc":"1","vc":"0.58","sd":"65.93","sr":"3.3","sz":"3.17","se":"444.59","ch":"522.44","sy":"59.63","tw":"426.98","tj":"5.58","tz":"22.43","th":"312.61","tl":"0.62","tg":"3.07","to":"0.3","tt":"21.2","tn":"43.86","tr":"729.05","tm":0,"ug":"17.12","ua":"136.56","ae":"239.65","gb":"2258.57","us":"14624.18","uy":"40.71","uz":"37.72","vu":"0.72","ve":"285.21","vn":"101.99","ye":"30.02","zm":"15.69","zw":"5.57"};

View File

@@ -0,0 +1,69 @@
( function ( $ ) {
"use strict";
$.plot("#flotBar1", [{
data: [[0, 3], [2, 8], [4, 5], [6, 13],[8,5], [10,7],[12,4], [14,6]],
bars: {
show: true,
lineWidth: 0,
fillColor: '#85c988'
}
}], {
grid: {
show: false,
hoverable: true
}
});
var plot = $.plot($('#flotLine1'),[{
data: [[0, 1], [1, 3], [2,6], [3, 5], [4, 7], [5, 8], [6, 10]],
color: '#fff'
}],
{
series: {
lines: {
show: false
},
splines: {
show: true,
tension: 0.4,
lineWidth: 2
//fill: 0.4
},
shadowSize: 0
},
points: {
show: false,
},
legend: {
noColumns: 1,
position: 'nw'
},
grid: {
hoverable: true,
clickable: true,
show: false
},
yaxis: {
min: 0,
max: 10,
color: '#eee',
font: {
size: 10,
color: '#6a7074'
}
},
xaxis: {
color: '#eee',
font: {
size: 10,
color: '#6a7074'
}
}
});
} )( jQuery );

2511
static/assets/scss/style.css Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More