Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Corentin Mors
avis-de-template-server
Commits
8812fae0
Commit
8812fae0
authored
Dec 07, 2018
by
Porchet Gaetan
Browse files
mise en place CRUD datacenters
parent
e3516d1b
Changes
6
Hide whitespace changes
Inline
Side-by-side
app.js
View file @
8812fae0
...
...
@@ -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
'
)));
...
...
routes/index.js
View file @
8812fae0
...
...
@@ -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
);
...
...
views/datacenters/edit.html
View file @
8812fae0
...
...
@@ -18,9 +18,23 @@
<div
class=
"input-group mb-3"
>
<div
class=
"input-group-prepend"
>
<span
class=
"input-group-text"
id=
"input-l
oc
ati
on
"
>
L
oc
ati
on
</span>
<span
class=
"input-group-text"
id=
"input-lati
tude
"
>
Lati
tude
</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>
...
...
views/datacenters/list.html
View file @
8812fae0
...
...
@@ -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>
...
...
views/datacenters/view.html
View file @
8812fae0
...
...
@@ -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>
...
...
views/partials/modals/add-datacenter.html
View file @
8812fae0
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment