8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-23 20:03:11 +00:00

Merge branch 'button' into 'master'

Button

See merge request federez/re2o!73
This commit is contained in:
klafyvel 2018-01-31 09:20:13 +01:00
commit de51aaba8d
12 changed files with 109 additions and 96 deletions

View file

@ -34,7 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<form class="form" method="post">
{% csrf_token %}
{% bootstrap_form factureform %}
{% bootstrap_button "Créer ou modifier" button_type="submit" icon="star" %}
{% bootstrap_button action_name button_type="submit" icon="star" %}
</form>
{% endblock %}

View file

@ -58,7 +58,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<p>
Prix total : <span id="total_price">0,00</span>
</p>
{% bootstrap_button "Créer ou modifier" button_type="submit" icon="star" %}
{% bootstrap_button "Créer" button_type="submit" icon="star" %}
</form>
<script type="text/javascript">

View file

@ -207,7 +207,8 @@ def new_facture_pdf(request):
'tpl_path': os.path.join(settings.BASE_DIR, LOGO_PATH)
})
return form({
'factureform': facture_form
'factureform': facture_form,
'action_name' : 'Editer'
}, 'cotisations/facture.html', request)
@ -313,7 +314,7 @@ def credit_solde(request, user, userid):
reversion.set_comment("Création")
messages.success(request, "Solde modifié")
return redirect(reverse('cotisations:index'))
return form({'factureform': facture}, 'cotisations/facture.html', request)
return form({'factureform': facture, 'action_name' : 'Créditer'}, 'cotisations/facture.html', request)
@login_required
@ -334,7 +335,7 @@ def add_article(request):
reversion.set_comment("Création")
messages.success(request, "L'article a été ajouté")
return redirect(reverse('cotisations:index-article'))
return form({'factureform': article}, 'cotisations/facture.html', request)
return form({'factureform': article, 'action_name' : 'Ajouter'}, 'cotisations/facture.html', request)
@login_required
@ -354,7 +355,7 @@ def edit_article(request, article_instance, articleid):
)
messages.success(request, "Type d'article modifié")
return redirect(reverse('cotisations:index-article'))
return form({'factureform': article}, 'cotisations/facture.html', request)
return form({'factureform': article, 'action_name' : 'Editer'}, 'cotisations/facture.html', request)
@login_required
@ -369,7 +370,7 @@ def del_article(request, instances):
reversion.set_user(request.user)
messages.success(request, "Le/les articles ont été supprimé")
return redirect(reverse('cotisations:index-article'))
return form({'factureform': article}, 'cotisations/facture.html', request)
return form({'factureform': article, 'action_name' : 'Supprimer'}, 'cotisations/facture.html', request)
@login_required
@ -385,7 +386,7 @@ def add_paiement(request):
reversion.set_comment("Création")
messages.success(request, "Le moyen de paiement a été ajouté")
return redirect(reverse('cotisations:index-paiement'))
return form({'factureform': paiement}, 'cotisations/facture.html', request)
return form({'factureform': paiement, 'action_name' : 'Ajouter'}, 'cotisations/facture.html', request)
@login_required
@ -404,7 +405,7 @@ def edit_paiement(request, paiement_instance, paiementid):
)
messages.success(request, "Type de paiement modifié")
return redirect(reverse('cotisations:index-paiement'))
return form({'factureform': paiement}, 'cotisations/facture.html', request)
return form({'factureform': paiement, 'action_name' : 'Editer'}, 'cotisations/facture.html', request)
@login_required
@ -431,7 +432,7 @@ def del_paiement(request, instances):
facture, vous ne pouvez pas le supprimer" % paiement_del
)
return redirect(reverse('cotisations:index-paiement'))
return form({'factureform': paiement}, 'cotisations/facture.html', request)
return form({'factureform': paiement, 'action_name' : 'Supprimer'}, 'cotisations/facture.html', request)
@login_required
@ -446,7 +447,7 @@ def add_banque(request):
reversion.set_comment("Création")
messages.success(request, "La banque a été ajoutée")
return redirect(reverse('cotisations:index-banque'))
return form({'factureform': banque}, 'cotisations/facture.html', request)
return form({'factureform': banque, 'action_name' : 'Ajouter'}, 'cotisations/facture.html', request)
@login_required
@ -465,7 +466,7 @@ def edit_banque(request, banque_instance, banqueid):
)
messages.success(request, "Banque modifiée")
return redirect(reverse('cotisations:index-banque'))
return form({'factureform': banque}, 'cotisations/facture.html', request)
return form({'factureform': banque, 'action_name' : 'Editer'}, 'cotisations/facture.html', request)
@login_required
@ -486,7 +487,7 @@ def del_banque(request, instances):
messages.error(request, "La banque %s est affectée à au moins\
une facture, vous ne pouvez pas la supprimer" % banque_del)
return redirect(reverse('cotisations:index-banque'))
return form({'factureform': banque}, 'cotisations/facture.html', request)
return form({'factureform': banque, 'action_name' : 'Supprimer'}, 'cotisations/facture.html', request)
@login_required

View file

@ -146,7 +146,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h3>Ipv6</h3>
{% bootstrap_form ipv6form %}
{% endif %}
{% bootstrap_button "Créer ou modifier" button_type="submit" icon="star" %}
{% bootstrap_button action_name button_type="submit" icon="star" %}
</form>
<br />
<br />

View file

@ -263,7 +263,8 @@ def new_machine(request, user, userid):
'machineform': machine,
'interfaceform': interface,
'domainform': domain,
'i_mbf_param': i_mbf_param
'i_mbf_param': i_mbf_param,
'action_name' : 'Créer une machine'
},
'machines/machine.html',
request
@ -304,7 +305,13 @@ def edit_interface(request, interface_instance, interfaceid):
kwargs={'userid':str(interface_instance.machine.user.id)}
))
i_mbf_param = generate_ipv4_mbf_param( interface_form, False )
return form({'machineform': machine_form, 'interfaceform': interface_form, 'domainform': domain_form, 'i_mbf_param': i_mbf_param}, 'machines/machine.html', request)
return form({
'machineform': machine_form,
'interfaceform': interface_form,
'domainform': domain_form,
'i_mbf_param': i_mbf_param,
'action_name' : 'Editer une interface'
}, 'machines/machine.html', request)
@login_required
@can_delete(Machine)
@ -350,7 +357,12 @@ def new_interface(request, machine, machineid):
kwargs={'userid':str(machine.user.id)}
))
i_mbf_param = generate_ipv4_mbf_param( interface_form, False )
return form({'interfaceform': interface_form, 'domainform': domain_form, 'i_mbf_param': i_mbf_param}, 'machines/machine.html', request)
return form({
'interfaceform': interface_form,
'domainform': domain_form,
'i_mbf_param': i_mbf_param,
'action_name' : 'Créer une interface'
}, 'machines/machine.html', request)
@login_required
@can_delete(Interface)
@ -387,7 +399,7 @@ def new_ipv6list(request, interface, interfaceid):
'machines:index-ipv6',
kwargs={'interfaceid':str(interface.id)}
))
return form({'ipv6form': ipv6}, 'machines/machine.html', request)
return form({'ipv6form': ipv6, 'action_name' : 'Créer'}, 'machines/machine.html', request)
@login_required
@can_edit(Ipv6List)
@ -404,7 +416,7 @@ def edit_ipv6list(request, ipv6list_instance, ipv6listid):
'machines:index-ipv6',
kwargs={'interfaceid':str(ipv6list_instance.interface.id)}
))
return form({'ipv6form': ipv6}, 'machines/machine.html', request)
return form({'ipv6form': ipv6, 'action_name' : 'Editer'}, 'machines/machine.html', request)
@login_required
@can_delete(Ipv6List)
@ -435,7 +447,7 @@ def add_iptype(request):
reversion.set_comment("Création")
messages.success(request, "Ce type d'ip a été ajouté")
return redirect(reverse('machines:index-iptype'))
return form({'iptypeform': iptype}, 'machines/machine.html', request)
return form({'iptypeform': iptype, 'action_name' : 'Créer'}, 'machines/machine.html', request)
@login_required
@can_edit(IpType)
@ -450,7 +462,7 @@ def edit_iptype(request, iptype_instance, iptypeid):
reversion.set_comment("Champs modifié(s) : %s" % ', '.join(field for field in iptype.changed_data))
messages.success(request, "Type d'ip modifié")
return redirect(reverse('machines:index-iptype'))
return form({'iptypeform': iptype}, 'machines/machine.html', request)
return form({'iptypeform': iptype, 'action_name' : 'Editer'}, 'machines/machine.html', request)
@login_required
@can_delete_set(IpType)
@ -468,7 +480,7 @@ def del_iptype(request, instances):
except ProtectedError:
messages.error(request, "Le type d'ip %s est affectée à au moins une machine, vous ne pouvez pas le supprimer" % iptype_del)
return redirect(reverse('machines:index-iptype'))
return form({'iptypeform': iptype}, 'machines/machine.html', request)
return form({'iptypeform': iptype, 'action_name' : 'Supprimer'}, 'machines/machine.html', request)
@login_required
@can_create(MachineType)
@ -482,7 +494,7 @@ def add_machinetype(request):
reversion.set_comment("Création")
messages.success(request, "Ce type de machine a été ajouté")
return redirect(reverse('machines:index-machinetype'))
return form({'machinetypeform': machinetype}, 'machines/machine.html', request)
return form({'machinetypeform': machinetype, 'action_name' : 'Créer'}, 'machines/machine.html', request)
@login_required
@can_edit(MachineType)
@ -496,7 +508,7 @@ def edit_machinetype(request, machinetype_instance, machinetypeid):
reversion.set_comment("Champs modifié(s) : %s" % ', '.join(field for field in machinetype.changed_data))
messages.success(request, "Type de machine modifié")
return redirect(reverse('machines:index-machinetype'))
return form({'machinetypeform': machinetype}, 'machines/machine.html', request)
return form({'machinetypeform': machinetype, 'action_name' : 'Editer'}, 'machines/machine.html', request)
@login_required
@can_delete_set(MachineType)
@ -513,7 +525,7 @@ def del_machinetype(request, instances):
except ProtectedError:
messages.error(request, "Le type de machine %s est affectée à au moins une machine, vous ne pouvez pas le supprimer" % machinetype_del)
return redirect(reverse('machines:index-machinetype'))
return form({'machinetypeform': machinetype}, 'machines/machine.html', request)
return form({'machinetypeform': machinetype, 'action_name' : 'Supprimer'}, 'machines/machine.html', request)
@login_required
@can_create(Extension)
@ -527,7 +539,7 @@ def add_extension(request):
reversion.set_comment("Création")
messages.success(request, "Cette extension a été ajoutée")
return redirect(reverse('machines:index-extension'))
return form({'extensionform': extension}, 'machines/machine.html', request)
return form({'extensionform': extension, 'action_name' : 'Créer'}, 'machines/machine.html', request)
@login_required
@can_edit(Extension)
@ -541,7 +553,7 @@ def edit_extension(request, extension_instance, extensionid):
reversion.set_comment("Champs modifié(s) : %s" % ', '.join(field for field in extension.changed_data))
messages.success(request, "Extension modifiée")
return redirect(reverse('machines:index-extension'))
return form({'extensionform': extension}, 'machines/machine.html', request)
return form({'extensionform': extension, 'action_name' : 'Editer'}, 'machines/machine.html', request)
@login_required
@can_delete_set(Extension)
@ -558,7 +570,7 @@ def del_extension(request, instances):
except ProtectedError:
messages.error(request, "L'extension %s est affectée à au moins un type de machine, vous ne pouvez pas la supprimer" % extension_del)
return redirect(reverse('machines:index-extension'))
return form({'extensionform': extension}, 'machines/machine.html', request)
return form({'extensionform': extension, 'action_name' : 'Supprimer'}, 'machines/machine.html', request)
@login_required
@can_create(SOA)
@ -572,7 +584,7 @@ def add_soa(request):
reversion.set_comment("Création")
messages.success(request, "Cet enregistrement SOA a été ajouté")
return redirect(reverse('machines:index-extension'))
return form({'soaform': soa}, 'machines/machine.html', request)
return form({'soaform': soa, 'action_name' : 'Créer'}, 'machines/machine.html', request)
@login_required
@can_edit(SOA)
@ -586,7 +598,7 @@ def edit_soa(request, soa_instance, soaid):
reversion.set_comment("Champs modifié(s) : %s" % ', '.join(field for field in soa.changed_data))
messages.success(request, "SOA modifié")
return redirect(reverse('machines:index-extension'))
return form({'soaform': soa}, 'machines/machine.html', request)
return form({'soaform': soa, 'action_name' : 'Editer'}, 'machines/machine.html', request)
@login_required
@can_delete_set(SOA)
@ -603,7 +615,7 @@ def del_soa(request, instances):
except ProtectedError:
messages.error(request, "Erreur le SOA suivant %s ne peut être supprimé" % soa_del)
return redirect(reverse('machines:index-extension'))
return form({'soaform': soa}, 'machines/machine.html', request)
return form({'soaform': soa, 'action_name' : 'Supprimer'}, 'machines/machine.html', request)
@login_required
@can_create(Mx)
@ -617,7 +629,7 @@ def add_mx(request):
reversion.set_comment("Création")
messages.success(request, "Cet enregistrement mx a été ajouté")
return redirect(reverse('machines:index-extension'))
return form({'mxform': mx}, 'machines/machine.html', request)
return form({'mxform': mx, 'action_name' : 'Créer'}, 'machines/machine.html', request)
@login_required
@can_edit(Mx)
@ -631,7 +643,7 @@ def edit_mx(request, mx_instance, mxid):
reversion.set_comment("Champs modifié(s) : %s" % ', '.join(field for field in mx.changed_data))
messages.success(request, "Mx modifié")
return redirect(reverse('machines:index-extension'))
return form({'mxform': mx}, 'machines/machine.html', request)
return form({'mxform': mx, 'action_name' : 'Editer'}, 'machines/machine.html', request)
@login_required
@can_delete_set(Mx)
@ -648,7 +660,7 @@ def del_mx(request, instances):
except ProtectedError:
messages.error(request, "Erreur le Mx suivant %s ne peut être supprimé" % mx_del)
return redirect(reverse('machines:index-extension'))
return form({'mxform': mx}, 'machines/machine.html', request)
return form({'mxform': mx, 'action_name' : 'Supprimer'}, 'machines/machine.html', request)
@login_required
@can_create(Ns)
@ -662,7 +674,7 @@ def add_ns(request):
reversion.set_comment("Création")
messages.success(request, "Cet enregistrement ns a été ajouté")
return redirect(reverse('machines:index-extension'))
return form({'nsform': ns}, 'machines/machine.html', request)
return form({'nsform': ns, 'action_name' : 'Créer'}, 'machines/machine.html', request)
@login_required
@can_edit(Ns)
@ -676,7 +688,7 @@ def edit_ns(request, ns_instance, nsid):
reversion.set_comment("Champs modifié(s) : %s" % ', '.join(field for field in ns.changed_data))
messages.success(request, "Ns modifié")
return redirect(reverse('machines:index-extension'))
return form({'nsform': ns}, 'machines/machine.html', request)
return form({'nsform': ns, 'action_name' : 'Editer'}, 'machines/machine.html', request)
@login_required
@can_delete_set(Ns)
@ -693,7 +705,7 @@ def del_ns(request, instances):
except ProtectedError:
messages.error(request, "Erreur le Ns suivant %s ne peut être supprimé" % ns_del)
return redirect(reverse('machines:index-extension'))
return form({'nsform': ns}, 'machines/machine.html', request)
return form({'nsform': ns, 'action_name' : 'Supprimer'}, 'machines/machine.html', request)
@login_required
@can_create(Txt)
@ -707,7 +719,7 @@ def add_txt(request):
reversion.set_comment("Création")
messages.success(request, "Cet enregistrement text a été ajouté")
return redirect(reverse('machines:index-extension'))
return form({'txtform': txt}, 'machines/machine.html', request)
return form({'txtform': txt, 'action_name' : 'Créer'}, 'machines/machine.html', request)
@login_required
@can_edit(Txt)
@ -721,7 +733,7 @@ def edit_txt(request, txt_instance, txtid):
reversion.set_comment("Champs modifié(s) : %s" % ', '.join(field for field in txt.changed_data))
messages.success(request, "Txt modifié")
return redirect(reverse('machines:index-extension'))
return form({'txtform': txt}, 'machines/machine.html', request)
return form({'txtform': txt, 'action_name' : 'Editer'}, 'machines/machine.html', request)
@login_required
@can_delete_set(Txt)
@ -738,7 +750,7 @@ def del_txt(request, instances):
except ProtectedError:
messages.error(request, "Erreur le Txt suivant %s ne peut être supprimé" % txt_del)
return redirect(reverse('machines:index-extension'))
return form({'txtform': txt}, 'machines/machine.html', request)
return form({'txtform': txt, 'action_name' : 'Supprimer'}, 'machines/machine.html', request)
@login_required
@can_create(Srv)
@ -752,7 +764,7 @@ def add_srv(request):
reversion.set_comment("Création")
messages.success(request, "Cet enregistrement srv a été ajouté")
return redirect(reverse('machines:index-extension'))
return form({'srvform': srv}, 'machines/machine.html', request)
return form({'srvform': srv, 'action_name' : 'Créer'}, 'machines/machine.html', request)
@login_required
@can_edit(Srv)
@ -766,7 +778,7 @@ def edit_srv(request, srv_instance, srvid):
reversion.set_comment("Champs modifié(s) : %s" % ', '.join(field for field in srv.changed_data))
messages.success(request, "Srv modifié")
return redirect(reverse('machines:index-extension'))
return form({'srvform': srv}, 'machines/machine.html', request)
return form({'srvform': srv, 'action_name' : 'Editer'}, 'machines/machine.html', request)
@login_required
@can_delete_set(Srv)
@ -783,7 +795,7 @@ def del_srv(request, instances):
except ProtectedError:
messages.error(request, "Erreur le Srv suivant %s ne peut être supprimé" % srv_del)
return redirect(reverse('machines:index-extension'))
return form({'srvform': srv}, 'machines/machine.html', request)
return form({'srvform': srv, 'action_name' : 'Supprimer'}, 'machines/machine.html', request)
@login_required
@can_create(Domain)
@ -803,7 +815,7 @@ def add_alias(request, interface, interfaceid):
'machines:index-alias',
kwargs={'interfaceid':str(interfaceid)}
))
return form({'aliasform': alias}, 'machines/machine.html', request)
return form({'aliasform': alias, 'action_name' : 'Créer'}, 'machines/machine.html', request)
@login_required
@can_edit(Domain)
@ -820,7 +832,7 @@ def edit_alias(request, domain_instance, domainid):
'machines:index-alias',
kwargs={'interfaceid':str(domain_instance.cname.interface_parent.id)}
))
return form({'aliasform': alias}, 'machines/machine.html', request)
return form({'aliasform': alias, 'action_name' : 'Editer'}, 'machines/machine.html', request)
@login_required
@can_edit(Interface)
@ -840,7 +852,7 @@ def del_alias(request, interface, interfaceid):
'machines:index-alias',
kwargs={'interfaceid':str(interfaceid)}
))
return form({'aliasform': alias}, 'machines/machine.html', request)
return form({'aliasform': alias, 'action_name' : 'Supprimer'}, 'machines/machine.html', request)
@login_required
@ -855,7 +867,7 @@ def add_service(request):
reversion.set_comment("Création")
messages.success(request, "Cet enregistrement service a été ajouté")
return redirect(reverse('machines:index-service'))
return form({'serviceform': service}, 'machines/machine.html', request)
return form({'serviceform': service, 'action_name' : 'Créer'}, 'machines/machine.html', request)
@login_required
@can_edit(Service)
@ -869,7 +881,7 @@ def edit_service(request, service_instance, serviceid):
reversion.set_comment("Champs modifié(s) : %s" % ', '.join(field for field in service.changed_data))
messages.success(request, "Service modifié")
return redirect(reverse('machines:index-service'))
return form({'serviceform': service}, 'machines/machine.html', request)
return form({'serviceform': service, 'action_name' : 'Editer'}, 'machines/machine.html', request)
@login_required
@can_delete_set(Service)
@ -886,7 +898,7 @@ def del_service(request, instances):
except ProtectedError:
messages.error(request, "Erreur le service suivant %s ne peut être supprimé" % service_del)
return redirect(reverse('machines:index-service'))
return form({'serviceform': service}, 'machines/machine.html', request)
return form({'serviceform': service, 'action_name' : 'Supprimer'}, 'machines/machine.html', request)
@login_required
@can_create(Vlan)
@ -900,7 +912,7 @@ def add_vlan(request):
reversion.set_comment("Création")
messages.success(request, "Cet enregistrement vlan a été ajouté")
return redirect(reverse('machines:index-vlan'))
return form({'vlanform': vlan}, 'machines/machine.html', request)
return form({'vlanform': vlan, 'action_name' : 'Créer'}, 'machines/machine.html', request)
@login_required
@can_edit(Vlan)
@ -914,7 +926,7 @@ def edit_vlan(request, vlan_instance, vlanid):
reversion.set_comment("Champs modifié(s) : %s" % ', '.join(field for field in vlan.changed_data))
messages.success(request, "Vlan modifié")
return redirect(reverse('machines:index-vlan'))
return form({'vlanform': vlan}, 'machines/machine.html', request)
return form({'vlanform': vlan, 'action_name' : 'Editer'}, 'machines/machine.html', request)
@login_required
@can_delete_set(Vlan)
@ -931,7 +943,7 @@ def del_vlan(request, instances):
except ProtectedError:
messages.error(request, "Erreur le Vlan suivant %s ne peut être supprimé" % vlan_del)
return redirect(reverse('machines:index-vlan'))
return form({'vlanform': vlan}, 'machines/machine.html', request)
return form({'vlanform': vlan, 'action_name' : 'Supprimer'}, 'machines/machine.html', request)
@login_required
@can_create(Nas)
@ -945,7 +957,7 @@ def add_nas(request):
reversion.set_comment("Création")
messages.success(request, "Cet enregistrement nas a été ajouté")
return redirect(reverse('machines:index-nas'))
return form({'nasform': nas}, 'machines/machine.html', request)
return form({'nasform': nas, 'action_name' : 'Créer'}, 'machines/machine.html', request)
@login_required
@can_edit(Nas)
@ -959,7 +971,7 @@ def edit_nas(request, nas_instance, nasid):
reversion.set_comment("Champs modifié(s) : %s" % ', '.join(field for field in nas.changed_data))
messages.success(request, "Nas modifié")
return redirect(reverse('machines:index-nas'))
return form({'nasform': nas}, 'machines/machine.html', request)
return form({'nasform': nas, 'action_name' : 'Editer'}, 'machines/machine.html', request)
@login_required
@can_delete_set(Nas)
@ -976,7 +988,7 @@ def del_nas(request, instances):
except ProtectedError:
messages.error(request, "Erreur le Nas suivant %s ne peut être supprimé" % nas_del)
return redirect(reverse('machines:index-nas'))
return form({'nasform': nas}, 'machines/machine.html', request)
return form({'nasform': nas, 'action_name' : 'Supprimer'}, 'machines/machine.html', request)
@login_required
@can_view_all(Machine)
@ -1130,7 +1142,7 @@ def add_portlist(request):
port_list.save()
messages.success(request, "Liste de ports créée")
return redirect(reverse('machines:index-portlist'))
return form({'machineform' : port_list}, 'machines/machine.html', request)
return form({'machineform' : port_list, 'action_name' : 'Créer'}, 'machines/machine.html', request)
@login_required
@can_create(OuverturePort)
@ -1143,7 +1155,7 @@ def configure_ports(request, interface_instance, interfaceid):
interface.save()
messages.success(request, "Configuration des ports mise à jour.")
return redirect(reverse('machines:index'))
return form({'interfaceform' : interface}, 'machines/machine.html', request)
return form({'interfaceform' : interface, 'action_name' : 'Editer la configuration'}, 'machines/machine.html', request)
""" Framework Rest """

