Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 520-akowner
  • 520-fix-event-wizard-datepicker
  • 520-fix-scheduling
  • 520-improve-scheduling
  • 520-improve-scheduling-2
  • 520-improve-submission
  • 520-improve-trackmanager
  • 520-improve-wall
  • 520-message-resolved
  • 520-status
  • 520-upgrades
  • add_express_interest_to_ak_overview
  • admin-production-color
  • bugfixes
  • csp
  • featire-ical-export
  • feature-ak-requirement-lists
  • feature-akslide-export-better-filename
  • feature-akslides
  • feature-better-admin
  • feature-better-cv-list
  • feature-colors
  • feature-constraint-checking
  • feature-constraint-checking-wip
  • feature-dashboard-history-button
  • feature-event-status
  • feature-event-wizard
  • feature-export-flag
  • feature-improve-admin
  • feature-improve-filters
  • feature-improved-user-creation-workflow
  • feature-interest-view
  • feature-mails
  • feature-modular-status
  • feature-plan-autoreload
  • feature-present-default
  • feature-register-link
  • feature-remaining-constraint-validation
  • feature-room-import
  • feature-scheduler-improve
  • feature-scheduling-2.0
  • feature-special-attention
  • feature-time-input
  • feature-tracker
  • feature-wiki-wishes
  • feature-wish-slots
  • feature-wizard-buttons
  • features-availabilities
  • fix-ak-times-above-folg
  • fix-api
  • fix-constraint-violation-string
  • fix-cv-checking
  • fix-default-slot-length
  • fix-default-slot-localization
  • fix-doc-minor
  • fix-duration-display
  • fix-event-tz-pytz-update
  • fix-history-interest
  • fix-interest-view
  • fix-js
  • fix-pipeline
  • fix-plan-timezone-now
  • fix-room-add
  • fix-scheduling-drag
  • fix-slot-defaultlength
  • fix-timezone
  • fix-translation-scheduling
  • fix-virtual-room-admin
  • fix-wizard-csp
  • font-locally
  • improve-admin
  • improve-online
  • improve-slides
  • improve-submission-coupling
  • interest_restriction
  • main
  • master
  • meta-debug-toolbar
  • meta-export
  • meta-makemessages
  • meta-performance
  • meta-tests
  • meta-tests-gitlab-test
  • meta-upgrades
  • mollux-master-patch-02906
  • port-availabilites-fullcalendar
  • qs
  • remove-tags
  • renovate/configure
  • renovate/django-4.x
  • renovate/django-5.x
  • renovate/django-bootstrap-datepicker-plus-5.x
  • renovate/django-bootstrap5-23.x
  • renovate/django-bootstrap5-24.x
  • renovate/django-compressor-4.x
  • renovate/django-debug-toolbar-4.x
  • renovate/django-registration-redux-2.x
  • renovate/django-simple-history-3.x
  • renovate/django-split-settings-1.x
  • renovate/django-timezone-field-5.x
100 results

Target

Select target project
  • konstantin/akplanning
  • matedealer/akplanning
  • kif/akplanning
  • mirco/akplanning
  • lordofthevoid/akplanning
  • voidptr/akplanning
  • xayomer/akplanning-fork
  • mollux/akplanning
  • neumantm/akplanning
  • mmarx/akplanning
  • nerf/akplanning
  • felix_bonn/akplanning
  • sebastian.uschmann/akplanning
13 results
Select Git revision
  • komasolver
  • main
  • renovate/django-5.x
  • renovate/django-debug-toolbar-5.x
  • renovate/django_csp-4.x
  • renovate/djangorestframework-3.x
  • renovate/tzdata-2025.x
  • renovate/uwsgi-2.x
