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
Commit
a35c44b6
authored
Feb 10, 2013
by
tarokkk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: Added public template list
parent
fc397c96
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
+41
-0
one/static/box.less
+9
-0
one/templates/box-templatelist.html
+29
-0
one/views.py
+3
-0
No files found.
one/static/box.less
View file @
a35c44b6
...
...
@@ -131,6 +131,12 @@
background-color: rgb(135, 211, 120);
}
}
&.public-template{
background-color: rgb(167, 179, 195);
&:hover{
background-color: rgb(157, 169, 185);
}
}
&:hover{
background-color: #b1b1b1;
background-image: none;
...
...
@@ -417,6 +423,9 @@
#template .wm .summary .name{
background-image: url(icons/document-template.png)
}
#template .wm .public-template .name{
background-image: url(icons/blue-document-share.png)
}
#new-template-button .name{
background-image: url(icons/document--plus.png) !important
}
...
...
one/templates/box-templatelist.html
View file @
a35c44b6
...
...
@@ -30,6 +30,8 @@
</div>
</li>
{% endfor %}
<!-- rgb(164, 179, 199) -->
{% if not mytemplates %}
<div
id=
"new-wm-tooltip"
>
<div
id=
"new-wm-tooltip-container"
>
...
...
@@ -49,6 +51,33 @@
<div
class=
"clear"
></div>
</div>
</li>
{% if publictemplates %}
{% for t in publictemplates %}
<li
class=
"wm"
id=
"t{{t.id }}"
>
<div
class=
"summary public-template"
>
<div
class=
"name"
>
{{t.name}}
</div>
<div
class=
"status"
>
{{t.state}}
</div>
<div
class=
"actions"
>
<a
href=
"#"
title=
"{% trans "
Share
"
%}"
><img
src=
"static/icons/user-share.png"
alt=
"{% trans "
Share
"
%}"
/></a>
</div>
<div
class=
"clear"
></div>
</div>
<div
class=
"details"
>
<ul>
<li
class=
"name"
>
{% trans "System" %}:
<span
class=
"value"
>
{{t.system}}
</span><div
class=
"clear"
></div></li>
<li
class=
"type"
>
{% trans "Size" %}:
<span
class=
"value"
>
{{t.instance_type}}:
<span
class=
"cpu"
>
{{t.instance_type.CPU}}
</span>
<span
class=
"memory"
>
{{t.instance_type.RAM}}
</span>
<span
class=
"credit"
>
{{t.instance_type.credit}}
</span>
</span></li>
<li
class=
"description"
>
{% trans "Description" %}:
<span
class=
"value"
>
{{t.description}}
</span><div
class=
"clear"
></div></li>
<li
class=
"date"
>
{% trans "Created at" %}:
<span
class=
"value"
>
{{t.created_at}} ({{t.owner.get_profile}})
</span><div
class=
"clear"
></div></li>
<li
class=
"count"
>
{% trans "Running instances" %}:
<span
class=
"value"
>
{{t.instance_set.count}}
</span></li>
</ul>
</div>
</li>
{% endfor %}
{% endif %}
<li
class=
"wm small"
>
<div
class=
"summary"
>
<div
class=
"quota"
>
...
...
one/views.py
View file @
a35c44b6
...
...
@@ -75,6 +75,7 @@ def home(request):
return
render_to_response
(
"home.html"
,
RequestContext
(
request
,
{
'templates'
:
Template
.
objects
.
filter
(
state
=
'READY'
),
'mytemplates'
:
Template
.
objects
.
filter
(
owner
=
request
.
user
),
'publictemplates'
:
Template
.
objects
.
filter
(
public
=
True
),
'instances'
:
_list_instances
(
request
),
'groups'
:
request
.
user
.
person_set
.
all
()[
0
]
.
owned_groups
.
all
(),
'semesters'
:
Semester
.
objects
.
all
(),
...
...
@@ -92,6 +93,8 @@ def ajax_template_delete(request):
return
HttpResponse
(
unicode
(
_
(
"There are running instances of this template."
)),
status
=
404
)
elif
template
.
share_set
.
exists
():
return
HttpResponse
(
unicode
(
_
(
"Template is still shared."
)),
status
=
404
)
elif
template
.
owner
!=
request
.
user
:
return
HttpResponse
(
unicode
(
_
(
"You don't have permission to delete this template."
)),
status
=
404
)
else
:
template
.
safe_delete
()
return
HttpResponse
(
unicode
(
_
(
"Template successfully deleted."
)))
...
...
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