Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
ludotheque
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
18
Issues
18
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Denis S. Valdenaire
ludotheque
Commits
a1605066
Commit
a1605066
authored
Dec 21, 2015
by
Denis S. Valdenaire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modif des listes simples en modal
parent
908f323d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
32 deletions
+66
-32
classes/payment_method.php
classes/payment_method.php
+3
-0
views/esar_categories/edit.html
views/esar_categories/edit.html
+16
-16
views/esar_categories/list.html
views/esar_categories/list.html
+36
-10
views/ihm_messages.html
views/ihm_messages.html
+6
-0
views/members/subscriptions.html
views/members/subscriptions.html
+3
-3
views/membership_types/list.html
views/membership_types/list.html
+2
-2
views/subscriptions/edit.html
views/subscriptions/edit.html
+0
-1
No files found.
classes/payment_method.php
View file @
a1605066
...
...
@@ -30,6 +30,9 @@ class Payment_Method extends Record {
return
$payment_method
;
}
// FIXME : hey you can't just delete like that
// if the payment method is used somewhere, that
// can't be done
public
static
function
delete
(
$id
)
{
// SQL SELECT payment_methods
$sql
=
" SELECT id
...
...
views/esar_categories/edit.html
View file @
a1605066
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<h4>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
id=
"myModalLabel"
>
<span
class=
"glyphicon glyphicon-list-alt"
style=
"margin-right: 10px;"
></span>
{% if object.id %} Catégorie ESAR : {{ object.name }} {% else %} Nouvelle catégorie ESAR {% endif %}
</h4>
</h4>
</div>
<div
class=
"
pane
l-body"
>
<div
class=
"
moda
l-body"
>
<div
class=
"form-group"
>
<label
class=
"control-label col-sm-2"
for=
"name"
>
Nom
</label>
<div
class=
"col-sm-4"
>
...
...
@@ -17,16 +18,19 @@
<input
type=
"text"
id=
"label"
name=
"label"
class=
"form-control"
value=
"{{ object.label }}"
/>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"col-sm-12"
align=
"center"
>
<input
type=
"button"
class=
"btn btn-primary"
id=
"back_button"
value=
"<< Retour à la liste"
>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Close
</button>
{% if object.id != 0 %}
<input
type=
"hidden"
id=
"esar_category_id"
value=
"{{ object.id }}"
>
<input
type=
"submit"
class=
"btn btn-success"
id=
"save_button"
value=
"Enregistrer les changements"
>
<input
type=
"button"
class=
"btn btn-danger"
id=
"delete_button"
value=
"Supprimer"
>
{% else %}
<input
type=
"hidden"
id=
"esar_category_id"
value=
"0"
>
<input
type=
"button"
class=
"btn btn-success"
id=
"save_button"
value=
"Créer"
>
{% endif %}
</div>
</div>
</div>
<!-- end of panel -->
...
...
@@ -40,9 +44,10 @@ $('#save_button').click(function(){
alert
(
"
Vous n'avez pas saisi de nom !
"
);
return
false
;
}
if
(
$
(
'
#
i
'
).
val
()
==
0
)
{
if
(
$
(
'
#
esar_category_id
'
).
val
()
==
0
)
{
$
(
'
#a
'
).
val
(
'
create
'
);
}
else
{
$
(
'
#i
'
).
val
(
$
(
'
#esar_category_id
'
).
val
());
$
(
'
#a
'
).
val
(
'
update
'
);
}
document
.
defaultform
.
submit
();
...
...
@@ -57,9 +62,4 @@ $('#delete_button').click(function(){
document
.
defaultform
.
submit
();
}
});
$
(
'
#back_button
'
).
click
(
function
(){
// TODO this function should verify that the object has not been modified
// and if yes, ask for confirmation from the user.
window
.
location
.
href
=
'
index.php?o=esar_categories&a=list
'
;
});
</script>
views/esar_categories/list.html
View file @
a1605066
{% extends "base.html" %}
{% block title %}Cat
alogue des jeux
{% endblock %}
{% block title %}Cat
égories ESAR
{% endblock %}
{% block content %}
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
...
...
@@ -8,10 +8,11 @@
Catégories ESAR
</span>
<span
class=
"btn btn-success btn-md"
style=
"float: right"
id=
"new_button"
>
<i
class=
"glyphicon glyphicon-plus"
></i>
<span>
Nouvelle catégorie...
</span>
</span>
<button
type=
"button"
class=
"btn btn-success btn-md"
style=
"float: right"
data-toggle=
"modal"
data-target=
"#editModal"
data-id=
"0"
>
<i
class=
"glyphicon glyphicon-plus"
></i>
<span>
Nouvelle catégorie...
</span>
</button>
</div>
</div>
...
...
@@ -23,17 +24,28 @@
<tr>
<th>
Label
</th>
<th>
Description
</th>
<th>
Actions
</th>
</tr>
</thead>
<tbody>
{% for key, val in objects %}
<tr>
<td>
<a
href=
"index.php?o=esar_categories&a=edit&i={{ val.id }}"
>
{{ val.label }}
</a>
{{ val.label }}
</td>
<td>
{{ val.name }}
</td>
<td
align=
"center"
>
<button
type=
"button"
class=
"btn btn-success btn-xs"
data-toggle=
"modal"
data-target=
"#editModal"
data-id=
"{{ val.id }}"
>
<i
class=
"glyphicon glyphicon-edit"
></i>
</button>
<a
onClick=
"if(confirm('Êtes vous sur ?')) { $('#a').val('delete'); $('i').val('{{ val.id }}'); defaultform.submit()}"
href=
"#"
>
<button
type=
"button"
class=
"btn btn-danger btn-xs"
>
<span
class=
"glyphicon glyphicon-trash"
aria-hidden=
"true"
></span></button>
</a>
</td>
</tr>
{% else %}
<tr>
...
...
@@ -49,6 +61,14 @@
<!-- end of panel -->
</div>
</div>
<!-- edit modal skel -->
<div
class=
"modal fade"
id=
"editModal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"editModalLabel"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
</div>
</div>
</div>
<!-- end edit modal -->
<script>
$
(
document
).
ready
(
function
()
{
...
...
@@ -58,11 +78,17 @@ $(document).ready(function() {
$
(
this
).
show
();
}
});
$
(
'
#new_button
'
).
click
(
function
(){
$
(
'
#a
'
).
val
(
'
new
'
);
defaultform
.
submit
();
});
$
(
"
#editModal
"
).
on
(
"
show.bs.modal
"
,
function
(
e
)
{
var
button
=
$
(
e
.
relatedTarget
);
if
(
button
.
data
(
'
id
'
)
==
0
)
{
$
(
this
).
find
(
"
.modal-content
"
).
load
(
"
index.php?o=esar_categories&a=new
"
);
}
else
{
$
(
this
).
find
(
"
.modal-content
"
).
load
(
"
index.php?o=esar_categories&a=edit&i=
"
+
button
.
data
(
'
id
'
));
}
}).
on
(
"
hidden.bs.modal
"
,
function
(
e
)
{
$
(
this
).
find
(
"
.modal-content
"
).
empty
();
});
});
/* FIXME : translation of the table
see https://datatables.net/plug-ins/i18n/French
...
...
views/ihm_messages.html
0 → 100644
View file @
a1605066
{% for key, val in global['ihm_message'] %}
<div
class=
"alert alert-{{ val.level }} alert-dismissible"
role=
"alert"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"alert"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
{{ val.msg }}
</div>
{% endfor %}
views/members/subscriptions.html
View file @
a1605066
{% extends "base.html" %}
{% block title %}
Catalogue des jeux
{% endblock %}
{% block title %}
{{ member.lastname }} {{ member.firstname }} - Adhésions
{% endblock %}
{% block content %}
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
...
...
@@ -9,7 +9,7 @@
</span>
<span
style=
"font-size: 150%; font-weight: bold"
>
{{ member.lastname }} {{ member.firstname }} - Adhésions
</span>
<button
type=
"button"
class=
"btn btn-success bt
m
-md"
style=
"float: right"
<button
type=
"button"
class=
"btn btn-success bt
n
-md"
style=
"float: right"
data-toggle=
"modal"
data-target=
"#editModal"
data-id=
"0"
>
<i
class=
"glyphicon glyphicon-plus"
></i>
<span>
Nouvelle adhésion...
</span>
...
...
@@ -42,7 +42,7 @@
<td>
{{ val.comments }}
</td>
<td>
<button
type=
"button"
class=
"btn btn-success bt
m-md
"
<button
type=
"button"
class=
"btn btn-success bt
n-sm
"
data-toggle=
"modal"
data-target=
"#editModal"
data-id=
"{{ val.id }}"
>
<i
class=
"glyphicon glyphicon-edit"
></i>
</button>
...
...
views/membership_types/list.html
View file @
a1605066
...
...
@@ -5,7 +5,7 @@
Types d'adhésion
</span>
<span
class=
"btn btn-success bt
m
-md"
style=
"float: right"
id=
"new_button"
>
<span
class=
"btn btn-success bt
n
-md"
style=
"float: right"
id=
"new_button"
>
<i
class=
"glyphicon glyphicon-plus"
></i>
<span>
Nouveau type
</span>
</span>
...
...
@@ -29,7 +29,7 @@
<th>
{{ val.name }}
</th>
<td>
{{ val.description }}
</td>
<td>
{{ val.price }}
</td>
<td>
<td
align=
"center"
>
<a
href=
"index.php?o=membership_types&a=edit&i={{ val.id }}"
>
<button
type=
"button"
class=
"btn btn-default btn-sm"
>
<span
class=
"glyphicon glyphicon-edit"
aria-hidden=
"true"
></span></button>
...
...
views/subscriptions/edit.html
View file @
a1605066
...
...
@@ -161,4 +161,3 @@ $('#delete_button').click(function(){
}
});
</script>
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