From 1fe6100034872c6134a08ecdac86c81e8b19c048 Mon Sep 17 00:00:00 2001 From: AleksandrKosmylev Date: Thu, 30 May 2024 02:00:16 +0300 Subject: [PATCH] Ordered templates --- contributors/views/achievements.py | 2 +- contributors/views/contributor.py | 2 +- contributors/views/contributor_compare.py | 2 +- contributors/views/contributor_issues.py | 2 +- contributors/views/contributor_prs.py | 2 +- contributors/views/contributors.py | 2 +- contributors/views/contributors_for_period.py | 2 +- contributors/views/issues.py | 2 +- contributors/views/leaderboard_commits.py | 2 +- contributors/views/leaderboard_issues.py | 2 +- contributors/views/leaderboard_prs.py | 2 +- contributors/views/organization.py | 2 +- contributors/views/organizations.py | 2 +- contributors/views/pull_requests.py | 2 +- contributors/views/repositories.py | 2 +- contributors/views/repository.py | 2 +- templates/{ => contributor}/achievements_list.html | 0 templates/{ => contributor}/contributor_details.html | 0 templates/{ => contributor}/contributor_issues.html | 0 templates/{ => contributor}/contributor_prs.html | 0 templates/{ => contributor}/user_settings.html | 0 .../contributors}/contributor_compare_with_yourself.html | 0 .../contributors}/contributors_for_period.html | 0 .../contributors}/contributors_list.html | 0 templates/{ => contributors_sections/issues}/open_issues.html | 0 .../leaderboard}/leaderboard_commits.html | 0 .../leaderboard}/leaderboard_issues.html | 0 .../leaderboard}/leaderboard_prs.html | 0 .../organizations}/organization_details.html | 0 .../organizations}/organizations_list.html | 0 .../pull_requests}/pull_requests_list.html | 0 .../repositories}/repositories_list.html | 0 .../repositories}/repository_details.html | 0 33 files changed, 16 insertions(+), 16 deletions(-) rename templates/{ => contributor}/achievements_list.html (100%) rename templates/{ => contributor}/contributor_details.html (100%) rename templates/{ => contributor}/contributor_issues.html (100%) rename templates/{ => contributor}/contributor_prs.html (100%) rename templates/{ => contributor}/user_settings.html (100%) rename templates/{ => contributors_sections/contributors}/contributor_compare_with_yourself.html (100%) rename templates/{ => contributors_sections/contributors}/contributors_for_period.html (100%) rename templates/{ => contributors_sections/contributors}/contributors_list.html (100%) rename templates/{ => contributors_sections/issues}/open_issues.html (100%) rename templates/{ => contributors_sections/leaderboard}/leaderboard_commits.html (100%) rename templates/{ => contributors_sections/leaderboard}/leaderboard_issues.html (100%) rename templates/{ => contributors_sections/leaderboard}/leaderboard_prs.html (100%) rename templates/{ => contributors_sections/organizations}/organization_details.html (100%) rename templates/{ => contributors_sections/organizations}/organizations_list.html (100%) rename templates/{ => contributors_sections/pull_requests}/pull_requests_list.html (100%) rename templates/{ => contributors_sections/repositories}/repositories_list.html (100%) rename templates/{ => contributors_sections/repositories}/repository_details.html (100%) diff --git a/contributors/views/achievements.py b/contributors/views/achievements.py index dac43af4..5feeff50 100644 --- a/contributors/views/achievements.py +++ b/contributors/views/achievements.py @@ -6,7 +6,7 @@ class AchievementListView(generic.ListView): """Achievement list.""" - template_name = 'achievements_list.html' + template_name = 'contributor/achievements_list.html' model = Contributor contributors = Contributor.objects.with_contributions() diff --git a/contributors/views/contributor.py b/contributors/views/contributor.py index 3a74a1e7..1b20e44c 100644 --- a/contributors/views/contributor.py +++ b/contributors/views/contributor.py @@ -15,7 +15,7 @@ class DetailView( """Contributor's details.""" model = Contributor - template_name = 'contributor_details.html' + template_name = 'contributor/contributor_details.html' slug_field = 'login' def get_context_data(self, **kwargs): diff --git a/contributors/views/contributor_compare.py b/contributors/views/contributor_compare.py index aa6f9011..d5a4778a 100644 --- a/contributors/views/contributor_compare.py +++ b/contributors/views/contributor_compare.py @@ -9,7 +9,7 @@ class CompareWithYourselfView(ListView): """View of comparing current user with another one.""" model = Contribution - template_name = 'contributor_compare_with_yourself.html' + template_name = 'contributors_sections/contributors/contributor_compare_with_yourself.html' # noqa: E501 slug_field = 'contributor' def get_queryset(self): diff --git a/contributors/views/contributor_issues.py b/contributors/views/contributor_issues.py index e3bd12cf..a8c2fdea 100644 --- a/contributors/views/contributor_issues.py +++ b/contributors/views/contributor_issues.py @@ -8,7 +8,7 @@ class ListView(TableSortSearchAndPaginationMixin, generic.ListView): """A list of issues of a contributor.""" - template_name = 'contributor_issues.html' + template_name = 'contributor/contributor_issues.html' sortable_fields = ( 'info__title', 'repository__full_name', diff --git a/contributors/views/contributor_prs.py b/contributors/views/contributor_prs.py index 8c0095fb..220b848d 100644 --- a/contributors/views/contributor_prs.py +++ b/contributors/views/contributor_prs.py @@ -8,7 +8,7 @@ class ListView(TableSortSearchAndPaginationMixin, generic.ListView): """A list of pull requests of a contributor.""" - template_name = 'contributor_prs.html' + template_name = 'contributor/contributor_prs.html' sortable_fields = ( 'info__title', 'repository__full_name', diff --git a/contributors/views/contributors.py b/contributors/views/contributors.py index 69383b1e..635a496a 100644 --- a/contributors/views/contributors.py +++ b/contributors/views/contributors.py @@ -9,7 +9,7 @@ class ListView(TableSortSearchAndPaginationMixin, generic.ListView): """A list of contributors with contributions.""" queryset = Contributor.objects.visible().with_contributions() - template_name = 'contributors_list.html' + template_name = 'contributors_sections/contributors/contributors_list.html' sortable_fields = ( 'login', 'name', diff --git a/contributors/views/contributors_for_period.py b/contributors/views/contributors_for_period.py index 9d7e0afd..662a1763 100644 --- a/contributors/views/contributors_for_period.py +++ b/contributors/views/contributors_for_period.py @@ -6,7 +6,7 @@ class ListView(contributors.ListView): """A list of contributors with monthly contributions.""" - template_name = 'contributors_for_period.html' + template_name = 'contributors_sections/contributors/contributors_for_period.html' # noqa: E501 context_object_name = 'contributors_list' def get_context_data(self, **kwargs): diff --git a/contributors/views/issues.py b/contributors/views/issues.py index 49ef3708..aa79863f 100644 --- a/contributors/views/issues.py +++ b/contributors/views/issues.py @@ -16,7 +16,7 @@ class ListView( ): """A list of issues.""" - template_name = 'open_issues.html' + template_name = 'contributors_sections/issues/open_issues.html' filterset_class = IssuesFilter sortable_fields = ( # noqa: WPS317 'info__title', diff --git a/contributors/views/leaderboard_commits.py b/contributors/views/leaderboard_commits.py index 9adf044b..6aaa70a0 100644 --- a/contributors/views/leaderboard_commits.py +++ b/contributors/views/leaderboard_commits.py @@ -15,7 +15,7 @@ class ListView( """List of leaders among contributors by commits.""" queryset = Contributor.objects.visible().with_contributions() - template_name = 'leaderboard_commits.html' + template_name = 'contributors_sections/leaderboard/leaderboard_commits.html' # noqa: E501 sortable_fields = ( '-commits', ) diff --git a/contributors/views/leaderboard_issues.py b/contributors/views/leaderboard_issues.py index 6a55be53..ab2b7969 100644 --- a/contributors/views/leaderboard_issues.py +++ b/contributors/views/leaderboard_issues.py @@ -15,7 +15,7 @@ class ListView( """List of leaders among contributors by issues.""" queryset = Contributor.objects.visible().with_contributions() - template_name = 'leaderboard_issues.html' + template_name = 'contributors_sections/leaderboard/leaderboard_issues.html' sortable_fields = ( '-issues', ) diff --git a/contributors/views/leaderboard_prs.py b/contributors/views/leaderboard_prs.py index f3fa5079..45dcec25 100644 --- a/contributors/views/leaderboard_prs.py +++ b/contributors/views/leaderboard_prs.py @@ -15,7 +15,7 @@ class ListView( """List of leaders among contributors by pull requests.""" queryset = Contributor.objects.visible().with_contributions() - template_name = 'leaderboard_prs.html' + template_name = 'contributors_sections/leaderboard/leaderboard_prs.html' sortable_fields = ( '-pull_requests', ) diff --git a/contributors/views/organization.py b/contributors/views/organization.py index af2523f6..7871dba3 100644 --- a/contributors/views/organization.py +++ b/contributors/views/organization.py @@ -8,7 +8,7 @@ class OrgRepositoryList(repositories.ListView): """An organization's details.""" - template_name = 'organization_details.html' + template_name = 'contributors_sections/organizations/organization_details.html' # noqa: E501 sortable_fields = ( # noqa: WPS317 'name', 'project', diff --git a/contributors/views/organizations.py b/contributors/views/organizations.py index ba9c2d8b..a33f5003 100644 --- a/contributors/views/organizations.py +++ b/contributors/views/organizations.py @@ -12,7 +12,7 @@ class ListView(TableSortSearchAndPaginationMixin, generic.ListView): queryset = Organization.objects.filter( repository__is_visible=True, ).distinct().annotate(repository_count=Count('repository')) - template_name = 'organizations_list.html' + template_name = 'contributors_sections/organizations/organizations_list.html' # noqa: E501 sortable_fields = ( 'name', ('repository_count', _("Repositories")), diff --git a/contributors/views/pull_requests.py b/contributors/views/pull_requests.py index 7ff8882e..91fc2e40 100644 --- a/contributors/views/pull_requests.py +++ b/contributors/views/pull_requests.py @@ -23,7 +23,7 @@ class ListView(TableSortSearchAndPaginationMixin, generic.ListView): ) ordering = sortable_fields[0] - template_name = 'pull_requests_list.html' + template_name = 'contributors_sections/pull_requests/pull_requests_list.html' # noqa: E501 def get_queryset(self): # noqa: WPS615 """Get pull requests. diff --git a/contributors/views/repositories.py b/contributors/views/repositories.py index 04951d17..01425384 100644 --- a/contributors/views/repositories.py +++ b/contributors/views/repositories.py @@ -36,7 +36,7 @@ class ListView( ), ) ) - template_name = 'repositories_list.html' + template_name = 'contributors_sections/repositories/repositories_list.html' sortable_fields = ( # noqa: WPS317 'name', 'organization', diff --git a/contributors/views/repository.py b/contributors/views/repository.py index 03023709..18bc4a82 100644 --- a/contributors/views/repository.py +++ b/contributors/views/repository.py @@ -7,7 +7,7 @@ class RepoContributorList(contributors.ListView): """A repository's details.""" - template_name = 'repository_details.html' + template_name = 'contributors_sections/repositories/repository_details.html' # noqa: E501 def get_queryset(self): # noqa: WPS615 """Get a dataset.""" diff --git a/templates/achievements_list.html b/templates/contributor/achievements_list.html similarity index 100% rename from templates/achievements_list.html rename to templates/contributor/achievements_list.html diff --git a/templates/contributor_details.html b/templates/contributor/contributor_details.html similarity index 100% rename from templates/contributor_details.html rename to templates/contributor/contributor_details.html diff --git a/templates/contributor_issues.html b/templates/contributor/contributor_issues.html similarity index 100% rename from templates/contributor_issues.html rename to templates/contributor/contributor_issues.html diff --git a/templates/contributor_prs.html b/templates/contributor/contributor_prs.html similarity index 100% rename from templates/contributor_prs.html rename to templates/contributor/contributor_prs.html diff --git a/templates/user_settings.html b/templates/contributor/user_settings.html similarity index 100% rename from templates/user_settings.html rename to templates/contributor/user_settings.html diff --git a/templates/contributor_compare_with_yourself.html b/templates/contributors_sections/contributors/contributor_compare_with_yourself.html similarity index 100% rename from templates/contributor_compare_with_yourself.html rename to templates/contributors_sections/contributors/contributor_compare_with_yourself.html diff --git a/templates/contributors_for_period.html b/templates/contributors_sections/contributors/contributors_for_period.html similarity index 100% rename from templates/contributors_for_period.html rename to templates/contributors_sections/contributors/contributors_for_period.html diff --git a/templates/contributors_list.html b/templates/contributors_sections/contributors/contributors_list.html similarity index 100% rename from templates/contributors_list.html rename to templates/contributors_sections/contributors/contributors_list.html diff --git a/templates/open_issues.html b/templates/contributors_sections/issues/open_issues.html similarity index 100% rename from templates/open_issues.html rename to templates/contributors_sections/issues/open_issues.html diff --git a/templates/leaderboard_commits.html b/templates/contributors_sections/leaderboard/leaderboard_commits.html similarity index 100% rename from templates/leaderboard_commits.html rename to templates/contributors_sections/leaderboard/leaderboard_commits.html diff --git a/templates/leaderboard_issues.html b/templates/contributors_sections/leaderboard/leaderboard_issues.html similarity index 100% rename from templates/leaderboard_issues.html rename to templates/contributors_sections/leaderboard/leaderboard_issues.html diff --git a/templates/leaderboard_prs.html b/templates/contributors_sections/leaderboard/leaderboard_prs.html similarity index 100% rename from templates/leaderboard_prs.html rename to templates/contributors_sections/leaderboard/leaderboard_prs.html diff --git a/templates/organization_details.html b/templates/contributors_sections/organizations/organization_details.html similarity index 100% rename from templates/organization_details.html rename to templates/contributors_sections/organizations/organization_details.html diff --git a/templates/organizations_list.html b/templates/contributors_sections/organizations/organizations_list.html similarity index 100% rename from templates/organizations_list.html rename to templates/contributors_sections/organizations/organizations_list.html diff --git a/templates/pull_requests_list.html b/templates/contributors_sections/pull_requests/pull_requests_list.html similarity index 100% rename from templates/pull_requests_list.html rename to templates/contributors_sections/pull_requests/pull_requests_list.html diff --git a/templates/repositories_list.html b/templates/contributors_sections/repositories/repositories_list.html similarity index 100% rename from templates/repositories_list.html rename to templates/contributors_sections/repositories/repositories_list.html diff --git a/templates/repository_details.html b/templates/contributors_sections/repositories/repository_details.html similarity index 100% rename from templates/repository_details.html rename to templates/contributors_sections/repositories/repository_details.html