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

Add support for template-thumbnail png file #130

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ public class WebprojectHandler implements Serializable {
private static final Pattern LANGUAGE_RANK_PATTERN = Pattern.compile("(?:language.)(\\w+)(?:.rank)");

private static final HashSet<String> NON_SITE_IMPORTS = new HashSet<>(Arrays.asList(
SERVER_PERMISSIONS_XML,
USERS_XML,
USERS_ZIP,
JahiaSitesService.SYSTEM_SITE_KEY + ".zip",
REFERENCES_ZIP,
ROLES_ZIP,
MOUNTS_ZIP
SERVER_PERMISSIONS_XML,
USERS_XML,
USERS_ZIP,
JahiaSitesService.SYSTEM_SITE_KEY + ".zip",
REFERENCES_ZIP,
ROLES_ZIP,
MOUNTS_ZIP
));

private static final Map<String, Integer> RANK;
Expand Down Expand Up @@ -389,8 +389,8 @@ public void exportToFile(RequestContext requestContext, boolean staging) throws
} catch (Exception e) {
logger.error(e.getMessage());
requestContext.getMessageContext().addMessage(new MessageBuilder().error()
.code("serverSettings.manageWebProjects.exportPath.invalidExportPath")
.build());
.code("serverSettings.manageWebProjects.exportPath.invalidExportPath")
.build());
}
}

Expand Down Expand Up @@ -1249,7 +1249,6 @@ public boolean isSiteLimitReached() {
if (value.isPresent()) {
return sitesService.getSiteCount(false) >= value.get();
}

return false;
}

Expand All @@ -1259,10 +1258,13 @@ public List<TemplateSetPreview> getTemplateSetsPreview() {
for (JahiaTemplatesPackage jahiaTemplatesPackage : templatesPackages) {
List<String> previewResources = new ArrayList<>();
Bundle templateSetBundle = jahiaTemplatesPackage.getBundle();
// The template preview displayed in Jahia is the first item of the previewResources list (and we continue to support the old folder structures)
previewResources.addAll(findPreviewResources(templateSetBundle, "/configuration", "template*.png"));
previewResources.addAll(findPreviewResources(templateSetBundle, "/img/template-preview","*.png"));
previewResources.addAll(findPreviewResources(templateSetBundle, "/images/template-preview","*.png"));
previewResources.addAll(findPreviewResources(templateSetBundle, "/images/template-preview","*.gif"));
previewResources.addAll(findPreviewResources(templateSetBundle, "/configuration", "template*.gif"));
previewResources.addAll(findPreviewResources(templateSetBundle, "/img/template-preview", "*.gif"));
previewResources.addAll(findPreviewResources(templateSetBundle, "/images/template-preview","*.gif"));
templateSetPreviews.add(new TemplateSetPreview(jahiaTemplatesPackage, previewResources));
}
return templateSetPreviews;
Expand Down
Loading