Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
11305fea
authored
Mar 12, 2015
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
request: make request table nicer
parent
9ed462b9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
0 deletions
+27
-0
circle/request/models.py
+3
-0
circle/request/tables.py
+14
-0
circle/request/templates/request/columns/status.html
+4
-0
circle/request/templates/request/columns/type.html
+2
-0
circle/request/templates/request/columns/user.html
+4
-0
No files found.
circle/request/models.py
View file @
11305fea
...
...
@@ -61,6 +61,9 @@ class Request(TimeStampedModel):
def
get_readable_status
(
self
):
return
self
.
STATUSES
[
self
.
status
]
def
get_readable_type
(
self
):
return
self
.
TYPES
[
self
.
type
]
def
get_request_icon
(
self
):
return
{
'resource'
:
"tasks"
,
...
...
circle/request/tables.py
View file @
11305fea
...
...
@@ -15,14 +15,28 @@ class RequestTable(Table):
args
=
[
A
(
'pk'
)],
verbose_name
=
_
(
"ID"
),
)
status
=
TemplateColumn
(
template_name
=
"request/columns/status.html"
,
verbose_name
=
_
(
"Status"
),
)
user
=
TemplateColumn
(
template_name
=
"request/columns/user.html"
,
verbose_name
=
_
(
"User"
),
)
type
=
TemplateColumn
(
template_name
=
"request/columns/type.html"
,
verbose_name
=
_
(
"Type"
),
)
class
Meta
:
model
=
Request
template
=
"django_tables2/with_pagination.html"
attrs
=
{
'class'
:
(
'table table-bordered table-striped table-hover'
),
'id'
:
"request-list-table"
}
fields
=
(
"pk"
,
"status"
,
"type"
,
"user"
,
)
order_by
=
(
"-pk"
,
)
empty_text
=
_
(
"No more requests."
)
per_page
=
10
class
LeaseTypeTable
(
Table
):
...
...
circle/request/templates/request/columns/status.html
0 → 100644
View file @
11305fea
<span
class=
"label label-{{ record.get_effect }}"
style=
"font-size: 1.2em;"
>
<i
class=
"fa fa-{{ record.get_status_icon }}"
></i>
{{ record.get_readable_status|upper }}
</span>
circle/request/templates/request/columns/type.html
0 → 100644
View file @
11305fea
<i
class=
"fa fa-{{ record.get_request_icon }}"
></i>
{{ record.get_readable_type|title }}
circle/request/templates/request/columns/user.html
0 → 100644
View file @
11305fea
<img
src=
"{{ record.user.profile.get_avatar_url }}"
width=
"20"
height=
"20"
/>
<a
href=
"{{ record.user.profile.get_absolute_url }}"
>
{{ record.user.profile.get_display_name }}
</a>
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