Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Resint
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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-Resint
Commits
1725a1e9
Verified
Commit
1725a1e9
authored
2 years ago
by
magicfelix
Browse files
Options
Downloads
Patches
Plain Diff
Reformat
parent
c1ca2d93
No related branches found
No related tags found
1 merge request
!56
Release 3.0b0
Pipeline
#113352
passed with warnings
2 years ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/resint/models.py
+15
-16
15 additions, 16 deletions
aleksis/apps/resint/models.py
aleksis/apps/resint/rules.py
+1
-2
1 addition, 2 deletions
aleksis/apps/resint/rules.py
with
16 additions
and
18 deletions
aleksis/apps/resint/models.py
+
15
−
16
View file @
1725a1e9
...
...
@@ -28,29 +28,29 @@ class PosterGroupDynamicRoute(DynamicRoute):
dynamic_routes
=
[]
for
poster_group
in
poster_groups
:
dynamic_routes
.
append
(
cls
.
get_route_data
(
poster_group
))
dynamic_routes
.
append
(
cls
.
get_route_data
(
poster_group
))
return
dynamic_routes
@classmethod
def
get_route_data
(
cls
,
instance
):
dynamic_route
=
{}
dynamic_route
=
{}
dynamic_route
[
"
parent_route_name
"
]
=
""
dynamic_route
[
"
parent_route_name
"
]
=
""
dynamic_route
[
"
route_path
"
]
=
reverse
(
"
poster_show_current
"
,
args
=
[
instance
.
slug
])
dynamic_route
[
"
route_name
"
]
=
f
"
resint.posterGroup.
{
instance
.
slug
}
"
dynamic_route
[
"
route_path
"
]
=
reverse
(
"
poster_show_current
"
,
args
=
[
instance
.
slug
])
dynamic_route
[
"
route_name
"
]
=
f
"
resint.posterGroup.
{
instance
.
slug
}
"
dynamic_route
[
"
display_account_menu
"
]
=
False
dynamic_route
[
"
display_sidenav_menu
"
]
=
instance
.
show_in_menu
dynamic_route
[
"
menu_new_tab
"
]
=
True
dynamic_route
[
"
display_account_menu
"
]
=
False
dynamic_route
[
"
display_sidenav_menu
"
]
=
instance
.
show_in_menu
dynamic_route
[
"
menu_new_tab
"
]
=
True
dynamic_route
[
"
menu_title
"
]
=
instance
.
name
dynamic_route
[
"
menu_icon
"
]
=
"
mdi-file-pdf-box
"
dynamic_route
[
"
menu_title
"
]
=
instance
.
name
dynamic_route
[
"
menu_icon
"
]
=
"
mdi-file-pdf-box
"
dynamic_route
[
"
route_permission
"
]
=
""
if
instance
.
public
else
"
resint.view_poster_pdf_menu
"
dynamic_route
[
"
route_permission
"
]
=
""
if
instance
.
public
else
"
resint.view_poster_pdf_menu
"
return
dynamic_route
return
dynamic_route
class
PosterGroup
(
ExtensibleModel
):
...
...
@@ -58,7 +58,7 @@ class PosterGroup(ExtensibleModel):
slug
=
models
.
SlugField
(
verbose_name
=
_
(
"
Slug used in URL name
"
),
help_text
=
_
(
"
If you use
'
example
'
, the filename will be
'
example.pdf
'
.
"
)
help_text
=
_
(
"
If you use
'
example
'
, the filename will be
'
example.pdf
'
.
"
)
,
)
name
=
models
.
CharField
(
max_length
=
255
,
verbose_name
=
_
(
"
Name
"
))
publishing_day
=
models
.
PositiveSmallIntegerField
(
...
...
@@ -79,8 +79,8 @@ class PosterGroup(ExtensibleModel):
verbose_name
=
_
(
"
Poster group
"
)
verbose_name_plural
=
_
(
"
Poster groups
"
)
constraints
=
[
models
.
UniqueConstraint
(
fields
=
[
"
site_id
"
,
"
name
"
],
name
=
"
unique_site_name
"
),
models
.
UniqueConstraint
(
fields
=
[
"
site_id
"
,
"
slug
"
],
name
=
"
unique_site_slug
"
),
models
.
UniqueConstraint
(
fields
=
[
"
site_id
"
,
"
name
"
],
name
=
"
unique_site_name
"
),
models
.
UniqueConstraint
(
fields
=
[
"
site_id
"
,
"
slug
"
],
name
=
"
unique_site_slug
"
),
]
permissions
=
[
(
"
view_poster_of_group
"
,
_
(
"
Can view all posters of this group
"
)),
...
...
@@ -92,7 +92,6 @@ class PosterGroup(ExtensibleModel):
def
__str__
(
self
)
->
str
:
return
f
"
{
self
.
name
}
(
{
self
.
publishing_day_name
}
,
{
self
.
publishing_time
}
)
"
@property
def
publishing_day_name
(
self
)
->
str
:
"""
Return the full name of the publishing day (e. g. Monday).
"""
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/resint/rules.py
+
1
−
2
View file @
1725a1e9
...
...
@@ -104,8 +104,7 @@ add_perm("resint.view_poster_pdf", view_poster_pdf_predicate)
# View poster PDF file in menu
view_poster_pdf_menu_predicate
=
has_person
&
(
has_global_perm
(
"
resint.view_postergroup
"
)
|
has_global_perm
(
"
resint.view_poster
"
)
has_global_perm
(
"
resint.view_postergroup
"
)
|
has_global_perm
(
"
resint.view_poster
"
)
)
add_perm
(
"
resint.view_poster_pdf_menu
"
,
view_poster_pdf_menu_predicate
)
...
...
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