use of j2html.tags.ContainerTag in project midpoint by Evolveum.
the class HtmlReportDataWriter method formatColumn.
private ContainerTag formatColumn(List<String> values) {
ContainerTag div = TagCreator.div().withStyle("white-space: pre-wrap");
values.forEach((value) -> {
if (div.getNumChildren() != 0) {
div.with(TagCreator.br());
}
div.withText(value);
});
return div;
}
use of j2html.tags.ContainerTag in project civiform by seattle-uat.
the class AwsFileUploadViewStrategy method renderFileUploadBottomNavButtons.
Tag renderFileUploadBottomNavButtons(Params params) {
Optional<Tag> maybeContinueButton = maybeRenderContinueButton(params);
Optional<ContainerTag> maybeSkipOrDeleteButton = maybeRenderSkipOrDeleteButton(params);
ContainerTag ret = div().withClasses(ApplicantStyles.APPLICATION_NAV_BAR).with(div().withClasses(Styles.FLEX_GROW)).with(renderReviewButton(params));
if (maybeSkipOrDeleteButton.isPresent()) {
ret.with(maybeSkipOrDeleteButton.get());
}
ret.with(renderUploadButton(params));
if (maybeContinueButton.isPresent()) {
ret.with(maybeContinueButton.get());
}
return ret;
}
use of j2html.tags.ContainerTag in project civiform by seattle-uat.
the class AzureFileUploadViewStrategy method maybeRenderSkipOrDeleteButton.
@Override
protected Optional<ContainerTag> maybeRenderSkipOrDeleteButton(Params params) {
String buttonText = params.messages().at(MessageKey.BUTTON_SKIP_FILEUPLOAD.getKeyName());
String buttonId = FILEUPLOAD_SKIP_BUTTON_ID;
Optional<ContainerTag> footer = Optional.empty();
if (hasUploadedFile(params)) {
buttonText = params.messages().at(MessageKey.BUTTON_DELETE_FILE.getKeyName());
buttonId = FILEUPLOAD_DELETE_BUTTON_ID;
footer = Optional.of(footer().with(viewUtils.makeLocalJsTag("azure_delete")));
}
ContainerTag button = button(buttonText).attr(FORM, FILEUPLOAD_DELETE_FORM_ID).withClasses(ApplicantStyles.BUTTON_REVIEW).withId(buttonId);
footer.ifPresent(button::with);
return Optional.of(button);
}
use of j2html.tags.ContainerTag in project civiform by seattle-uat.
the class AzureFileUploadViewStrategy method renderFileUploadBlockSubmitForms.
@Override
public Tag renderFileUploadBlockSubmitForms(Params params, ApplicantQuestionRendererFactory applicantQuestionRendererFactory) {
String key = FileNameFormatter.formatFileUploadQuestionFilename(params);
String onSuccessRedirectUrl = params.baseUrl() + routes.ApplicantProgramBlocksController.updateFile(params.applicantId(), params.programId(), params.block().getId(), params.inReview()).url();
StorageUploadRequest request = params.storageClient().getSignedUploadRequest(key, onSuccessRedirectUrl);
BlobStorageUploadRequest blobStorageUploadRequest = castStorageRequest(request);
ApplicantQuestionRendererParams rendererParams = ApplicantQuestionRendererParams.builder().setMessages(params.messages()).setSignedFileUploadRequest(blobStorageUploadRequest).build();
ContainerTag formTag = form().withId(BLOCK_FORM_ID).attr(ENCTYPE, "multipart/form-data").with(each(params.block().getQuestions(), question -> renderQuestion(question, rendererParams, applicantQuestionRendererFactory)));
Tag skipForms = renderDeleteAndContinueFileUploadForms(params);
Tag buttons = renderFileUploadBottomNavButtons(params);
return div(formTag, skipForms, buttons).withId("azure-upload-form-component").with(footer(viewUtils.makeWebJarsTag(WebJarJsPaths.AZURE_STORAGE_BLOB)), footer(viewUtils.makeLocalJsTag("azure_upload")));
}
use of j2html.tags.ContainerTag in project civiform by seattle-uat.
the class AzureFileUploadViewStrategy method renderFileUploadBottomNavButtons.
private Tag renderFileUploadBottomNavButtons(Params params) {
Optional<Tag> maybeContinueButton = maybeRenderContinueButton(params);
Optional<ContainerTag> maybeSkipOrDeleteButton = maybeRenderSkipOrDeleteButton(params);
ContainerTag ret = div().withClasses(ApplicantStyles.APPLICATION_NAV_BAR).with(div().withClasses(Styles.FLEX_GROW)).with(renderReviewButton(params));
if (maybeSkipOrDeleteButton.isPresent()) {
ret.with(maybeSkipOrDeleteButton.get());
}
ret.with(renderUploadButton(params));
if (maybeContinueButton.isPresent()) {
ret.with(maybeContinueButton.get());
}
return ret;
}
Aggregations