theme.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <form data-auto="true" action="{:sysuri()}" method="post" id="theme" class='layui-form layui-card' autocomplete="off">
  2. <div class="layui-card-body padding-left-40">
  3. <div class="layui-form-item margin-bottom-5 label-required-prev">
  4. <div class="help-label"><b>后台主题样式</b>Theme Style</div>
  5. <div class="layui-textarea" style="min-height:unset">
  6. {foreach $themes as $k=>$v}
  7. <label class="think-radio">
  8. {if isset($theme) and $theme eq $k}
  9. <input name="site_theme" type="radio" value="{$k}" lay-ignore checked> {$v}
  10. {else}
  11. <input name="site_theme" type="radio" value="{$k}" lay-ignore> {$v}
  12. {/if}
  13. </label>
  14. {/foreach}
  15. </div>
  16. </div>
  17. </div>
  18. <div class="hr-line-dashed"></div>
  19. <div class="layui-form-item text-center">
  20. <button class="layui-btn" type="submit">保存配置</button>
  21. <button class="layui-btn layui-btn-danger" type='button' data-close>取消修改</button>
  22. </div>
  23. </form>
  24. <script>
  25. layui.form.render();
  26. $('form#theme input[name=site_theme]').on('click', function () {
  27. var alls = '', that = this, prox = 'layui-layout-theme-', curt = prox + that.value;
  28. $('form#theme input[name=site_theme]').map(function () {
  29. if (this.value !== that.value) alls += ' ' + prox + this.value;
  30. });
  31. $('.layui-layout-admin').removeClass(alls).addClass(curt)
  32. });
  33. </script>