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

Display template path of current page in dev mode #18717

Merged
merged 4 commits into from
Feb 11, 2022

Conversation

lunny
Copy link
Member

@lunny lunny commented Feb 11, 2022

For developing, when a page has problem, we have to investigate which template is the page. Now the template path will be displayed in the footer nearby template load time if it's develop mode.

image

@lunny lunny added the type/enhancement An improvement of existing functionality label Feb 11, 2022
@lunny lunny added this to the 1.17.0 milestone Feb 11, 2022
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 11, 2022
@wxiaoguang
Copy link
Contributor

Maybe we can show all rendered template file paths in TRACE level. There are a lot of embedded templates, they can not be found by this PR's mechanism.

@lunny
Copy link
Member Author

lunny commented Feb 11, 2022

Maybe we can show all rendered template file paths in TRACE level. There are a lot of embedded templates, they can not be found by this PR's mechanism.

This will display the entry template path. Once you can open that file, you can find the embedded templates. I don't think it's meaningful to display them in trace log. You can always find them in the entry template as soon as you want.

If we really want to know that, we can reject some js or css code around the embbeded template to add some box lines and title in the pages to indicate which area is from which template.

@silverwind
Copy link
Member

silverwind commented Feb 11, 2022

Would suggest Template <name>: <time>.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Feb 11, 2022

Would suggest Template <name>: <time>.

Or maybe: Page: 279ms Template: 103ms(repo/home)

Either is fine to me.

@lunny lunny force-pushed the lunny/display_template_path_dev branch from 9943555 to 640f64e Compare February 11, 2022 14:22
@lunny
Copy link
Member Author

lunny commented Feb 11, 2022

@wxiaoguang I changed the name and for the position I followed @silverwind's advice because templatename maybe blank. and : is one char but () are two. :)

@GiteaBot GiteaBot 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 Feb 11, 2022
@GiteaBot GiteaBot 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 Feb 11, 2022
Co-authored-by: silverwind <me@silverwind.io>
@lunny lunny merged commit e068899 into go-gitea:main Feb 11, 2022
@lunny lunny deleted the lunny/display_template_path_dev branch February 11, 2022 17:08
zjjhot added a commit to zjjhot/gitea that referenced this pull request Feb 12, 2022
* giteaofficial/main:
  Send mail to issue/pr assignee/reviewer also when OnMention is set (go-gitea#18707)
  Reduce CI go module downloads, add make targets (go-gitea#18708)
  Add number in queue status to monitor page (go-gitea#18712)
  Fix source code line highlighting (go-gitea#18729)
  Fix forked repositories missed tags (go-gitea#18719)
  [skip ci] Updated translations via Crowdin
  Fix release typo (go-gitea#18728)
  Display template path of current page in dev mode (go-gitea#18717)
  Separate the details links of commit-statuses in headers (go-gitea#18661)
  Add LDAP group sync to Teams, fixes go-gitea#1395 (go-gitea#16299)
  Change git.cmd to RunWithContext (go-gitea#18693)
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
* Display template path of current page in dev mode

* improve code

* Update templates/base/footer_content.tmpl

Co-authored-by: silverwind <me@silverwind.io>

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
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.

5 participants