PageRenderTime 45ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/apps/layout/layout-seo-web/src/main/resources/META-INF/resources/site_settings/open_graph.jsp

https://github.com/vilmospapp/liferay-portal
JavaServer Pages | 97 lines | 65 code | 19 blank | 13 comment | 0 complexity | 9367b004845a51f0a13444d2b5b01b6a MD5 | raw file
  1. <%--
  2. /**
  3. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
  4. *
  5. * This library is free software; you can redistribute it and/or modify it under
  6. * the terms of the GNU Lesser General Public License as published by the Free
  7. * Software Foundation; either version 2.1 of the License, or (at your option)
  8. * any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  12. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  13. * details.
  14. */
  15. --%>
  16. <%@ include file="/init.jsp" %>
  17. <%
  18. OpenGraphSettingsDisplayContext openGraphSettingsDisplayContext = (OpenGraphSettingsDisplayContext)request.getAttribute(OpenGraphSettingsDisplayContext.class.getName());
  19. %>
  20. <liferay-util:html-top>
  21. <link href="<%= PortalUtil.getStaticResourceURL(request, application.getContextPath() + "/css/main.css") %>" rel="stylesheet" type="text/css" />
  22. </liferay-util:html-top>
  23. <aui:field-wrapper cssClass="form-group">
  24. <aui:input id="openGraphEnabled" label="enable-open-graph" name="openGraphEnabled" type="checkbox" value="<%= openGraphSettingsDisplayContext.isOpenGraphEnabled() %>" />
  25. <p class="small text-secondary"><liferay-ui:message key="enable-open-graph-description" /></p>
  26. </aui:field-wrapper>
  27. <div class="open-graph-settings <%= openGraphSettingsDisplayContext.isOpenGraphEnabled() ? "" : "disabled" %>" id="<portlet:namespace />openGraphSettings">
  28. <h4 class="sheet-subtitle">
  29. <liferay-ui:message key="open-graph-image" />
  30. </h4>
  31. <p class="small text-secondary">
  32. <liferay-ui:message key="open-graph-image-description" />
  33. </p>
  34. <div class="form-group">
  35. <label class="control-label"><liferay-ui:message key="image" /></label>
  36. <div class="input-group mb-3">
  37. <div class="input-group-item">
  38. <input class="field form-control lfr-input-text" disabled="<%= !openGraphSettingsDisplayContext.isOpenGraphEnabled() %>" id="<portlet:namespace />openGraphImageTitle" name="<portlet:namespace />parentSiteTitle" placeholder="image" readonly="<%= true %>" type="text" value="<%= openGraphSettingsDisplayContext.getOpenGraphImageTitle() %>" />
  39. </div>
  40. <div class="input-group-item input-group-item-shrink">
  41. <button class="btn btn-secondary mr-1" id="<portlet:namespace />openGraphImageButton" type="button">
  42. <liferay-ui:message key="select" />
  43. </button>
  44. <button class="btn btn-secondary" id="<portlet:namespace />openGraphClearImageButton" type="button">
  45. <liferay-ui:message key="clear" />
  46. </button>
  47. </div>
  48. </div>
  49. <aui:model-context bean="<%= openGraphSettingsDisplayContext.getLayoutSEOSite() %>" model="<%= LayoutSEOSite.class %>" />
  50. <aui:input disabled="<%= !openGraphSettingsDisplayContext.isOpenGraphEnabled() || Validator.isNull(openGraphSettingsDisplayContext.getOpenGraphImageURL()) %>" helpMessage="open-graph-image-alt-description-help" label="open-graph-image-alt-description" name="openGraphImageAlt" placeholder="open-graph-alt-description" />
  51. </div>
  52. <aui:input id="openGraphImageFileEntryId" name="openGraphImageFileEntryId" type="hidden" value="<%= openGraphSettingsDisplayContext.getOpenGraphImageFileEntryId() %>" />
  53. <div class="form-group">
  54. <label><liferay-ui:message key="preview" /> <liferay-ui:icon-help message="preview-help" /></label>
  55. <div class="preview-seo preview-seo-og" dir="ltr">
  56. <div class="aspect-ratio aspect-ratio-191-to-100 bg-light mb-0 preview-seo-image">
  57. <div class="preview-seo-placeholder" id="<portlet:namespace />openGraphPreviewPlaceholder">
  58. <liferay-ui:icon
  59. icon="picture"
  60. iconCssClass="aspect-ratio-item aspect-ratio-item-center-middle aspect-ratio-item-fluid preview-seo-placeholder-icon"
  61. markupView="lexicon"
  62. />
  63. <div class="preview-seo-placeholder-text"><liferay-ui:message key="open-graph-image-placeholder" /></div>
  64. </div>
  65. <img alt="" class="aspect-ratio-item aspect-ratio-item-center-middle aspect-ratio-item-flush <%= Validator.isNull(openGraphSettingsDisplayContext.getOpenGraphImageURL()) ? "hide" : "" %>" id="<portlet:namespace />openGraphPreviewImage" src="<%= openGraphSettingsDisplayContext.getOpenGraphImageURL() %>" />
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. <liferay-frontend:component
  71. context='<%=
  72. HashMapBuilder.<String, Object>put(
  73. "uploadOpenGraphImageURL", openGraphSettingsDisplayContext.getItemSelectorURL()
  74. ).build()
  75. %>'
  76. module="js/seo/openGraphSettings.es"
  77. servletContext="<%= application %>"
  78. />