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

Refactor large templates #1275

Closed
2 of 25 tasks
bkcsoft opened this issue Mar 15, 2017 · 5 comments
Closed
2 of 25 tasks

Refactor large templates #1275

bkcsoft opened this issue Mar 15, 2017 · 5 comments
Labels
type/refactoring Existing code has been cleaned up. There should be no new functionality. type/summary This issue aggregates a bunch of other issues

Comments

@bkcsoft
Copy link
Member

bkcsoft commented Mar 15, 2017

  • Gitea version (or commit ref): e83c8af

Description

As of e83c8af a lot of templates are huge (over 100 lines) and some are only added to ad infinitum without any checks. Templates are one of these things that can be broken down quite easily. IMO this should be done (I'll start with a few so I'm not just pointing fingers 😛 )

List of templates that are huge (200loc+) and a quick thought on how to refactor

  • 444 repo/issue/view_content.tmpl Refactor repo/issue/view_content.tmpl #1276
    Start by splitting range .Issue.Comments and go from there
  • 393 repo/settings/options.tmpl
    Not as easy, I'd suggest looking at Vue :trollface:
  • 354 home.tmpl
    Just a bunch of translations for no apparent reason...
  • 281 admin/config.tmpl
    Vue?
  • 260 install.tmpl
    Not that much that can be done...
  • 211 admin/auth/edit.tmpl
    Easy, it's a long list of if-statements that can be broken out
  • 209 base/head.tmpl
    Split out the big if .IsSigned-block
  • 205 admin/auth/new.tmpl Refactor admin/auth/new.tmpl #1277
    Split on auth-method

List of less prioritized files (100=>200 loc) that I didn't bother looking into

These don't make much sense to refactor, 150 loc isn't that much really... At least until we start moving things into Vue-Modules :trollface:

  • 157 repo/issue/labels.tmpl
  • 156 repo/issue/list.tmpl
  • 155 repo/diff/box.tmpl
  • 135 user/dashboard/dashboard.tmpl
  • 134 repo/issue/milestones.tmpl
  • 132 admin/user/edit.tmpl
  • 125 admin/dashboard.tmpl
  • 121 repo/issue/new_form.tmpl
  • 116 repo/create.tmpl
  • 113 user/notification/notification.tmpl
  • 112 user/dashboard/issues.tmpl
  • 109 repo/release/new.tmpl
  • 108 user/profile.tmpl
  • 107 repo/header.tmpl
  • 104 repo/wiki/view.tmpl
  • 104 admin/notice.tmpl
  • 101 repo/migrate.tmpl

Any thoughts?

@bkcsoft bkcsoft added type/proposal The new feature has not been accepted yet but needs to be discussed first. type/refactoring Existing code has been cleaned up. There should be no new functionality. labels Mar 15, 2017
@strk
Copy link
Member

strk commented Mar 16, 2017

One thought: custom templates would be broken every time we change templates, so if it needs to be done, let's do it once in a way to reduce further changes.
Another thing: what is Vue ? :)

@andreynering
Copy link
Contributor

http://vuejs.org

@bkcsoft
Copy link
Member Author

bkcsoft commented Apr 18, 2017

@strk not exactly, I haven't (and won't be for the time being) changed the data-format, only broken down template-files, so all custom templates should still be fine. Breaking them down actually makes it easier to maintain custom templates since they are now smaller and more focused around one thing only 🙂

@strk
Copy link
Member

strk commented Apr 18, 2017

@bkcsoft got it: so this is just adding more templates, basically, while still allowing using the parent for a single override. Great move !

@lunny lunny added this to the 1.x.x milestone May 4, 2017
@lunny lunny added the type/summary This issue aggregates a bunch of other issues label Oct 15, 2020
@lunny lunny removed this from the 1.x.x milestone Oct 15, 2020
@lunny lunny removed type/proposal The new feature has not been accepted yet but needs to be discussed first. type/refactoring Existing code has been cleaned up. There should be no new functionality. labels Oct 15, 2020
@noerw noerw added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Mar 20, 2021
@lunny
Copy link
Member

lunny commented Sep 11, 2023

Close as many templates changed and this is outdated.

@lunny lunny closed this as completed Sep 11, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/refactoring Existing code has been cleaned up. There should be no new functionality. type/summary This issue aggregates a bunch of other issues
Projects
None yet
Development

No branches or pull requests

5 participants