Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
28fb75ef
authored
Apr 30, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: warn the user about not having leases when creating new template
parent
da3cefe3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
circle/dashboard/templates/dashboard/_template-create-2.html
+7
-0
circle/dashboard/views.py
+1
-2
No files found.
circle/dashboard/templates/dashboard/_template-create-2.html
View file @
28fb75ef
{% load i18n %}
{% load i18n %}
{% load crispy_forms_tags %}
{% load crispy_forms_tags %}
{% if leases
<
1
%}
<
div
class=
"alert alert-warning"
>
{% trans "You haven't created any leases yet, but you need one ot create a template!" %}
<a
href=
"{% url "
dashboard
.
views
.
lease-create
"
%}"
>
{% trans "Create a new lease now." %}
</a>
</div>
{% endif %}
{% with form=form %}
{% with form=form %}
{% include "display-form-errors.html" %}
{% include "display-form-errors.html" %}
{% endwith %}
{% endwith %}
...
...
circle/dashboard/views.py
View file @
28fb75ef
...
@@ -878,8 +878,6 @@ class TemplateClone(CreateView):
...
@@ -878,8 +878,6 @@ class TemplateClone(CreateView):
class
TemplateCreate
(
SuccessMessageMixin
,
CreateView
):
class
TemplateCreate
(
SuccessMessageMixin
,
CreateView
):
model
=
InstanceTemplate
model
=
InstanceTemplate
form_class
=
TemplateForm
form_class
=
TemplateForm
template_name
=
"dashboard/template-create.html"
success_message
=
_
(
"Successfully created a new template!"
)
def
get_template_names
(
self
):
def
get_template_names
(
self
):
if
self
.
request
.
is_ajax
():
if
self
.
request
.
is_ajax
():
...
@@ -894,6 +892,7 @@ class TemplateCreate(SuccessMessageMixin, CreateView):
...
@@ -894,6 +892,7 @@ class TemplateCreate(SuccessMessageMixin, CreateView):
'box_title'
:
_
(
"Create a new base VM"
),
'box_title'
:
_
(
"Create a new base VM"
),
'ajax_title'
:
False
,
'ajax_title'
:
False
,
'template'
:
"dashboard/_template-create-2.html"
,
'template'
:
"dashboard/_template-create-2.html"
,
'leases'
:
Lease
.
objects
.
count
()
})
})
return
context
return
context
...
...
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