Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature suggestion: default custom template for dashboard info display #10870

Closed
2 of 7 tasks
nergdron opened this issue Mar 28, 2020 · 5 comments · Fixed by #10885
Closed
2 of 7 tasks

feature suggestion: default custom template for dashboard info display #10870

nergdron opened this issue Mar 28, 2020 · 5 comments · Fixed by #10885
Labels
topic/ui Change the appearance of the Gitea UI type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@nergdron
Copy link

  • Gitea version (or commit ref): gitea docker image (00ca50a67b9a)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

loving gitea so far, very happy to be switching over to it from commercial hosting. something I'd like to see is a default custom template which gets loaded into the user's dashboard view by the default templates, like extra_links.tmpl or similar. I'd use it for displaying things like system info and help, other integrated js features, or just a fun graphic for users. would really help me expose the customizations (like mermaid) that I've done to the server so users are aware of them.

adding it to the upstream template would be good because then I'm not copying the whole dashboard.tmpl and editing it, which could cause me to lose upstream changes to that template as you guys do further development. I'd rather have a location on that page I can just update independently and know it'll always show up on the dashboard, but I'll still get other upstream improvements.

I was thinking a good location would be under the right repo / org bar, as that typically has lots of free space vs the history list on the left.

Screenshots

gitea-template

@guillep2k guillep2k added type/proposal The new feature has not been accepted yet but needs to be discussed first. topic/ui Change the appearance of the Gitea UI labels Mar 29, 2020
@guillep2k
Copy link
Member

We could add some empty templates in some specific pages, like dashboard, new issue/PR, etc. for this kind of job. Also a good place to do that would be in mail footers. I don't think that would add too much overhead; IIRC templates are loaded on startup, even the custom ones.

@nergdron
Copy link
Author

yeah, I've had to restart gitea every time I change templates, so I'm under that impression as well. and I love the idea of having a dedicated info space on every major page we can adjust with a builtin custom template. more places to easily customize without having to track the upstream templates is better! :)

@mrsdizzie
Copy link
Member

IMO it would be better to fully enclose all the current sections of the dashboard in their own templates so people can easily create their own dashboard template without falling behind important upstream changes (So think of it like having blocks you can build with)

So you'd be able to create your own dashboard page easily like

<template/navbar>
<template/heatmap>
<template/feed>
<template/repos>
<template/customsection>

And not really fall behind upstream because any important changes would take place within those template files.

It is actually already about 50% like this, with navbar and feeds being in their own file. If Heatmap and repo list moved into their own file it could probably easily work that way.

This would fix the issue of templates being annoying to use because they fall out of sync/don't get updates and also provide more flexibility because you could easily arrange a dashboard page any way you want, add multiple sections, etc..

@nergdron
Copy link
Author

@mrsdizzie love it, even better!

mrsdizzie added a commit to mrsdizzie/gitea that referenced this issue Mar 30, 2020
No code change just Move Heatmap and Repo list/search into separate
template files (like feeds and navbar already are). This will let a
user more easily replace dashboard.tmpl without regularly becoming
out of sync with fixes or changes to the actual code.

Fixes go-gitea#10870
guillep2k pushed a commit that referenced this issue Mar 30, 2020
* Split dashboard elements into separate template files

No code change just Move Heatmap and Repo list/search into separate
template files (like feeds and navbar already are). This will let a
user more easily replace dashboard.tmpl without regularly becoming
out of sync with fixes or changes to the actual code.

Fixes #10870

* End file with an empty line

Co-authored-by: zeripath <[email protected]>
@guillep2k
Copy link
Member

@nergdron if you set RUN_MODE = dev in app.ini, Gitea will detect changes in the file-system under public/, custom/ and/or static/ if you use any of them (which of course will be a little slower, but handy for testing templates and such). And you can compile Gitea without the bindata flag to force it to look for all the templates and files in the file-system under /static instead of having them embedded.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/ui Change the appearance of the Gitea UI type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants