diff options
Diffstat (limited to '')
-rw-r--r-- | config.go | 3 | ||||
-rw-r--r-- | docs/cca.scfg.example | 4 | ||||
-rw-r--r-- | index.go | 3 | ||||
-rw-r--r-- | static/style.css | 15 | ||||
-rw-r--r-- | tmpl/index.html | 3 | ||||
-rw-r--r-- | tmpl/index_login.html | 3 |
6 files changed, 17 insertions, 14 deletions
@@ -41,6 +41,7 @@ var configWithPointers struct { Prod *bool `scfg:"prod"` Tmpl *string `scfg:"tmpl"` Static *bool `scfg:"static"` + Source *string `scfg:"source"` Listen struct { Proto *string `scfg:"proto"` Net *string `scfg:"net"` @@ -71,6 +72,7 @@ var config struct { Prod bool Tmpl string Static bool + Source string Listen struct { Proto string Net string @@ -111,6 +113,7 @@ func fetchConfig(path string) error { config.Prod = *(configWithPointers.Prod) config.Tmpl = *(configWithPointers.Tmpl) config.Static = *(configWithPointers.Static) + config.Source = *(configWithPointers.Source) config.Listen.Proto = *(configWithPointers.Listen.Proto) config.Listen.Net = *(configWithPointers.Listen.Net) config.Listen.Addr = *(configWithPointers.Listen.Addr) diff --git a/docs/cca.scfg.example b/docs/cca.scfg.example index 8117e57..02224b3 100644 --- a/docs/cca.scfg.example +++ b/docs/cca.scfg.example @@ -19,6 +19,10 @@ tmpl tmpl/* # directory. static true +# Where could the source code of this instance be found? It is important to +# keep this up to date to comply with the AGPL. +source https://git.sr.ht/~runxiyu/cca + listen { # Which protocol are we listening for? This may be set to "http" for # plain HTTP, or "fcgi" for FastCGI. FastCGI is recommended for most @@ -46,6 +46,7 @@ func handleIndex(w http.ResponseWriter, req *http.Request) { "index_login", map[string]string{ "authURL": authURL, + "source": config.Source, /* * We directly generate the login URL here * instead of doing so in a redirect to save @@ -82,6 +83,7 @@ func handleIndex(w http.ResponseWriter, req *http.Request) { map[string]interface{}{ "authURL": authURL, "notes": "You sent an invalid session cookie.", + "source": config.Source, }, ) if err != nil { @@ -104,6 +106,7 @@ func handleIndex(w http.ResponseWriter, req *http.Request) { "Department": userDepartment, }, "courses": courses, + "source": config.Source, }, ) if err != nil { diff --git a/static/style.css b/static/style.css index 5ffae4c..16a2072 100644 --- a/static/style.css +++ b/static/style.css @@ -55,7 +55,7 @@ body { padding: 0; } -main, body > section, .reading-width { +main, body > section, .reading-width, footer { margin: 1rem auto; padding-left: 1rem; padding-right: 1rem; @@ -146,19 +146,6 @@ header h1 { } /* - * I would like a footer that sticks to the bottom if the page is too short, - * but that seems difficult to implement. - */ -footer { - padding-left: 1rem; - padding-right: 1rem; -} -footer p { - margin-top: 0rem; - margin-bottom: 1ex; -} - -/* * The table, the most important element in my site design... */ table { diff --git a/tmpl/index.html b/tmpl/index.html index d55c929..6f22fd0 100644 --- a/tmpl/index.html +++ b/tmpl/index.html @@ -140,6 +140,9 @@ --> </div> </div> + <footer> + CCA Selection System, licensed under the GNU Affero General Public License, version 3.0 or any later version. Source code available at <a href="{{.source}}"><code>{{.source}}</code></a>. + </footer> <script src="static/main.js"></script> <script> document.addEventListener("DOMContentLoaded", () => { diff --git a/tmpl/index_login.html b/tmpl/index_login.html index d1846f7..55aeadc 100644 --- a/tmpl/index_login.html +++ b/tmpl/index_login.html @@ -79,6 +79,9 @@ </form> </div> </main> + <footer> + CCA Selection System, licensed under the GNU Affero General Public License, version 3.0 or any later version. Source code available at <a href="{{.source}}"><code>{{.source}}</code></a>. + </footer> </body> </html> {{- end -}} |