Skip to content

Commit d0912e8

Browse files
authored
Move top-level mustache templates to subdirs. (#3229)
1 parent 6717dd7 commit d0912e8

15 files changed

+18
-41
lines changed

app/lib/frontend/templates/admin.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ import 'layout.dart';
2020
import 'listing.dart';
2121
import 'publisher.dart' show renderPublisherList;
2222

23-
/// Renders the `views/authorized.mustache` template.
23+
/// Renders the `views/account/authorized.mustache` template.
2424
String renderAuthorizedPage() {
25-
final String content = templateCache.renderTemplate('authorized', {});
25+
final String content = templateCache.renderTemplate('account/authorized', {});
2626
return renderLayoutPage(PageType.package, content,
2727
title: 'Pub Authorized Successfully', includeSurvey: false);
2828
}
2929

30-
/// Renders the `views/consent.mustache` template.
30+
/// Renders the `views/account/consent.mustache` template.
3131
String renderConsentPage({
3232
@required String consentId,
3333
@required String title,
3434
@required String descriptionHtml,
3535
}) {
36-
final content = templateCache.renderTemplate('consent', {
36+
final content = templateCache.renderTemplate('account/consent', {
3737
'title': title,
3838
'description_html': descriptionHtml,
3939
});

app/lib/frontend/templates/landing.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import '_cache.dart';
99
import 'layout.dart';
1010
import 'misc.dart' show renderMiniList;
1111

12-
/// Renders the `views/landing.mustache` template.
12+
/// Renders the `views/page/landing.mustache` template.
1313
String renderLandingPage({
1414
List<PackageView> taggedPackages,
1515
List<PackageView> topPackages,
@@ -24,7 +24,7 @@ String renderLandingPage({
2424
'top_minilist_html': hasTop ? renderMiniList(topPackages) : null,
2525
'top_more_url': urls.searchUrl(),
2626
};
27-
final String content = templateCache.renderTemplate('landing', values);
27+
final String content = templateCache.renderTemplate('page/landing', values);
2828
return renderLayoutPage(
2929
PageType.landing,
3030
content,

app/lib/frontend/templates/layout.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ enum PageType {
3333
standalone,
3434
}
3535

36-
/// Renders the `views/layout.mustache` template.
36+
/// Renders the `views/shared/layout.mustache` template.
3737
String renderLayoutPage(
3838
PageType type,
3939
String contentHtml, {
@@ -93,7 +93,7 @@ String renderLayoutPage(
9393
'page_data_encoded': pageDataEncoded,
9494
};
9595

96-
return templateCache.renderTemplate('layout', values);
96+
return templateCache.renderTemplate('shared/layout', values);
9797
}
9898

9999
String _renderSiteHeader() {

app/lib/frontend/templates/listing.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ import '_utils.dart';
1818
import 'layout.dart';
1919
import 'misc.dart';
2020

21-
/// Renders the `views/pagination.mustache` template.
21+
/// Renders the `views/shared/pagination.mustache` template.
2222
String renderPagination(PageLinks pageLinks) {
2323
final values = {
2424
'page_links': pageLinks.hrefPatterns(),
2525
};
26-
return templateCache.renderTemplate('pagination', values);
26+
return templateCache.renderTemplate('shared/pagination', values);
2727
}
2828

2929
/// Renders the `views/pkg/package_list.mustache` template.

app/lib/frontend/templates/misc.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ String renderUnauthorizedPage({String messageMarkdown}) {
4444
);
4545
}
4646

47-
/// Renders the `views/help.mustache` template.
47+
/// Renders the `views/page/help.mustache` template.
4848
String renderHelpPage() {
49-
final String content = templateCache.renderTemplate('help', {
49+
final String content = templateCache.renderTemplate('page/help', {
5050
'dart_site_root': urls.dartSiteRoot,
5151
'pana_url': urls.panaUrl(),
5252
'pana_maintenance_url': urls.panaMaintenanceUrl(),
@@ -55,14 +55,14 @@ String renderHelpPage() {
5555
title: 'Help | Dart packages');
5656
}
5757

58-
/// Renders the `views/security.mustache` template.
58+
/// Renders the `views/page/security.mustache` template.
5959
String renderSecurityPage() {
60-
final String content = templateCache.renderTemplate('security', {});
60+
final String content = templateCache.renderTemplate('page/security', {});
6161
return renderLayoutPage(PageType.standalone, content,
6262
title: 'Security | Pub site');
6363
}
6464

65-
/// Renders the `views/show.mustache` template.
65+
/// Renders the `views/page/error.mustache` template.
6666
String renderErrorPage(
6767
String title, String message, List<PackageView> topPackages) {
6868
final hasTopPackages = topPackages != null && topPackages.isNotEmpty;
@@ -73,7 +73,7 @@ String renderErrorPage(
7373
'has_top_packages': hasTopPackages,
7474
'top_packages_html': topPackagesHtml,
7575
};
76-
final String content = templateCache.renderTemplate('error', values);
76+
final String content = templateCache.renderTemplate('page/error', values);
7777
return renderLayoutPage(
7878
PageType.error,
7979
content,
@@ -82,7 +82,7 @@ String renderErrorPage(
8282
);
8383
}
8484

85-
/// Renders the `views/mini_list.mustache` template.
85+
/// Renders the `views/pkg/mini_list.mustache` template.
8686
String renderMiniList(List<PackageView> packages) {
8787
final values = {
8888
'packages': packages.map((package) {
@@ -103,7 +103,7 @@ String renderMiniList(List<PackageView> packages) {
103103
};
104104
}).toList(),
105105
};
106-
return templateCache.renderTemplate('mini_list', values);
106+
return templateCache.renderTemplate('pkg/mini_list', values);
107107
}
108108

109109
/// Renders the tags using the pkg/tags template.

app/lib/frontend/templates/views/uploader_approval.mustache

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)