Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
dashboard
Commits
63277edc
Commit
63277edc
authored
Jan 31, 2018
by
Guilhem Saurel
Browse files
Project: updated, repos, rpkgs
parent
21103fe5
Changes
5
Hide whitespace changes
Inline
Side-by-side
dashboard/settings.py
View file @
63277edc
...
...
@@ -111,9 +111,9 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization
# https://docs.djangoproject.com/en/2.0/topics/i18n/
LANGUAGE_CODE
=
'
en-us
'
LANGUAGE_CODE
=
'
fr-FR
'
TIME_ZONE
=
'
UTC
'
TIME_ZONE
=
'
Europe/Paris
'
USE_I18N
=
True
...
...
rainboard/migrations/0011_project_updated.py
0 → 100644
View file @
63277edc
# Generated by Django 2.0.1 on 2018-01-31 17:16
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'rainboard'
,
'0010_robotpkg'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'project'
,
name
=
'updated'
,
field
=
models
.
DateTimeField
(
blank
=
True
,
null
=
True
),
),
]
rainboard/models.py
View file @
63277edc
...
...
@@ -163,6 +163,7 @@ class Project(Links, NamedModel, TimeStampedModel):
articles
=
models
.
ManyToManyField
(
Article
)
description
=
models
.
TextField
()
version
=
models
.
CharField
(
max_length
=
20
,
blank
=
True
,
null
=
True
)
updated
=
models
.
DateTimeField
(
blank
=
True
,
null
=
True
)
# TODO: release github ↔ robotpkg
def
get_absolute_url
(
self
):
...
...
@@ -222,6 +223,20 @@ class Project(Links, NamedModel, TimeStampedModel):
self
.
__dict__
[
value
]
=
search
.
groups
()[
0
].
strip
(
'''
\r\n\t
'"'''
)
self
.
save
()
def
repos
(
self
):
return
self
.
repo_set
.
count
()
def
rpkgs
(
self
):
return
self
.
robotpkg_set
.
count
()
def
update
(
self
,
pull
=
True
):
git_repo
=
self
.
git
()
if
pull
:
for
repo
in
self
.
repo_set
.
all
():
repo
.
git
().
fetch
()
self
.
updated
=
git_repo
.
commit
().
authored_datetime
self
.
save
()
class
Repo
(
TimeStampedModel
):
name
=
models
.
CharField
(
max_length
=
200
)
...
...
rainboard/tables.py
View file @
63277edc
...
...
@@ -29,9 +29,12 @@ class NamespaceTable(StrippedTable):
class
ProjectTable
(
StrippedTable
):
repos
=
tables
.
Column
(
accessor
=
'repos'
,
orderable
=
False
)
rpkgs
=
tables
.
Column
(
accessor
=
'rpkgs'
,
orderable
=
False
)
class
Meta
:
model
=
models
.
Project
fields
=
(
'main_namespace'
,
'name'
,
'license'
,
'homepage'
)
fields
=
(
'main_namespace'
,
'name'
,
'license'
,
'homepage'
,
'updated'
)
def
render_name
(
self
,
record
):
return
record
.
get_link
()
...
...
rainboard/templates/rainboard/project_detail.html
View file @
63277edc
...
...
@@ -27,6 +27,7 @@
<dt>
Description
</dt>
<dd>
{{ project.description }}
</dd>
<dt>
Version
</dt>
<dd>
{{ project.version|default:"—" }}
</dd>
<dt>
Homepage
</dt>
<dd>
{% if project.homepage %}
<a
href=
"{{ project.homepage }}"
>
{{ project.homepage }}
</a>
{% else %}—{% endif %}
</dd>
<dt>
Updated
</dt>
<dd>
{{ project.updated }}
</dd>
</dl>
</div>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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