Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
work.w
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
30
Issues
30
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
osp
work.w
Commits
9e0c2f45
Commit
9e0c2f45
authored
Jun 15, 2017
by
Nicolas
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.constantvzw.org:osp/work.w
parents
b15cc506
9d642eeb
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
4 deletions
+21
-4
playground/models.py
playground/models.py
+3
-0
playground/static/playground/js/views.js
playground/static/playground/js/views.js
+1
-1
playground/templates/playground/score_list.html
playground/templates/playground/score_list.html
+8
-0
playground/urls.py
playground/urls.py
+2
-2
playground/views.py
playground/views.py
+7
-1
No files found.
playground/models.py
View file @
9e0c2f45
...
@@ -11,3 +11,6 @@ class Score(models.Model):
...
@@ -11,3 +11,6 @@ class Score(models.Model):
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
title
return
self
.
title
def
get_absolute_url
(
self
):
return
"/playground/score/#{}"
.
format
(
self
.
id
)
playground/static/playground/js/views.js
View file @
9e0c2f45
...
@@ -183,7 +183,7 @@ window.W = window.W || {};
...
@@ -183,7 +183,7 @@ window.W = window.W || {};
alt_div
.
hide
();
alt_div
.
hide
();
this
.
render
();
this
.
render
();
return
false
;
return
false
;
}
else
{
}
else
{
var
$target
=
$
(
e
.
target
);
var
$target
=
$
(
e
.
target
);
var
alt_div
=
$target
.
parent
();
var
alt_div
=
$target
.
parent
();
alt_div
.
hide
();
alt_div
.
hide
();
...
...
playground/templates/playground/score_list.html
0 → 100644
View file @
9e0c2f45
<h1>
scores
</h1>
<ul>
{% for score in object_list %}
<li><a
href=
"{{ score.get_absolute_url }}"
>
{{ score.title }}
</a></li>
{% empty %}
<li>
No scores yet.
</li>
{% endfor %}
</ul>
playground/urls.py
View file @
9e0c2f45
from
django.conf.urls
import
url
from
django.conf.urls
import
url
from
playground.views
import
ScoreDetailView
,
SandboxView
from
playground.views
import
ScoreDetailView
,
S
coreListView
,
S
andboxView
urlpatterns
=
[
urlpatterns
=
[
url
(
r'^sandbox/$'
,
SandboxView
.
as_view
(),
name
=
'sandbox'
),
url
(
r'^sandbox/$'
,
SandboxView
.
as_view
(),
name
=
'sandbox'
),
url
(
r'^score/'
,
ScoreDetailView
.
as_view
(),
name
=
'score-detail'
),
url
(
r'^score/'
,
ScoreDetailView
.
as_view
(),
name
=
'score-detail'
),
# url(r'^score/(?P<pk>\d+)/$', ScoreDetailView.as_view(), name='score-detail
'),
url
(
r'^$'
,
ScoreListView
.
as_view
(),
name
=
'score-list
'
),
]
]
playground/views.py
View file @
9e0c2f45
from
django.views.generic
import
Detail
View
from
django.views.generic
.list
import
List
View
from
django.views.generic.base
import
TemplateView
from
django.views.generic.base
import
TemplateView
from
rest_framework
import
viewsets
from
rest_framework
import
viewsets
from
.models
import
Score
from
.models
import
Score
...
@@ -13,6 +13,12 @@ class ScoreViewSet(viewsets.ModelViewSet):
...
@@ -13,6 +13,12 @@ class ScoreViewSet(viewsets.ModelViewSet):
serializer_class
=
ScoreSerializer
serializer_class
=
ScoreSerializer
class
ScoreListView
(
ListView
):
"""
"""
model
=
Score
class
ScoreDetailView
(
TemplateView
):
class
ScoreDetailView
(
TemplateView
):
"""
"""
"""
"""
...
...
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