mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-05 09:52:49 +01:00
21a1d76911
### The CustomEvent prefix There was already `ce-quick-submit`, the `ce-` prefix seems better than `us-`. Rename the only `us-` prefixed `us-load-context-popup` to `ce-` prefixed. ### Styles and Attributes in Go HTML Template https://github.com/go-gitea/gitea/pull/21855#issuecomment-1429643073 Suggest to stick to `class="c1 {{if $var}}c2{{end}}"` The readability and maintainability should be applied to the code which is read by developers, but not for the generated outputs. The template code is the code for developers, while the generated HTML are only for browsers. The `class="c1 {{if $var}}c2{{end}}"` style is clearer for developers and more intuitive, and the generated HTML also makes browsers happy (a few spaces do not affect anything) Think about a more complex case: * `class="{{if $active}}active{{end}} menu item {{if $show}}show{{end}} {{if $warn}}warn{{end}}"` * --vs-- * `class="{{if $active}}active {{end}}menu item{{if $show}} show{{end}}{{if $warn}} warn{{end}}"` The first style make it clearer to see each CSS class name with its `{{if}}` block. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> |
||
---|---|---|
.. | ||
api-usage.en-us.md | ||
api-usage.zh-cn.md | ||
guidelines-backend.en-us.md | ||
guidelines-frontend.en-us.md | ||
guidelines-refactoring.en-us.md | ||
hacking-on-gitea.en-us.md | ||
hacking-on-gitea.zh-cn.md | ||
integrations.en-us.md | ||
integrations.zh-tw.md | ||
migrations.en-us.md | ||
migrations.zh-tw.md | ||
oauth2-provider.en-us.md | ||
oauth2-provider.zh-tw.md |