* pkg/context: Render live notice banner from file
- Contexter checks if there is a file called 'notice' under the
GOGS_CUSTOM directory and loads it.
- The first line is treated as a header/title and everything else as the
message body.
- Message body is rendered as HTML (tags allowed).
- File size is limited to 1024 bytes.
- File mime type must be text.
- Notice is rendered in head.tmpl for all pages.
* pkg/context: Rename maxlen to maxSize
Rename maxlen to maxSize for the maximum size (in bytes) of the notice
file to render.
Define the variable when needed to avoid instantiating it when the file
doesn't exist.
Co-Authored-By: ᴊ. ᴄʜᴇɴ <u@gogs.io>
* pkg/context: Package name after license header
Co-Authored-By: ᴊ. ᴄʜᴇɴ <u@gogs.io>
* pkg/context: Don't print 'Found notice file'
Becomes too verbose as it prints on every page load when the file
exists.
* pkg/context: Match project conventions
Import order and grouping
Variable names:
fileloc -> fpath
fp -> f
finfo -> fi
* pkg/context: Remove empty line
Co-Authored-By: ᴊ. ᴄʜᴇɴ <u@gogs.io>
* pkg/context: Render notice as markdown
Server notice file should be named 'notice.md'. The contents of the
file are treated as markdown and rendered as a warning message at the
top of every page.
* Update notice.go
Co-authored-by: ᴊ. ᴄʜᴇɴ <u@gogs.io>
* Update repository description field to contain more than 256 symbols
- update repository model - description field now is `TEXT` and limited by 4000 symbols
- new migration
- add description to html forms - repo creation and repo settings
- add translation for description
* Update for description field, new features
- add autosize (height) for description textarea, new plugin
- set max description length to 512 symbols
- update locales
* Fix migration - typo in var
* Update repo description behaviour
- add textarea autosize for /repo/create
- add symbols counter under description testarea (create/edit)
* Fix function definition - it a var
* Revert ru-RU locale
* Update by review
- Use type `varchar(512)` in migration
- Remove unused files from autosize plugin
* Fix migration - new project paths
* Fixes after review 2
- copyright year
- format includes
- use switch instead of multi-if
* Remove unused `default:` option.
This is an attempt to fix#3089 following the strategy introduced
in d625e41c6c, although that strategy
by itself does not seem to be sufficient.
What needs be done is honouring the redirect_url query parameter
from the auth router.
* Add and start jQuery AreYouSure
* Update SimpleMDE to 1.10.1 for `forceSync` support
* Forgot to remove old version SimpleMDE 1.10.0
* formatting -.-
Set the description meta tag correctly when there is no repo
description. Also use the ability to trim trailing whitespaces,
to make the template cleaner.
This commit improves templates readability, since all of them use consistent
indent with all template command blocks indented too.
1. Indents both HTML containers such as <div>, <p> and Go HTML template blocks
such as {{if}} {{with}}
2. Cleans all trailing white-space
3. Adds trailing last line-break to each file