Commit b224bb4a authored by Yann Caumartin's avatar Yann Caumartin
Browse files

Adds mission adding

parent 9608fa20
......@@ -34,6 +34,7 @@ var resources = require('./models/resources');
var listes = require('./models/checklists');
var source = require('./models/sources');
var datacenter = require('./models/datacenters');
var mission = require('./models/missions');
// Load templating and statics
app.use(express.static(path.join(__dirname, 'public')));
......
......@@ -26,5 +26,6 @@ router.use('/checklists', require('./checklistRoute'));
router.use('/sources', require('./sourceRoute'));
router.use('/guides', require('./guideRoute'));
router.use('/datacenters', require('./datacenterRoute'));
router.use('/missions', require('./missionRoute'));
module.exports = router
'use strict';
var express = require('express'),
router = express.Router();
var missionController = require('../controllers/missions');
router.route('/')
.get(missionController.list_missions)
.post(missionController.add_mission);
module.exports = router
......@@ -5,9 +5,9 @@
<div class="row">
<div class="col-12">
{% include "partials/modals/add-misssion.html" %}
{% include "partials/modals/add-mission.html" %}
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#add-misssion-modal">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#add-mission-modal">
Add new misssion
</button>
......@@ -15,7 +15,7 @@
<div class="list-group">
{% for misssion in misssions %}
{% for mission in missions %}
<div class="list-group-item list-group-item-action align-items-start list-group-item-flex">
<div class="list-group-item-tools">
<a href="misssions/{{ misssion._id }}" title="Look mission"><i class="fas fa-eye"></i></a>
......@@ -36,8 +36,7 @@
</div>
<p class="mb-1">{{ mission.start_date }}</p>
<p class="mb-1">{{ mission.end_date }}</p>
<p class="mb-1">{{ misssion.email }}</p>
<small>group-one, group-two</small>
<p class="mb-1">{{ mission.email }}</p>
</div>
</div>
{% endfor %}
......
<div class="modal fade" id="add-mission-modal" tabindex="-1" role="dialog" aria-labelledby="add-mission-modal-label" aria-hidden="true">
<div class="modal-dialog" role="document">
<form action="/missions/" method="POST">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Add new mission</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="input-title">Title</label>
<input title="text" class="form-control" id="input-title" name="title" aria-describedby="quantityHelp" placeholder="Enter title">
</div>
<div class="form-group">
<label for="input-description">description</label>
<input type="description" class="form-control" id="input-description" name="description" aria-describedby="descriptionHelp" placeholder="Enter description">
</div>
<div class="form-group">
<label for="input-priority">priority</label>
<input type="priority" class="form-control" id="input-priority" name="priority" aria-describedby="priorityHelp" placeholder="Enter priority">
</div>
<div class="form-group">
<label for="input-start_date">start_date</label>
<input type="start_date" class="form-control" id="input-start_date" name="start_date" aria-describedby="start_dateHelp" placeholder="Enter start date">
</div>
<div class="form-group">
<label for="input-end_date">end_date</label>
<input type="end_date" class="form-control" id="input-end_date" name="end_date" aria-describedby="end_dateHelp" placeholder="Enter end date">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Add mission</button>
</div>
</div>
</form>
</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