Gentoo Archives: gentoo-commits

From: Magnus Granberg <zorry@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/tinderbox-cluster-www:master commit in: python/bb_dashboard/, python/templates/includes/container/, ...
Date: Fri, 24 Sep 2021 02:23:02
Message-Id: 1632450169.3fb5065d4b67af1df11cec4e7a3e888c9598b9d1.zorry@gentoo
1 commit: 3fb5065d4b67af1df11cec4e7a3e888c9598b9d1
2 Author: Magnus Granberg <zorry <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 24 01:54:59 2021 +0000
4 Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 24 02:22:49 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/tinderbox-cluster-www.git/commit/?id=3fb5065d
7
8 Add Buildbot Dashboard for Gentoo Ci
9
10 Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org>
11
12 .gitignore | 5 +
13 python/bb_dashboard/bb_dashboard/__init__.py | 0
14 python/bb_dashboard/bb_dashboard/asgi.py | 16 +++
15 .../bb_dashboard/bb_dashboard/settings.py.sample | 149 +++++++++++++++++++++
16 python/bb_dashboard/bb_dashboard/urls.py | 9 ++
17 python/bb_dashboard/bb_dashboard/wsgi.py | 16 +++
18 python/bb_dashboard/manage.py | 22 +++
19 python/bb_dashboard/projects/__init__.py | 0
20 python/bb_dashboard/projects/admin.py | 3 +
21 python/bb_dashboard/projects/apps.py | 6 +
22 .../bb_dashboard/projects/migrations/__init__.py | 0
23 python/bb_dashboard/projects/models.py | 3 +
24 python/bb_dashboard/projects/tests.py | 3 +
25 python/bb_dashboard/projects/views.py | 3 +
26 python/bb_dashboard/repository/__init__.py | 0
27 python/bb_dashboard/repository/admin.py | 3 +
28 python/bb_dashboard/repository/apps.py | 6 +
29 .../bb_dashboard/repository/migrations/__init__.py | 0
30 python/bb_dashboard/repository/models.py | 45 +++++++
31 python/bb_dashboard/repository/tests.py | 3 +
32 python/bb_dashboard/repository/views.py | 3 +
33 python/bb_dashboard/static/screen.css | 3 +
34 .../templates/includes/container/end | 0
35 .../templates/includes/container/start | 3 +
36 .../templates/includes/layout/footer.html | 43 ++++++
37 .../templates/includes/layout/head.html | 26 ++++
38 .../templates/includes/layout/header.html | 89 ++++++++++++
39 .../templates/includes/navigation/primary | 0
40 .../templates/includes/navigation/secondary | 0
41 python/bb_dashboard/templates/layout/base.html | 20 +++
42 python/bb_dashboard/www/__init__.py | 0
43 python/bb_dashboard/www/admin.py | 7 +
44 python/bb_dashboard/www/apps.py | 6 +
45 python/bb_dashboard/www/migrations/0001_initial.py | 95 +++++++++++++
46 python/bb_dashboard/www/migrations/__init__.py | 0
47 python/bb_dashboard/www/models.py | 74 ++++++++++
48 python/bb_dashboard/www/router.py | 31 +++++
49 python/bb_dashboard/www/templates/www/index.html | 42 ++++++
50 .../www/templates/www/news.html} | 9 +-
51 python/bb_dashboard/www/tests.py | 3 +
52 python/bb_dashboard/www/urls.py | 7 +
53 python/bb_dashboard/www/utils.py | 55 ++++++++
54 python/bb_dashboard/www/views.py | 16 +++
55 python/templates/includes/container/start | 3 -
56 python/templates/includes/frontpage/new_build_req | 15 ---
57 python/templates/includes/frontpage/new_logs | 27 ----
58 python/templates/includes/frontpage/new_packages | 10 --
59 python/templates/includes/frontpage/new_repoman_qa | 18 ---
60 .../includes/navigation/sitemap_secondary | 5 -
61 49 files changed, 823 insertions(+), 79 deletions(-)
62
63 diff --git a/.gitignore b/.gitignore
64 new file mode 100644
65 index 0000000..ddf3b02
66 --- /dev/null
67 +++ b/.gitignore
68 @@ -0,0 +1,5 @@
69 +# Backup files
70 +*~
71 +__pycache__
72 +python/bb_dashboard/bb_dashboard/settings.py
73 +
74
75 diff --git a/python/bb_dashboard/bb_dashboard/__init__.py b/python/bb_dashboard/bb_dashboard/__init__.py
76 new file mode 100644
77 index 0000000..e69de29
78
79 diff --git a/python/bb_dashboard/bb_dashboard/asgi.py b/python/bb_dashboard/bb_dashboard/asgi.py
80 new file mode 100644
81 index 0000000..1e2115c
82 --- /dev/null
83 +++ b/python/bb_dashboard/bb_dashboard/asgi.py
84 @@ -0,0 +1,16 @@
85 +"""
86 +ASGI config for bb_dashboard project.
87 +
88 +It exposes the ASGI callable as a module-level variable named ``application``.
89 +
90 +For more information on this file, see
91 +https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
92 +"""
93 +
94 +import os
95 +
96 +from django.core.asgi import get_asgi_application
97 +
98 +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bb_dashboard.settings')
99 +
100 +application = get_asgi_application()
101
102 diff --git a/python/bb_dashboard/bb_dashboard/settings.py.sample b/python/bb_dashboard/bb_dashboard/settings.py.sample
103 new file mode 100644
104 index 0000000..079368e
105 --- /dev/null
106 +++ b/python/bb_dashboard/bb_dashboard/settings.py.sample
107 @@ -0,0 +1,149 @@
108 +"""
109 +Django settings for bb_dashboard project.
110 +
111 +Generated by 'django-admin startproject' using Django 3.2.3.
112 +
113 +For more information on this file, see
114 +https://docs.djangoproject.com/en/3.2/topics/settings/
115 +
116 +For the full list of settings and their values, see
117 +https://docs.djangoproject.com/en/3.2/ref/settings/
118 +"""
119 +
120 +from pathlib import Path
121 +
122 +# Build paths inside the project like this: BASE_DIR / 'subdir'.
123 +BASE_DIR = Path(__file__).resolve().parent.parent
124 +
125 +
126 +# Quick-start development settings - unsuitable for production
127 +# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
128 +
129 +# SECURITY WARNING: keep the secret key used in production secret!
130 +SECRET_KEY = 'fooo'
131 +
132 +# SECURITY WARNING: don't run with debug turned on in production!
133 +DEBUG = True
134 +
135 +ALLOWED_HOSTS = [
136 + '.localhost',
137 + '127.0.0.1',
138 + '[::1]',
139 + ]
140 +
141 +
142 +# Application definition
143 +
144 +INSTALLED_APPS = [
145 + 'django.contrib.admin',
146 + 'django.contrib.auth',
147 + 'django.contrib.contenttypes',
148 + 'django.contrib.sessions',
149 + 'django.contrib.messages',
150 + 'django.contrib.staticfiles',
151 + 'www.apps.WwwConfig',
152 +]
153 +
154 +MIDDLEWARE = [
155 + 'django.middleware.security.SecurityMiddleware',
156 + 'django.contrib.sessions.middleware.SessionMiddleware',
157 + 'django.middleware.common.CommonMiddleware',
158 + 'django.middleware.csrf.CsrfViewMiddleware',
159 + 'django.contrib.auth.middleware.AuthenticationMiddleware',
160 + 'django.contrib.messages.middleware.MessageMiddleware',
161 + 'django.middleware.clickjacking.XFrameOptionsMiddleware',
162 +]
163 +
164 +ROOT_URLCONF = 'bb_dashboard.urls'
165 +
166 +TEMPLATES = [
167 + {
168 + 'BACKEND': 'django.template.backends.django.DjangoTemplates',
169 + 'DIRS': [
170 + 'templates',
171 + ],
172 + 'APP_DIRS': True,
173 + 'OPTIONS': {
174 + 'context_processors': [
175 + 'django.template.context_processors.debug',
176 + 'django.template.context_processors.request',
177 + 'django.contrib.auth.context_processors.auth',
178 + 'django.contrib.messages.context_processors.messages',
179 + ],
180 + },
181 + },
182 +]
183 +
184 +WSGI_APPLICATION = 'bb_dashboard.wsgi.application'
185 +
186 +
187 +# Database
188 +# https://docs.djangoproject.com/en/3.2/ref/settings/#databases
189 +
190 +DATABASES = {
191 + 'default': {
192 + 'ENGINE': 'django.db.backends.postgresql',
193 + 'NAME': '',
194 + 'USER': '',
195 + 'PASSWORD': '',
196 + 'HOST': '',
197 + 'PORT': '',
198 + },
199 + 'gentoo-ci': {
200 + 'ENGINE': 'django.db.backends.postgresql',
201 + 'NAME': '',
202 + 'USER': '',
203 + 'PASSWORD': '',
204 + 'HOST': '',
205 + 'PORT': '',
206 + }
207 +}
208 +
209 +DATABASE_ROUTERS = ['www.router.WWWRouter']
210 +
211 +# Password validation
212 +# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
213 +
214 +AUTH_PASSWORD_VALIDATORS = [
215 + {
216 + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
217 + },
218 + {
219 + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
220 + },
221 + {
222 + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
223 + },
224 + {
225 + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
226 + },
227 +]
228 +
229 +
230 +# Internationalization
231 +# https://docs.djangoproject.com/en/3.2/topics/i18n/
232 +
233 +LANGUAGE_CODE = 'en-us'
234 +
235 +TIME_ZONE = 'Europe/Stockholm'
236 +
237 +USE_I18N = True
238 +
239 +USE_L10N = True
240 +
241 +USE_TZ = True
242 +
243 +
244 +# Static files (CSS, JavaScript, Images)
245 +# https://docs.djangoproject.com/en/3.2/howto/static-files/
246 +
247 +STATIC_URL = '/static/'
248 +
249 +STATICFILES_DIRS = [
250 + BASE_DIR / "static",
251 +]
252 +
253 +# Default primary key field type
254 +# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
255 +
256 +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
257
258 diff --git a/python/bb_dashboard/bb_dashboard/urls.py b/python/bb_dashboard/bb_dashboard/urls.py
259 new file mode 100644
260 index 0000000..f1e4c86
261 --- /dev/null
262 +++ b/python/bb_dashboard/bb_dashboard/urls.py
263 @@ -0,0 +1,9 @@
264 +from django.contrib import admin
265 +from django.urls import include, path
266 +
267 +urlpatterns = [
268 + path('www/', include('www.urls')),
269 + #path('auth/', include('gosbs_auth.urls')),
270 + #path('projects/', include('projects.urls', namespace="projects")),
271 + #path('admin/', admin.site.urls),
272 +]
273
274 diff --git a/python/bb_dashboard/bb_dashboard/wsgi.py b/python/bb_dashboard/bb_dashboard/wsgi.py
275 new file mode 100644
276 index 0000000..cf71243
277 --- /dev/null
278 +++ b/python/bb_dashboard/bb_dashboard/wsgi.py
279 @@ -0,0 +1,16 @@
280 +"""
281 +WSGI config for bb_dashboard project.
282 +
283 +It exposes the WSGI callable as a module-level variable named ``application``.
284 +
285 +For more information on this file, see
286 +https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
287 +"""
288 +
289 +import os
290 +
291 +from django.core.wsgi import get_wsgi_application
292 +
293 +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bb_dashboard.settings')
294 +
295 +application = get_wsgi_application()
296
297 diff --git a/python/bb_dashboard/manage.py b/python/bb_dashboard/manage.py
298 new file mode 100755
299 index 0000000..8a6e55f
300 --- /dev/null
301 +++ b/python/bb_dashboard/manage.py
302 @@ -0,0 +1,22 @@
303 +#!/usr/bin/env python
304 +"""Django's command-line utility for administrative tasks."""
305 +import os
306 +import sys
307 +
308 +
309 +def main():
310 + """Run administrative tasks."""
311 + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bb_dashboard.settings')
312 + try:
313 + from django.core.management import execute_from_command_line
314 + except ImportError as exc:
315 + raise ImportError(
316 + "Couldn't import Django. Are you sure it's installed and "
317 + "available on your PYTHONPATH environment variable? Did you "
318 + "forget to activate a virtual environment?"
319 + ) from exc
320 + execute_from_command_line(sys.argv)
321 +
322 +
323 +if __name__ == '__main__':
324 + main()
325
326 diff --git a/python/bb_dashboard/projects/__init__.py b/python/bb_dashboard/projects/__init__.py
327 new file mode 100644
328 index 0000000..e69de29
329
330 diff --git a/python/bb_dashboard/projects/admin.py b/python/bb_dashboard/projects/admin.py
331 new file mode 100644
332 index 0000000..8c38f3f
333 --- /dev/null
334 +++ b/python/bb_dashboard/projects/admin.py
335 @@ -0,0 +1,3 @@
336 +from django.contrib import admin
337 +
338 +# Register your models here.
339
340 diff --git a/python/bb_dashboard/projects/apps.py b/python/bb_dashboard/projects/apps.py
341 new file mode 100644
342 index 0000000..afae498
343 --- /dev/null
344 +++ b/python/bb_dashboard/projects/apps.py
345 @@ -0,0 +1,6 @@
346 +from django.apps import AppConfig
347 +
348 +
349 +class ProjectsConfig(AppConfig):
350 + default_auto_field = 'django.db.models.BigAutoField'
351 + name = 'projects'
352
353 diff --git a/python/bb_dashboard/projects/migrations/__init__.py b/python/bb_dashboard/projects/migrations/__init__.py
354 new file mode 100644
355 index 0000000..e69de29
356
357 diff --git a/python/bb_dashboard/projects/models.py b/python/bb_dashboard/projects/models.py
358 new file mode 100644
359 index 0000000..71a8362
360 --- /dev/null
361 +++ b/python/bb_dashboard/projects/models.py
362 @@ -0,0 +1,3 @@
363 +from django.db import models
364 +
365 +# Create your models here.
366
367 diff --git a/python/bb_dashboard/projects/tests.py b/python/bb_dashboard/projects/tests.py
368 new file mode 100644
369 index 0000000..7ce503c
370 --- /dev/null
371 +++ b/python/bb_dashboard/projects/tests.py
372 @@ -0,0 +1,3 @@
373 +from django.test import TestCase
374 +
375 +# Create your tests here.
376
377 diff --git a/python/bb_dashboard/projects/views.py b/python/bb_dashboard/projects/views.py
378 new file mode 100644
379 index 0000000..91ea44a
380 --- /dev/null
381 +++ b/python/bb_dashboard/projects/views.py
382 @@ -0,0 +1,3 @@
383 +from django.shortcuts import render
384 +
385 +# Create your views here.
386
387 diff --git a/python/bb_dashboard/repository/__init__.py b/python/bb_dashboard/repository/__init__.py
388 new file mode 100644
389 index 0000000..e69de29
390
391 diff --git a/python/bb_dashboard/repository/admin.py b/python/bb_dashboard/repository/admin.py
392 new file mode 100644
393 index 0000000..8c38f3f
394 --- /dev/null
395 +++ b/python/bb_dashboard/repository/admin.py
396 @@ -0,0 +1,3 @@
397 +from django.contrib import admin
398 +
399 +# Register your models here.
400
401 diff --git a/python/bb_dashboard/repository/apps.py b/python/bb_dashboard/repository/apps.py
402 new file mode 100644
403 index 0000000..9c086eb
404 --- /dev/null
405 +++ b/python/bb_dashboard/repository/apps.py
406 @@ -0,0 +1,6 @@
407 +from django.apps import AppConfig
408 +
409 +
410 +class RepositoryConfig(AppConfig):
411 + default_auto_field = 'django.db.models.BigAutoField'
412 + name = 'repository'
413
414 diff --git a/python/bb_dashboard/repository/migrations/__init__.py b/python/bb_dashboard/repository/migrations/__init__.py
415 new file mode 100644
416 index 0000000..e69de29
417
418 diff --git a/python/bb_dashboard/repository/models.py b/python/bb_dashboard/repository/models.py
419 new file mode 100644
420 index 0000000..a7989bc
421 --- /dev/null
422 +++ b/python/bb_dashboard/repository/models.py
423 @@ -0,0 +1,45 @@
424 +from django.db import models
425 +
426 +class Categories(models.Model):
427 + CategoryId = models.IntegerField(primary_key=True, db_column='category_id')
428 + Category = models.CharField(max_length=150, db_column='category')
429 + Active = models.BooleanField(db_column='active')
430 + TimeStamp = models.DateTimeField(db_column='time_stamp')
431 + class Meta:
432 + db_table = 'categories'
433 + def __str__(self):
434 + return '%s %s %s %s' % (self.CategoryId, self.Category, self.Active, self.TimeStamp)
435 +
436 +class Repos(models.Model):
437 + RepoId = models.IntegerField(primary_key=True, db_column='repo_id')
438 + Repo = models.CharField(max_length=100, db_column='repo')
439 + class Meta:
440 + db_table = 'repos'
441 + def __str__(self):
442 + return '%s %s' % (self.RepoId, self.Repo)
443 +
444 +class Packages(models.Model):
445 + PackageId = models.IntegerField(primary_key=True, db_column='package_id')
446 + CategoryId = models.ForeignKey(Categories, db_column='category_id')
447 + Package = models.CharField(max_length=150, db_column='package')
448 + RepoId = models.ForeignKey(Repos, db_column='repo_id')
449 + Checksum = models.CharField(max_length=100, db_column='checksum')
450 + Active = models.BooleanField(db_column='active')
451 + TimeStamp = models.DateTimeField(db_column='time_stamp')
452 + class Meta:
453 + db_table = 'packages'
454 + def __str__(self):
455 + return '%s %s %s %s %s %s %s' % (self.PackageId, self.CategoryId, self.Package, self.RepoId, self.Checksum, self.Active, self.TimeStamp)
456 +
457 +class Ebuilds(models.Model):
458 + EbuildId = models.IntegerField(primary_key=True, db_column='ebuild_id')
459 + PackageId = models.ForeignKey(Packages, db_column='package_id')
460 + Version = models.CharField(max_length=150, db_column='version')
461 + Checksum = models.CharField(max_length=100, db_column='checksum')
462 + Active = models.BooleanField(db_column='active')
463 + TimeStamp = models.DateTimeField(db_column='time_stamp')
464 + class Meta:
465 + db_table = 'ebuilds'
466 + def __str__(self):
467 + return '%s %s %s %s %s %s' % (self.EbuildId, self.PackageId, self.Version, self.Checksum, self.Active, self.TimeStamp)
468 +
469
470 diff --git a/python/bb_dashboard/repository/tests.py b/python/bb_dashboard/repository/tests.py
471 new file mode 100644
472 index 0000000..7ce503c
473 --- /dev/null
474 +++ b/python/bb_dashboard/repository/tests.py
475 @@ -0,0 +1,3 @@
476 +from django.test import TestCase
477 +
478 +# Create your tests here.
479
480 diff --git a/python/bb_dashboard/repository/views.py b/python/bb_dashboard/repository/views.py
481 new file mode 100644
482 index 0000000..91ea44a
483 --- /dev/null
484 +++ b/python/bb_dashboard/repository/views.py
485 @@ -0,0 +1,3 @@
486 +from django.shortcuts import render
487 +
488 +# Create your views here.
489
490 diff --git a/python/bb_dashboard/static/screen.css b/python/bb_dashboard/static/screen.css
491 new file mode 100644
492 index 0000000..b0470e8
493 --- /dev/null
494 +++ b/python/bb_dashboard/static/screen.css
495 @@ -0,0 +1,3 @@
496 +.devmap-entry{background-color:#f7f7f7;border:1px solid #e1e1e1;border-radius:4px;padding:8px;margin-bottom:4px;max-width:300px}.devmap-entry h3 small{color:#333;font-size:80%;mmargin-left:1em}.download-size{margin-left:1em}.download-tag{margin-left:1em}.stick-top{margin-top:0}@media (min-width: 768px){.other-arches .tab-pane{margin-left:1em}}ul.sitemap{padding-left:1em}ul.sitemap li{list-style-type:none}@media (min-width: 768px){.container-sitemap{padding-top:1em;margin-top:1em;margin-bottom:1em}}@media (min-width: 992px){.container-sitemap{border-top:1px solid #d5d5d5;border-bottom:1px solid #d5d5d5}}.footer-breadcrumb{margin-top:2em}.hero-section{background-size:cover;background-repeat:no-repeat;min-height:200px;font-size:120%;padding-top:2%;padding-bottom:2%}@media (min-width: 768px){.hero-section{font-size:150%}.hero-section h2{font-size:130%}}.get-started-livecd{color:black;background-color:#B0BEC5}.get-started-handbook{color:black;background-color:#90A4AE;margin-top:-1px}.get
497 -started-go{color:white;background-color:#54487a;margin-top:-1px}.emergehdr{margin-top:-21px;background-color:#54487a;background-image:url("https://www.gentoo.org/assets/img/bg/emerge.jpg");cursor:default;min-height:0;box-shadow:0px 0px 5px #333;padding-top:1em;padding-bottom:1em}@media (min-width: 992px){.emergehdr{font-size:1.95em}}.emergehdr p{text-shadow:0px 0px 5px black;color:white;margin:0}.emergehdr .buttons{margin-top:3px}.abouthdr{background:#c2bcd6;background:-moz-linear-gradient(-45deg, #c2bcd6 0%, #53487a 43%, #53487a 100%);background:-webkit-gradient(left top, right bottom, color-stop(0%, #c2bcd6), color-stop(43%, #53487a), color-stop(100%, #53487a));background:-webkit-linear-gradient(-45deg, #c2bcd6 0%, #53487a 43%, #53487a 100%);background:-o-linear-gradient(-45deg, #c2bcd6 0%, #53487a 43%, #53487a 100%);background:-ms-linear-gradient(-45deg, #c2bcd6 0%, #53487a 43%, #53487a 100%);background:linear-gradient(135deg, #c2bcd6 0%, #53487a 43%, #53487a 100%);filter:progid
498 :DXImageTransform.Microsoft.gradient( startColorstr='#c2bcd6', endColorstr='#53487a', GradientType=1 );bbackground-size:cover;bbackground-repeat:no-repeat;bbackground-image:url("/assets/img/bg/larry-about.jpg");min-height:300px;color:white}.abouthdr .right{text-align:right;margin-right:20%}.featured-panel{margin-top:2em;margin-bottom:2em;background-color:#eaeaea}.featured-panel p:last-child{margin-bottom:0}.pound-gentoo{background-color:#e1e1e1}@media (min-width: 768px){.pound-gentoo{margin-top:1em;margin-bottom:1em}}.ml-actions{width:8em;text-align:right}.huge{font-size:140%}.large{font-size:125%}@media (min-width: 768px){.huge{font-size:200%}.huge h1{font-size:200%}}::selection{background:#dddaec}::-moz-selection{background:#dddaec}.gentoo-nav a:link,.gentoo-nav a:visited{color:#54487a}.old-docs dd{margin-bottom:.5em;margin-left:.5em;font-size:90%}body.nav-align-h2 #content h2:first-of-type{margin-top:0}.caption h3{margin-top:5px}.label-aspect{width:4em;display:inline-block}.gento
499 o-badges img{max-width:6em;min-width:6em}.herd-desc-col{width:10em}.herd-maint-col{width:50%}@media (min-width: 768px){.frontpage-table{width:100%;table-layout:fixed}.frontpage-table td{text-overflow:ellipsis;max-height:1.2em;overflow:hidden;white-space:nowrap}.frontpage-table-planet-author{width:30%}.frontpage-table-package-atom{width:30%}.frontpage-table-wiki-title{width:70%}}.get-started-icon .fa,.contribute-icon .fa{padding-left:20px}@media (max-width: 768px){.button-bar{line-height:3em}}.site-logo object{overflow:hidden}.use-flag{width:25%}.use-desc{width:75%}.external-link{color:#979797}.stick-top{margin-top:0}.stick-bottom{margin-bottom:0}.logo-table img{max-height:100px}.logo-table td.img{text-align:center}article.newsitem{margin-top:2em}.newsitem-headline{padding-left:45px}.newsitem-content{padding-left:46px}.newsitem-bullet{color:#aaa;float:left}@media (max-width: 768px){.newsitem-bullet{display:none}.newsitem-content,.newsitem-headline{padding-left:0}}.news-img-right{floa
500 t:right;margin-left:2em}.news-more{text-align:right;margin:0;margin-top:18px;padding:0;font-size:90%}.news-more a:link,.news-more a:active,.news-more a:visited,.news-more a:hover{color:#aaa}.news-more hr{margin-top:2px}.sponsor{margin-bottom:.5em}@media (min-width: 768px){.sponsor{display:flex;align-items:center}}.sponsorlogo{text-align:center}.sponsorlogo img{margin-bottom:.5em}.sponsortext h3{margin-top:0}.text-ad{display:inline-block;height:125px;width:125px;line-height:125px;overflow:hidden;border:1px solid #ddd;padding:2px;font-size:90%;background:#ffffff;background:-moz-linear-gradient(top, #fff 0%, #f6f6f6 47%, #ededed 100%);background:-webkit-gradient(left top, left bottom, color-stop(0%, #fff), color-stop(47%, #f6f6f6), color-stop(100%, #ededed));background:-webkit-linear-gradient(top, #fff 0%, #f6f6f6 47%, #ededed 100%);background:-o-linear-gradient(top, #fff 0%, #f6f6f6 47%, #ededed 100%);background:-ms-linear-gradient(top, #fff 0%, #f6f6f6 47%, #ededed 100%);background:l
501 inear-gradient(to bottom, #fff 0%, #f6f6f6 47%, #ededed 100%)}.text-ad>.text-ad-content{display:inline-block;vertical-align:middle;line-height:1.2em}.donate{margin-top:-21px;background-color:#a40000;background-image:url("/assets/img/bg/donate.jpg");cursor:default}.donate-thanks{background-image:url("/assets/img/bg/larry-lessthanthree.png");background-size:contain;background-position:50% 50%;height:400px}.donate h1{color:white;text-shadow:0px 0px 5px black}.donate p{text-shadow:0px 0px 5px black;color:white}@media (min-width: 768px){.donate-form{margin-left:20%;margin-right:20%}}
502 +
503 +/*# sourceMappingURL=screen.css.map */
504
505 diff --git a/python/templates/includes/container/end b/python/bb_dashboard/templates/includes/container/end
506 similarity index 100%
507 rename from python/templates/includes/container/end
508 rename to python/bb_dashboard/templates/includes/container/end
509
510 diff --git a/python/bb_dashboard/templates/includes/container/start b/python/bb_dashboard/templates/includes/container/start
511 new file mode 100644
512 index 0000000..1dca7a2
513 --- /dev/null
514 +++ b/python/bb_dashboard/templates/includes/container/start
515 @@ -0,0 +1,3 @@
516 +</div></div></div>
517 +<div class="hero-section emergehdr">
518 + <div class="container">
519
520 diff --git a/python/bb_dashboard/templates/includes/layout/footer.html b/python/bb_dashboard/templates/includes/layout/footer.html
521 new file mode 100644
522 index 0000000..71d1339
523 --- /dev/null
524 +++ b/python/bb_dashboard/templates/includes/layout/footer.html
525 @@ -0,0 +1,43 @@
526 +<footer>
527 + <div class="container">
528 + <div class="row">
529 + <div class="col-xs-12 col-md-offset-2 col-md-7">
530 + </div>
531 + <div class="col-xs-12 col-md-3">
532 + <h3 class="footerhead">Questions or comments?</h3>
533 + Please feel free to <a href="/inside-gentoo/contact/">contact us</a>.
534 + </div>
535 + </div>
536 + </div>
537 + <div class="container">
538 + <div class="row">
539 + <div class="col-xs-3 col-md-2">
540 + <ul class="footerlinks three-icons">
541 + <li><a href="https://twitter.com/gentoo" title="@Gentoo on Twitter"><span class="fa fa-twitter fa-fw"></span></a></li>
542 + <li><a href="https://www.facebook.com/gentoo.org" title="Gentoo on Facebook"><span class="fa fa-facebook fa-fw"></span></a></li>
543 + </ul>
544 + <div>
545 + <div class="sitemap text-center">
546 + <a href="https://wiki.gentoo.org/wiki/Foundation:Privacy_Policy">Privacy Policy</a>
547 + </div>
548 + </div>
549 + </div>
550 + <div class="col-xs-8 col-md-8">
551 + <strong>&copy; 2001-{% now "Y" %} Gentoo Foundation, Inc.</strong><br>
552 + <small>
553 + Gentoo is a trademark of the Gentoo Foundation, Inc.
554 + The contents of this document, unless otherwise expressly stated, are licensed under the
555 + <a href="https://creativecommons.org/licenses/by-sa/3.0/" rel="license">CC-BY-SA-3.0</a> license.
556 + The <a href="https://www.gentoo.org/inside-gentoo/foundation/name-logo-guidelines.html">Gentoo Name and Logo Usage Guidelines</a> apply.
557 + </small>
558 + </div>
559 + <div class="col-xs-1 col-md-1">
560 + <strong><a class="text-dark" href="https://gitweb.gentoo.org/sites/www.git/">Version</a></strong><br>
561 + <small>
562 + de76aa4
563 +
564 + </small>
565 + </div>
566 + </div>
567 + </div>
568 +</footer>
569
570 diff --git a/python/bb_dashboard/templates/includes/layout/head.html b/python/bb_dashboard/templates/includes/layout/head.html
571 new file mode 100644
572 index 0000000..492b392
573 --- /dev/null
574 +++ b/python/bb_dashboard/templates/includes/layout/head.html
575 @@ -0,0 +1,26 @@
576 +<head>
577 + {% load static %}
578 + <title>{% if activemeny.title %}{{ activemeny.title }} – {{ site.title }}{% else %}{{ site.title }}{% endif %}</title>
579 + {% if activemeny.description %}<meta name="description" content="{{ activemeny.description }}">{% endif %}
580 + <meta charset="utf-8">
581 + <meta name="theme-color" content="#54487a">
582 + <meta name="viewport" content="width=device-width, initial-scale=1.0">
583 + <meta http-equiv="X-UA-Compatible" content="IE=edge">
584 + <meta property="og:title" content="{% if activemeny.title %}{{ activemeny.title }} – {{ site.title }}{% else %}{{ site.title }}{% endif %}">
585 + <meta property="og:image" content="https://www.gentoo.org/assets/img/logo/gentoo-g.png">
586 + <meta property="og:description" content="{% if activemeny.description %}{{ activemeny.description }}{% else %}{{ site.description }}{% endif %}">
587 + <meta name="twitter:image" content="https://www.gentoo.org/assets/img/logo/gentoo-g.png">
588 + <link rel="apple-touch-icon" href="https://www.gentoo.org/assets/img/logo/icon-192.png">
589 + <link rel="icon" sizes="192x192" href="https://www.gentoo.org/assets/img/logo/icon-192.png">
590 + <link href="https://assets.gentoo.org/tyrian/v1/bootstrap.min.css" rel="stylesheet" media="screen">
591 + <link href="https://assets.gentoo.org/tyrian/v1/tyrian.min.css" rel="stylesheet" media="screen">
592 + <link href="{% static 'screen.css' %}" rel="stylesheet" media="screen">
593 +
594 + <link rel="icon" href="https://www.gentoo.org/favicon.ico" type="image/x-icon">
595 + <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/www-gentoo-org.xml" title="Gentoo Website">
596 + <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/forums-gentoo-org.xml" title="Gentoo Forums">
597 + <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla">
598 + <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages">
599 + <link rel="search" type="application/opensearchdescription+xml" href="https://www.gentoo.org/search/archives-gentoo-org.xml" title="Gentoo List Archives">
600 + <link rel="alternate" type="application/atom+xml" title="Gentoo Linux news" href="https://www.gentoo.org/feeds/news.xml">
601 +</head>
602
603 diff --git a/python/bb_dashboard/templates/includes/layout/header.html b/python/bb_dashboard/templates/includes/layout/header.html
604 new file mode 100644
605 index 0000000..382bcf4
606 --- /dev/null
607 +++ b/python/bb_dashboard/templates/includes/layout/header.html
608 @@ -0,0 +1,89 @@
609 +<header>
610 + <div class="site-title">
611 + <div class="container">
612 + <div class="row">
613 + <div class="site-title-buttons">
614 + <div class="btn-group btn-group-sm">
615 + <a href="https://get.gentoo.org/" role="button" class="btn get-gentoo"><span class="fa fa-fw fa-download"></span> <strong>Get Gentoo!</strong></a>
616 + <div class="btn-group btn-group-sm">
617 + <a class="btn gentoo-org-sites dropdown-toggle" data-toggle="dropdown" data-target="#" href="#">
618 + <span class="fa fa-fw fa-map-o"></span> <span class="hidden-xs">gentoo.org sites</span> <span class="caret"></span>
619 + </a>
620 + <ul class="dropdown-menu dropdown-menu-right">
621 + <li><a href="https://www.gentoo.org/" title="Main Gentoo website"><span class="fa fa-home fa-fw"></span> gentoo.org</a></li>
622 + <li><a href="https://wiki.gentoo.org/" title="Find and contribute documentation"><span class="fa fa-file-text-o fa-fw"></span> Wiki</a></li>
623 + <li><a href="https://bugs.gentoo.org/" title="Report issues and find common issues"><span class="fa fa-bug fa-fw"></span> Bugs</a></li>
624 + <li><a href="https://forums.gentoo.org/" title="Discuss with the community"><span class="fa fa-comments-o fa-fw"></span> Forums</a></li>
625 + <li><a href="https://packages.gentoo.org/" title="Find software for your Gentoo"><span class="fa fa-hdd-o fa-fw"></span> Packages</a></li>
626 + <li class="divider"></li>
627 + <li><a href="https://planet.gentoo.org/" title="Find out what's going on in the developer community"><span class="fa fa-rss fa-fw"></span> Planet</a></li>
628 + <li><a href="https://archives.gentoo.org/" title="Read up on past discussions"><span class="fa fa-archive fa-fw"></span> Archives</a></li>
629 + <li><a href="https://gitweb.gentoo.org/" title="Browse our source code in Gitweb"><span class="fa fa-code fa-fw"></span> Gitweb</a></li>
630 + <li class="divider"></li>
631 + <li><a href="https://infra-status.gentoo.org/" title="Get updates on the services provided by Gentoo"><span class="fa fa-server fa-fw"></span> Infra status</a></li>
632 + </ul>
633 + </div>
634 + </div>
635 + </div>
636 + <div class="logo">
637 + <a href="/" title="Back to the homepage" class="site-logo">
638 + <object data="https://assets.gentoo.org/tyrian/site-logo.svg" type="image/svg+xml">
639 + <img src="https://assets.gentoo.org/tyrian/site-logo.png" alt="Gentoo Linux logo">
640 + </object>
641 + </a>
642 + <span class="site-label">Gentoo Ci Dashboard</span>
643 + </div>
644 + </div>
645 + </div>
646 + </div>
647 + <nav class="tyrian-navbar" role="navigation">
648 + <div class="container">
649 + <div class="row">
650 + <div class="navbar-header">
651 + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">
652 + <span class="sr-only">Toggle navigation</span>
653 + <span class="icon-bar"></span>
654 + <span class="icon-bar"></span>
655 + <span class="icon-bar"></span>
656 + </button>
657 + </div>
658 + <div class="collapse navbar-collapse navbar-main-collapse">
659 + <ul class="nav navbar-nav">
660 + {% include "includes/navigation/primary" %}
661 + </ul>
662 + <ul class="nav navbar-nav navbar-right">
663 + <li class=""><a href="http://www.gentoo.org/donate/"><span class="fa fa-heart" style="color:#d9534f;"></span> Donate</a></li>
664 + </ul>
665 + <ul class="nav navbar-nav navbar-right">
666 + <li class=""><span class="" style="color:#d9534f;"></span>
667 + {% if user.is_authenticated %}
668 + Welcome, {{ user.username }}. Thanks for logging in.
669 + {% endif %}
670 + </li>
671 + </ul>
672 + </div>
673 + </div>
674 + </div>
675 + </nav>
676 + {% if subpages %}
677 + <nav class="navbar navbar-grey navbar-stick" role="navigation">
678 + <div class="container">
679 + <div class="row">
680 + <div class="navbar-header">
681 + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-secondary-collapse">
682 + <span class="sr-only">Toggle secondary navigation</span>
683 + <span class="icon-bar"></span>
684 + <span class="icon-bar"></span>
685 + <span class="icon-bar"></span>
686 + </button>
687 + </div>
688 + <div class="collapse navbar-collapse navbar-secondary-collapse">
689 + <ul class="nav navbar-nav">
690 + {% include "includes/navigation/secondary" %}
691 + </ul>
692 + </div>
693 + </div>
694 + </div>
695 + </nav>
696 + {% endif %}
697 +</header>
698
699 diff --git a/python/templates/includes/navigation/primary b/python/bb_dashboard/templates/includes/navigation/primary
700 similarity index 100%
701 rename from python/templates/includes/navigation/primary
702 rename to python/bb_dashboard/templates/includes/navigation/primary
703
704 diff --git a/python/templates/includes/navigation/secondary b/python/bb_dashboard/templates/includes/navigation/secondary
705 similarity index 100%
706 rename from python/templates/includes/navigation/secondary
707 rename to python/bb_dashboard/templates/includes/navigation/secondary
708
709 diff --git a/python/bb_dashboard/templates/layout/base.html b/python/bb_dashboard/templates/layout/base.html
710 new file mode 100644
711 index 0000000..0dd7d8c
712 --- /dev/null
713 +++ b/python/bb_dashboard/templates/layout/base.html
714 @@ -0,0 +1,20 @@
715 +<!DOCTYPE html>
716 +<html>
717 + {% include "includes/layout/head.html" %}
718 + <body class="">
719 + {% include "includes/layout/header.html" %}
720 +
721 + <div class="container">
722 + <div class="row">
723 + <div id="content" class="col-md-12">
724 + {% block content %}{% endblock %}
725 + </div>
726 + </div>
727 + </div>
728 +
729 + {% include "includes/layout/footer.html" %}
730 +
731 + <script src="https://assets.gentoo.org/tyrian/v1/jquery.min.js"></script>
732 + <script src="https://assets.gentoo.org/tyrian/v1/bootstrap.min.js"></script>
733 + </body>
734 +</html>
735
736 diff --git a/python/bb_dashboard/www/__init__.py b/python/bb_dashboard/www/__init__.py
737 new file mode 100644
738 index 0000000..e69de29
739
740 diff --git a/python/bb_dashboard/www/admin.py b/python/bb_dashboard/www/admin.py
741 new file mode 100644
742 index 0000000..168b0b2
743 --- /dev/null
744 +++ b/python/bb_dashboard/www/admin.py
745 @@ -0,0 +1,7 @@
746 +from django.contrib import admin
747 +
748 +from .models import SiteSettings, Menys, SubMenys
749 +
750 +admin.site.register(SiteSettings)
751 +admin.site.register(Menys)
752 +admin.site.register(SubMenys)
753
754 diff --git a/python/bb_dashboard/www/apps.py b/python/bb_dashboard/www/apps.py
755 new file mode 100644
756 index 0000000..a339bca
757 --- /dev/null
758 +++ b/python/bb_dashboard/www/apps.py
759 @@ -0,0 +1,6 @@
760 +from django.apps import AppConfig
761 +
762 +
763 +class WwwConfig(AppConfig):
764 + default_auto_field = 'django.db.models.BigAutoField'
765 + name = 'www'
766
767 diff --git a/python/bb_dashboard/www/migrations/0001_initial.py b/python/bb_dashboard/www/migrations/0001_initial.py
768 new file mode 100644
769 index 0000000..d2ef79d
770 --- /dev/null
771 +++ b/python/bb_dashboard/www/migrations/0001_initial.py
772 @@ -0,0 +1,95 @@
773 +# Generated by Django 3.2.3 on 2021-06-12 23:07
774 +
775 +from django.db import migrations, models
776 +import django.db.models.deletion
777 +
778 +
779 +class Migration(migrations.Migration):
780 +
781 + initial = True
782 +
783 + dependencies = [
784 + ]
785 +
786 + operations = [
787 + migrations.CreateModel(
788 + name='Menys',
789 + fields=[
790 + ('id', models.IntegerField(primary_key=True, serialize=False)),
791 + ('title', models.CharField(max_length=200)),
792 + ('description', models.CharField(max_length=200)),
793 + ('name', models.CharField(max_length=100)),
794 + ('view', models.BooleanField(default=False)),
795 + ('sort', models.IntegerField(default=0)),
796 + ('url', models.CharField(max_length=200)),
797 + ('arg', models.CharField(blank=True, max_length=50)),
798 + ('access', models.BooleanField(default=False)),
799 + ('sub', models.BooleanField(default=False)),
800 + ],
801 + options={
802 + 'db_table': 'menys',
803 + },
804 + ),
805 + migrations.CreateModel(
806 + name='Posts',
807 + fields=[
808 + ('id', models.IntegerField(primary_key=True, serialize=False)),
809 + ('title', models.CharField(max_length=200)),
810 + ('url', models.CharField(max_length=200)),
811 + ('text', models.TextField()),
812 + ('created_at', models.DateTimeField(auto_now_add=True)),
813 + ],
814 + options={
815 + 'db_table': 'posts',
816 + },
817 + ),
818 + migrations.CreateModel(
819 + name='SiteSettings',
820 + fields=[
821 + ('id', models.IntegerField(primary_key=True, serialize=False)),
822 + ('site', models.CharField(max_length=20)),
823 + ('title', models.CharField(max_length=50)),
824 + ('email', models.CharField(max_length=50)),
825 + ('description', models.CharField(max_length=100)),
826 + ('url', models.CharField(max_length=50)),
827 + ('contact', models.CharField(max_length=50)),
828 + ],
829 + options={
830 + 'db_table': 'site_settings',
831 + },
832 + ),
833 + migrations.CreateModel(
834 + name='Sponsors',
835 + fields=[
836 + ('id', models.IntegerField(primary_key=True, serialize=False)),
837 + ('name', models.CharField(max_length=200)),
838 + ('img', models.CharField(max_length=200)),
839 + ('link', models.CharField(max_length=200)),
840 + ('title', models.CharField(max_length=200)),
841 + ('alt', models.CharField(max_length=200)),
842 + ('weight', models.IntegerField(default=0)),
843 + ('active', models.BooleanField(default=False)),
844 + ],
845 + options={
846 + 'db_table': 'sponsors',
847 + },
848 + ),
849 + migrations.CreateModel(
850 + name='SubMenys',
851 + fields=[
852 + ('id', models.IntegerField(primary_key=True, serialize=False)),
853 + ('title', models.CharField(max_length=200)),
854 + ('description', models.CharField(max_length=200)),
855 + ('name', models.CharField(max_length=100)),
856 + ('view', models.BooleanField(default=False)),
857 + ('sort', models.IntegerField(default=0)),
858 + ('url', models.CharField(max_length=200)),
859 + ('arg', models.CharField(blank=True, max_length=50)),
860 + ('access', models.BooleanField(default=False)),
861 + ('MenyId', models.ForeignKey(db_column='meny_id', on_delete=django.db.models.deletion.CASCADE, to='www.menys')),
862 + ],
863 + options={
864 + 'db_table': 'sub_menys',
865 + },
866 + ),
867 + ]
868
869 diff --git a/python/bb_dashboard/www/migrations/__init__.py b/python/bb_dashboard/www/migrations/__init__.py
870 new file mode 100644
871 index 0000000..e69de29
872
873 diff --git a/python/bb_dashboard/www/models.py b/python/bb_dashboard/www/models.py
874 new file mode 100644
875 index 0000000..85dbc35
876 --- /dev/null
877 +++ b/python/bb_dashboard/www/models.py
878 @@ -0,0 +1,74 @@
879 +# Copyright 1998-2019 Gentoo Foundation
880 +# Distributed under the terms of the GNU General Public License v2
881 +
882 +from django.db import models
883 +
884 +class SiteSettings(models.Model):
885 + id = models.IntegerField(primary_key=True)
886 + site = models.CharField(max_length=20)
887 + title = models.CharField(max_length=50)
888 + email = models.CharField(max_length=50)
889 + description = models.CharField(max_length=100)
890 + url = models.CharField(max_length=50)
891 + contact = models.CharField(max_length=50)
892 + class Meta:
893 + db_table = 'site_settings'
894 + def __str__(self):
895 + return '%s %s %s %s %s %s %s' % (self.id, self.site, self.title, self.email, self.description, self.url, self.contact)
896 +
897 +class Menys(models.Model):
898 + id = models.IntegerField(primary_key=True)
899 + title = models.CharField(max_length=200)
900 + description = models.CharField(max_length=200)
901 + name = models.CharField(max_length=100)
902 + view = models.BooleanField(default=False)
903 + sort = models.IntegerField(default=0)
904 + url = models.CharField(max_length=200)
905 + arg = models.CharField(max_length=50, blank=True)
906 + access = models.BooleanField(default=False)
907 + sub = models.BooleanField(default=False)
908 + class Meta:
909 + db_table = 'menys'
910 + def __str__(self):
911 + return '%s %s %s %s %s %s %s %s %s %s' % (self.id, self.title, self.description, self.name, self.view, self.sort, self.url, self.arg, self.access, self.sub)
912 +
913 +class SubMenys(models.Model):
914 + id = models.IntegerField(primary_key=True)
915 + title = models.CharField(max_length=200)
916 + description = models.CharField(max_length=200)
917 + MenyId = models.ForeignKey(Menys, on_delete=models.CASCADE, db_column='meny_id')
918 + name = models.CharField(max_length=100)
919 + view = models.BooleanField(default=False)
920 + sort = models.IntegerField(default=0)
921 + url = models.CharField(max_length=200)
922 + arg = models.CharField(max_length=50, blank=True)
923 + access = models.BooleanField(default=False)
924 + class Meta:
925 + db_table = 'sub_menys'
926 + def __str__(self):
927 + return '%s %s %s %s %s %s %s %s %s %s' % (self.id, self.title, self.description, self.MenyId, self.name, self.view, self.sort, self.url, self.arg, self.access)
928 +
929 +class Posts(models.Model):
930 + id = models.IntegerField(primary_key=True)
931 + title = models.CharField(max_length=200)
932 + url = models.CharField(max_length=200)
933 + text = models.TextField()
934 + created_at = models.DateTimeField(auto_now_add=True)
935 + class Meta:
936 + db_table='posts'
937 + def __str__(self):
938 + return '%s %s %s %s %s' % (self.id, self.title, self.url, self.text, self.created_at)
939 +
940 +class Sponsors(models.Model):
941 + id = models.IntegerField(primary_key=True)
942 + name = models.CharField(max_length=200)
943 + img = models.CharField(max_length=200)
944 + link = models.CharField(max_length=200)
945 + title = models.CharField(max_length=200)
946 + alt = models.CharField(max_length=200)
947 + weight = models.IntegerField(default=0)
948 + active = models.BooleanField(default=False)
949 + class Meta:
950 + db_table = 'sponsors'
951 + def __str__(self):
952 + return '%s %s %s %s %s %s %s' % (self.id, self.name, self.img, self.link, self.alt, self.weight, self.active)
953
954 diff --git a/python/bb_dashboard/www/router.py b/python/bb_dashboard/www/router.py
955 new file mode 100644
956 index 0000000..70fa685
957 --- /dev/null
958 +++ b/python/bb_dashboard/www/router.py
959 @@ -0,0 +1,31 @@
960 +# Copyright 1998-2015 Gentoo Foundation
961 +# Distributed under the terms of the GNU General Public License v2
962 +
963 +class WWWRouter(object):
964 + def db_for_read(self, model, **hints):
965 + "Point all operations on zobcs models to 'zobcs'"
966 + if model._meta.app_label == 'www':
967 + return 'default'
968 + return 'gentoo-ci'
969 +
970 + def db_for_write(self, model, **hints):
971 + "Point all operations on zobcs models to 'zobcs'"
972 + if model._meta.app_label == 'www':
973 + return 'default'
974 + return 'gentoo-ci'
975 +
976 + def allow_relation(self, obj1, obj2, **hints):
977 + "Allow any relation if a both models in zobcs app"
978 + if obj1._meta.app_label == 'www' and obj2._meta.app_label == 'www':
979 + return True
980 + # Allow if neither is zobcs app
981 + elif 'www' not in [obj1._meta.app_label, obj2._meta.app_label]:
982 + return True
983 + return False
984 +
985 + def allow_migrate(self, db, app_label, model_name=None, **hints):
986 + if db == 'gentoo-ci':
987 + return app_label == 'gentoo-ci'
988 + elif app_label == 'gentoo-ci':
989 + return False
990 + return True
991
992 diff --git a/python/bb_dashboard/www/templates/www/index.html b/python/bb_dashboard/www/templates/www/index.html
993 new file mode 100644
994 index 0000000..18ecc63
995 --- /dev/null
996 +++ b/python/bb_dashboard/www/templates/www/index.html
997 @@ -0,0 +1,42 @@
998 +{% extends "layout/base.html" %}
999 +{% block content %}
1000 +{% include "includes/container/start" %}
1001 +<div class="row">
1002 + <div class="col-xs-12 col-sm-8 col-md-9">
1003 + <p>
1004 + Welcome to Gentoo Ci Dashboard.
1005 + </p>
1006 + </div>
1007 + <div class="col-xs-12 col-sm-4 col-md-3 buttons">
1008 + <a href="/get-started/about/" class="btn btn-default btn-block">Learn more</a>
1009 + <a href="/get-started/" class="btn btn-primary btn-block"><i class="fa fa-fw fa-rocket"></i> Get started now</a>
1010 + </div>
1011 +</div>
1012 +{% include "includes/container/end" %}
1013 +{% include "www/news.html" %}
1014 +
1015 +<div class="row">
1016 + <div class="col-xs-12 col-md-6">
1017 + <h2>New Commits <small>more at the <a href="/new_packages/">New Commits</a></small></h2>
1018 +
1019 + </div>
1020 + <div class="col-xs-12 col-md-6">
1021 + <h2>New Builds <small>more at the <a href="/new_logs/">New Builds</a></small></h2>
1022 +
1023 + </div>
1024 +</div>
1025 +
1026 +<div class="row">
1027 + <div class="col-xs-12 col-md-6">
1028 + <h2>New Build Requests <small>more at the <a href="/new_build_req">New Build Requests</a></small></h2>
1029 +
1030 + </div>
1031 + <div class="col-xs-12 col-md-6">
1032 + <h2>New Pkgcheck or QA checks <small>on the <a href="/new/repomanqa/">New Pkgcheck or QA checks</a></small></h2>
1033 +
1034 + </div>
1035 +</div>
1036 +
1037 +<hr>
1038 +
1039 +{% endblock %}
1040
1041 diff --git a/python/templates/includes/frontpage/news b/python/bb_dashboard/www/templates/www/news.html
1042 similarity index 66%
1043 rename from python/templates/includes/frontpage/news
1044 rename to python/bb_dashboard/www/templates/www/news.html
1045 index 1f1a7d3..b722f51 100644
1046 --- a/python/templates/includes/frontpage/news
1047 +++ b/python/bb_dashboard/www/templates/www/news.html
1048 @@ -1,5 +1,6 @@
1049 +<section id="news">
1050 {% for post in posts %}
1051 -<article>
1052 +<article class="newsitem">
1053 <h2 class="stick-top newsitem-bullet">
1054 <span class="fa fa-fw fa-chevron-circle-right" title="News item"> </span>
1055 </h2>
1056 @@ -11,3 +12,9 @@
1057 </div>
1058 </article>
1059 {% endfor %}
1060 +</section>
1061 +
1062 +<div class="news-more">
1063 + <a href="/news" class="btn btn-xs">All news items <span class="fa fa-fw fa-chevron-right"></span></a>
1064 +<hr>
1065 +</div>
1066
1067 diff --git a/python/bb_dashboard/www/tests.py b/python/bb_dashboard/www/tests.py
1068 new file mode 100644
1069 index 0000000..7ce503c
1070 --- /dev/null
1071 +++ b/python/bb_dashboard/www/tests.py
1072 @@ -0,0 +1,3 @@
1073 +from django.test import TestCase
1074 +
1075 +# Create your tests here.
1076
1077 diff --git a/python/bb_dashboard/www/urls.py b/python/bb_dashboard/www/urls.py
1078 new file mode 100644
1079 index 0000000..88a9cac
1080 --- /dev/null
1081 +++ b/python/bb_dashboard/www/urls.py
1082 @@ -0,0 +1,7 @@
1083 +from django.urls import path
1084 +
1085 +from . import views
1086 +
1087 +urlpatterns = [
1088 + path('', views.index, name='index'),
1089 +]
1090
1091 diff --git a/python/bb_dashboard/www/utils.py b/python/bb_dashboard/www/utils.py
1092 new file mode 100644
1093 index 0000000..a69f406
1094 --- /dev/null
1095 +++ b/python/bb_dashboard/www/utils.py
1096 @@ -0,0 +1,55 @@
1097 +# Copyright 1998-2019 Gentoo Foundation
1098 +# Distributed under the terms of the GNU General Public License v2
1099 +
1100 +import calendar
1101 +import datetime
1102 +import dateutil.tz
1103 +
1104 +from django.shortcuts import get_object_or_404
1105 +from www.models import SiteSettings, Menys, SubMenys
1106 +
1107 +def default_siteinfo(request, menyrequest):
1108 + siteinfo = {}
1109 + siteinfo['site'] = get_object_or_404(SiteSettings)
1110 + activemeny = get_object_or_404(Menys, name = menyrequest)
1111 + menys = Menys.objects.all().order_by('sort')
1112 + #contact = get_object_or_404(SubPages, nav2 = 'contact')
1113 + for meny in menys:
1114 + if meny.title == 'Login' and request.user.is_authenticated:
1115 + meny.show = False
1116 + if meny.title == 'User' and request.user.is_authenticated:
1117 + meny.show = True
1118 + if meny.arg == '':
1119 + meny.arg = False
1120 + siteinfo['activemeny'] = activemeny
1121 + siteinfo['menys'] = menys
1122 + #siteinfo['contact'] = contact
1123 + if activemeny.sub:
1124 + submenys = SubMenys.objects.filter(MenyId = activemeny.id).order_by('sort')
1125 + for submeny in submenys:
1126 + if submeny.arg == '':
1127 + submeny.arg = False
1128 + siteinfo['submenys'] = submenys
1129 + siteinfo['subactivemeny'] = False
1130 + else:
1131 + siteinfo['submenys'] = []
1132 + siteinfo['subactivemeny'] = False
1133 + return siteinfo
1134 +
1135 +# time-handling methods
1136 +
1137 +# this used to be a custom class; now it's just an instance of dateutil's class
1138 +UTC = dateutil.tz.tzutc()
1139 +
1140 +def epoch2datetime(epoch):
1141 + """Convert a UNIX epoch time to a datetime object, in the UTC timezone"""
1142 + if epoch is not None:
1143 + return datetime.datetime.fromtimestamp(epoch, tz=UTC)
1144 + return None
1145 +
1146 +
1147 +def datetime2epoch(dt):
1148 + """Convert a non-naive datetime object to a UNIX epoch timestamp"""
1149 + if dt is not None:
1150 + return calendar.timegm(dt.utctimetuple())
1151 + return None
1152
1153 diff --git a/python/bb_dashboard/www/views.py b/python/bb_dashboard/www/views.py
1154 new file mode 100644
1155 index 0000000..05dcd10
1156 --- /dev/null
1157 +++ b/python/bb_dashboard/www/views.py
1158 @@ -0,0 +1,16 @@
1159 +# Copyright 1998-2019 Gentoo Foundation
1160 +# Distributed under the terms of the GNU General Public License v2
1161 +
1162 +from django.http import HttpResponse
1163 +from django.shortcuts import render
1164 +from django.conf import settings
1165 +
1166 +from .utils import default_siteinfo
1167 +from .models import Posts
1168 +
1169 +def index(request):
1170 + menyrequest = 'www'
1171 + siteinfo = default_siteinfo(request, menyrequest)
1172 + siteinfo['posts'] = Posts.objects.all()[:2]
1173 + htmlrequest = menyrequest + '/index.html'
1174 + return render(request, htmlrequest, siteinfo)
1175
1176 diff --git a/python/templates/includes/container/start b/python/templates/includes/container/start
1177 deleted file mode 100644
1178 index 2ec1951..0000000
1179 --- a/python/templates/includes/container/start
1180 +++ /dev/null
1181 @@ -1,3 +0,0 @@
1182 -</div></div></div>
1183 -<div class="{{ class_include }}">
1184 - <div class="container">
1185 \ No newline at end of file
1186
1187 diff --git a/python/templates/includes/frontpage/new_build_req b/python/templates/includes/frontpage/new_build_req
1188 deleted file mode 100644
1189 index 3a47530..0000000
1190 --- a/python/templates/includes/frontpage/new_build_req
1191 +++ /dev/null
1192 @@ -1,15 +0,0 @@
1193 -<table class="table table-striped frontpage-table">
1194 - {% for k, v in BJ.items %}
1195 - <tr>
1196 - <td class="frontpage-table-package-atom"><a href="/new_build_req/{{ k }}" title="{{ v.C }}/{{ v.P }}-{{ v.V }}::{{ v.R }}">{{ v.C }}/{{ v.P }}-{{ v.V }}::{{ v.R }}</a></td>
1197 - <td><p title="{{ v.title }}">{{ v.title|truncatewords:2}}</p>
1198 - <td class="text-right">
1199 - {% if v.Status == 'Building' %}
1200 - <span class="label label-primary">{{ v.Status }}</span>
1201 - {% else %}
1202 - <span class="label label-default">{{ v.Status }}</span>
1203 - {% endif %}
1204 - </td></td>
1205 - </tr>
1206 - {% endfor %}
1207 -</table>
1208 \ No newline at end of file
1209
1210 diff --git a/python/templates/includes/frontpage/new_logs b/python/templates/includes/frontpage/new_logs
1211 deleted file mode 100644
1212 index 3074c4d..0000000
1213 --- a/python/templates/includes/frontpage/new_logs
1214 +++ /dev/null
1215 @@ -1,27 +0,0 @@
1216 -<table class="table table-striped frontpage-table">
1217 - {% for B in BL%}
1218 - <tr>
1219 - <td class="frontpage-table-package-atom"><a href="/new_logs/{{ B.BuildLogId }}/" title="{{ B.C }}/{{ B.P }}-{{ B.V }}::{{ B.R }}">
1220 - {{ B.C }}/{{ B.P }}-{{ B.V }}::{{ B.R }}</a></td>
1221 - <td><p title="{{ B.SummeryText }}">{{ B.SummeryText|truncatewords:3 }}</p>
1222 - <td class="text-right">
1223 - {% if B.Fail %}
1224 - {% for BE in B.BE_tmp %}
1225 - {% if BE.BuildLogId.BuildLogId == B.BuildLogId %}
1226 - {% if BE.ErrorId.ErrorId == 1 or BE.ErrorId.ErrorId == 2 %}
1227 - <span class="label label-warning">{{ BE.ErrorId.ErrorName|upper }}</span>
1228 - {% elif BE.ErrorId.ErrorId == 3 %}
1229 - <span class="label label-info">OTHERS</span>
1230 - {% else %}
1231 - <span class="label label-danger">{{ BE.ErrorId.ErrorName|upper }}</span>
1232 - {% endif %}
1233 - {% endif %}
1234 - {% endfor %}
1235 - {% else %}
1236 - <span class="label label-success">OK</span>
1237 - {% endif %}
1238 - </td>
1239 - </td>
1240 - </tr>
1241 - {% endfor %}
1242 -</table>
1243 \ No newline at end of file
1244
1245 diff --git a/python/templates/includes/frontpage/new_packages b/python/templates/includes/frontpage/new_packages
1246 deleted file mode 100644
1247 index 6c845b7..0000000
1248 --- a/python/templates/includes/frontpage/new_packages
1249 +++ /dev/null
1250 @@ -1,10 +0,0 @@
1251 -<table class="table table-striped frontpage-table">
1252 - {% for E in EM %}
1253 - <tr>
1254 - <td class="frontpage-table-package-atom">
1255 - <a href="/packages/{{ E.EbuildId.PackageId.PackageId }}/" title="{{ E.EbuildId.PackageId.CategoryId.Category }}/{{ E.EbuildId.PackageId.Package }}-{{ E.EbuildId.Version }}::{{ E.EbuildId.PackageId.RepoId.Repo }}">
1256 - {{ E.EbuildId.PackageId.CategoryId.Category }}/{{ E.EbuildId.PackageId.Package }}-{{ E.EbuildId.Version }}::{{ E.EbuildId.PackageId.RepoId.Repo }}</a></td>
1257 - <td><p title="{{ E.Descriptions }}">{{ E.Descriptions }}</p></td>
1258 - </tr>
1259 - {% endfor %}
1260 -</table>
1261 \ No newline at end of file
1262
1263 diff --git a/python/templates/includes/frontpage/new_repoman_qa b/python/templates/includes/frontpage/new_repoman_qa
1264 deleted file mode 100644
1265 index 61ac691..0000000
1266 --- a/python/templates/includes/frontpage/new_repoman_qa
1267 +++ /dev/null
1268 @@ -1,18 +0,0 @@
1269 -<table class="table table-striped frontpage-table">
1270 - {% for QA in QA_tmp %}
1271 - <tr>
1272 - <td class="frontpage-table-package-atom"><a href="/repoman_qa/{{ QA.BuildLogId.BuildLogId }}/" title="{{ QA.BuildLogId.EbuildId.PackageId.CategoryId.Category }}/{{ QA.BuildLogId.EbuildId.PackageId.Package }}-{{ QA.BuildLogId.EbuildId.Version }}::{{ QA.BuildLogId.EbuildId.PackageId.RepoId.Repo }}">
1273 - {{ QA.BuildLogId.EbuildId.PackageId.CategoryId.Category }}/{{ QA.BuildLogId.EbuildId.PackageId.Package }}-{{ QA.BuildLogId.EbuildId.Version }}::{{ QA.BuildLogId.EbuildId.PackageId.RepoId.Repo }}</a>
1274 - </td>
1275 - <td><p title="{{ QA.SummeryText }}">{{ QA.SummeryText|truncatewords:3 }}</p></td>
1276 - </tr>
1277 - {% endfor %}
1278 - {% for PR in PR_tmp %}
1279 - <tr>
1280 - <td class="frontpage-table-package-atom"><a href="/repoman/{{ PR.PackageId.PackageId }}/" title="{{ PR.PackageId.CategoryId.Category }}/{{ PR.PackageId.Package }}::{{ PR.PackageId.RepoId.Repo }}">
1281 - {{ PR.PackageId.CategoryId.Category }}/{{ PR.PackageId.Package }}::{{ PR.PackageId.RepoId.Repo }}</a>
1282 - </td>
1283 - <td><p title="{{ PR.RepomanText }}">{{ PR.RepomanText|truncatewords:3 }}</p></td>
1284 - </tr>
1285 - {% endfor %}
1286 -</table>
1287 \ No newline at end of file
1288
1289 diff --git a/python/templates/includes/navigation/sitemap_secondary b/python/templates/includes/navigation/sitemap_secondary
1290 deleted file mode 100644
1291 index f7b5379..0000000
1292 --- a/python/templates/includes/navigation/sitemap_secondary
1293 +++ /dev/null
1294 @@ -1,5 +0,0 @@
1295 -{% for node in smappages %}
1296 - {% if page.PageId == node.PageId.PageId %}
1297 - <li><a href="{{node.url }}">{% if node.nav_title %}{{ node.nav_title }}{% else %}{{node.title}}{% endif %}</a></li>
1298 - {% endif %}
1299 -{% endfor %}