Commit 8812fae0 authored by Porchet Gaetan's avatar Porchet Gaetan
Browse files

mise en place CRUD datacenters

parent e3516d1b
......@@ -23,6 +23,7 @@ var personnages = require('./models/users');
var resources = require('./models/resources');
var listes = require('./models/checklists');
var source = require('./models/sources');
var datacenter = require('./models/datacenters');
// Load templating and statics
app.use(express.static(path.join(__dirname, 'public')));
......
......@@ -7,6 +7,7 @@ router.use('/users', require('./userRoute'));
router.use('/resources', require('./resourceRoute'));
router.use('/checklists', require('./checklistRoute'));
router.use('/sources', require('./sourceRoute'));
router.use('/datacenters', require('./datacenterRoute'));
router.route('/').get(indexController.welcome);
......
......@@ -18,9 +18,23 @@
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="input-location">Location</span>
<span class="input-group-text" id="input-latitude">Latitude</span>
</div>
<input type="text" name="location" class="form-control" placeholder="{{ datacenter.location }}" value="{{ datacenter.location }}" aria-label="Location">
<input type="text" name="latitude" class="form-control" placeholder="{{ datacenter.latitude }}" value="{{ datacenter.latitude }}" aria-label="latitude">
</div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="input-longitude">Longitude</span>
</div>
<input type="text" name="longitude" class="form-control" placeholder="{{ datacenter.longitude }}" value="{{ datacenter.longitude }}" aria-label="longitude">
</div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="input-altitude">Altitude</span>
</div>
<input type="text" name="altitude" class="form-control" placeholder="{{ datacenter.altitude }}" value="{{ datacenter.altitude }}" aria-label="altitude">
</div>
<button type="submit" type="button" class="btn btn-primary float-right">Submit modifications</button>
......
......@@ -5,7 +5,7 @@
<div class="row">
<div class="col-12">
{% include "../partials/modals/add-datacenter-modal.html" %}
{% include "../partials/modals/add-datacenter.html" %}
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#add-datacenter-modal">
Add new datacenter
......@@ -25,7 +25,9 @@
<div class="d-flex w-90 justify-content-between">
<h5 class="mb-1">{{ datacenter.name }}</h5>
</div>
<p class="mb-1">{ datacenter.location }</p>
<p class="mb-1"> latitude : {{ datacenter.location.lat }}</p>
<p class="mb-1"> longitude : {{ datacenter.location.lon }}</p>
<p class="mb-1"> altitude : {{ datacenter.location.alt }}</p>
</div>
</div>
</div>
......
......@@ -20,7 +20,9 @@
<div class="d-flex w-90 justify-content-between">
<h5 class="mb-1">{{ datacenter.name }}</h5>
</div>
<p class="mb-1">{datacenter.location }</p>
<p class="mb-1"> latitude : {{ datacenter.location.lat }}</p>
<p class="mb-1"> longitude : {{ datacenter.location.lon }}</p>
<p class="mb-1"> altitude : {{ datacenter.location.alt }}</p>
</div>
</div>
......
......@@ -15,8 +15,16 @@
<input type="text" class="form-control" id="input-name" name="name" aria-describedby="nameHelp" placeholder="Enter name">
</div>
<div class="form-group">
<label for="input-name">location</label>
<input type="text" class="form-control" id="input-location" name="location" aria-describedby="locationHelp" placeholder="Enter location">
<label for="input-name">latitude</label>
<input type="text" class="form-control" id="input-latitude" name="latitude" aria-describedby="latitudeHelp" placeholder="Enter latitude">
</div>
<div class="form-group">
<label for="input-name">longitude</label>
<input type="text" class="form-control" id="input-longitude" name="longitude" aria-describedby="longitudeHelp" placeholder="Enter longitude">
</div>
<div class="form-group">
<label for="input-name">altitude</label>
<input type="text" class="form-control" id="input-altitude" name="altitude"altitude aria-describedby="altitudeHelp" placeholder="Enter altitude">
</div>
</div>
......
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