fix: acp category-selector being changed by theme

This commit is contained in:
Barış Soner Uşaklı
2022-12-13 11:18:09 -05:00
parent 9b3616b103
commit ac1f3c314b
9 changed files with 47 additions and 8 deletions

View File

@@ -35,7 +35,7 @@
<!-- IMPORT partials/breadcrumbs.tpl -->
<div class="mb-3">
<!-- IMPORT partials/category-selector.tpl -->
<!-- IMPORT admin/partials/category-selector.tpl -->
</div>
{{{ if !categoryMods.length }}}
<div><p class="alert alert-info">[[admin/manage/admins-mods:no-sub-categories]]</p></div>

View File

@@ -2,7 +2,7 @@
<div class="row">
<div class="col-lg-12">
<div class="category btn-group">
<!-- IMPORT partials/category-selector.tpl -->
<!-- IMPORT admin/partials/category-selector.tpl -->
</div>
<div class="btn-group">
<button id="collapse-all" class="btn btn-outline-secondary">[[admin/manage/categories:collapse-all]]</button>

View File

@@ -1,7 +1,7 @@
<div class="category" data-cid="{category.cid}">
<div class="row mb-3">
<div class="d-flex col-12 justify-content-end">
<!-- IMPORT partials/category-selector-right.tpl -->
<!-- IMPORT admin/partials/category-selector-right.tpl -->
</div>
</div>

View File

@@ -105,7 +105,7 @@
<input id="memberPostCids" type="text" class="form-control" value="{group.memberPostCids}">
</div>
<div class="col-md-3 member-post-cids-selector">
<!-- IMPORT partials/category-selector.tpl -->
<!-- IMPORT admin/partials/category-selector.tpl -->
</div>
</div>
</div>
@@ -146,7 +146,7 @@
<hr />
<div class="edit-privileges-selector">
<label class="form-label" class="float-start">[[admin/manage/privileges:edit-privileges]]</label>
<!-- IMPORT partials/category-selector.tpl -->
<!-- IMPORT admin/partials/category-selector.tpl -->
</div>
</div>
</form>

View File

@@ -8,7 +8,7 @@
<div class="lead mb-3">
[[admin/manage/categories:privileges.category-selector]]
<!-- IMPORT partials/category-selector.tpl -->
<!-- IMPORT admin/partials/category-selector.tpl -->
</div>
<div class="privilege-table-container">

View File

@@ -5,12 +5,12 @@
</div>
<div class="mb-3" id="parentCidGroup">
<label class="form-label" for="parentCid">[[admin/manage/categories:optional-parent-category]]</label>
<!-- IMPORT partials/category-selector.tpl -->
<!-- IMPORT admin/partials/category-selector.tpl -->
</div>
<div class="mb-3" id="cloneFromCidGroup">
<label class="form-label" for="cloneFromCid">[[admin/manage/categories:optional-clone-settings]]</label>
<!-- IMPORT partials/category-selector.tpl -->
<!-- IMPORT admin/partials/category-selector.tpl -->
<label>
<input id="cloneChildren" name="cloneChildren" type="checkbox">
<strong>[[admin/manage/categories:clone-children]]</strong>

View File

@@ -0,0 +1,33 @@
<button type="button" class="btn btn-outline-secondary dropdown-toggle" data-bs-toggle="dropdown">
<span component="category-selector-selected">
{{{ if (selectedCategory && !showCategorySelectLabel) }}}
<span class="category-item">
{buildCategoryIcon(selectedCategory, "24px", "rounded-circle")}
{selectedCategory.name}
</span>
{{{ else }}}
<span class="visible-sm-inline visible-md-inline visible-lg-inline">{{{ if selectCategoryLabel }}}{selectCategoryLabel}{{{ else }}}[[topic:thread_tools.select_category]]{{{ end }}}</span><span class="visible-xs-inline"><i class="fa fa-fw {{{ if selectCategoryIcon }}}{selectCategoryIcon}{{{ else }}}fa-list{{{ end }}}"></i></span>
{{{ end }}}</span> <span class="caret"></span>
</button>
<div component="category-selector-search" class="hidden position-absolute">
<input type="text" class="form-control" autocomplete="off">
</div>
<ul component="category/list" class="dropdown-menu category-dropdown-menu" role="menu">
<li component="category/no-matches" role="presentation" class="category hidden">
<a class="dropdown-item" role="menu-item">[[search:no-matches]]</a>
</li>
{{{each categoryItems}}}
<li role="presentation" class="category {{{ if ../disabledClass }}}disabled {{{ end }}}" data-cid="{../cid}" data-name="{../name}" data-parent-cid="{../parentCid}">
<a class="dropdown-item" role="menu-item">{../level}
<span component="category-markup" style="{{{ if ../match }}}font-weight: bold;{{{end}}}">
<div class="category-item d-inline-block">
{{{ if ./icon }}}
{buildCategoryIcon(@value, "24px", "rounded-circle")}
{{{ end }}}
{./name}
</div>
</span>
</a>
</li>
{{{ end }}}
</ul>

View File

@@ -0,0 +1,3 @@
<div component="category-selector" class="btn-group right category-dropdown-container bottom-sheet">
<!-- IMPORT admin/partials/category-selector-content.tpl -->
</div>

View File

@@ -0,0 +1,3 @@
<div component="category-selector" class="btn-group bottom-sheet">
<!-- IMPORT admin/partials/category-selector-content.tpl -->
</div>