Commit 7811880c authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

ndh3, bootstrap4, remove articles, docker

parent 7c012145
*
db.sqlite3
.env
LICENSE
README.md
requirements.in
.git
.python-version
.venv
*/__pycache__
*.orig
FROM python:alpine
EXPOSE 8000
RUN mkdir /app
WORKDIR /app
ADD requirements.txt manage.py ./
RUN pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir -U https://github.com/jieter/django-tables2/archive/template-makeover.zip
ADD . .
CMD ./manage.py runserver
......@@ -21,12 +21,12 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'mgun706*g8lq6voa#1n*)cfk7t4m%8s@4my^al#@8tzis+#v5e'
SECRET_KEY = os.environ['SECRET_KEY']
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = os.environ.get('DEBUG', 'False').lower() == 'true'
ALLOWED_HOSTS = ['hagurosan', 'hagurosan.laas.fr', 'localhost']
ALLOWED_HOSTS = ['rainboard', 'rainboard.laas.fr', 'localhost']
# Application definition
......@@ -41,7 +41,7 @@ INSTALLED_APPS = [
'django.contrib.sites',
'django_tables2',
'django_filters',
'bootstrap3',
'bootstrap4',
'ndh',
'rainboard',
]
......
version: '3'
services:
app:
build: .
volumes:
- ./db.sqlite3:./db.sqlite3
- /srv/dashboard/repositories:/srv/dashboard/repositories
- /srv/dashboard/robotpkg:/srv/dashboard/robotpkg
ports:
- '8001:8000'
env_file:
- .env
......@@ -3,7 +3,6 @@ from django.contrib.admin import site
from . import models
for model in [
models.Article,
models.License,
models.Namespace,
models.Project,
......
# Generated by Django 2.0.2 on 2018-03-02 09:49
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('rainboard', '0007_projects_tests_docs'),
]
operations = [
migrations.RemoveField(
model_name='article',
name='authors',
),
migrations.RemoveField(
model_name='project',
name='articles',
),
migrations.DeleteModel(
name='Article',
),
]
......@@ -29,13 +29,6 @@ TRAVIS_STATE = {'created': None, 'passed': True, 'started': None, 'failed': Fals
GITLAB_STATUS = {'failed': False, 'success': True, 'pending': None, 'skipped': None, 'canceled': None, 'running': None}
class Article(NamedModel):
authors = models.ManyToManyField(settings.AUTH_USER_MODEL)
year = models.PositiveSmallIntegerField()
url = models.URLField(max_length=200)
pdf = models.URLField(max_length=200)
class Namespace(NamedModel):
group = models.BooleanField(default=False)
......@@ -156,7 +149,6 @@ class Project(Links, NamedModel, TimeStampedModel):
main_forge = models.ForeignKey(Forge, on_delete=models.SET_NULL, null=True, blank=True)
license = models.ForeignKey(License, on_delete=models.SET_NULL, blank=True, null=True)
homepage = models.URLField(max_length=200, blank=True, null=True)
articles = models.ManyToManyField(Article)
description = models.TextField()
version = models.CharField(max_length=20, blank=True, null=True)
updated = models.DateTimeField(blank=True, null=True)
......
/*
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #333;
background: #f8f8f8;
}
.hljs-comment,
.hljs-quote {
color: #998;
font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
color: #333;
font-weight: bold;
}
.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
color: #008080;
}
.hljs-string,
.hljs-doctag {
color: #d14;
}
.hljs-title,
.hljs-section,
.hljs-selector-id {
color: #900;
font-weight: bold;
}
.hljs-subst {
font-weight: normal;
}
.hljs-type,
.hljs-class .hljs-title {
color: #458;
font-weight: bold;
}
.hljs-tag,
.hljs-name,
.hljs-attribute {
color: #000080;
font-weight: normal;
}
.hljs-regexp,
.hljs-link {
color: #009926;
}
.hljs-symbol,
.hljs-bullet {
color: #990073;
}
.hljs-built_in,
.hljs-builtin-name {
color: #0086b3;
}
.hljs-meta {
color: #999;
font-weight: bold;
}
.hljs-deletion {
background: #fdd;
}
.hljs-addition {
background: #dfd;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
This diff is collapsed.
......@@ -10,12 +10,6 @@ class StrippedTable(tables.Table):
attrs = {'class': 'table table-striped'}
class ArticleTable(StrippedTable):
class Meta:
model = models.Article
fields = ('name', 'authors', 'year', 'url', 'pdf')
class ForgeTable(StrippedTable):
class Meta:
model = models.Forge
......
{% extends 'ndh.html' %}
{% load static %}
{% block style %}<link rel="stylesheet" href="{% static 'highlight/github.css' %}">{% endblock %}
{% block pagetitle %}Gepetto Packages{% endblock %}
{% block sitetitle %}Gepetto Packages{% endblock %}
{% block navbarleft %}
<li><a href="{% url 'rainboard:articles' %}">Articles</a></li>
<li><a href="{% url 'rainboard:forges' %}">Forges</a></li>
<li><a href="{% url 'rainboard:namespaces' %}">Namespaces</a></li>
<li><a href="{% url 'rainboard:contributors' %}">Contributors</a></li>
<li class="nav-item"><a class="nav-link" href="{% url 'rainboard:forges' %}">Forges</a></li>
<li class="nav-item"><a class="nav-link" href="{% url 'rainboard:namespaces' %}">Namespaces</a></li>
<li class="nav-item"><a class="nav-link" href="{% url 'rainboard:contributors' %}">Contributors</a></li>
{% endblock %}
{% block scripts %}
<script src="{% static 'highlight/highlight.pack.js' %}"></script>
<script>hljs.initHighlightingOnLoad();</script>
{% endblock %}
{% extends 'base.html' %}
{% block content %}
{% include 'ndh/form.html' %}
{% endblock %}
../form.html
\ No newline at end of file
{% extends 'base.html' %}
{% load django_tables2 %}
{% block content %}
<h1>Articles</h1>
{% render_table table %}
<a class="btn btn-success" href="{% url 'rainboard:article-new' %}">+</a>
{% endblock %}
{% extends 'base.html' %}
{% load django_tables2 bootstrap3 %}
{% load django_tables2 bootstrap4 %}
{% block content %}
......
{% extends 'base.html' %}
{% load django_tables2 bootstrap3 %}
{% load django_tables2 bootstrap4 %}
{% block content %}
......@@ -20,70 +20,69 @@
{% endif %}
</div>
<dl class="dl-horizontal">
<dt>Main forge</dt> <dd>{{ project.main_forge.get_link }}</dd>
<dt>Main namespace</dt> <dd>{{ project.main_namespace }}</dd>
<dt>Main branch</dt> <dd>{{ project.main_branch }}</dd>
<dt>Description</dt> <dd>{{ project.description }}</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>
<dt>Version</dt> <dd>{{ project.version|default:"—" }}</dd>
<dt>Commits since</dt> <dd>{{ project.commits_since }}</dd>
<dt>Has tests</dt> <dd>{{ project.tests|yesno:"✔,✘" }}</dd>
<dt>Has docs</dt> <dd>{{ project.docs|yesno:"✔,✘" }}</dd>
<dl class="row" style="line-height: 1">
<dt class="col-3 text-right">Main forge</dt> <dd class="col-9">{{ project.main_forge.get_link }}</dd>
<dt class="col-3 text-right">Main namespace</dt> <dd class="col-9">{{ project.main_namespace }}</dd>
<dt class="col-3 text-right">Main branch</dt> <dd class="col-9">{{ project.main_branch }}</dd>
<dt class="col-3 text-right">Description</dt> <dd class="col-9">{{ project.description }}</dd>
<dt class="col-3 text-right">Homepage</dt> <dd class="col-9">{% if project.homepage %}<a href="{{ project.homepage }}">{{ project.homepage }}</a>{% else %}—{% endif %}</dd>
<dt class="col-3 text-right">Updated</dt> <dd class="col-9">{{ project.updated }}</dd>
<dt class="col-3 text-right">Version</dt> <dd class="col-9">{{ project.version|default:"—" }}</dd>
<dt class="col-3 text-right">Commits since</dt> <dd class="col-9">{{ project.commits_since }}</dd>
<dt class="col-3 text-right">Has tests</dt> <dd class="col-9">{{ project.tests|yesno:"✔,✘" }}</dd>
<dt class="col-3 text-right">Has docs</dt> <dd class="col-9">{{ project.docs|yesno:"✔,✘" }}</dd>
</dl>
</div>
<ul class="nav nav-tabs">
<li role="presentation" {% if 'robotpkg' in request.path %}class="active"{% endif %}><a href="{% url 'rainboard:project' slug=project.slug %}">Robotpkg </a></h2></li>
<li role="presentation" {% if 'repos' in request.path %}class="active"{% endif %}><a href="{% url 'rainboard:project-repos' slug=project.slug %}">Repos </a></h2></li>
<li role="presentation" {% if 'branches' in request.path %}class="active"{% endif %}><a href="{% url 'rainboard:project-branches' slug=project.slug %}">Branches </a></h2></li>
<li role="presentation" {% if 'images' in request.path %}class="active"{% endif %}><a href="{% url 'rainboard:project-images' slug=project.slug %}">Images </a></h2></li>
<li role="presentation" {% if 'contributors' in request.path %}class="active"{% endif %}><a href="{% url 'rainboard:project-contributors' slug=project.slug %}">Contributors</a></h2></li>
<li class="nav-item"><a class="nav-link {% if 'robotpkg' in request.path %}active{% endif %}" href="{% url 'rainboard:project' slug=project.slug %}">Robotpkg </a></li>
<li class="nav-item"><a class="nav-link {% if 'repos' in request.path %}active{% endif %}" href="{% url 'rainboard:project-repos' slug=project.slug %}">Repos </a></li>
<li class="nav-item"><a class="nav-link {% if 'branches' in request.path %}active{% endif %}" href="{% url 'rainboard:project-branches' slug=project.slug %}">Branches </a></li>
<li class="nav-item"><a class="nav-link {% if 'images' in request.path %}active{% endif %}" href="{% url 'rainboard:project-images' slug=project.slug %}">Images </a></li>
<li class="nav-item"><a class="nav-link {% if 'contributors' in request.path %}active{% endif %}" href="{% url 'rainboard:project-contributors' slug=project.slug %}">Contributors</a></li>
</ul>
{% if table %}
{% render_table table %}
{% if 'images' in request.path %}
<pre>{% for image in object_list %}
<pre><code class="bash">{% for image in object_list %}
{{ image.pull|join:' ' }}
{{ image.build|join:' ' }}
{{ image.push|join:' ' }}
{% endfor %}</pre>
{% endfor %}</code></pre>
{% endif %}
{% else %}
<h2>Robotpkg</h2>
{% for rpkg in project.robotpkg_set.all %}
<h3>{{ rpkg.category }} / {{ rpkg }}</h3>
{{ rpkg.description }}
<dl class="dl-horizontal">
<dt>Base</dt> <dd>{{ rpkg.pkgbase }}</dd>
<dt>Version</dt> <dd>{{ rpkg.pkgversion }}</dd>
<dl class="row" style="line-height: 1">
<dt class="col-3 text-right">Base</dt> <dd class="col-9">{{ rpkg.pkgbase }}</dd>
<dt class="col-3 text-right">Version</dt> <dd class="col-9">{{ rpkg.pkgversion }}</dd>
{% if project.public and not request.user.is_staff %}
<dt>Master Sites</dt> <dd>{{ rpkg.master_sites }}</dd>
<dt>Master Repository</dt> <dd>{{ rpkg.master_repository }}</dd>
<dt class="col-3 text-right">Master Sites</dt> <dd class="col-9">{{ rpkg.master_sites }}</dd>
<dt class="col-3 text-right">Master Repository</dt> <dd class="col-9">{{ rpkg.master_repository }}</dd>
{% endif %}
<dt>Maintainer</dt> <dd>{{ rpkg.maintainer }}</dd>
<dt>Comment</dt> <dd>{{ rpkg.comment }}</dd>
<dt>License</dt> <dd>{{ rpkg.license }}</dd>
<dt>Updated</dt> <dd>{{ rpkg.updated }}</dd>
<dt>Main page</dt> <dd>{% if rpkg.main_page %}<a href="{{ rpkg.main_page }}">{{ rpkg.main_page }}</a>{% else %}—{% endif %}</dd>
<dt>Build page</dt> <dd><a href="{{ rpkg.build_page }}">{{ rpkg.build_page }}</a></dd>
<dt class="col-3 text-right">Maintainer</dt> <dd class="col-9">{{ rpkg.maintainer }}</dd>
<dt class="col-3 text-right">Comment</dt> <dd class="col-9">{{ rpkg.comment }}</dd>
<dt class="col-3 text-right">License</dt> <dd class="col-9">{{ rpkg.license }}</dd>
<dt class="col-3 text-right">Updated</dt> <dd class="col-9">{{ rpkg.updated }}</dd>
<dt class="col-3 text-right">Main page</dt> <dd class="col-9">{% if rpkg.main_page %}<a href="{{ rpkg.main_page }}">{{ rpkg.main_page }}</a>{% else %}—{% endif %}</dd>
<dt class="col-3 text-right">Build page</dt> <dd class="col-9"><a href="{{ rpkg.build_page }}">{{ rpkg.build_page }}</a></dd>
</dl>
{% endfor %}
<h3>generated .gitlab-ci.yml</h3>
<pre>
<pre><code class="yaml">
{{ project.gitlabciyml }}
</pre>
</code></pre>
{% endif %}
......
{% extends 'base.html' %}
{% load django_tables2 bootstrap3 %}
{% load django_tables2 bootstrap4 %}
{% block content %}
......
{% extends 'django_tables2/bootstrap.html' %}
{% load bootstrap3 %}
{% load bootstrap4 %}
{% block pagination %}
{% bootstrap_pagination table.page extra=request.GET.urlencode %}
......
......@@ -7,8 +7,6 @@ app_name = 'rainboard'
urlpatterns = [
path('', RedirectView.as_view(pattern_name='rainboard:projects'), name='home'),
path('forges', views.ForgesView.as_view(), name='forges'),
path('articles', views.ArticlesView.as_view(), name='articles'),
path('article/create', views.ArticleCreateView.as_view(), name='article-new'),
path('namespaces', views.NamespacesView.as_view(), name='namespaces'),
path('contributors', views.ContributorsView.as_view(), name='contributors'),
path('projects', views.ProjectsView.as_view(), name='projects'),
......
......@@ -7,16 +7,6 @@ from django_tables2.views import SingleTableMixin, SingleTableView
from . import models, tables, filters
class ArticlesView(SingleTableView):
model = models.Article
table_class = tables.ArticleTable
class ArticleCreateView(CreateView):
model = models.Article
fields = ('name', 'authors', 'year', 'url', 'pdf')
class ForgesView(SingleTableView):
model = models.Forge
table_class = tables.ForgeTable
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment