diff --git a/tildes/scss/modules/_site-footer.scss b/tildes/scss/modules/_site-footer.scss index d9c6924..a421d06 100644 --- a/tildes/scss/modules/_site-footer.scss +++ b/tildes/scss/modules/_site-footer.scss @@ -37,3 +37,15 @@ margin-left: 1rem; } } + +.site-footer-theme-selection { + font-style: normal; + margin-bottom: 1rem; + + select { + width: auto; + font-size: 0.6rem; + height: 1.4rem; + padding: 0 0 0 0.2rem; + } +} diff --git a/tildes/scss/themes/_theme_base.scss b/tildes/scss/themes/_theme_base.scss index 2ea6f7e..3095190 100644 --- a/tildes/scss/themes/_theme_base.scss +++ b/tildes/scss/themes/_theme_base.scss @@ -61,12 +61,6 @@ } } - a.logged-in-user-username:visited, - a.site-header-context:visited, - a.site-header-logo:visited { - color: unset; - } - @include syntax-highlighting($is-light); blockquote { @@ -299,7 +293,7 @@ @include theme-special-label(map-get($theme, "topic-tag-spoiler"), $is-light); } - .logged-in-user-username { + .logged-in-user-username, .logged-in-user-username:visited { color: map-get($theme, "foreground-primary"); } @@ -346,12 +340,11 @@ background-color: map-get($theme, "background-primary"); } - .site-header-context, - .site-header-username { + .site-header-context, .site-header-context:visited { color: map-get($theme, "foreground-primary"); } - .site-header-logo { + .site-header-logo, .site-header-logo:visited { color: map-get($theme, "foreground-highlight"); } diff --git a/tildes/tildes/auth.py b/tildes/tildes/auth.py index 226c2e2..e5d4766 100644 --- a/tildes/tildes/auth.py +++ b/tildes/tildes/auth.py @@ -10,7 +10,7 @@ from pyramid.authorization import ACLAuthorizationPolicy from pyramid.config import Configurator from pyramid.httpexceptions import HTTPFound from pyramid.request import Request -from pyramid.security import ACLDenied, ACLPermitsResult, Allow, Authenticated, Everyone +from pyramid.security import Allow, Everyone from tildes.models.user import User @@ -72,11 +72,7 @@ def includeme(config: Configurator) -> None: # default permission config.set_root_factory(DefaultRootFactory) - # Set the authorization policy to a custom one that always returns a "denied" result - # if the user isn't logged in. When overall site access is no longer being - # restricted, the AuthorizedOnlyPolicy class can just be replaced with the standard - # ACLAuthorizationPolicy - config.set_authorization_policy(AuthorizedOnlyPolicy()) + config.set_authorization_policy(ACLAuthorizationPolicy()) config.set_authentication_policy( SessionAuthenticationPolicy(callback=auth_callback) @@ -92,25 +88,6 @@ def includeme(config: Configurator) -> None: config.add_request_method(has_any_permission, "has_any_permission") -class AuthorizedOnlyPolicy(ACLAuthorizationPolicy): - """ACLAuthorizationPolicy override that always denies logged-out users.""" - - def permits( - self, context: Any, principals: Sequence[Any], permission: str - ) -> ACLPermitsResult: - """Deny logged-out users, otherwise pass up to normal policy.""" - if Authenticated not in principals: - return ACLDenied( - "", - "", - permission, - principals, - context, - ) - - return super().permits(context, principals, permission) - - def has_any_permission( request: Request, permissions: Sequence[str], context: Any ) -> bool: diff --git a/tildes/tildes/templates/base.jinja2 b/tildes/tildes/templates/base.jinja2 index f947771..22d16a5 100644 --- a/tildes/tildes/templates/base.jinja2 +++ b/tildes/tildes/templates/base.jinja2 @@ -90,6 +90,26 @@