Commit 55430047 by Szabolcs Gelencser

fix login page html

parent af853c19
No preview for this file type
......@@ -64,6 +64,7 @@ def handler403(request):
return resp
#TODO: something like this for quotas?
class CreateLimitedResourceMixin(object):
resource_name = None
model = None
......
{% extends "dashboard/base.html" %}
{% load staticfiles %}
{% extends "registration/base.html" %}
{% load i18n %}
{% block title-page %}{% trans "Virtual machines" %}{% endblock %}
{% block title-page %}{% trans "Login" %}{% endblock %}
{% block content %}
{% block extra_link %}
{% include "open-graph.html" %}
{% endblock %}
<form method="POST">
{% block content_box %}
<div class="row">
{% if form.password.errors or form.username.errors %}
<div class="login-form-errors">
{% include "display-form-errors.html" %}
</div>
{% endif %}
<div class="col-xs-{% if saml2 %}6{% else %}12{% endif %}">
<div class="login-form">
<form method="POST">
{% csrf_token %}
<div class="input-group">
<span class="input-group-addon">
......@@ -21,7 +31,14 @@
<input type="password" name="password" class="form-control">
</div>
<button type="submit" class="btn btn-success">Sign in</button>
</form>
</form>
</div>
</div>
{% if saml2 %}
<div class="col-xs-6">
<h4 style="padding-top: 0; margin-top: 20px;">{% trans "Login with SSO" %}</h4>
<a href="{% url "saml2_login" %}">{% trans "Click here!" %}</a>
</div>
{% endif %}
</div>
{% endblock %}
......@@ -362,7 +362,6 @@ class VxlanSuperUserForm(ModelForm):
'vlan',
'description',
'comment',
'owner',
)
),
FormActions(
......@@ -374,7 +373,7 @@ class VxlanSuperUserForm(ModelForm):
class Meta:
model = Vxlan
fields = ('name', 'vni', 'vlan', 'description', 'comment', 'owner', )
fields = ('name', 'vni', 'vlan', 'description', 'comment', )
class VxlanForm(ModelForm):
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-02-26 12:31
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('network', '0003_editorelement'),
]
operations = [
migrations.RemoveField(
model_name='vxlan',
name='owner',
),
]
......@@ -95,8 +95,6 @@ class Vxlan(models.Model):
'Notes, comments about the network'))
created_at = models.DateTimeField(auto_now_add=True,
verbose_name=_('created at'))
owner = models.ForeignKey(User, blank=True, null=True,
verbose_name=_('owner'))
modified_at = models.DateTimeField(auto_now=True,
verbose_name=_('modified at'))
editor_elements = GenericRelation(EditorElement)
......
......@@ -19,7 +19,7 @@
<div class="col-md-9 text-left">
<h3 class="no-margin"><i class="fa fa-sitemap"></i> {% trans 'Editor' %}</h3>
</div>
<div class="col-md-3 text-left">
<div class="col-md-3 text-right">
<button class="btn btn-success btn-xs" id="saveButton"><i class="fa fa-floppy-o"></i></button>
</div>
</div>
......
......@@ -995,8 +995,7 @@ class VxlanDetail(LoginRequiredMixin, SuccessMessageMixin, UpdateView): #TODO: c
return super(VxlanDetail, self).post(*args, **kwargs)
class VxlanCreate(LoginRequiredMixin, CreateLimitedResourceMixin,
SuccessMessageMixin, InitialOwnerMixin, CreateView):
class VxlanCreate(LoginRequiredMixin, SuccessMessageMixin, InitialOwnerMixin, CreateView):
model = Vxlan
profile_attribute = 'network_limit'
resource_name = _('Virtual network')
......@@ -1032,7 +1031,6 @@ class VxlanCreate(LoginRequiredMixin, CreateLimitedResourceMixin,
def form_valid(self, form):
obj = form.save(commit=False)
obj.owner = self.request.user
obj.vlan = self.get_default_vlan()
try:
obj.full_clean()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment