vendor/uvdesk/support-center-bundle/Resources/views/Staff/branding.html.twig line 1

Open in your IDE?
  1. {% extends "@UVDeskCoreFramework//Templates//layout.html.twig" %}
  2. {% block title %}
  3.     {{ 'Branding'|trans }}
  4. {% endblock %}
  5. {% block pageContent %}
  6.     <style>
  7.         .uv-image-upload-brick {
  8.             margin: 10px 0px;
  9.         }
  10.         .uv-color-field {
  11.             color: #fff;
  12.             width: 100px;
  13.             text-transform: uppercase;
  14.         }
  15.         .uv-header-link-wrapper {
  16.             padding-bottom: 20px;
  17.         }
  18.         .uv-footer-link-wrapper {
  19.             border-top: solid 1px #D3D3D3;
  20.             padding-top: 20px;
  21.         }
  22.         .uv-knowledgebase-layout  {
  23.             border-top: solid 1px #D3D3D3;
  24.             padding-top: 20px;
  25.             margin-top: 20px;
  26.         }
  27.         .uv-knowledgebase-layout input[type='radio'] {
  28.             display: none;
  29.         }
  30.         #links .uv-field-block input:first-child {
  31.             width: 200px;
  32.             margin-bottom: 0;
  33.         }
  34.         #links .remove-link {
  35.             margin-left: 10px;
  36.         }
  37.         .grammarly-fix-broadcast {
  38.             max-width: 518px;
  39.         }
  40.         #uv-reset-colors {
  41.             float: right;
  42.             cursor: pointer;
  43.             position: relative;
  44.             z-index:1 ;
  45.         }
  46.     </style>
  47.     <div class="uv-inner-section">        
  48.         {# Append Panel Aside #}
  49.         {% set asideTemplate = 'Webkul\\UVDesk\\CoreFrameworkBundle\\Dashboard\\AsideTemplate' %}
  50.         {% set asideSidebarReference = 'Webkul\\UVDesk\\CoreFrameworkBundle\\UIComponents\\Dashboard\\Panel\\Sidebars\\Branding' %}
  51.         {{ uvdesk_extensibles.getRegisteredComponent(asideTemplate).renderSidebar(asideSidebarReference) | raw }}
  52.         <div class="uv-view {% if app.request.cookies and app.request.cookies.get('uv-asideView') %}uv-aside-view{% endif %}">
  53.             <h1>{{ 'Branding'|trans }}</h1>
  54.             <!--Tabs-->
  55.             <div class="uv-tabs">
  56.                 <ul>
  57.                     <li for="general" {% if type == 'general' or type == '' %}class="uv-tab-active"{% endif %}>{{ 'General'|trans }}</li>
  58.                     <li for="knowledgebase" {% if type == 'knowledgebase' %} class="uv-tab-active"{% endif %}>{{ 'Knowledgebase'|trans }}</li>
  59.                     <li for="time" {% if type == 'time' %}class="uv-tab-active"{% endif %}>{{ 'Time'|trans }}</li>
  60.                     <li for="seo" {% if type == 'seo' %}class="uv-tab-active"{% endif %}>{{ 'SEO'|trans }}</li>
  61.                     <li for="links" {% if type == 'links' %}class="uv-tab-active"{% endif %}>{{ 'Links'|trans }}</li>
  62.                     <li for="advanced" {% if type == 'advanced' %}class="uv-tab-active"{% endif %}>{{ 'Advanced'|trans }}</li>
  63.                     <li for="broadcasting" {% if type == 'broadcasting' %}class="uv-tab-active"{% endif %}>{{ 'Broadcast Message'|trans }}</li>                  
  64.                 </ul>
  65.             </div>
  66.             <!--Tabs-->
  67.             <!--Tab View-->
  68.             <div class="uv-tab-view {% if type == 'general' or type == '' %}uv-tab-view-active{% endif %}" id="general">
  69.                 <!--Form-->
  70.                 <form method="post" action="{{ path('helpdesk_member_knowledgebase_theme', {'type': 'general'}) }}" id="generalSettingForm" enctype="multipart/form-data">
  71.                     <!-- Image block -->
  72.                     <div class="uv-image-upload-wrapper uv-no-error-success-icon">
  73.                         <div class="uv-element-block">
  74.                             <label class="uv-field-label">{{ 'Wide Logo'|trans }}</label>
  75.                             <div class="uv-field-block">
  76.                                 {% set isLogo = websiteData.logo ? 1 : 0 %}
  77.                                 <div class="uv-image-upload-brick uv-image-upload-brick-200 {% if isLogo %}uv-on-drop-shadow{% endif %}" {% if isLogo %}style="border-color: transparent;"{% endif %}>
  78.                                     <input type="file" name="website[logo]" id="uv-upload-profile" accept="image/*">
  79.                                     <div class="uv-image-upload-placeholder">
  80.                                         <svg xmlns="http://www.w3.org/2000/svg" width="48" height="32" viewBox="0 0 48 32">
  81.                                             <path fill="#7c74f1" fill-rule="evenodd" d="M26.516,22.252H21.477V17.226h-3.75L24,11.031l6.269,6.195h-3.75v5.026ZM29.973,8.138A9.1,9.1,0,0,0,24,6.005a8.947,8.947,0,0,0-4.863,1.4,9.78,9.78,0,0,0-3.457,3.682A7.494,7.494,0,0,0,9,18.512a7.2,7.2,0,0,0,2.2,5.289,7.234,7.234,0,0,0,5.3,2.192H32.727A6.294,6.294,0,0,0,39,19.739,5.933,5.933,0,0,0,37.3,15.5a6.113,6.113,0,0,0-4.1-1.958A9.112,9.112,0,0,0,29.973,8.138Z"/>
  82.                                         </svg>
  83.                                     </div>
  84.                                     <img id="dynamic-image-upload" {% if isLogo %} src="{{ app.request.scheme ~'://' ~ app.request.httpHost ~ asset('') }}{{ websiteData.logo }}" {% endif %}>
  85.                                 </div>
  86.                                 <div class="uv-image-info-brick">
  87.                                     <span class="uv-field-info">{{ 'Upload an Image (200px x 48px) in</br> PNG or JPG Format'|trans|raw }}</span>
  88.                                 </div>
  89.                             </div>
  90.                             <span class="uv-field-info">{{ 'It will be shown as Logo on Knowledgebase and Helpdesk'|trans }}</span>
  91.                         </div>
  92.                     </div>
  93.                     <!-- //Image block -->
  94.                     <!-- Field -->
  95.                     <div class="uv-element-block">
  96.                           <label class="uv-field-label">{{ 'Website Status'|trans }}</label>
  97.                           <div class="uv-field-block">
  98.                             <div class="uv-checkbox uv-margin-top-5">
  99.                                 <input type="checkbox" name="website[status]" style="cursor:pointer;" {{ configuration.status ? 'checked="checked"' : '' }} >
  100.                                 <span class="uv-checkbox-view"></span>
  101.                             </div>
  102.                             <span class="uv-field-info uv-margin-top-5">{{ 'Enable front end website and knowledgebase for customer(s)'|trans }}</span>
  103.                         </div>
  104.                     </div>
  105.                     <!-- //Field -->
  106.                     <!-- Field -->
  107.                     <div class="uv-element-block">
  108.                         {##564DA8#}
  109.                           <label class="uv-field-label">{{ 'Brand Color'|trans }}</label>
  110.                           <div class="uv-field-block">
  111.                             <input name="website[brandColor]" class="uv-field uv-color-field" type="text" value="{{ configuration.brandColor ? configuration.brandColor : '#7C70F4'}}" style="background:{{ configuration.brandColor ? configuration.brandColor : '#7C70F4'}}" placeholder="#7C70F4">
  112.                           </div>
  113.                     </div>
  114.                     <!-- //Field -->
  115.                     
  116.                     <!-- Field -->
  117.                     <div class="uv-element-block">
  118.                           <label class="uv-field-label">{{ 'Name'|trans }}</label>
  119.                           <div class="uv-field-block">
  120.                             <input name="website[name]" class="uv-field" type="text" value="{{ websiteData.name ? websiteData.name : '' }}">
  121.                           </div>
  122.                     </div>
  123.                     <!-- //Field -->
  124.                     <!--CTA-->
  125.                     <input class="uv-btn general-btn" href="#" value="{{ 'Save Changes'|trans }}" type="button">
  126.                     <!--//CTA-->
  127.                 </form>
  128.                 <!--//Form-->
  129.             </div>
  130.             <!--//Tab View-->
  131.             <!--Tab View-->
  132.             <div class="uv-tab-view {% if type == 'knowledgebase' %}uv-tab-view-active{% endif %}" id="knowledgebase">
  133.                 <!--Form-->
  134.                 <form method="post" action="{{ path('helpdesk_member_knowledgebase_theme', {'type': 'knowledgebase'}) }}" id="knowledgebaseForm">
  135.                     <!-- Field -->
  136.                     <div class="uv-element-block">
  137.                         <span  id="uv-reset-colors" class="uv-icon-history" data-toggle="tooltip" data-placement="right" title="{{ 'Use Default Colors'|trans }}"></span>
  138.                         {##564DA8#}
  139.                           <label class="uv-field-label">{{ 'Page Background Color'|trans }}</label>
  140.                           <div class="uv-field-block">
  141.                             <input name="website[pageBackgroundColor]" class="uv-field uv-color-field" type="text" value="{{ configuration.pageBackgroundColor}}" style="background: {{ configuration.pageBackgroundColor ? configuration.pageBackgroundColor : '#FFFFFF' }}">
  142.                           </div>
  143.                     </div>
  144.                     <!-- //Field -->
  145.                     <!-- Field -->
  146.                     <div class="uv-element-block">
  147.                         {##564DA8#}
  148.                           <label class="uv-field-label">{{ 'Header Background Color'|trans }}</label>
  149.                           <div class="uv-field-block">
  150.                             <input name="website[headerBackgroundColor]" class="uv-field uv-color-field" type="text" value="{{ configuration.headerBackgroundColor ? configuration.headerBackgroundColor : '#FFFFFF' }}" style="background: {{ configuration.pageBackgroundColor ? configuration.headerBackgroundColor : '#FFFFFF' }}">
  151.                           </div>
  152.                     </div>
  153.                     <!-- //Field -->
  154.                     <!-- Field -->
  155.                     <div class="uv-element-block">
  156.                         {##564DA8#}
  157.                           <label class="uv-field-label">{{ 'Banner Background Color'|trans }}</label>
  158.                           <div class="uv-field-block">
  159.                             <input name="website[bannerBackgroundColor]" class="uv-field uv-color-field" type="text" value="{{ configuration.bannerBackgroundColor ? configuration.bannerBackgroundColor : '#70B5F4' }}" style="background: {{ configuration.bannerBackgroundColor ? configuration.bannerBackgroundColor : '#70B5F4' }}">
  160.                           </div>
  161.                     </div>
  162.                     <!-- //Field -->
  163.                     <!-- Field -->
  164.                     <div class="uv-element-block">
  165.                         {##564DA8#}
  166.                           <label class="uv-field-label">{{ 'Page Link Color'|trans }}</label>
  167.                           <div class="uv-field-block">
  168.                             <input name="website[linkColor]" class="uv-field uv-color-field" type="text" value="{{ configuration.linkColor  ? configuration.linkColor : '#C427A1' }}" style="background: {{ configuration.linkColor  ? configuration.linkColor : '#C427A1' }}">
  169.                           </div>
  170.                     </div>
  171.                     <!-- //Field -->
  172.                     <!-- Field -->
  173.                     <div class="uv-element-block">
  174.                         {##564DA8#}
  175.                           <label class="uv-field-label">{{ 'Page Link Hover Color'|trans }}</label>
  176.                           <div class="uv-field-block">
  177.                             <input name="website[linkHoverColor]" class="uv-field uv-color-field" type="text" value="{{ configuration.linkHoverColor  ? configuration.linkHoverColor : '#2750C4' }}" style="background: {{ configuration.linkColor  ? configuration.linkHoverColor : '#2750C4' }}">
  178.                           </div>
  179.                     </div>
  180.                     <!-- //Field -->
  181.                     <!-- Field -->
  182.                     <div class="uv-element-block">
  183.                         {##564DA8#}
  184.                           <label class="uv-field-label">{{ 'Article Text Color'|trans }}</label>
  185.                           <div class="uv-field-block">
  186.                             <input name="website[articleTextColor]" class="uv-field uv-color-field" type="text" value="{{ configuration.articleTextColor  ? configuration.articleTextColor : '#333333' }}" style="background: {{ configuration.linkColor  ? configuration.articleTextColor : '#333333' }}">
  187.                           </div>
  188.                     </div>
  189.                     <!-- //Field -->
  190.                     <!-- Field -->
  191.                     <div class="uv-element-block">
  192.                           <label class="uv-field-label">{{ 'Tag Line'|trans }}</label>
  193.                           <div class="uv-field-block">
  194.                             <input name="website[siteDescription]" class="uv-field" type="text" value="{{ configuration.siteDescription ? configuration.siteDescription : '' }}" placeholder="{{ 'Hi! how can we help?'|trans }} ">
  195.                           </div>
  196.                     </div>
  197.                     <!-- //Field -->
  198.                     <div class="uv-knowledgebase-layout uv-no-error-success-icon">
  199.                         <div class="uv-element-block">
  200.                             <label class="uv-field-label">{{ 'Layout '|trans }}</label>
  201.                             <div class="uv-layout-icon-wrapper">
  202.                                 <label for="homepage-masonry" class="uv-layout-icon uv-layout-grid {% if configuration.homepageContent and configuration.homepageContent == 'masonry' %}uv-layout-icon-active{% endif %}" data-toggle="tooltip" title="{{ 'Masonry'|trans }}"></label>
  203.                                 <input name="website[homepageContent]" type="radio" id="homepage-masonry" value="masonry" {% if configuration.homepageContent and configuration.homepageContent == 'masonry' %}checked{% endif %}/>
  204.                                 <label for="homepage-folder" class="uv-layout-icon uv-layout-folder {% if configuration.homepageContent and configuration.homepageContent == 'folder' %}uv-layout-icon-active{% endif %}" data-toggle="tooltip" title="{{ 'Folder'|trans }}"></label>
  205.                                 <input name="website[homepageContent]" type="radio" id="homepage-folder" value="folder" {% if configuration.homepageContent and configuration.homepageContent == 'folder' %}checked{% endif %}/>
  206.                                 <label for="homepage-category" class="uv-layout-icon uv-layout-category {% if configuration.homepageContent and configuration.homepageContent == 'category' %}uv-layout-icon-active{% endif %}" data-toggle="tooltip" title="{{ 'Category'|trans }}"></label>
  207.                                 <input name="website[homepageContent]" type="radio" id="homepage-category" value="category" {% if configuration.homepageContent and configuration.homepageContent == 'category' %}checked{% endif %}/>
  208.                                 <label for="homepage-article" class="uv-layout-icon uv-layout-article {% if configuration.homepageContent and configuration.homepageContent == 'article' %}uv-layout-icon-active{% endif %}" data-toggle="tooltip" title="{{ 'Popular Article'|trans }}"></label>
  209.                                 <input name="website[homepageContent]" type="radio" id="homepage-article" value="article" {% if configuration.homepageContent and configuration.homepageContent == 'article' %}checked{% endif %}/>
  210.                             </div>
  211.                         </div>
  212.                         <!-- Field -->
  213.                         <div class="uv-element-block" style="margin: 20px 0">
  214.                             <label>
  215.                                 <div class="uv-checkbox">
  216.                                     <input name="website[ticketCreateOption]" type="checkbox" {{ configuration.ticketCreateOption ? 'checked="checked"':""}} />
  217.                                     <span class="uv-checkbox-view"></span>
  218.                                 </div>
  219.                                 <span class="uv-checkbox-label">{{ 'Ticket Create Option'|trans }}</span>
  220.                             </label>
  221.                         </div>
  222.                         <!-- //Field -->
  223.                         <!-- Field -->
  224.                         <div class="uv-element-block" style="margin: 20px 0">
  225.                             <label>
  226.                                 <div class="uv-checkbox">
  227.                                     <input name="website[loginRequiredToCreate]" type="checkbox" {{ configuration.loginRequiredToCreate ? 'checked="checked"':""}}/>
  228.                                     <span class="uv-checkbox-view"></span>
  229.                                 </div>
  230.                                 <span class="uv-checkbox-label">{{ 'Login Required To Create Tickets'|trans }}</span>
  231.                             </label>
  232.                         </div>
  233.                         <!-- //Field -->
  234.                         <!-- Field -->
  235.                         <div class="uv-element-block" style="margin: 20px 0">
  236.                             <label>
  237.                                 <div class="uv-checkbox">
  238.                                     <input name="website[removeCustomerLoginButton]" type="checkbox" value="1" {{ configuration.removeCustomerLoginButton ? 'checked="checked"':""}} />
  239.                                     <span class="uv-checkbox-view"></span>
  240.                                 </div>
  241.                                 <span class="uv-checkbox-label">{{ 'Remove Customer Login/Signin Button'|trans }}</span>
  242.                             </label>
  243.                         </div>
  244.                         <!-- //Field -->
  245.                         <!-- Field -->
  246.                         <div class="uv-element-block" style="margin: 20px 0">
  247.                             <label>
  248.                                 <div class="uv-checkbox">
  249.                                     <input name="website[disableCustomerLogin]" type="checkbox" value="1" {{ configuration.disableCustomerLogin ? 'checked="checked"':""}} />
  250.                                     <span class="uv-checkbox-view"></span>
  251.                                 </div>
  252.                                 <span class="uv-checkbox-label">{{ 'Disable Customer Login'|trans }}</span>
  253.                             </label>
  254.                         </div>
  255.                         <!-- //Field -->
  256.                     </div>
  257.                     <!-- CSRF token Field -->
  258.                     {# <input type="hidden" name="website[_token]" value="{{ uvdesk_service.generateCsrfToken('website') }}"/> #}
  259.                     <!-- //CSRF token Field -->
  260.                     <!--CTA-->
  261.                     <input class="uv-btn knowledgebase-btn" href="#" value="{{ 'Save Changes'|trans }}" type="button">
  262.                     <!--//CTA-->
  263.                 </form>
  264.             </div>
  265.             <!--//Tab View-->
  266.             <!--Tab View-->
  267.             <div class="uv-tab-view {% if type == 'seo' %}uv-tab-view-active{% endif %}" id="seo">
  268.                 <form method="post" action="{{ path('helpdesk_member_knowledgebase_theme', {'type': 'seo'}) }}" id="seoForm">
  269.                     <!-- Field -->
  270.                     <div class="uv-element-block">
  271.                         <label class="uv-field-label">{{ 'Meta Description (Recommended)'|trans }}</label>
  272.                         <div class="uv-field-block">
  273.                             <textarea name="metaDescription" class="uv-field">{{configuration.metaDescription ? configuration.metaDescription : "" }}</textarea>
  274.                         </div>
  275.                     </div>
  276.                     <!-- //Field -->
  277.                     <!-- Field -->
  278.                     <div class="uv-element-block">
  279.                         <label class="uv-field-label">{{ 'Meta Keywords (Recommended)'|trans }}</label>
  280.                         <div class="uv-field-block">
  281.                             <textarea name="metaKeywords" class="uv-field">{{ configuration.metaKeywords ? configuration.metaKeywords : "" }}</textarea>
  282.                         </div>
  283.                     </div>
  284.                     <!-- //Field -->
  285.                     <!-- CSRF token Field -->
  286.                     <input type="hidden" name="_token" value=""/>
  287.                     <!-- //CSRF token Field -->
  288.                     <!--CTA-->
  289.                     <input class="uv-btn seo-btn" href="#" value="{{ 'Save Changes'|trans }}" type="button">
  290.                     <!--//CTA-->
  291.                 </form>
  292.             </div>
  293.             <!--//Tab View-->
  294.             <!--Tab View-->
  295.             <div class="uv-tab-view {% if type == 'links' %}uv-tab-view-active{% endif %}" id="links">
  296.                 <form method="post" action="{{ path('helpdesk_member_knowledgebase_theme', {'type': 'links'}) }}" id="linksForm" class="uv-no-error-success-icon">
  297.                     <div class="uv-header-link-wrapper">
  298.                         <div class="links">
  299.                             {% if configuration.headerLinks|length %}
  300.                                 {% for key, link in configuration.headerLinks %}
  301.                                     <!-- Field -->
  302.                                     <div class="uv-element-block">
  303.                                         <label class="uv-field-label">{{ 'Header Link'|trans }} #{{key}}</label>
  304.                                         <div class="uv-field-block">
  305.                                             <input type="text" class="uv-field" name="headerLinks[{{key}}][label]" value="{{ link.label }}"  placeholder="{{ 'Label'|trans }}"/>
  306.                                             <input type="text" class="uv-field" name="headerLinks[{{key}}][url]" value="{{ link.url }}"  placeholder="{{ 'URL (with http:// or https://)'|trans }}" />
  307.                                             <a class="uv-btn-tag remove-link" href="#"><span class="uv-icon-remove-dark-box"></span></a>
  308.                                         </div>
  309.                                     </div>
  310.                                     <!-- //Field -->
  311.                                 {% endfor %}
  312.                             {% else %}
  313.                                 <!-- Field -->
  314.                                 <div class="uv-element-block">
  315.                                     <label class="uv-field-label">{{ 'Header Link'|trans }} #1</label>
  316.                                     <div class="uv-field-block">
  317.                                         <input type="text" class="uv-field" name="headerLinks[1][label]" placeholder="{{ 'Label'|trans }}" />
  318.                                         <input type="text" class="uv-field" name="headerLinks[1][url]" placeholder="{{ 'URL (with http:// or https://)'|trans }}" />
  319.                                         <a class="uv-btn-tag remove-link" href="#"><span class="uv-icon-remove-dark-box"></span></a>
  320.                                     </div>
  321.                                 </div>
  322.                                 <!-- //Field -->
  323.                             {% endif %}
  324.                         </div>
  325.                         <a class="uv-btn-tag btn-add" href="#" data-type="header">
  326.                             <span class="uv-icon-add-dark"></span> {{ 'Add More'|trans }}
  327.                         </a>
  328.                     </div>
  329.                     <div class="uv-footer-link-wrapper">
  330.                         <div class="links">
  331.                             {% if configuration.footerLinks|length %}
  332.                                 {% for key, link in configuration.footerLinks %}
  333.                                     <!-- Field -->
  334.                                     <div class="uv-element-block">
  335.                                         <label class="uv-field-label">{{ 'Footer Link'|trans }} #{{key}}</label>
  336.                                         <div class="uv-field-block">
  337.                                             <input type="text" class="uv-field" name="footerLinks[{{key}}][label]" value="{{ link.label }}"  placeholder="{{ 'Label'|trans }}"/>
  338.                                             <input type="text" class="uv-field" name="footerLinks[{{key}}][url]" value="{{ link.url }}"  placeholder="{{ 'URL (with http:// or https://)'|trans }}" />
  339.                                             <a class="uv-btn-tag remove-link" href="#"><span class="uv-icon-remove-dark-box"></span></a>
  340.                                         </div>
  341.                                     </div>
  342.                                     <!-- //Field -->
  343.                                 {% endfor %}
  344.                             {% else %}
  345.                                 <!-- Field -->
  346.                                 <div class="uv-element-block">
  347.                                     <label class="uv-field-label">{{ 'Footer Link'|trans }} #1</label>
  348.                                     <div class="uv-field-block">
  349.                                         <input type="text" class="uv-field" name="footerLinks[1][label]" placeholder="{{ 'Label'|trans }}" />
  350.                                         <input type="text" class="uv-field" name="footerLinks[1][url]" placeholder="{{ 'URL (with http:// or https://)'|trans }}" />
  351.                                         <a class="uv-btn-tag remove-link" href="#"><span class="uv-icon-remove-dark-box"></span></a>
  352.                                     </div>
  353.                                 </div>
  354.                                 <!-- //Field -->
  355.                             {% endif %}
  356.                         </div>
  357.                         <a class="uv-btn-tag btn-add" href="#" data-type="footer">
  358.                             <span class="uv-icon-add-dark"></span> {{ 'Add More'|trans }}
  359.                         </a>
  360.                     </div>
  361.                     <!--CTA-->
  362.                     <input class="uv-btn links-btn" style="margin-top: 15px;" href="#" value="{{ 'Save Changes'|trans }}" type="button">
  363.                     <!--//CTA-->
  364.                 </form>
  365.             </div>
  366.             <!--//Tab View-->
  367.                 <!--Tab View-->
  368.                 <div class="uv-tab-view {% if type == 'advanced' %}uv-tab-view-active{% endif %}" id="advanced">
  369.                     <form method="post" action="{{ path('helpdesk_member_knowledgebase_theme', {'type': 'advanced'}) }}" id="advancedForm">
  370.                         <!-- Field -->
  371.                         <div class="uv-element-block">
  372.                             <label class="uv-field-label">{{ 'Custom CSS (Optional)'|trans }}</label>
  373.                             <div class="uv-field-block">
  374.                                 <textarea name="customCSS" class="uv-field">{{ configuration.customCSS }}</textarea>
  375.                             </div>
  376.                             <span class="uv-field-info">{{ 'It will be add to the frontend knowledgebase only'|trans }}</span>
  377.                         </div>
  378.                         <!-- //Field -->
  379.                         <!-- Field -->
  380.                         <div class="uv-element-block">
  381.                             <label class="uv-field-label">{{ 'Custom Javascript (Optional)'|trans }}</label>
  382.                             <div class="uv-field-block">
  383.                                 <textarea name="script" class="uv-field">{{ configuration.script }}</textarea>
  384.                             </div>
  385.                             <span class="uv-field-info">{{ 'It will be add to the frontend knowledgebase only'|trans }}</span>
  386.                         </div>
  387.                         <!-- //Field -->
  388.                         <!-- CSRF token Field -->
  389.                         <input type="hidden" name="form[_token]" value="{{ uvdesk_service.generateCsrfToken('form') }}"/>
  390.                         <!-- //CSRF token Field -->
  391.                         <!--CTA-->
  392.                         <input class="uv-btn advanced-btn" href="#" value="{{ 'Save Changes'|trans }}" type="button">
  393.                         <!--//CTA-->
  394.                     </form>
  395.                 </div>
  396.                 <!--//Tab View-->
  397.         
  398.             <!--Tab View-->
  399.             <div class="uv-tab-view {% if type == 'broadcasting' %}uv-tab-view-active{% endif %}" id="broadcasting">
  400.                 {# {% set broadcastMessage = website.broadcastMessage|json_decode %} #}
  401.                 <form method="post" action="{{ path('helpdesk_member_knowledgebase_theme', {'type': 'broadcasting'}) }}" id="broadcastingForm">
  402.                     <!-- Field -->
  403.                     <div class="uv-element-block">
  404.                         <label class="uv-field-label">{{ 'Broadcast Message'|trans }}</label>
  405.                         <div class="uv-field-block">
  406.                             <textarea name="broadcasting[message]" class="uv-field grammarly-fix-broadcast">{{ broadcast.message is defined ? broadcast.message : '' }}</textarea>
  407.                         </div>
  408.                         <span class="uv-field-info">{{ 'Broadcast message content to show on helpdesk'|trans }}</span>
  409.                     </div>
  410.                     <!-- //Field -->
  411.                     <!-- Field -->
  412.                     <div class="uv-element-block">
  413.                         <label>{{ 'From'|trans }}</label>
  414.                         <div class="uv-field-block date">
  415.                             <input type="text" name="broadcasting[from]" class="uv-field datetime date-from" value="{{ broadcast.from is defined ? broadcast.from : '' }}">
  416.                         </div>
  417.                         <label>{{ 'To'|trans }}</label>
  418.                         <div class="uv-field-block date">
  419.                             <input type="text" name="broadcasting[to]" class="uv-field datetime date-to" value="{{ broadcast.to is defined ? broadcast.to : '' }}">
  420.                         </div>
  421.                         <span class="uv-field-info">{{ 'Time duration between which message will be displayed(if applicable)'|trans }}</span>
  422.                     </div>
  423.                     <!-- //Field -->
  424.                     <div class="uv-element-block">
  425.                         <label class="uv-field-label">{{'Broadcasting Status'|trans}}</label>
  426.                         <div class="uv-element-block">
  427.                             <label>
  428.                                 <div class="uv-checkbox">
  429.                                     <input type="checkbox" name="broadcasting[isActive]" value="{{ broadcast is not empty and broadcast.isActive ? 1 : 0 }}" {{ broadcast is not empty and broadcast.isActive ? 'checked' : '' }}>
  430.                                     <span class="uv-checkbox-view"></span>
  431.                                 </div>
  432.                                 <span class="uv-checkbox-label">{{'Broadcasting is Active'|trans}}</span>
  433.                             </label>
  434.                         </div>
  435.                     </div>
  436.                     <!-- CSRF token Field -->
  437.                     <input type="hidden" name="form[_token]" value=""/>
  438.                     <!-- //CSRF token Field -->
  439.                     <!--CTA-->
  440.                     <input class="uv-btn broadcasting-btn " href="#" value="{{ 'Save Changes'|trans }}" type="button">
  441.                     <!--//CTA-->
  442.                 </form>
  443.             </div>
  444.             <!--//Tab View-->
  445.             <!--Tab View-->
  446.             <div class="uv-tab-view {% if type == 'time' %}uv-tab-view-active{% endif %}" id="time">
  447.                 <!--Form-->
  448.                 
  449.                 <form method="post" action="{{ path('helpdesk_member_knowledgebase_theme', {'type': 'time'}) }}" id="timeSettingForm">
  450.                     <!-- Field -->
  451.                     <div class="uv-element-block">
  452.                         <label class="uv-field-label">{{ 'Timezone'|trans }}</label>
  453.                         <div class="uv-field-block">
  454.                             <select name="form[timezone]" class="uv-select">
  455.                                 {% for timezone in uvdesk_service.getTimezones() %}
  456.                                     <option value="{{ timezone }}" {% if websiteData.timezone == timezone %}selected{% endif %}>{{ timezone }}</option>
  457.                                 {% endfor %}
  458.                             </select>
  459.                         </div>
  460.                         <span class="uv-field-info">{{ "Choose a default company's timezone"|trans }}</span>
  461.                     </div>
  462.                     <!-- //Field -->
  463.                     <!-- Field -->
  464.                     <div class="uv-element-block">
  465.                         <label class="uv-field-label">{{ 'Date Time Format'|trans }}</label>
  466.                         <div class="uv-field-block">
  467.                             <select name="form[timeFormat]" class="uv-select">
  468.                                 {% for key, timeFormat in uvdesk_service.getTimeFormats() %}
  469.                                     <option value="{{ key }}" {% if websiteData.timeFormat == key %}selected{% endif %}>{{ timeFormat }}</option>
  470.                                 {% endfor %}
  471.                             </select>
  472.                         </div>
  473.                         <span class="uv-field-info">{{ 'Choose a format to convert date to specified date time format'|trans }}</span>
  474.                     </div>
  475.                     <!-- //Field -->
  476.                     <!--CTA-->
  477.                     <input class="uv-btn timezone-btn" href="#" value="{{ 'Save Changes'|trans }}" type="button">
  478.                     <!--//CTA-->
  479.                 </form>
  480.                 <!--//Form-->
  481.             </div>
  482.             <!--//Tab View-->
  483.         </div>
  484.     </div>
  485. {% endblock %}
  486. {% block footer %}
  487.     {{ parent() }}
  488.  <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-colorpicker/2.3.0/css/bootstrap-colorpicker.min.css">
  489.     <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-colorpicker/2.3.0/js/bootstrap-colorpicker.min.js"></script>
  490.     <script>
  491.           $('.datetime').datetimepicker({
  492.             format: 'YYYY-MM-DD H:mm:ss'
  493.         });
  494.     </script>
  495.     <!-- Header Link template -->
  496.     <script id="header_link_tmp" type="text/template">
  497.         <div class="uv-element-block">
  498.             <label class="uv-field-label">{{ 'Header Link'|trans }} #<%= count %></label>
  499.             <div class="uv-field-block">
  500.                 <input type="text" class="uv-field" name="headerLinks[<%= count %>][label]" placeholder="{{ 'Label'|trans }}" />
  501.                 <input type="text" class="uv-field" name="headerLinks[<%= count %>][url]" placeholder="{{ 'URL (with http:// or https://)'|trans }}" />
  502.                 <a class="uv-btn-tag remove-link" href="#"><span class="uv-icon-remove-dark-box"></span></a>
  503.             </div>
  504.         </div>
  505.     </script>
  506.     <!-- //Header Link template -->
  507.     <!-- Footer Link template -->
  508.     <script id="footer_link_tmp" type="text/template">
  509.         <div class="uv-element-block">
  510.             <label class="uv-field-label">{{ 'Footer Link'|trans }} #<%= count %></label>
  511.             <div class="uv-field-block">
  512.                 <input type="text" class="uv-field" name="footerLinks[<%= count %>][label]" placeholder="{{ 'Label'|trans }}" />
  513.                 <input type="text" class="uv-field" name="footerLinks[<%= count %>][url]" placeholder="{{ 'URL (with http:// or https://)'|trans }}" />
  514.                 <a class="uv-btn-tag remove-link" href="#"><span class="uv-icon-remove-dark-box"></span></a>
  515.             </div>
  516.         </div>
  517.     </script>
  518.     <!-- //Footer Link template -->
  519.     <script type="text/javascript">
  520.         $(function () {
  521.             $('.uv-color-field').colorpicker({format: "hex"}).on('changeColor', function(ev) {
  522.                 $(this).css('background', $(this).val())
  523.                 textColor = app.appView.getTextColorBasedBackground($(this).val());
  524.                 $(this).css('color', textColor)
  525.             });
  526.             var BrandingModel = Backbone.Model.extend({
  527.                 validation: {
  528.                     'website[name]': {
  529.                           required: true,
  530.                            msg: '{{ "This field is mandatory"|trans }}'
  531.                     },
  532.                                       
  533.                     'website[favicon]': [{
  534.                             notEmptyFile: true,
  535.                             msg: "{{ 'An empty file is not allowed.'|trans }}",
  536.                         }, {
  537.                             sizeLimit: true,
  538.                             msg: "{{ 'File size must not be greater than 200KB !!'|trans }}",
  539.                         }, {
  540.                             imageFile: true,
  541.                             msg: "{{ 'Please upload valid Image file (Only JPEG, JPG, PNG allowed)!!'|trans }}",
  542.                         }
  543.                     ],
  544.                     'website[logo]': [{
  545.                             notEmptyFile: true,
  546.                             msg: "{{ 'An empty file is not allowed.'|trans }}",
  547.                         }, {
  548.                             sizeLimit: true,
  549.                             msg: "{{ 'File size must not be greater than 200KB !!'|trans }}",
  550.                         }, {
  551.                             imageFile: true,
  552.                             msg: "{{ 'Please upload valid Image file (Only JPEG, JPG, PNG allowed)!!'|trans }}",
  553.                         }
  554.                     ],
  555.                 }
  556.             });
  557.             _.extend(Backbone.Validation.validators, {
  558.                 notEmptyFile: function(value, attr) {
  559.                     var field = $('input[name="' + attr + '"]');
  560.                     if(field.length && field[0].files && field[0].files.length ) {
  561.                         var file = field[0].files[0];
  562.                         if(file && 0 == file.size) {
  563.                             return true; //error
  564.                         }
  565.                     }                    
  566.                 },
  567.                 sizeLimit: function(value, attr) {
  568.                     var field = $('input[name="' + attr + '"]');
  569.                     if(field.length && field[0].files && field[0].files.length ) {
  570.                         var file = field[0].files[0];
  571.                         if(file && file.size/1024 > 200) {
  572.                             return true; //error                            
  573.                         }
  574.                     }                    
  575.                 },
  576.                 imageFile: function(value, attr) { 
  577.                     var field = $('input[name="' + attr + '"]');
  578.                     if(field.length && field[0].files && field[0].files.length ) {
  579.                         var file = field[0].files[0];
  580.                         if(file && file.type.indexOf('image/') != 0) {
  581.                             return true; //error                            
  582.                         }
  583.                     }
  584.                 }
  585.             });
  586.             var BrandingForm = Backbone.View.extend({
  587.                 events: {
  588.                     'click .general-btn': 'generalBrandingFormSubmit',
  589.                     'click .pending-response-btn': 'pendingResponseSettingFormSubmit',
  590.                     'click .uv-btn': 'disableButton',
  591.                     'blur input:not[type="file"]': 'formChanegd',
  592.                     'change input[type="file"]': 'formChanegd',
  593.                     'change .convertToSlug': 'convertToSlug',
  594.                     'click .uv-btn-tag.btn-add': 'addMoreLink',
  595.                     'click .remove-link': 'removeLink',
  596.                     "change .uv-knowledgebase-layout input[type='radio']": 'layoutChanged',
  597.                     'click #uv-reset-colors': 'resetDefaultColors',
  598.                 },
  599.                 resetDefaultColors: function(e) {
  600.                     var defaultColorArray = {
  601.                         'pageBackgroundColor': '#FFFFFF',
  602.                         'headerBackgroundColor': '#FFFFFF',
  603.                         'bannerBackgroundColor': '#7C70F4',
  604.                         'linkColor': '#2750C4',
  605.                         'linkHoverColor': '#2750C4',
  606.                         'articleTextColor': '#333333',
  607.                         'brandColor': '#7C70F4',
  608.                     };
  609.                     $(e.target).addClass('uv-icon-history-active');
  610.                     setTimeout(function () { 
  611.                         $(e.target).removeClass('uv-icon-history-active');
  612.                     }, 500);
  613.                     $.each(defaultColorArray, function(index, value) {
  614.                         var selectedField = $('input[name="website['+ index +']"]');
  615.                         selectedField.val(value);
  616.                         selectedField.trigger('changeColor');
  617.                     });
  618.                 },
  619.                 headerLinkTemplate : _.template($("#header_link_tmp").html()),
  620.                 footerLinkTemplate : _.template($("#footer_link_tmp").html()),
  621.                 initialize: function () {
  622.                     $('.uv-color-field').each(function() {
  623.                         textColor = app.appView.getTextColorBasedBackground($(this).val());
  624.                         $(this).css('color', textColor)
  625.                     });
  626.                     Backbone.Validation.bind(this);                  
  627.                 },
  628.                 formChanegd: function(e) {
  629.                     if(!Backbone.$(e.currentTarget).parents('.links').length) {
  630.                         this.model.set(Backbone.$(e.currentTarget).attr('name'), Backbone.$(e.currentTarget).val())
  631.                         this.model.isValid([Backbone.$(e.currentTarget).attr('name')])
  632.                     }
  633.                 },          
  634.                 generalBrandingFormSubmit: function (e) {
  635.                     e.preventDefault();
  636.                     this.model.set($('#generalSettingForm').serializeObject());
  637.                         console.log("form_submited fail");
  638.                     
  639.                     if(this.model.isValid(true)) {
  640.                        $("#generalSettingForm").submit();
  641.                     }
  642.                 },
  643.                 pendingResponseSettingFormSubmit: function (e) {
  644.                     e.preventDefault();
  645.                     this.model.set($('#pendingResponseSettingForm').serializeObject());
  646.                     if(this.model.isValid('website[pendingSince]')) {
  647.                         $('.pending-response-btn').attr('disabled', 'disabled');
  648.                         $("#pendingResponseSettingForm").submit();
  649.                     }
  650.                 },
  651.                 disableButton: function(e) {
  652.                     var form = Backbone.$(e.currentTarget).parents('form');
  653.                     if(form.attr('id') == 'seoForm' || form.attr('id') == 'advancedForm' || form.attr('id') == 'knowledgebaseForm') {
  654.                         Backbone.$(e.currentTarget).attr('disabled', 'disabled');
  655.                         form.submit()
  656.                     }
  657.                 },
  658.                 convertToSlug: function(e) {
  659.                     Backbone.$(e.currentTarget).val(app.appView.convertToSlug(Backbone.$(e.currentTarget).val()));
  660.                 },
  661.                 addMoreLink: function(e) {
  662.                     e.preventDefault();
  663.                     var currentElement = Backbone.$(e.currentTarget);
  664.                     if(currentElement.attr('data-type') == 'header') {
  665.                         count = $('.uv-header-link-wrapper .uv-element-block').length + 1;
  666.                         $('.uv-header-link-wrapper .links').append(this.headerLinkTemplate({'count' : count}))
  667.                     } else {
  668.                         count = $('.uv-footer-link-wrapper .uv-element-block').length + 1;
  669.                         $('.uv-footer-link-wrapper .links').append(this.footerLinkTemplate({'count' : count}))
  670.                     }
  671.                 },
  672.                 removeLink: function(e) {
  673.                     e.preventDefault()
  674.                     Backbone.$(e.currentTarget).parents('.uv-element-block').remove()
  675.                 },
  676.                 layoutChanged: function(e) {
  677.                     var currentElement = Backbone.$(e.currentTarget);
  678.                     $('.uv-layout-icon').removeClass('uv-layout-icon-active');
  679.                     $("label[for='" + currentElement.attr('id') + "']").addClass('uv-layout-icon-active');
  680.                 }
  681.             });
  682.             var brandingForm = new BrandingForm({
  683.                 el: 'form',
  684.                 model: new BrandingModel()
  685.             });
  686.             
  687.             var BroadcastModel = Backbone.Model.extend({
  688.                 validation: {
  689.                     'broadcasting[message]': {
  690.                           required: true,
  691.                            msg: '{{ "This field is mandatory"|trans }}'
  692.                     },
  693.                 }
  694.             });
  695.             var BroadcastForm = Backbone.View.extend({
  696.                 el: '#broadcastingForm',
  697.                 events: {
  698.                     'click .broadcasting-btn': 'broadcastingFormSubmit',
  699.                     'change textarea': 'formChanged',
  700.                 },
  701.                 initialize: function() {
  702.                     Backbone.Validation.bind(this);
  703.                 },
  704.                 formChanged: function(e) {
  705.                     if(!Backbone.$(e.currentTarget).parents('.links').length) {
  706.                         this.model.set(Backbone.$(e.currentTarget).attr('name'), Backbone.$(e.currentTarget).val())
  707.                         this.model.isValid([Backbone.$(e.currentTarget).attr('name')])
  708.                     }
  709.                 },
  710.                 broadcastingFormSubmit: function(e) {
  711.                     var form = Backbone.$(e.currentTarget).closest('form')
  712.                     if(form.attr('id') == 'broadcastingForm') {
  713.                         data = form.serializeObject();
  714.                         this.model.set(data);
  715.                         if(this.model.isValid(true)) {
  716.                             Backbone.$(e.currentTarget).attr('disabled', 'disabled');
  717.                             form.submit()
  718.                         }
  719.                     }
  720.                 }
  721.             });
  722.             var LinksModel = Backbone.Model.extend({
  723.                 validation: {
  724.                 }
  725.             });
  726.             var LinksForm = Backbone.View.extend({
  727.                 el: '#linksForm',
  728.                 initialize: function() {
  729.                     Backbone.Validation.bind(this);
  730.                 },                
  731.                 events: {
  732.                     'click .links-btn': 'validateLinks',
  733.                 },
  734.                 validateLinks: function(e) {
  735.                     e.preventDefault();
  736.                     var data = $('#linksForm').serializeObject();
  737.                     var self = this; var valid = true;
  738.                     $.each(data, function(key, value) {
  739.                         if(key.indexOf('[url]') != -1 && value && !value.match('^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$')) {
  740.                             Backbone.Validation.callbacks.invalid(self, key, '{{ "Provide a valid url(with protocol)"|trans }}', 'input');
  741.                             valid = false;
  742.                         } else {
  743.                             Backbone.Validation.callbacks.valid(self, key, '{{ "Provide a valid url(with protocol)"|trans }}', 'input');                            
  744.                         }
  745.                     });
  746.                     if(valid) {
  747.                         $('.links-btn').attr('disabled', 'disabled');
  748.                         $("#linksForm").submit();
  749.                     }
  750.                 },                      
  751.             });
  752.             var TimezoneForm = Backbone.View.extend({
  753.                 el: '#timeSettingForm',
  754.                 events: {
  755.                     'click .timezone-btn': 'timezoneFormSubmit',
  756.                     
  757.                 },
  758.                 timezoneFormSubmit: function(e) {
  759.                     var form = Backbone.$(e.currentTarget).closest('form')
  760.                     if (form.attr('id') == 'timeSettingForm') {
  761.                         data = form.serializeObject();
  762.                         form.submit()
  763.                     }
  764.                 }
  765.             });
  766.             var time = new TimezoneForm();
  767.             var broadcastForm = new BroadcastForm({
  768.                 model: new BroadcastModel()
  769.             });
  770.             var linksForm = new LinksForm({
  771.                 model: new LinksModel()                
  772.             });
  773.         });
  774.     </script>
  775.     {{ include("@UVDeskCoreFramework/Templates/tinyMCE.html.twig") }}
  776.     <script>
  777.         sfTinyMce.init({
  778.             height: '250px',
  779.             selector : '.grammarly-fix-broadcast',
  780.             plugins: 'autolink  link',
  781.             imagetools_cors_hosts: ['picsum.photos'],
  782.             toolbar: 'link anchor',
  783.             toolbar_sticky: true,
  784.             autosave_ask_before_unload: true,
  785.             autosave_interval: '30s',
  786.             autosave_prefix: '{path}{query}-{id}-',
  787.             autosave_restore_when_empty: false,
  788.             autosave_retention: '2m',
  789.             image_advtab: true,
  790.             templates: [
  791.                 { title: 'New Table', description: 'creates a new table', content: '<div class="mceTmpl"><table width="98%%"  border="0" cellspacing="0" cellpadding="0"><tr><th scope="col"> </th><th scope="col"> </th></tr><tr><td> </td><td> </td></tr></table></div>' },
  792.                 { title: 'Starting my story', description: 'A cure for writers block', content: 'Once upon a time...' },
  793.                 { title: 'New list with dates', description: 'New List with dates', content: '<div class="mceTmpl"><span class="cdate">cdate</span><br /><span class="mdate">mdate</span><h2>My List</h2><ul><li></li><li></li></ul></div>' }
  794.             ],
  795.             template_cdate_format: '[Date Created (CDATE): %d/%m/%Y : %H:%M:%S]',
  796.             template_mdate_format: '[Date Modified (MDATE): %d/%m/%Y : %H:%M:%S]',
  797.             height: 600,
  798.             image_caption: true,
  799.             quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote quickimage quicktable',
  800.             noneditable_noneditable_class: 'mceNonEditable',
  801.             toolbar_mode: 'sliding',
  802.             contextmenu: 'link image imagetools table',
  803.             content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }',
  804.             setup: function(editor) {
  805.             }
  806.         });
  807.     </script>
  808. {% endblock %}