Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
Respect My Net
Commits
054ad23e
Commit
054ad23e
authored
Apr 30, 2011
by
stef
Browse files
[enh] listing of reports
parent
0a0ae097
Changes
3
Hide whitespace changes
Inline
Side-by-side
bt/models.py
View file @
054ad23e
...
...
@@ -52,9 +52,9 @@ class Violation(models.Model):
country
=
models
.
CharField
(
max_length
=
2
,
choices
=
COUNTRIES
)
operator
=
models
.
CharField
(
max_length
=
256
)
contract
=
models
.
CharField
(
max_length
=
256
)
resource
=
models
.
CharField
(
max_length
=
1
,
choices
=
RESOURCES
)
type
=
models
.
CharField
(
max_length
=
1
,
choices
=
TYPES
)
media
=
models
.
CharField
(
max_length
=
1
,
choices
=
MEDIA
)
resource
=
models
.
CharField
(
max_length
=
20
,
choices
=
RESOURCES
)
type
=
models
.
CharField
(
max_length
=
20
,
choices
=
TYPES
)
media
=
models
.
CharField
(
max_length
=
20
,
choices
=
MEDIA
)
temporary
=
models
.
BooleanField
(
)
contractual
=
models
.
BooleanField
()
contract_excerpt
=
models
.
TextField
()
...
...
bt/views.py
View file @
054ad23e
...
...
@@ -4,6 +4,7 @@ from django.shortcuts import render_to_response
from
django.template
import
RequestContext
from
django.core.files
import
File
from
django.conf
import
settings
from
django.core.paginator
import
Paginator
,
EmptyPage
,
PageNotAnInteger
from
models
import
Violation
,
Attachment
,
Comment
from
tempfile
import
mkstemp
from
datetime
import
datetime
...
...
@@ -55,4 +56,15 @@ def ajax(request, country=None, operator=None):
return
HttpResponse
(
'["Basic", "Surfer", "Gamer", "Pro", "Business"]'
)
def
index
(
request
):
return
HttpResponse
(
"ohai, nothing to see here"
)
v_list
=
Violation
.
objects
.
all
()
paginator
=
Paginator
(
v_list
,
25
)
page
=
request
.
GET
.
get
(
'page'
,
'1'
)
try
:
violations
=
paginator
.
page
(
page
)
except
PageNotAnInteger
:
violations
=
paginator
.
page
(
1
)
except
EmptyPage
:
violations
=
paginator
.
page
(
paginator
.
num_pages
)
return
render_to_response
(
'list.html'
,
{
"violations"
:
violations
})
media/css/style.css
View file @
054ad23e
...
...
@@ -7,6 +7,8 @@ h2 { margin: auto; width: 50%; padding 4em; }
.fieldWrapper
label
{
width
:
200px
;
display
:
inline-block
;
}
.help_text
{
font-size
:
0.7em
;
left
:
30px
;
width
:
20%
;
position
:
absolute
;
}
.attachments
{
float
:
right
;
margin-top
:
0.4em
;
display
:
block
;
clear
:
both
;
}
table
.listing
,
.pagination
{
width
:
90%
;
margin
:
auto
;
}
table
.listing
thead
td
{
font-weight
:
bold
;
border-bottom
:
1px
solid
black
;
}
#addForm
{
margin
:
auto
;
width
:
50%
;
padding
4em;
}
#add_attach
{
cursor
:
pointer
;
}
...
...
Write
Preview
Supports
Markdown
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