1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-26 16:15:25 +00:00
webvirtcloud/accounts/templates/account.html

104 lines
7.6 KiB
HTML
Raw Normal View History

2015-03-02 08:52:07 +00:00
{% extends "base.html" %}
{% load i18n %}
2015-03-05 09:55:15 +00:00
{% block title %}{% trans "User" %} - {{ user }}{% endblock %}
2015-03-02 08:52:07 +00:00
{% block content %}
2015-03-05 09:55:15 +00:00
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
2015-04-02 13:20:46 +00:00
{% include 'create_user_inst_block.html' %}
2015-03-05 09:55:15 +00:00
<h1 class="page-header">{{ user }}</h1>
</div>
</div>
<!-- /.row -->
2015-03-02 08:52:07 +00:00
2015-03-03 09:34:09 +00:00
{% include 'errors_block.html' %}
2015-03-02 08:52:07 +00:00
2015-03-05 09:55:15 +00:00
<div class="row">
2015-03-10 14:24:10 +00:00
<div class="col-lg-12">
{% if not user_insts %}
<div class="col-lg-12">
<div class="alert alert-warning alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "User doesn't have any Instace" %}
</div>
</div>
{% else %}
<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>#</th>
2015-03-16 13:46:44 +00:00
<th>{% trans "Instance" %}</th>
<th>{% trans "Resize" %}</th>
<th>{% trans "Delete" %}</th>
2015-03-10 14:24:10 +00:00
<th colspan="2">{% trans "Action" %}</th>
</tr>
</thead>
<tbody>
{% for inst in user_insts %}
<tr>
<td>{{ forloop.counter }}</td>
2015-03-16 13:46:44 +00:00
<td><a href="{% url 'instance' inst.instance.compute.id inst.instance.name %}">{{ inst.instance.name }}</a></td>
2015-03-10 14:24:10 +00:00
<td>{{ inst.is_change }}</td>
<td>{{ inst.is_delete }}</td>
<td style="width:5px;">
<a href="#editPriv{{ forloop.counter }}" type="button" class="btn btn-xs btn-default" data-toggle="modal">
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
</a>
<!-- Modal pool -->
<div class="modal fade" id="editPriv{{ forloop.counter }}" tabindex="-1" role="dialog" aria-labelledby="editPrivLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">{% trans "Edit privilegies for" %} {{ inst.instance.name }}</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
2015-03-16 13:46:44 +00:00
<input type="hidden" name="user_inst" value="{{ inst.id }}">
2015-03-10 14:24:10 +00:00
<div class="form-group">
2015-03-16 13:46:44 +00:00
<label class="col-sm-4 control-label">{% trans "Resize" %}</label>
2015-03-10 14:24:10 +00:00
<div class="col-sm-6">
<select type="text" class="form-control" name="inst_change">
<option value="">False</option>
2015-03-16 13:46:44 +00:00
<option value="1" {% if inst.is_change %}selected{% endif %}>True</option>
2015-03-10 14:24:10 +00:00
</select>
</div>
</div>
<div class="form-group">
2015-03-16 13:46:44 +00:00
<label class="col-sm-4 control-label">{% trans "Delete" %}</label>
2015-03-10 14:24:10 +00:00
<div class="col-sm-6">
<select type="text" class="form-control" name="inst_delete">
<option value="">False</option>
2015-03-16 13:46:44 +00:00
<option value="1" {% if inst.is_delete %}selected{% endif %}>True</option>
2015-03-10 14:24:10 +00:00
</select>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
2015-03-16 13:46:44 +00:00
<button type="submit" class="btn btn-primary" name="permission">{% trans "Edit" %}</button>
2015-03-10 14:24:10 +00:00
</div>
</form>
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog -->
</div> <!-- /.modal -->
</td>
<td style="width:5px;">
<form action="" method="post" role="form">{% csrf_token %}
<input type="hidden" name="user_inst" value="{{ inst.id }}">
<button type="submit" class="btn btn-xs btn-default" name="delete" tittle="{% trans "Delete" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
2015-03-05 09:55:15 +00:00
</div>
2015-03-02 08:52:07 +00:00
{% endblock %}