1 {% extends
"base.html" %}
10 {% block title_header_big %}
13 {% block left_sidebar %}
15 {% include 'left_sidebar_base.html' %}
20 {% block breadcrumb_body %}
22 <li><a href=
"{% url 'projects:projects_list' %}">Projects
</a></li>
25 {% block content_body %}
29 <div class=
"col-md-12">
32 <div class=
"box-header with-border">
33 <h3 class=
"box-title">Projects
</h3>
34 <div class=
"box-tools">
35 <button type=
"button" class=
"btn btn-default" data-container=
"body"
36 data-toggle=
"tooltip" data-placement=
"top" title=
"New Project"
37 onclick=
"javascript:showModalNewProject()">
38 <i class=
"fa fa-plus"></i> New Project
</button>
41 <div class=
"box-body">
42 <table id=
"projects_table" class=
"table table-bordered table-striped">
48 <th>Modification Date
</th>
49 <th>Creation Date
</th>
52 <th><i class=
"far fa-trash-alt"></i></th>
56 {% for p in projects %}
60 <a href=
"/projects/switch/{{ p.name }}" >{{ p.name }}
</a>
63 <td>{{ p|get_sub:
"_admin,modified"|get_date}}
</td>
64 <td>{{ p|get_sub:
"_admin,created"|get_date}}
</td>
66 <td><a href=
"javascript:deleteProject('{% url 'projects:delete_project' %}')"> Delete
</a></td>
77 {% include
"modal/new_project.html" %}
80 {% block resource_block %}
83 function showModalNewProject(){
84 $('#modal_new_project').modal('show');
87 function deleteProject(url) {
88 bootbox.confirm(
"Are you sure want to delete?", function (result) {
94 "Accept": 'application/json'
98 }).done(function (response,textStatus, jqXHR) {
102 message:
"Project deleted.",
103 callback: function () {
107 }).fail(function(result){
108 var data = result.responseJSON;
109 var title =
"Error " + (data.code ? data.code: 'unknown');
110 var message = data.detail ? data.detail: 'No detail available.';
120 $(document).ready(function () {
121 $(
"#formNewProject").submit(function (event) {
122 event.preventDefault(); //prevent default action
123 var post_url = $(this).attr(
"action"); //get form action url
124 var request_method = $(this).attr(
"method"); //get form GET/POST method
125 var form_data = new FormData(this); //Encode form elements for submission
126 console.log(post_url);
129 type: request_method,
132 "Accept": 'application/json'
136 }).done(function (response,textStatus, jqXHR) {
139 message:
"Project created.",
140 callback: function () {
144 }).fail(function(result){
145 var data = result.responseJSON;
146 var title =
"Error " + (data.code ? data.code: 'unknown');
147 var message = data.detail ? data.detail: 'No detail available.';