Commit dc3be826 authored by Jomaro Rodrigues's avatar Jomaro Rodrigues

refatoração da parte web

parent f48f30db
......@@ -14,7 +14,7 @@ import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_DIR = os.path.join(BASE_DIR, '..')
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
......@@ -38,7 +38,10 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'uploads.core'
'django_extensions',
'adega',
'uploads'
]
MIDDLEWARE_CLASSES = [
......@@ -52,12 +55,12 @@ MIDDLEWARE_CLASSES = [
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'uploads.urls'
ROOT_URLCONF = 'adega.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'uploads/templates'),],
'DIRS': [], #[os.path.join(BASE_DIR, 'uploads/templates'),],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
......@@ -71,7 +74,7 @@ TEMPLATES = [
},
]
WSGI_APPLICATION = 'uploads.wsgi.application'
WSGI_APPLICATION = 'adega.wsgi.application'
# Database
......@@ -107,9 +110,9 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/
LANGUAGE_CODE = 'en-us'
LANGUAGE_CODE = 'pt-br'
TIME_ZONE = 'UTC'
TIME_ZONE = 'America/Sao_Paulo'
USE_I18N = True
......@@ -122,7 +125,10 @@ USE_TZ = True
# https://docs.djangoproject.com/en/1.9/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
MEDIA_URL = '/script/base/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'script/base')
# MEDIA_URL = None # a gente não quer ninguem fazendo download disso
# MEDIA_ROOT = os.path.join(PROJECT_DIR, 'uploads')
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*!
* Bootstrap Reboot v4.0.0 (https://getbootstrap.com)
* Copyright 2011-2018 The Bootstrap Authors
* Copyright 2011-2018 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
html {
font-family: sans-serif;
line-height: 1.15;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
-ms-overflow-style: scrollbar;
-webkit-tap-highlight-color: transparent;
}
@-ms-viewport {
width: device-width;
}
article, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {
display: block;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
text-align: left;
background-color: #fff;
}
[tabindex="-1"]:focus {
outline: 0 !important;
}
hr {
box-sizing: content-box;
height: 0;
overflow: visible;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 0;
margin-bottom: 0.5rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title],
abbr[data-original-title] {
text-decoration: underline;
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
border-bottom: 0;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: .5rem;
margin-left: 0;
}
blockquote {
margin: 0 0 1rem;
}
dfn {
font-style: italic;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 80%;
}
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -.25em;
}
sup {
top: -.5em;
}
a {
color: #007bff;
text-decoration: none;
background-color: transparent;
-webkit-text-decoration-skip: objects;
}
a:hover {
color: #0056b3;
text-decoration: underline;
}
a:not([href]):not([tabindex]) {
color: inherit;
text-decoration: none;
}
a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus {
color: inherit;
text-decoration: none;
}
a:not([href]):not([tabindex]):focus {
outline: 0;
}
pre,
code,
kbd,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
pre {
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
-ms-overflow-style: scrollbar;
}
figure {
margin: 0 0 1rem;
}
img {
vertical-align: middle;
border-style: none;
}
svg:not(:root) {
overflow: hidden;
}
table {
border-collapse: collapse;
}
caption {
padding-top: 0.75rem;
padding-bottom: 0.75rem;
color: #6c757d;
text-align: left;
caption-side: bottom;
}
th {
text-align: inherit;
}
label {
display: inline-block;
margin-bottom: .5rem;
}
button {
border-radius: 0;
}
button:focus {
outline: 1px dotted;
outline: 5px auto -webkit-focus-ring-color;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
input {
overflow: visible;
}
button,
select {
text-transform: none;
}
button,
html [type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
padding: 0;
border-style: none;
}
input[type="radio"],
input[type="checkbox"] {
box-sizing: border-box;
padding: 0;
}
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"] {
-webkit-appearance: listbox;
}
textarea {
overflow: auto;
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
display: block;
width: 100%;
max-width: 100%;
padding: 0;
margin-bottom: .5rem;
font-size: 1.5rem;
line-height: inherit;
color: inherit;
white-space: normal;
}
progress {
vertical-align: baseline;
}
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
[type="search"] {
outline-offset: -2px;
-webkit-appearance: none;
}
[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
summary {
display: list-item;
cursor: pointer;
}
template {
display: none;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.css.map */
\ No newline at end of file
This diff is collapsed.
/*!
* Bootstrap Reboot v4.0.0 (https://getbootstrap.com)
* Copyright 2011-2018 The Bootstrap Authors
* Copyright 2011-2018 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
/*# sourceMappingURL=bootstrap-reboot.min.css.map */
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,10 +2,11 @@
<html>
<head>
<meta charset="utf-8">
<title>Simple File Upload</title>
<title>{{ title|default:"A.D.E.G.A"}}</title>
</head>
<body>
{% block content %}
{% endblock %}
</body>
</html>
\ No newline at end of file
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^uploads/', include('uploads.urls', namespace='uploads')),
url(r'^admin/', admin.site.urls),
]
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "uploads.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "adega.settings")
from django.core.management import execute_from_command_line
......
This diff is collapsed.
This diff is collapsed.
Chart.defaults.symmetricErrorLine = Chart.defaults.line;
var custom = Chart.controllers.line.extend({
draw: function(ease) {
Chart.controllers.line.prototype.draw.call(this, ease);
var meta = this.getMeta();
for (m in meta.data) {
var pt0 = meta.data[m];
var point = pt0._view
var chart = this.chart;
var height = chart.chartArea.bottom - chart.chartArea.top;
var ctx = this.chart.chart.ctx;
var datasets = chart.config.data.datasets[pt0._datasetIndex];
var error = datasets.error;
var values = datasets.data;
var p = height / pt0._yScale.max;
var width = pt0._yScale.maxWidth / 4;
var true_error = p * error[pt0._index];
var smallest = point.y + true_error;
if (this.chart.config.options.scales.yAxes[0].ticks.beginAtZero) {
if (smallest >= chart.chartArea.bottom) {
smallest = chart.chartArea.bottom;
}
}
var color = datasets.errorColor;
ctx.beginPath();
ctx.strokeStyle = color;
ctx.moveTo(point.x, point.y);
ctx.lineTo(point.x, smallest);
ctx.lineTo(point.x, point.y - true_error);
ctx.moveTo(point.x, point.y - true_error);
ctx.lineTo(point.x - width, point.y - true_error);
ctx.lineTo(point.x + width, point.y - true_error);
ctx.moveTo(point.x, smallest);
ctx.lineTo(point.x - width, smallest);
ctx.lineTo(point.x + width, smallest);
ctx.stroke();
}
}
});
Chart.controllers.symmetricErrorLine = custom;
Chart.defaults.symmetricErrorBar = Chart.defaults.bar;
var custom2 = Chart.controllers.bar.extend({
draw: function(ease) {
Chart.controllers.bar.prototype.draw.call(this, ease);
var meta = this.getMeta();
for (m in meta.data) {
var pt0 = meta.data[m];
var point = pt0._view
var chart = this.chart;
var height = chart.chartArea.bottom - chart.chartArea.top;
var ctx = this.chart.chart.ctx;
var datasets = chart.config.data.datasets[pt0._datasetIndex];
var error = datasets.error;
var values = datasets.data;
var p = height / pt0._yScale.max;
var width = point.width / 4;
var true_error = p * error[pt0._index];
var smallest = point.y + true_error;
if (this.chart.config.options.scales.yAxes[0].ticks.beginAtZero) {
if (smallest >= chart.chartArea.bottom) {
smallest = chart.chartArea.bottom;
}
}
var color = datasets.errorColor;
ctx.beginPath();
ctx.strokeStyle = color;
ctx.moveTo(point.x, point.y);
ctx.lineTo(point.x, smallest);
ctx.lineTo(point.x, point.y - true_error);
ctx.moveTo(point.x, point.y - true_error);
ctx.lineTo(point.x - width, point.y - true_error);
ctx.lineTo(point.x + width, point.y - true_error);
ctx.moveTo(point.x, smallest);
ctx.lineTo(point.x - width, smallest);
ctx.lineTo(point.x + width, smallest);
ctx.stroke();
}
}
});
Chart.controllers.symmetricErrorBar = custom2;
This diff is collapsed.
<html>
<head>
<meta charset=UTF-8>
<script src="jquery.min.js"></script>
<script src="Chart.min.js"></script>
<script src="ChartType.js"></script>
<script src="chartGenerator.js"></script>
<script src="script.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="fileinput.min.js"></script>
<style>
.grafico{
width:500px;
height:200px;
max-height:200px;
}
</style>
</head>
<body>
<div class="grafico">
<canvas id="canvas"></canvas>
</div>
</body>
<script>
var grupos = [
['2010', {A: 12.7, B: 6.1}],
['2011', {A: 13.5746, B: 4.35}],
['2012', {A: 7.6598, B: 3.12}],
['2013', {A: 7.516, B: 1.158}],
['2014', {A: 12.5899, B: 5.1598}],
['2015', {A: 5.1568, B: 3.6998}],
['2016', {A: 3.14995, B: 4.698}],
['2017', {A: 7.2695, B: 2.158}],