Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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-Core
Commits
662f796e
Commit
662f796e
authored
3 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Plain Diff
Merge branch '581-icons-logo-should-be-uploaded-to-public' into 'master'
Resolve "Icons/logo should be uploaded to public/" Closes
#581
See merge request
!837
parents
a78893d6
6fee1cf3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!837
Resolve "Icons/logo should be uploaded to public/"
Pipeline
#46267
passed with warnings
3 years ago
Stage: test
Stage: build
Stage: publish
Stage: docker
Stage: deploy
Pipeline: AlekSIS
#46308
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.rst
+1
-0
1 addition, 0 deletions
CHANGELOG.rst
aleksis/core/mixins.py
+14
-0
14 additions, 0 deletions
aleksis/core/mixins.py
aleksis/core/preferences.py
+4
-3
4 additions, 3 deletions
aleksis/core/preferences.py
with
19 additions
and
3 deletions
CHANGELOG.rst
+
1
−
0
View file @
662f796e
...
@@ -19,6 +19,7 @@ Fixed
...
@@ -19,6 +19,7 @@ Fixed
* Correctly update theme colours on change again
* Correctly update theme colours on change again
* Imprint is now called "Imprint" and not "Impress".
* Imprint is now called "Imprint" and not "Impress".
* Logo files weren't uploaded to public namespace.
`2.3.1`_ – 2021-12-17
`2.3.1`_ – 2021-12-17
---------------------
---------------------
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/mixins.py
+
14
−
0
View file @
662f796e
# flake8: noqa: DJ12
# flake8: noqa: DJ12
import
os
from
datetime
import
datetime
from
datetime
import
datetime
from
typing
import
Any
,
Callable
,
List
,
Optional
,
Union
from
typing
import
Any
,
Callable
,
List
,
Optional
,
Union
...
@@ -21,6 +22,8 @@ from django.views.generic import CreateView, UpdateView
...
@@ -21,6 +22,8 @@ from django.views.generic import CreateView, UpdateView
from
django.views.generic.edit
import
DeleteView
,
ModelFormMixin
from
django.views.generic.edit
import
DeleteView
,
ModelFormMixin
import
reversion
import
reversion
from
dynamic_preferences.settings
import
preferences_settings
from
dynamic_preferences.types
import
FilePreference
from
guardian.admin
import
GuardedModelAdmin
from
guardian.admin
import
GuardedModelAdmin
from
guardian.core
import
ObjectPermissionChecker
from
guardian.core
import
ObjectPermissionChecker
from
jsonstore.fields
import
IntegerField
,
JSONFieldMixin
from
jsonstore.fields
import
IntegerField
,
JSONFieldMixin
...
@@ -529,3 +532,14 @@ class SchoolTermRelatedExtensibleForm(ExtensibleForm):
...
@@ -529,3 +532,14 @@ class SchoolTermRelatedExtensibleForm(ExtensibleForm):
kwargs
[
"
initial
"
]
=
{
"
school_term
"
:
SchoolTerm
.
current
}
kwargs
[
"
initial
"
]
=
{
"
school_term
"
:
SchoolTerm
.
current
}
super
().
__init__
(
*
args
,
**
kwargs
)
super
().
__init__
(
*
args
,
**
kwargs
)
class
PublicFilePreferenceMixin
(
FilePreference
):
"""
Uploads a file to the public namespace.
"""
upload_path
=
"
public
"
def
get_upload_path
(
self
):
return
os
.
path
.
join
(
self
.
upload_path
,
preferences_settings
.
FILE_PREFERENCE_UPLOAD_DIR
,
self
.
identifier
()
)
This diff is collapsed.
Click to expand it.
aleksis/core/preferences.py
+
4
−
3
View file @
662f796e
...
@@ -16,6 +16,7 @@ from dynamic_preferences.types import (
...
@@ -16,6 +16,7 @@ from dynamic_preferences.types import (
)
)
from
oauth2_provider.models
import
AbstractApplication
from
oauth2_provider.models
import
AbstractApplication
from
.mixins
import
PublicFilePreferenceMixin
from
.models
import
Group
,
Person
from
.models
import
Group
,
Person
from
.registries
import
person_preferences_registry
,
site_preferences_registry
from
.registries
import
person_preferences_registry
,
site_preferences_registry
from
.util.notifications
import
get_notification_choices_lazy
from
.util.notifications
import
get_notification_choices_lazy
...
@@ -78,7 +79,7 @@ class ColourSecondary(StringPreference):
...
@@ -78,7 +79,7 @@ class ColourSecondary(StringPreference):
@site_preferences_registry.register
@site_preferences_registry.register
class
Logo
(
FilePreference
):
class
Logo
(
PublicFilePreferenceMixin
,
FilePreference
):
"""
Logo of your AlekSIS instance.
"""
"""
Logo of your AlekSIS instance.
"""
section
=
theme
section
=
theme
...
@@ -88,7 +89,7 @@ class Logo(FilePreference):
...
@@ -88,7 +89,7 @@ class Logo(FilePreference):
@site_preferences_registry.register
@site_preferences_registry.register
class
Favicon
(
FilePreference
):
class
Favicon
(
PublicFilePreferenceMixin
,
FilePreference
):
"""
Favicon of your AlekSIS instance.
"""
"""
Favicon of your AlekSIS instance.
"""
section
=
theme
section
=
theme
...
@@ -98,7 +99,7 @@ class Favicon(FilePreference):
...
@@ -98,7 +99,7 @@ class Favicon(FilePreference):
@site_preferences_registry.register
@site_preferences_registry.register
class
PWAIcon
(
FilePreference
):
class
PWAIcon
(
PublicFilePreferenceMixin
,
FilePreference
):
"""
PWA-Icon of your AlekSIS instance.
"""
"""
PWA-Icon of your AlekSIS instance.
"""
section
=
theme
section
=
theme
...
...
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