View file

@ -36,7 +36,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<form class="form" method="post" enctype="multipart/form-data">
{% csrf_token %}
{% massive_bootstrap_form options 'utilisateur_asso' %}
{% bootstrap_button "Créer ou modifier" button_type="submit" icon="star" %}
{% bootstrap_button "Modifier" button_type="submit" icon="star" %}
</form>
<br />
<br />

View file

@ -38,7 +38,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if preferenceform %}
{% bootstrap_form preferenceform %}
{% endif %}
{% bootstrap_button "Créer ou modifier" button_type="submit" icon="star" %}
{% bootstrap_button action_name button_type="submit" icon="star" %}
</form>
<br />
<br />

View file

@ -129,7 +129,7 @@ def add_service(request):
messages.success(request, "Ce service a été ajouté")
return redirect(reverse('preferences:display-options'))
return form(
{'preferenceform': service},
{'preferenceform': service, 'action_name' : 'Ajouter'},
'preferences/preferences.html',
request
)
@ -152,7 +152,7 @@ def edit_service(request, service_instance, serviceid):
messages.success(request, "Service modifié")
return redirect(reverse('preferences:display-options'))
return form(
{'preferenceform': service},
{'preferenceform': service, 'action_name' : 'Editer'},
'preferences/preferences.html',
request
)
@ -176,7 +176,7 @@ def del_services(request, instances):
suivant %s ne peut être supprimé" % services_del)
return redirect(reverse('preferences:display-options'))
return form(
{'preferenceform': services},
{'preferenceform': services, 'action_name' : 'Supprimer'},
'preferences/preferences.html',
request
)

View file

@ -37,7 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<form class="form" method="post">
{% csrf_token %}
{% massive_bootstrap_form topoform 'room,related,machine_interface' %}
{% bootstrap_button "Créer ou modifier" button_type="submit" icon="ok" %}
{% bootstrap_button action_name button_type="submit" icon="ok" %}
</form>
<br />
<br />

View file

@ -235,7 +235,7 @@ def new_port(request, switch_id):
'topologie:index-port',
kwargs={'switch_id':switch_id}
))
return form({'id_switch': switch_id,'topoform': port}, 'topologie/topo.html', request)
return form({'id_switch': switch_id,'topoform': port, 'action_name' : 'Ajouter'}, 'topologie/topo.html', request)
@login_required
@ -257,7 +257,7 @@ def edit_port(request, port_object, port_id):
'topologie:index-port',
kwargs={'switch_id': str(port_object.switch.id)}
))
return form({'id_switch': str(port_object.switch.id), 'topoform': port}, 'topologie/topo.html', request)
return form({'id_switch': str(port_object.switch.id), 'topoform': port, 'action_name' : 'Editer'}, 'topologie/topo.html', request)
@login_required
@ -292,7 +292,7 @@ def new_stack(request):
reversion.set_user(request.user)
reversion.set_comment("Création")
messages.success(request, "Stack crée")
return form({'topoform': stack}, 'topologie/topo.html', request)
return form({'topoform': stack, 'action_name' : 'Créer'}, 'topologie/topo.html', request)
@login_required
@ -311,7 +311,7 @@ def edit_stack(request, stack, stack_id):
)
)
return redirect(reverse('topologie:index-stack'))
return form({'topoform': stack}, 'topologie/topo.html', request)
return form({'topoform': stack, 'action_name' : 'Editer'}, 'topologie/topo.html', request)
@login_required
@ -522,7 +522,7 @@ def new_room(request):
reversion.set_comment("Création")
messages.success(request, "La chambre a été créé")
return redirect(reverse('topologie:index-room'))
return form({'topoform': room}, 'topologie/topo.html', request)
return form({'topoform': room, 'action_name' : 'Ajouter'}, 'topologie/topo.html', request)
@login_required
@ -540,7 +540,7 @@ def edit_room(request, room, room_id):
)
messages.success(request, "La chambre a bien été modifiée")
return redirect(reverse('topologie:index-room'))
return form({'topoform': room}, 'topologie/topo.html', request)
return form({'topoform': room, 'action_name' : 'Editer'}, 'topologie/topo.html', request)
@login_required
@ -576,7 +576,7 @@ def new_model_switch(request):
reversion.set_comment("Création")
messages.success(request, "Le modèle a été créé")
return redirect(reverse('topologie:index-model-switch'))
return form({'topoform': model_switch}, 'topologie/topo.html', request)
return form({'topoform': model_switch, 'action_name' : 'Ajouter'}, 'topologie/topo.html', request)
@login_required
@ -594,7 +594,7 @@ def edit_model_switch(request, model_switch, model_switch_id):
)
messages.success(request, "Le modèle a bien été modifié")
return redirect(reverse('topologie:index-model-switch'))
return form({'topoform': model_switch}, 'topologie/topo.html', request)
return form({'topoform': model_switch, 'action_name' : 'Editer'}, 'topologie/topo.html', request)
@login_required
@ -630,7 +630,7 @@ def new_constructor_switch(request):
reversion.set_comment("Création")
messages.success(request, "Le constructeur a été créé")
return redirect(reverse('topologie:index-model-switch'))
return form({'topoform': constructor_switch}, 'topologie/topo.html', request)
return form({'topoform': constructor_switch, 'action_name' : 'Ajouter'}, 'topologie/topo.html', request)
@login_required
@ -648,7 +648,7 @@ def edit_constructor_switch(request, constructor_switch, constructor_switch_id):
)
messages.success(request, "Le modèle a bien été modifié")
return redirect(reverse('topologie:index-model-switch'))
return form({'topoform': constructor_switch}, 'topologie/topo.html', request)
return form({'topoform': constructor_switch, 'action_name' : 'Editer'}, 'topologie/topo.html', request)
@login_required

View file

@ -34,7 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<form class="form" method="post">
{% csrf_token %}
{% massive_bootstrap_form userform 'room,school,administrators,members' %}
{% bootstrap_button "Créer ou modifier" button_type="submit" icon="star" %}
{% bootstrap_button action_name button_type="submit" icon="star" %}
</form>
<br>
{% if showCGU %}

View file

@ -122,7 +122,7 @@ def new_user(request):
'users:profil',
kwargs={'userid':str(user.id)}
))
return form({'userform': user,'GTU_sum_up':GTU_sum_up,'GTU':GTU,'showCGU':True}, 'users/user.html', request)
return form({'userform': user,'GTU_sum_up':GTU_sum_up,'GTU':GTU,'showCGU':True, 'action_name':'Créer un utilisateur'}, 'users/user.html', request)
@login_required
@ -144,7 +144,7 @@ def new_club(request):
'users:profil',
kwargs={'userid':str(club.id)}
))
return form({'userform': club, 'showCGU':False}, 'users/user.html', request)
return form({'userform': club, 'showCGU':False, 'action_name':'Créer un club'}, 'users/user.html', request)
@login_required
@ -165,7 +165,7 @@ def edit_club_admin_members(request, club_instance, clubid):
'users:profil',
kwargs={'userid':str(club_instance.id)}
))
return form({'userform': club, 'showCGU':False}, 'users/user.html', request)
return form({'userform': club, 'showCGU':False, 'action_name':'Editer les admin et membres'}, 'users/user.html', request)
@login_required
@ -198,7 +198,7 @@ def edit_info(request, user, userid):
'users:profil',
kwargs={'userid':str(userid)}
))
return form({'userform': user}, 'users/user.html', request)
return form({'userform': user, 'action_name': "Editer l'utilisateur"}, 'users/user.html', request)
@login_required
@ -225,7 +225,7 @@ def state(request, user, userid):
'users:profil',
kwargs={'userid':str(userid)}
))
return form({'userform': state}, 'users/user.html', request)
return form({'userform': state, 'action_name': "Editer l'état"}, 'users/user.html', request)
@login_required
@ -244,7 +244,7 @@ def groups(request, user, userid):
'users:profil',
kwargs={'userid':str(userid)}
))
return form({'userform': group}, 'users/user.html', request)
return form({'userform': group, 'action_name':'Editer les groupes'}, 'users/user.html', request)
@login_required
@ -264,7 +264,7 @@ def password(request, user, userid):
'users:profil',
kwargs={'userid':str(user.id)}
))
return form({'userform': u_form}, 'users/user.html', request)
return form({'userform': u_form, 'action_name':'Changer le mot de passe'}, 'users/user.html', request)
@login_required
@ -294,7 +294,7 @@ def new_serviceuser(request):
"L'utilisateur %s a été crée" % user_object.pseudo
)
return redirect(reverse('users:index-serviceusers'))
return form({'userform': user}, 'users/user.html', request)
return form({'userform': user, 'action_name':'Créer un serviceuser'}, 'users/user.html', request)
@login_required
@ -314,7 +314,7 @@ def edit_serviceuser(request, user, userid):
))
messages.success(request, "L'user a bien été modifié")
return redirect(reverse('users:index-serviceusers'))
return form({'userform': user}, 'users/user.html', request)
return form({'userform': user, 'action_name':'Editer un serviceuser'}, 'users/user.html', request)
@login_required
@ -358,7 +358,7 @@ def add_ban(request, user, userid):
request,
"Attention, cet utilisateur a deja un bannissement actif"
)
return form({'userform': ban}, 'users/user.html', request)
return form({'userform': ban, 'action_name': 'Ajouter un ban'}, 'users/user.html', request)
@login_required
@can_edit(Ban)
@ -376,7 +376,7 @@ def edit_ban(request, ban_instance, banid):
))
messages.success(request, "Bannissement modifié")
return redirect(reverse('users:index'))
return form({'userform': ban}, 'users/user.html', request)
return form({'userform': ban, 'action_name': 'Editer un ban'}, 'users/user.html', request)
@login_required
@ -407,7 +407,7 @@ def add_whitelist(request, user, userid):
request,
"Attention, cet utilisateur a deja un accès gracieux actif"
)
return form({'userform': whitelist}, 'users/user.html', request)
return form({'userform': whitelist, 'action_name': 'Ajouter une whitelist'}, 'users/user.html', request)
@login_required
@ -430,7 +430,7 @@ def edit_whitelist(request, whitelist_instance, whitelistid):
))
messages.success(request, "Whitelist modifiée")
return redirect(reverse('users:index'))
return form({'userform': whitelist}, 'users/user.html', request)
return form({'userform': whitelist, 'action_name': 'Editer une whitelist'}, 'users/user.html', request)
@login_required
@ -446,7 +446,7 @@ def add_school(request):
reversion.set_comment("Création")
messages.success(request, "L'établissement a été ajouté")
return redirect(reverse('users:index-school'))
return form({'userform': school}, 'users/user.html', request)
return form({'userform': school, 'action_name':'Ajouter'}, 'users/user.html', request)
@login_required
@ -464,7 +464,7 @@ def edit_school(request, school_instance, schoolid):
))
messages.success(request, "Établissement modifié")
return redirect(reverse('users:index-school'))
return form({'userform': school}, 'users/user.html', request)
return form({'userform': school, 'action_name':'Editer'}, 'users/user.html', request)
@login_required
@ -489,7 +489,7 @@ def del_school(request, instances):
"L'établissement %s est affecté à au moins un user, \
vous ne pouvez pas le supprimer" % school_del)
return redirect(reverse('users:index-school'))
return form({'userform': school}, 'users/user.html', request)
return form({'userform': school, 'action_name': 'Supprimer'}, 'users/user.html', request)
@login_required
@ -505,7 +505,7 @@ def add_listright(request):
reversion.set_comment("Création")
messages.success(request, "Le droit/groupe a été ajouté")
return redirect(reverse('users:index-listright'))
return form({'userform': listright}, 'users/user.html', request)
return form({'userform': listright, 'action_name': 'Ajouter'}, 'users/user.html', request)
@login_required
@ -526,7 +526,7 @@ def edit_listright(request, listright_instance, listrightid):
))
messages.success(request, "Droit modifié")
return redirect(reverse('users:index-listright'))
return form({'userform': listright}, 'users/user.html', request)
return form({'userform': listright, 'action_name': 'Editer'}, 'users/user.html', request)
@login_required
@ -549,7 +549,7 @@ def del_listright(request, instances):
"Le groupe %s est affecté à au moins un user, \
vous ne pouvez pas le supprimer" % listright_del)
return redirect(reverse('users:index-listright'))
return form({'userform': listright}, 'users/user.html', request)
return form({'userform': listright, 'action_name': 'Supprimer'}, 'users/user.html', request)
@login_required
@ -797,12 +797,12 @@ def reset_password(request):
)
except User.DoesNotExist:
messages.error(request, "Cet utilisateur n'existe pas")
return form({'userform': userform}, 'users/user.html', request)
return form({'userform': userform, 'action_name': 'Réinitialiser'}, 'users/user.html', request)
user.reset_passwd_mail(request)
messages.success(request, "Un mail pour l'initialisation du mot\
de passe a été envoyé")
redirect(reverse('index'))
return form({'userform': userform}, 'users/user.html', request)
return form({'userform': userform, 'action_name': 'Réinitialiser'}, 'users/user.html', request)
def process(request, token):
@ -829,7 +829,7 @@ def process_passwd(request, req):
req.delete()
messages.success(request, "Le mot de passe a changé")
return redirect(reverse('index'))
return form({'userform': u_form}, 'users/user.html', request)
return form({'userform': u_form, 'action_name': 'Changer le mot de passe'}, 'users/user.html', request)
class JSONResponse(HttpResponse):