Skip to content

Move top-level mustache templates to subdirs. #3229

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

Merged
merged 1 commit into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/lib/frontend/templates/admin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ import 'layout.dart';
import 'listing.dart';
import 'publisher.dart' show renderPublisherList;

/// Renders the `views/authorized.mustache` template.
/// Renders the `views/account/authorized.mustache` template.
String renderAuthorizedPage() {
final String content = templateCache.renderTemplate('authorized', {});
final String content = templateCache.renderTemplate('account/authorized', {});
return renderLayoutPage(PageType.package, content,
title: 'Pub Authorized Successfully', includeSurvey: false);
}

/// Renders the `views/consent.mustache` template.
/// Renders the `views/account/consent.mustache` template.
String renderConsentPage({
@required String consentId,
@required String title,
@required String descriptionHtml,
}) {
final content = templateCache.renderTemplate('consent', {
final content = templateCache.renderTemplate('account/consent', {
'title': title,
'description_html': descriptionHtml,
});
Expand Down
4 changes: 2 additions & 2 deletions app/lib/frontend/templates/landing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import '_cache.dart';
import 'layout.dart';
import 'misc.dart' show renderMiniList;

/// Renders the `views/landing.mustache` template.
/// Renders the `views/page/landing.mustache` template.
String renderLandingPage({
List<PackageView> taggedPackages,
List<PackageView> topPackages,
Expand All @@ -24,7 +24,7 @@ String renderLandingPage({
'top_minilist_html': hasTop ? renderMiniList(topPackages) : null,
'top_more_url': urls.searchUrl(),
};
final String content = templateCache.renderTemplate('landing', values);
final String content = templateCache.renderTemplate('page/landing', values);
return renderLayoutPage(
PageType.landing,
content,
Expand Down
4 changes: 2 additions & 2 deletions app/lib/frontend/templates/layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ enum PageType {
standalone,
}

/// Renders the `views/layout.mustache` template.
/// Renders the `views/shared/layout.mustache` template.
String renderLayoutPage(
PageType type,
String contentHtml, {
Expand Down Expand Up @@ -93,7 +93,7 @@ String renderLayoutPage(
'page_data_encoded': pageDataEncoded,
};

return templateCache.renderTemplate('layout', values);
return templateCache.renderTemplate('shared/layout', values);
}

String _renderSiteHeader() {
Expand Down
4 changes: 2 additions & 2 deletions app/lib/frontend/templates/listing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import '_utils.dart';
import 'layout.dart';
import 'misc.dart';

/// Renders the `views/pagination.mustache` template.
/// Renders the `views/shared/pagination.mustache` template.
String renderPagination(PageLinks pageLinks) {
final values = {
'page_links': pageLinks.hrefPatterns(),
};
return templateCache.renderTemplate('pagination', values);
return templateCache.renderTemplate('shared/pagination', values);
}

/// Renders the `views/pkg/package_list.mustache` template.
Expand Down
16 changes: 8 additions & 8 deletions app/lib/frontend/templates/misc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ String renderUnauthorizedPage({String messageMarkdown}) {
);
}

/// Renders the `views/help.mustache` template.
/// Renders the `views/page/help.mustache` template.
String renderHelpPage() {
final String content = templateCache.renderTemplate('help', {
final String content = templateCache.renderTemplate('page/help', {
'dart_site_root': urls.dartSiteRoot,
'pana_url': urls.panaUrl(),
'pana_maintenance_url': urls.panaMaintenanceUrl(),
Expand All @@ -55,14 +55,14 @@ String renderHelpPage() {
title: 'Help | Dart packages');
}

/// Renders the `views/security.mustache` template.
/// Renders the `views/page/security.mustache` template.
String renderSecurityPage() {
final String content = templateCache.renderTemplate('security', {});
final String content = templateCache.renderTemplate('page/security', {});
return renderLayoutPage(PageType.standalone, content,
title: 'Security | Pub site');
}

/// Renders the `views/show.mustache` template.
/// Renders the `views/page/error.mustache` template.
String renderErrorPage(
String title, String message, List<PackageView> topPackages) {
final hasTopPackages = topPackages != null && topPackages.isNotEmpty;
Expand All @@ -73,7 +73,7 @@ String renderErrorPage(
'has_top_packages': hasTopPackages,
'top_packages_html': topPackagesHtml,
};
final String content = templateCache.renderTemplate('error', values);
final String content = templateCache.renderTemplate('page/error', values);
return renderLayoutPage(
PageType.error,
content,
Expand All @@ -82,7 +82,7 @@ String renderErrorPage(
);
}

/// Renders the `views/mini_list.mustache` template.
/// Renders the `views/pkg/mini_list.mustache` template.
String renderMiniList(List<PackageView> packages) {
final values = {
'packages': packages.map((package) {
Expand All @@ -103,7 +103,7 @@ String renderMiniList(List<PackageView> packages) {
};
}).toList(),
};
return templateCache.renderTemplate('mini_list', values);
return templateCache.renderTemplate('pkg/mini_list', values);
}

/// Renders the tags using the pkg/tags template.
Expand Down
23 changes: 0 additions & 23 deletions app/lib/frontend/templates/views/uploader_approval.mustache

This file was deleted.