8 results
Show changes
Commits on Source (8)
...@@ -20,6 +20,10 @@ before_script: ...@@ -20,6 +20,10 @@ before_script:
- apt-get -qq install -y python3-virtualenv python3 python3-dev python3-pip gettext default-mysql-client default-libmysqlclient-dev - apt-get -qq install -y python3-virtualenv python3 python3-dev python3-pip gettext default-mysql-client default-libmysqlclient-dev
- export DJANGO_SETTINGS_MODULE=AKPlanning.settings_ci - export DJANGO_SETTINGS_MODULE=AKPlanning.settings_ci
- ./Utils/setup.sh --prod - ./Utils/setup.sh --prod
- mkdir -p public/badges public/lint
- echo undefined > public/badges/$CI_JOB_NAME.score
- source venv/bin/activate
- pip install pylint-gitlab pylint-django
- mysql --version - mysql --version
check: check:
...@@ -48,3 +52,32 @@ test: ...@@ -48,3 +52,32 @@ test:
coverage_format: cobertura coverage_format: cobertura
path: coverage.xml path: coverage.xml
junit: unit.xml junit: unit.xml
lint:
stage: test
script:
- pylint --load-plugins pylint_django --exit-zero --output-format=text $(find -type f -name "*.py" ! -path "**/venv/**") | tee /tmp/pylint.txt
- sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' /tmp/pylint.txt > public/badges/$CI_JOB_NAME.score
- pylint --load-plugins pylint_django --exit-zero --output-format=pylint_gitlab.GitlabCodeClimateReporter $(find -type f -name "*.py" ! -path "**/venv/**") > codeclimate.json
- pylint --load-plugins pylint_django --exit-zero --output-format=pylint_gitlab.GitlabPagesHtmlReporter $(find -type f -name "*.py" ! -path "**/venv/**") > public/lint/index.html
after_script:
- |
echo "Linting score: $(cat public/badges/$CI_JOB_NAME.score)"
artifacts:
paths:
- public
reports:
codequality: codeclimate.json
when: always
pages:
stage: deploy
image: alpine:latest
script:
- echo
artifacts:
paths:
- public
only:
refs:
- main
...@@ -4,6 +4,9 @@ from AKDashboard.models import DashboardButton ...@@ -4,6 +4,9 @@ from AKDashboard.models import DashboardButton
@admin.register(DashboardButton) @admin.register(DashboardButton)
class DashboardButtonAdmin(admin.ModelAdmin): class DashboardButtonAdmin(admin.ModelAdmin):
"""
Admin interface for dashboard buttons
"""
list_display = ['text', 'url', 'event'] list_display = ['text', 'url', 'event']
list_filter = ['event'] list_filter = ['event']
search_fields = ['text', 'url'] search_fields = ['text', 'url']
......
...@@ -2,4 +2,7 @@ from django.apps import AppConfig ...@@ -2,4 +2,7 @@ from django.apps import AppConfig
class AkdashboardConfig(AppConfig): class AkdashboardConfig(AppConfig):
"""
App configuration for dashboard (default)
"""
name = 'AKDashboard' name = 'AKDashboard'
...@@ -6,6 +6,17 @@ from AKModel.models import Event ...@@ -6,6 +6,17 @@ from AKModel.models import Event
class DashboardButton(models.Model): class DashboardButton(models.Model):
"""
Model for a single dashboard button
Allows to specify
* a text (currently without possibility to translate),
* a color (based on predefined design colors)
* a url the button should point to (internal or external)
* an icon (from the collection of fontawesome)
Each button is associated with a single event and will be deleted when the event is deleted.
"""
class Meta: class Meta:
verbose_name = _("Dashboard Button") verbose_name = _("Dashboard Button")
verbose_name_plural = _("Dashboard Buttons") verbose_name_plural = _("Dashboard Buttons")
......
from django.apps import apps from django.apps import apps
from django.urls import reverse_lazy
from django.utils.decorators import method_decorator from django.utils.decorators import method_decorator
from django.views.decorators.csrf import ensure_csrf_cookie from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.generic import TemplateView, DetailView from django.views.generic import TemplateView, DetailView
...@@ -10,6 +9,11 @@ from AKPlanning import settings ...@@ -10,6 +9,11 @@ from AKPlanning import settings
class DashboardView(TemplateView): class DashboardView(TemplateView):
"""
Index view of dashboard and therefore the main entry point for AKPlanning
Displays information and buttons for all public events
"""
template_name = 'AKDashboard/dashboard.html' template_name = 'AKDashboard/dashboard.html'
@method_decorator(ensure_csrf_cookie) @method_decorator(ensure_csrf_cookie)
...@@ -23,6 +27,14 @@ class DashboardView(TemplateView): ...@@ -23,6 +27,14 @@ class DashboardView(TemplateView):
class DashboardEventView(DetailView): class DashboardEventView(DetailView):
"""
Dashboard view for a single event
In addition to the basic information and the buttons,
an overview over recent events (new and changed AKs, moved AKSlots) for the given event is shown.
The event dashboard also exists for non-public events (one only needs to know the URL/slug of the event).
"""
template_name = 'AKDashboard/dashboard_event.html' template_name = 'AKDashboard/dashboard_event.html'
context_object_name = 'event' context_object_name = 'event'
model = Event model = Event
...@@ -32,11 +44,16 @@ class DashboardEventView(DetailView): ...@@ -32,11 +44,16 @@ class DashboardEventView(DetailView):
# Show feed of recent changes (if activated) # Show feed of recent changes (if activated)
if settings.DASHBOARD_SHOW_RECENT: if settings.DASHBOARD_SHOW_RECENT:
# Create a list of chronically sorted events (both AK and plan changes):
recent_changes = [] recent_changes = []
# Newest AKs # Newest AKs (if AKSubmission is used)
if apps.is_installed("AKSubmission"): if apps.is_installed("AKSubmission"):
submission_changes = AK.history.filter(event=context['event'])[:int(settings.DASHBOARD_RECENT_MAX)] # Get the latest x changes (if there are that many),
# where x corresponds to the entry threshold configured in the settings
# (such that the list will be completely filled even if there are no (newer) plan changes)
submission_changes = AK.history.filter(event=context['event'])[:int(settings.DASHBOARD_RECENT_MAX)] # pylint: disable=no-member, line-too-long
# Create textual representation including icons
for s in submission_changes: for s in submission_changes:
if s.history_type == '+': if s.history_type == '+':
text = _('New AK: %(ak)s.') % {'ak': s.name} text = _('New AK: %(ak)s.') % {'ak': s.name}
...@@ -48,18 +65,21 @@ class DashboardEventView(DetailView): ...@@ -48,18 +65,21 @@ class DashboardEventView(DetailView):
text = _('AK "%(ak)s" deleted.') % {'ak': s.name} text = _('AK "%(ak)s" deleted.') % {'ak': s.name}
icon = ('times', 'fas') icon = ('times', 'fas')
recent_changes.append({'icon': icon, 'text': text, 'link': s.instance.detail_url, 'timestamp': s.history_date}) # Store representation in change list (still unsorted)
recent_changes.append(
# Changes in plan {'icon': icon, 'text': text, 'link': s.instance.detail_url, 'timestamp': s.history_date}
if apps.is_installed("AKPlan"): )
if not context['event'].plan_hidden:
last_changed_slots = AKSlot.objects.select_related('ak').filter(event=context['event'], start__isnull=False).order_by('-updated')[ # Changes in plan (if AKPlan is used and plan is publicly visible)
:int(settings.DASHBOARD_RECENT_MAX)] if apps.is_installed("AKPlan") and not context['event'].plan_hidden:
for changed_slot in last_changed_slots: # Get the latest plan changes (again using a threshold, see above)
recent_changes.append({'icon': ('clock', 'far'), last_changed_slots = AKSlot.objects.select_related('ak').filter(event=context['event'], start__isnull=False).order_by('-updated')[:int(settings.DASHBOARD_RECENT_MAX)] #pylint: disable=line-too-long
'text': _('AK "%(ak)s" (re-)scheduled.') % {'ak': changed_slot.ak.name}, for changed_slot in last_changed_slots:
'link': changed_slot.ak.detail_url, # Create textual representation including icons and links and store in list (still unsorted)
'timestamp': changed_slot.updated}) recent_changes.append({'icon': ('clock', 'far'),
'text': _('AK "%(ak)s" (re-)scheduled.') % {'ak': changed_slot.ak.name},
'link': changed_slot.ak.detail_url,
'timestamp': changed_slot.updated})
# Sort by change date... # Sort by change date...
recent_changes.sort(key=lambda x: x['timestamp'], reverse=True) recent_changes.sort(key=lambda x: x['timestamp'], reverse=True)
......
[MAIN]
ignore=tests.py, urls.py, migrations
load-plugins=
pylint_django,
pylint_django.checkers.migrations
django-settings-module=AKPlanning.settings
disable=
C0114, # missing-module-docstring
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=120
indent-string=' '
[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines=6
# Ignore comments when computing similarities.
ignore-comments=yes
# Ignore docstrings when computing similarities.
ignore-docstrings=yes
# Ignore imports when computing similarities.
ignore-imports=yes
# Signatures are removed from the similarity computation
ignore-signatures=yes
[BASIC]
# Regular expression matching correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+)|(AK[A-Z][a-z0-9_]+))$
# Good variable names which should always be accepted, separated by a comma
good-names=i,j,k,a,e,ak,tz,_
# Allow single-letter variables and enforce lowercase variables with underscores otherwise
variable-rgx=[a-z_][a-z0-9_]{0,30}$
[TYPECHECK]
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set).
ignored-classes=SQLObject,WSGIRequest
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed.
generated-members=objects,DoesNotExist,id,pk,_meta,base_fields,context
# List of method names used to declare (i.e. assign) instance attributes
defining-attr-methods=__init__,__new__,setUp