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

Improve 404 screen on mobile #28710

Closed
wants to merge 1 commit into from

Conversation

earl-warren
Copy link
Contributor

  • Remove container to remove unnecessary margins being added to the whole page.
  • Specify max width for the 404 image to avoid overflow of the image.

Refs: https://codeberg.org/forgejo/forgejo/pulls/2101

(cherry picked from commit 2235c227402c7b1b6e2d4c77215fa15d636f25c7)

- Remove `container` to remove unnecessary margins being added to the
whole page.
- Specify max width for the 404 image to avoid overflow of the image.

Refs: https://codeberg.org/forgejo/forgejo/pulls/2101

(cherry picked from commit 2235c227402c7b1b6e2d4c77215fa15d636f25c7)
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 6, 2024
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 6, 2024
@github-actions github-actions bot added the modifies/templates This PR modifies the template files label Jan 6, 2024
@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 Jan 6, 2024
@@ -1,8 +1,8 @@
{{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content ui container center gt-w-screen {{if .IsRepo}}repository{{end}}">
<div role="main" aria-label="{{.Title}}" class="page-content ui center gt-w-screen {{if .IsRepo}}repository{{end}}">
Copy link
Contributor

@wxiaoguang wxiaoguang Jan 6, 2024

Choose a reason for hiding this comment

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

Does ui or center make sense here? The gt-w-screen seems a no-op here too.

Maybe it should be: class="page-content {{if .IsRepo}}repository{{end}}"

{{if .IsRepo}}{{template "repo/header" .}}{{end}}
<div class="ui container center">
<p style="margin-top: 100px"><img src="{{AssetUrlPrefix}}/img/404.png" alt="404"></p>
<p style="margin-top: 100px"><img src="{{AssetUrlPrefix}}/img/404.png" alt="404" style="max-width: 100%"></p>
Copy link
Contributor

@wxiaoguang wxiaoguang Jan 6, 2024

Choose a reason for hiding this comment

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

It seems that there are already some good-enough helpers for this case.

Maybe it should be: <img class="gt-mt-5 gt-max-w-full" src="{{AssetUrlPrefix}}/img/404.png" alt="404"> (maybe it needs a new helper class max-w-full as tailwind style)

(Although "avoiding inline styles as much as possible" hasn't been written into guideline yet, it has been a consensus for long time during reviewing.)

@techknowlogick
Copy link
Member

Could you provide a screenshot of what this looks like on mobile?

@wxiaoguang
Copy link
Contributor

-> Fix some pending problems #29985

@wxiaoguang wxiaoguang closed this Mar 22, 2024
wxiaoguang added a commit that referenced this pull request Mar 22, 2024
These changes are quite independent and trivial, so I don't want to open
too many PRs.

* #29882 (comment)
    * the `f.Close` should be called properly
* the error message could be more meaningful
(#29882 (review))
*
#29859 (review)
    * the new translation strings don't take arguments
* #28710 (comment)
    * stale for long time
*  #28140 
    * a form was forgotten to be changed to work with backend code
DennisRasey pushed a commit to DennisRasey/forgejo that referenced this pull request Mar 26, 2024
These changes are quite independent and trivial, so I don't want to open
too many PRs.

* go-gitea/gitea#29882 (comment)
    * the `f.Close` should be called properly
* the error message could be more meaningful
(go-gitea/gitea#29882 (review))
*
go-gitea/gitea#29859 (review)
    * the new translation strings don't take arguments
* go-gitea/gitea#28710 (comment)
    * stale for long time
*  #28140
    * a form was forgotten to be changed to work with backend code

(cherry picked from commit 226231ea27d4f2b0f09fa4efb39501507613b284)

Conflicts:
	templates/repo/issue/view_content/pull.tmpl
	discarded because unexplained
	templates/status/404.tmpl
	implemented differently in Forgejo
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jun 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 1 This PR needs approval from one additional maintainer to be merged. modifies/templates This PR modifies the template files size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants