diff --git a/README.md b/README.md index a911135..d115e62 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,13 @@ the token and adds a record to the Gonito database. You can simulate a front-end by going to `/static/test-gonito-as-backend.html`. +### Menuless mode + +If you want to combine an external front-end with some features of the +Gonito native front-end, you can run Gonito in a _menuless_ mode +setting `MENULESS` to `true`. This way, you will not show all the +functions of native Gonito. + Gonito & git ------------ diff --git a/Settings.hs b/Settings.hs index 75bee20..c9908c8 100644 --- a/Settings.hs +++ b/Settings.hs @@ -115,6 +115,11 @@ data AppSettings = AppSettings -- The team for which the user is the captain -- will be preferred , appAutoTeam :: Bool + + -- ^ Do not show the menu + -- (Unless the user is an admin). Can be used to combine Gonito + -- with an external front-end. + , appMenuless :: Bool } instance FromJSON AppSettings where @@ -168,6 +173,8 @@ instance FromJSON AppSettings where appAutoTeam <- o .:? "auto-team" .!= False + appMenuless <- o .:? "menuless" .!= False + return AppSettings {..} -- just in case, not sure if needed diff --git a/config/settings.yml b/config/settings.yml index 1d7ed53..20992c7 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -16,6 +16,7 @@ leaderboard-style: "_env:LEADERBOARD_STYLE:by-submitter" announcement-hook: "_env:ANNOUNCEMENT_HOOK:" server-ssh-public-key: "_env:SERVER_SSH_PUBLIC_KEY:" is-public: "_env:IS_PUBLIC:true" +menuless: "_env:MENULESS:false" # How the output of asynchronous operations is presented # - with-plain-text - just plain text shown by the browser; diff --git a/docker-compose-simple.yml b/docker-compose-simple.yml index c3427a4..25f1125 100644 --- a/docker-compose-simple.yml +++ b/docker-compose-simple.yml @@ -17,6 +17,7 @@ services: - IS_PUBLIC=${GONITO_IS_PUBLIC:-true} - JSON_WEB_KEY=${JSON_WEB_KEY} - ANNOUNCEMENT_HOOK=${GONITO_ANNOUNCEMENT_HOOK} + - MENULESS=${GONITO_MENULESS} ports: - 3000:3000 volumes: diff --git a/docker-compose.yml b/docker-compose.yml index 10f6b50..bd000b9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,6 +30,7 @@ services: - AUTO_TEAM=${GONITO_AUTO_TEAM:-false} - TEAM_FIELD=$GONITO_TEAM_FIELD - ANNOUNCEMENT_HOOK=${GONITO_ANNOUNCEMENT_HOOK} + - MENULESS=${GONITO_MENULESS} expose: - "3000" volumes: diff --git a/sample.env b/sample.env index 44fa227..a342150 100644 --- a/sample.env +++ b/sample.env @@ -29,3 +29,6 @@ JSON_WEB_KEY={"kty":"RSA", "alg":"RS256", "use":"sig", "kid":"h01jmt_bD-1Di8i_GY # Announcements can be sent to Slack or Discord via a given web hook GONITO_ANNOUNCEMENT_HOOK=https://discord.com/api/webhooks/123456789/abcdefghijklmnopqrstuvwxz123456789 + +# Do not show the menu if set to true. Can be useful when combined with an external front-end. +GONITO_MENULESS=false diff --git a/templates/default-layout.hamlet b/templates/default-layout.hamlet index 86b0d95..a5e1a66 100644 --- a/templates/default-layout.hamlet +++ b/templates/default-layout.hamlet @@ -4,7 +4,9 @@
-