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

Templates for extra links in top navbar and repo tool tabs. #3308

Merged
merged 7 commits into from
Jan 10, 2018

Conversation

AlbertoGP
Copy link
Contributor

These templates add content to the top navbar and to the repository page.
This way we do not have to copy and modify the whole template, and re-modify it after upgrading Gitea if
it changes.

I'll put a comment with more details under "Custom tabs for projects in web ui #1199".

This fixes "Custom tabs for projects in web ui #1199", and the intention of "Custom Routing / new Pages?! #2115" (but without routing changes).

@codecov-io
Copy link

codecov-io commented Jan 5, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@88a3bb6). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #3308   +/-   ##
=========================================
  Coverage          ?   35.03%           
=========================================
  Files             ?      280           
  Lines             ?    40559           
  Branches          ?        0           
=========================================
  Hits              ?    14211           
  Misses            ?    24242           
  Partials          ?     2106

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 88a3bb6...2a0f297. Read the comment docs.

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 5, 2018
@lafriks
Copy link
Member

lafriks commented Jan 6, 2018

Please place them under custom folder

@AlbertoGP
Copy link
Contributor Author

Sure, no problem. Is it fine if the tmpl files do not exist by default?

Please note that both "extra_tabs.tmpl" files are just placeholders, with their content commented out so they have no effect. The real ones go indeed into "custom/templates/".

@lafriks
Copy link
Member

lafriks commented Jan 6, 2018

I think at least empty files must exist

@AlbertoGP
Copy link
Contributor Author

All right, I've made both .tmpl files empty.

Copy link
Member

@techknowlogick techknowlogick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlbertoGP I think @lafriks meant for you to put templates in the custom folder in the templates dir (so custom/templates/custom). The templates shouldn't go into base folder.

See #3051 as an example of how this has been done already. Also you can see #3286

@AlbertoGP
Copy link
Contributor Author

Oh, I see now, thanks!
I'll put them in "templates/custom/", which also means they need different file names.

@AlbertoGP AlbertoGP force-pushed the master branch 2 times, most recently from c833f07 to 71522ae Compare January 7, 2018 09:53
@lafriks
Copy link
Member

lafriks commented Jan 7, 2018

Could you also add info about this in gitea customization docs?

@AlbertoGP
Copy link
Contributor Author

AlbertoGP commented Jan 7, 2018

Yes, of course: I tried doing that, but got blocked by "Documentation build: Partial "header.html" not found #3306".
I found a solution for that one, but to make it into a different pull request I need to move this one to another branch, which I'm doing right now.
Edit: no need to change this PR to another branch after all.

@thehowl
Copy link
Contributor

thehowl commented Jan 7, 2018

CI fail seems to be unrelated. LGTM

@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 7, 2018
@AlbertoGP AlbertoGP force-pushed the master branch 2 times, most recently from 9a170f1 to a9c3650 Compare January 7, 2018 15:55
@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 7, 2018
@@ -51,6 +51,8 @@ Any statement contained inside `{{` and `}}` are Gitea templete's syntax and sho

To add in custom HTML to the header or the footer of the page, in the `templates/custom` directory there are `header.tmpl` and `footer.tmpl` that can be modified. This is useful if you want to add in custom CSS files, or additional Javascript.

If all you want is to add extra links to the top navigation bar, or extra tabs to the repository view, you can put them in `templates/custom/extra_links.tmpl` and `templates/custom/extra_tabs.tmpl` inside your `custom/` directory.
Copy link
Member

@lafriks lafriks Jan 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change to:
you can put them in extra_links.tmpl and extra_tabs.tmpl inside your templates/custom directory

These templates add content to the top navbar
and to the repository page.
This way we do not have to copy and modify the whole
template, and re-modify it after upgrading Gitea if
it changes.

Signed-off-by: Alberto González Palomo <bugs@sentido-labs.com>
@lafriks lafriks added the type/enhancement An improvement of existing functionality label Jan 8, 2018
@lafriks lafriks added this to the 1.4.0 milestone Jan 8, 2018
@lafriks
Copy link
Member

lafriks commented Jan 8, 2018

@techknowlogick needs your approval

@techknowlogick
Copy link
Member

@lafriks thanks for the ping. approved.

@lafriks lafriks merged commit 45c264f into go-gitea:master Jan 10, 2018
@AlbertoGP AlbertoGP mentioned this pull request Jan 10, 2018
7 tasks
@lafriks lafriks mentioned this pull request Jan 23, 2018
6 tasks
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants