Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Chronos
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Chronos
Commits
d804aa9b
Commit
d804aa9b
authored
5 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Add row_attr helper to highlight lessons with subsitutions. Advances
#19
,
#12
.
parent
cb454a99
Loading
Loading
1 merge request
!9
WIP: Add way to edit substitution
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
biscuit/apps/chronos/tables.py
+11
-0
11 additions, 0 deletions
biscuit/apps/chronos/tables.py
with
11 additions
and
0 deletions
biscuit/apps/chronos/tables.py
+
11
−
0
View file @
d804aa9b
...
@@ -2,6 +2,14 @@ from django.utils.translation import ugettext_lazy as _
...
@@ -2,6 +2,14 @@ from django.utils.translation import ugettext_lazy as _
import
django_tables2
as
tables
import
django_tables2
as
tables
from
django_tables2.utils
import
A
from
django_tables2.utils
import
A
def
_css_class_from_lesson_state
(
record
:
Optional
[
LessonPeriod
]
=
None
,
table
:
Optional
[
LessonTable
]
=
None
)
->
str
:
if
record
.
get_substitution
(
table
.
_week
):
return
'
table-warning
'
else
:
return
''
class
LessonsTable
(
tables
.
Table
):
class
LessonsTable
(
tables
.
Table
):
class
Meta
:
class
Meta
:
attrs
=
{
'
class
'
:
'
table table-striped table-bordered table-hover table-responsive-xl
'
}
attrs
=
{
'
class
'
:
'
table table-striped table-bordered table-hover table-responsive-xl
'
}
...
@@ -15,3 +23,6 @@ class LessonsTable(tables.Table):
...
@@ -15,3 +23,6 @@ class LessonsTable(tables.Table):
def
__init__
(
self
,
week
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
week
,
*
args
,
**
kwargs
):
self
.
_week
=
week
self
.
_week
=
week
super
().
__init__
(
*
args
,
**
kwargs
)
super
().
__init__
(
*
args
,
**
kwargs
)
class
Meta
:
row_attrs
=
{
'
class
'
:
_css_class_from_lesson_state
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment