Skip to content

Refactor large templates #1275

Closed
Closed
@bkcsoft

Description

@bkcsoft
  • 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/refactoringExisting code has been cleaned up. There should be no new functionality.type/summaryThis issue aggregates a bunch of other issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions