mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-09 09:08:15 -06:00
Move the create/update/cancel buttons to the righthand side and make them float
This commit is contained in:
parent
d5488ca7da
commit
d9735c2279
@ -132,7 +132,7 @@ def secret_add(request, pk):
|
|||||||
form = forms.SecretForm(instance=secret)
|
form = forms.SecretForm(instance=secret)
|
||||||
|
|
||||||
return render(request, 'secrets/secret_edit.html', {
|
return render(request, 'secrets/secret_edit.html', {
|
||||||
'secret': secret,
|
'obj': secret,
|
||||||
'form': form,
|
'form': form,
|
||||||
'return_url': device.get_absolute_url(),
|
'return_url': device.get_absolute_url(),
|
||||||
})
|
})
|
||||||
@ -185,7 +185,7 @@ def secret_edit(request, pk):
|
|||||||
form = forms.SecretForm(instance=secret)
|
form = forms.SecretForm(instance=secret)
|
||||||
|
|
||||||
return render(request, 'secrets/secret_edit.html', {
|
return render(request, 'secrets/secret_edit.html', {
|
||||||
'secret': secret,
|
'obj': secret,
|
||||||
'form': form,
|
'form': form,
|
||||||
'return_url': reverse('secrets:secret', kwargs={'pk': secret.pk}),
|
'return_url': reverse('secrets:secret', kwargs={'pk': secret.pk}),
|
||||||
})
|
})
|
||||||
|
@ -1,24 +1,10 @@
|
|||||||
{% extends '_base.html' %}
|
{% extends 'utilities/obj_edit.html' %}
|
||||||
{% load staticfiles %}
|
{% load staticfiles %}
|
||||||
{% load form_helpers %}
|
{% load form_helpers %}
|
||||||
|
|
||||||
{% block content %}
|
{% block title %}Circuit {{ obj.circuit }} - {{ form.term_side.value }} Side{% endblock %}
|
||||||
<form action="." method="post" class="form form-horizontal">
|
|
||||||
{% csrf_token %}
|
{% block form %}
|
||||||
{% for field in form.hidden_fields %}
|
|
||||||
{{ field }}
|
|
||||||
{% endfor %}
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6 col-md-offset-3">
|
|
||||||
<h3>{% block title %}Circuit {{ obj.circuit }} - {{ form.term_side.value }} Side{% endblock %}</h3>
|
|
||||||
{% if form.non_field_errors %}
|
|
||||||
<div class="panel panel-danger">
|
|
||||||
<div class="panel-heading"><strong>Errors</strong></div>
|
|
||||||
<div class="panel-body">
|
|
||||||
{{ form.non_field_errors }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading"><strong>Location</strong></div>
|
<div class="panel-heading"><strong>Location</strong></div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
@ -73,19 +59,6 @@
|
|||||||
{% render_field form.pp_info %}
|
{% render_field form.pp_info %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6 col-md-offset-3 text-right">
|
|
||||||
{% if obj.pk %}
|
|
||||||
<button type="submit" name="_update" class="btn btn-primary">Update</button>
|
|
||||||
{% else %}
|
|
||||||
<button type="submit" name="_create" class="btn btn-primary">Create</button>
|
|
||||||
{% endif %}
|
|
||||||
<a href="{{ return_url }}" class="btn btn-default">Cancel</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block javascript %}
|
{% block javascript %}
|
||||||
|
@ -35,17 +35,6 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block buttons %}
|
|
||||||
{% if obj.pk %}
|
|
||||||
<button type="submit" name="_update" class="btn btn-primary">Update</button>
|
|
||||||
<button type="submit" formaction="?return_url={% url 'dcim:interface_edit' pk=obj.pk %}" class="btn btn-primary">Update and Continue Editing</button>
|
|
||||||
{% else %}
|
|
||||||
<button type="submit" name="_create" class="btn btn-primary">Create</button>
|
|
||||||
<button type="submit" name="_addanother" class="btn btn-primary">Create and Add Another</button>
|
|
||||||
{% endif %}
|
|
||||||
<a href="{{ return_url }}" class="btn btn-default">Cancel</a>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block javascript %}
|
{% block javascript %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
@ -1,29 +1,17 @@
|
|||||||
{% extends '_base.html' %}
|
{% extends 'utilities/obj_edit.html' %}
|
||||||
{% load static from staticfiles %}
|
{% load static from staticfiles %}
|
||||||
{% load form_helpers %}
|
{% load form_helpers %}
|
||||||
|
|
||||||
{% block content %}
|
{% block title %}{% if obj.pk %}Editing {{ secret }}{% else %}Add a Secret{% endif %}{% endblock %}
|
||||||
<form action="." method="post" class="form form-horizontal">
|
|
||||||
{% csrf_token %}
|
{% block form %}
|
||||||
{{ form.private_key }}
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6 col-md-offset-3">
|
|
||||||
<h3>{% block title %}{% if secret.pk %}Editing {{ secret }}{% else %}Add a Secret{% endif %}{% endblock %}</h3>
|
|
||||||
{% if form.non_field_errors %}
|
|
||||||
<div class="panel panel-danger">
|
|
||||||
<div class="panel-heading"><strong>Errors</strong></div>
|
|
||||||
<div class="panel-body">
|
|
||||||
{{ form.non_field_errors }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading"><strong>Secret Attributes</strong></div>
|
<div class="panel-heading"><strong>Secret Attributes</strong></div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-3 control-label required">Device</label>
|
<label class="col-md-3 control-label required">Device</label>
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<p class="form-control-static">{{ secret.device }}</p>
|
<p class="form-control-static">{{ obj.device }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% render_field form.role %}
|
{% render_field form.role %}
|
||||||
@ -34,17 +22,17 @@
|
|||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading"><strong>Secret Data</strong></div>
|
<div class="panel-heading"><strong>Secret Data</strong></div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{% if secret.pk %}
|
{% if obj.pk %}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-3 control-label required">Current Plaintext</label>
|
<label class="col-md-3 control-label required">Current Plaintext</label>
|
||||||
<div class="col-md-7">
|
<div class="col-md-7">
|
||||||
<p class="form-control-static" id="secret_{{ secret.pk }}">********</p>
|
<p class="form-control-static" id="secret_{{ obj.pk }}">********</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2 text-right">
|
<div class="col-md-2 text-right">
|
||||||
<button class="btn btn-xs btn-success unlock-secret" secret-id="{{ secret.pk }}">
|
<button class="btn btn-xs btn-success unlock-secret" secret-id="{{ obj.pk }}">
|
||||||
<i class="fa fa-lock"></i> Unlock
|
<i class="fa fa-lock"></i> Unlock
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-xs btn-danger lock-secret collapse" secret-id="{{ secret.pk }}">
|
<button class="btn btn-xs btn-danger lock-secret collapse" secret-id="{{ obj.pk }}">
|
||||||
<i class="fa fa-unlock-alt"></i> Lock
|
<i class="fa fa-unlock-alt"></i> Lock
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@ -68,27 +56,9 @@
|
|||||||
{% render_field form.tags %}
|
{% render_field form.tags %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="col-md-12 text-center">
|
|
||||||
{% if secret.pk %}
|
|
||||||
<button type="submit" name="_update" class="btn btn-primary">Update</button>
|
|
||||||
<a href="{% url 'secrets:secret' pk=secret.pk %}" class="btn btn-default">Cancel</a>
|
|
||||||
{% else %}
|
|
||||||
<button type="submit" name="_create" class="btn btn-primary">Create</button>
|
|
||||||
<button type="submit" name="_addanother" class="btn btn-primary">Create and Add Another</button>
|
|
||||||
<a href="{{ return_url }}" class="btn btn-default">Cancel</a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
{% include 'secrets/inc/private_key_modal.html' %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block javascript %}
|
{% block javascript %}
|
||||||
|
{% include 'secrets/inc/private_key_modal.html' %}
|
||||||
<script src="{% static 'js/secrets.js' %}?v{{ settings.VERSION }}"></script>
|
<script src="{% static 'js/secrets.js' %}?v{{ settings.VERSION }}"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{% extends 'utilities/obj_edit.html' %}
|
{% extends 'utilities/obj_edit.html' %}
|
||||||
{% load static from staticfiles %}
|
|
||||||
{% load form_helpers %}
|
{% load form_helpers %}
|
||||||
|
|
||||||
{% block form %}
|
{% block form %}
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6 col-md-offset-3">
|
<div class="col-md-6 col-md-offset-3">
|
||||||
<h3>{% block title %}{% if obj.pk %}Editing {{ obj_type }} {{ obj }}{% else %}Add a new {{ obj_type }}{% endif %}{% endblock %}</h3>
|
<h3>{% block title %}{% if obj.pk %}Editing {{ obj_type }} {{ obj }}{% else %}Add a new {{ obj_type }}{% endif %}{% endblock %}</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 col-md-offset-3">
|
||||||
{% block tabs %}{% endblock %}
|
{% block tabs %}{% endblock %}
|
||||||
{% if form.non_field_errors %}
|
{% if form.non_field_errors %}
|
||||||
<div class="panel panel-danger">
|
<div class="panel panel-danger">
|
||||||
@ -28,19 +32,19 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col-md-3">
|
||||||
<div class="row">
|
<div style="position: fixed">
|
||||||
<div class="col-md-6 col-md-offset-3 text-right">
|
|
||||||
{% block buttons %}
|
{% block buttons %}
|
||||||
{% if obj.pk %}
|
{% if obj.pk %}
|
||||||
<button type="submit" name="_update" class="btn btn-primary">Update</button>
|
<p><button type="submit" name="_save" class="btn btn-success"><i class="fa fa-save"></i> Save</button></p>
|
||||||
{% else %}
|
{% else %}
|
||||||
<button type="submit" name="_create" class="btn btn-primary">Create</button>
|
<p><button type="submit" name="_create" class="btn btn-success"><i class="fa fa-plus"></i> Create</button></p>
|
||||||
<button type="submit" name="_addanother" class="btn btn-primary">Create and Add Another</button>
|
<p><button type="submit" name="_addanother" class="btn btn-primary"><i class="fa fa-plus"></i> Create and Add Another</button></p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="{{ return_url }}" class="btn btn-default">Cancel</a>
|
<p><a href="{{ return_url }}" class="btn btn-default"><i class="fa fa-ban"></i> Cancel</a></p>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -26,17 +26,6 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block buttons %}
|
|
||||||
{% if obj.pk %}
|
|
||||||
<button type="submit" name="_update" class="btn btn-primary">Update</button>
|
|
||||||
<button type="submit" formaction="?return_url={% url 'virtualization:interface_edit' pk=obj.pk %}" class="btn btn-primary">Update and Continue Editing</button>
|
|
||||||
{% else %}
|
|
||||||
<button type="submit" name="_create" class="btn btn-primary">Create</button>
|
|
||||||
<button type="submit" name="_addanother" class="btn btn-primary">Create and Add Another</button>
|
|
||||||
{% endif %}
|
|
||||||
<a href="{{ return_url }}" class="btn btn-default">Cancel</a>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block javascript %}
|
{% block javascript %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user