Commit 1c113da9 authored by hypsug0's avatar hypsug0
Browse files

feat: Import locally chart js lib

parent 6dc932bf
This diff is collapsed.
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("chart.js")):"function"==typeof define&&define.amd?define("VueChartJs",["chart.js"],e):"object"==typeof exports?exports.VueChartJs=e(require("chart.js")):t.VueChartJs=e(t.Chart)}("undefined"!=typeof self?self:this,function(t){return function(t){function e(a){if(r[a])return r[a].exports;var n=r[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,a){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:a})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,r){"use strict";function a(t,e){if(e){var r=this.$data._chart,a=t.datasets.map(function(t){return t.label}),n=e.datasets.map(function(t){return t.label}),s=JSON.stringify(n);JSON.stringify(a)===s&&e.datasets.length===t.datasets.length?(t.datasets.forEach(function(t,a){var n=Object.keys(e.datasets[a]),s=Object.keys(t);n.filter(function(t){return"_meta"!==t&&-1===s.indexOf(t)}).forEach(function(t){delete r.data.datasets[a][t]});for(var i in t)t.hasOwnProperty(i)&&(r.data.datasets[a][i]=t[i])}),t.hasOwnProperty("labels")&&(r.data.labels=t.labels,this.$emit("labels:update")),t.hasOwnProperty("xLabels")&&(r.data.xLabels=t.xLabels,this.$emit("xlabels:update")),t.hasOwnProperty("yLabels")&&(r.data.yLabels=t.yLabels,this.$emit("ylabels:update")),r.update(),this.$emit("chart:update")):(r&&(r.destroy(),this.$emit("chart:destroy")),this.renderChart(this.chartData,this.options),this.$emit("chart:render"))}else this.$data._chart&&(this.$data._chart.destroy(),this.$emit("chart:destroy")),this.renderChart(this.chartData,this.options),this.$emit("chart:render")}function n(t,e){return{render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:t,type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},generateLegend:function(){if(this.$data._chart)return this.$data._chart.generateLegend()},renderChart:function(t,r){this.$data._chart&&this.$data._chart.destroy(),this.$data._chart=new c.a(this.$refs.canvas.getContext("2d"),{type:e,data:t,options:r,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}}}Object.defineProperty(e,"__esModule",{value:!0});var s={data:function(){return{chartData:null}},watch:{chartData:a}},i={props:{chartData:{type:Object,required:!0,default:function(){}}},watch:{chartData:a}},o={reactiveData:s,reactiveProp:i},u=r(1),c=r.n(u),h=n("bar-chart","bar"),d=n("horizontalbar-chart","horizontalBar"),l=n("doughnut-chart","doughnut"),f=n("line-chart","line"),p=n("pie-chart","pie"),b=n("polar-chart","polarArea"),y=n("radar-chart","radar"),g=n("bubble-chart","bubble"),m=n("scatter-chart","scatter");r.d(e,"VueCharts",function(){return v}),r.d(e,"Bar",function(){return h}),r.d(e,"HorizontalBar",function(){return d}),r.d(e,"Doughnut",function(){return l}),r.d(e,"Line",function(){return f}),r.d(e,"Pie",function(){return p}),r.d(e,"PolarArea",function(){return b}),r.d(e,"Radar",function(){return y}),r.d(e,"Bubble",function(){return g}),r.d(e,"Scatter",function(){return m}),r.d(e,"mixins",function(){return o}),r.d(e,"generateChart",function(){return n});var v={Bar:h,HorizontalBar:d,Doughnut:l,Line:f,Pie:p,PolarArea:b,Radar:y,Bubble:g,Scatter:m,mixins:o,generateChart:n,render:function(){return console.error("[vue-chartjs]: This is not a vue component. It is the whole object containing all vue components. Please import the named export or access the components over the dot notation. For more info visit https://vue-chartjs.org/#/home?id=quick-start")}};e.default=v},function(e,r){e.exports=t}])});
//# sourceMappingURL=vue-chartjs.min.js.map
\ No newline at end of file
......@@ -38,8 +38,8 @@
<script src="{% static 'js/moment.min.js' %} " defer></script>
<script src="{% static 'js/bootstrap-datetimepicker.min.js' %} " defer></script>
<script src="{% static 'js/what-input.js' %} " defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js"></script>
<script src="https://unpkg.com/vue-chartjs/dist/vue-chartjs.min.js"></script>
<script src="{% static 'js/chart.min.js' %}" defer></script>
<script src="{% static 'js/vue-chartjs.min.js' %}" defer></script>
<script src="{% static 'js/app.js' %} " defer></script>
{% if form %} {{ form.media }} {% endif %}
<!-- filter tag is for django filter -->
......
......@@ -5,245 +5,165 @@
{% block title %}{{ title | safe }}{% endblock %}
{% block content %}
<style>
.leaflet-container-default {
min-height: 800px;
}
.leaflet-container-default {
min-height: 800px;
}
#searchMap {
height: 800px;
min-height: 800px;
}
#searchMap {
height: 800px;
min-height: 800px;
}
input[type='range'] {
width: 100%;
height: 1px;
}
input[type='range'] {
width: 100%;
height: 1px;
}
</style>
<script>
const dataUrl = "{% url 'sights:place_search_api' %}";
$(document).ready(function() {
placeSearchBlock();
});
const dataUrl = "{% url 'sights:place_search_api' %}";
$(document).ready(function () {
placeSearchBlock();
});
</script>
<div id="placeSearch">
<h1>
<a
href="{% url 'sights:place_create' %}"
class="btn btn-primary pull-right"
><i class="fa fa-fw fa-map-marker-alt"></i>
{% trans 'Créer une localité' %}</a
><i class="{{ icon | safe }}"></i> {{ title | safe }}
</h1>
<h1>
<a href="{% url 'sights:place_create' %}" class="btn btn-primary pull-right"><i
class="fa fa-fw fa-map-marker-alt"></i>
{% trans 'Créer une localité' %}</a><i class="{{ icon | safe }}"></i> {{ title | safe }}
</h1>
{% comment %}Tableau de recherche avec filtrage {% endcomment %}
<div class="col-sm-12 col-md-6 col-lg-7">
<div class="panel panel-default">
<div class="panel-body">
<form id="searchForm" class="form-inline text-center">
<div class="form-row">
<div class="form-group form-group-sm mr-2">
<label for="territory" class="control-label">Département</label>
<select class="form-control form-control-sm" name="territory" id="territory">
<option value="">-</option>
{% for t in enable_territory %}
<option value="{{t.id}}">{{ t.name }} ({{ t.code }})</option>
{% endfor %}
</select>
</div>
<div class="form-group form-group-sm mr-2">
<label for="municipality" class="control-label"
>Commune</label
>
<input
class="form-control form-control-sm"
type="text"
id="municipality"
name="municipality"
placeholder="Commune"
/>
</div>
<div class="form-group form-group-sm mr-2">
<label for="type" class="control-label">Nom</label>
<input
class="form-control form-control-sm"
type="text"
id="name"
name="name"
placeholder="Nom"
/>
</div>
<div class="form-group form-group-sm mr-2">
<label for="metaplace" class="control-label"
>Métasite</label
>
<input
class="form-control form-control-sm"
type="text"
id="metaplace"
name="metaplace"
placeholder="Métasite"
/>
</div>
</div>
<div class="form-row">
<div class="form-group form-group-sm">
<input
name="gite"
type="checkbox"
class="form-check-input"
id="gite"
/>
<label class="form-check-label" for="gite"
>Gite</label
>
</div>
<div class="form-group form-group-sm">
<label for="type">Type</label>
<input
class="form-control form-control-sm"
type="text"
id="type"
name="type"
placeholder="Type"
/>
</div>
<div class="form-group form-group-sm">
<input
id="convention"
name="convention"
type="checkbox"
class="form-check-input"
/>
<label class="form-check-label" for="gite"
>Convention refuge</label
>
</div>
<div class="form-group form-group-sm">
<input
id="managed"
name="managed"
type="checkbox"
class="form-check-input"
/>
<label class="form-check-label" for="managed"
>Site géré</label
>
</div>
</div>
<div class="form-row">
<div class="form-group form-group-sm">
<label for="alt_min">Altitude mini</label>
<input
class="form-control form-control-sm"
type="number"
id="alt_min"
name="alt_min"
placeholder="Altitude mini"
/>
</div>
<div class="form-group form-group-sm">
<label for="alt_max">Altitude maxi</label>
<input
class="form-control form-control-sm"
type="number"
id="alt_max"
name="alt_max"
placeholder="Altitude maxi"
/>
</div>
<div class="form-group form-group-sm mr-2">
<label for="page_size">Nombre de donnnées à afficher</label>
<input class="form-control form-control-sm" type="number" id="page_size"
name="page_size" min="1000" max="5000" step="1000"
placeholder="Nombre de données">
</div>
</div>
<span id="results"></span>
</form>
{% comment %}Tableau de recherche avec filtrage {% endcomment %}
<div class="col-sm-12 col-md-6 col-lg-7">
<div class="panel panel-default">
<div class="panel-body">
<form id="searchForm" class="form-inline text-center">
<div class="form-row">
<div class="form-group form-group-sm mr-2">
<label for="territory" class="control-label">Département</label>
<select class="form-control form-control-sm" name="territory" id="territory">
<option value="">-</option>
{% for t in enable_territory %}
<option value="{{t.id}}">{{ t.name }} ({{ t.code }})</option>
{% endfor %}
</select>
</div>
</div>
{% if count %}
<div class="panel panel-default">
<div class="panel-body">
{% if export %}
<div class="btn-group btn-group-xs pull-right">
<button
type="button"
class="btn btn-primary btn-xs dropdown-toggle"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
{% trans 'Exporter' %} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="{% querystring '_export'='csv' %}">
download as csv</a
>
</li>
<li>
<a href="{% querystring '_export'='ods' %}">
download as ods</a
>
</li>
<li>
<a href="{% querystring '_export'='xls' %}">
download as xlsx</a
>
</li>
<li>
<a href="{% querystring '_export'='xlsx' %}">
download as xls</a
>
</li>
</ul>
</div>
{% endif %} {{ counttitle }} : <b>{{ count }}</b>
<div class="form-group form-group-sm mr-2">
<label for="municipality" class="control-label">Commune</label>
<input class="form-control form-control-sm" type="text" id="municipality" name="municipality"
placeholder="Commune" />
</div>
<div class="form-group form-group-sm mr-2">
<label for="type" class="control-label">Nom</label>
<input class="form-control form-control-sm" type="text" id="name" name="name" placeholder="Nom" />
</div>
<div class="form-group form-group-sm mr-2">
<label for="metaplace" class="control-label">Métasite</label>
<input class="form-control form-control-sm" type="text" id="metaplace" name="metaplace"
placeholder="Métasite" />
</div>
</div>
<div class="form-row">
<div class="form-group form-group-sm">
<input name="gite" type="checkbox" class="form-check-input" id="gite" />
<label class="form-check-label" for="gite">Gite</label>
</div>
<div class="form-group form-group-sm">
<label for="type">Type</label>
<input class="form-control form-control-sm" type="text" id="type" name="type" placeholder="Type" />
</div>
<div class="form-group form-group-sm">
<input id="convention" name="convention" type="checkbox" class="form-check-input" />
<label class="form-check-label" for="gite">Convention refuge</label>
</div>
<div class="form-group form-group-sm">
<input id="managed" name="managed" type="checkbox" class="form-check-input" />
<label class="form-check-label" for="managed">Site géré</label>
</div>
</div>
<div class="form-row">
<div class="form-group form-group-sm">
<label for="alt_min">Altitude mini</label>
<input class="form-control form-control-sm" type="number" id="alt_min" name="alt_min"
placeholder="Altitude mini" />
</div>
<div class="form-group form-group-sm">
<label for="alt_max">Altitude maxi</label>
<input class="form-control form-control-sm" type="number" id="alt_max" name="alt_max"
placeholder="Altitude maxi" />
</div>
<div class="form-group form-group-sm mr-2">
<label for="page_size">Nombre de donnnées à afficher</label>
<input class="form-control form-control-sm" type="number" id="page_size" name="page_size" min="1000"
max="5000" step="1000" placeholder="Nombre de données">
</div>
</div>
<span id="results"></span>
</form>
</div>
</div>
{% if count %}
<div class="panel panel-default">
<div class="panel-body">
{% if export %}
<div class="btn-group btn-group-xs pull-right">
<button type="button" class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
{% trans 'Exporter' %} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="{% querystring '_export'='csv' %}">
download as csv</a>
</li>
<li>
<a href="{% querystring '_export'='ods' %}">
download as ods</a>
</li>
<li>
<a href="{% querystring '_export'='xls' %}">
download as xlsx</a>
</li>
<li>
<a href="{% querystring '_export'='xlsx' %}">
download as xls</a>
</li>
</ul>
</div>
{% endif %}
<div class="panel panel-default table-responsive">
<table
id="place_results"
class="table table-striped table-condensed map-navigation"
cellspacing="0"
width="100%"
>
<thead>
<tr>
<th>+</th>
<th>Actions</th>
<th>Nom</th>
<th>Altitude</th>
<th>Commune</th>
<th>Métasite</th>
<th>Type</th>
{% comment %} <th>Sessions</th> {% endcomment %}
<th>Création</th>
</tr>
</thead>
</table>
</div>
<script></script>
{% endif %} {{ counttitle }} : <b>{{ count }}</b>
</div>
</div>
<script type="text/javascript">
{{js | safe }}
</script>
{% if filter %}
<link
rel="stylesheet"
href="{% static 'css/select2-bootstrap.min.css' %}"
/>
<script type="text/javascript">
{{ js | safe }}
$.fn.select2.defaults.set('theme', 'bootstrap')
</script>
{% endif %} {# <div class="col-sm-12 col-md-6 col-lg-5"> #} {# {% leaflet_map "main" %}#} {# </div> #}
<div class="col-sm-12 col-md-6 col-lg-5">
{% leaflet_map "main" %}
{% endif %}
<div class="panel panel-default table-responsive">
<table id="place_results" class="table table-striped table-condensed map-navigation" cellspacing="0" width="100%">
<thead>
<tr>
<th>+</th>
<th>Actions</th>
<th>Nom</th>
<th>Altitude</th>
<th>Commune</th>
<th>Métasite</th>
<th>Type</th>
</tr>
</thead>
</table>
</div>
<script></script>
</div>
{% if filter %}
<link rel="stylesheet" href="{% static 'css/select2-bootstrap.min.css' %}" />
<script type="text/javascript">
{{js | safe}}
$.fn.select2.defaults.set('theme', 'bootstrap')
</script>
{% endif %} {# <div class="col-sm-12 col-md-6 col-lg-5"> #} {# {% leaflet_map "main" %}#}
{# </div> #}
<div class="col-sm-12 col-md-6 col-lg-5">
{% leaflet_map "main" %}
</div>
</div>
<script type="text/javascript"></script>
{% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment