Skip to content

Commit

Permalink
Some design updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdharmesh committed Dec 12, 2024
1 parent 5b97784 commit 35c9941
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 56 deletions.
54 changes: 19 additions & 35 deletions includes/Classifai/Features/TermCleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function render_settings_page() {
}
?>

<div class="classifai-wrap wrap classifai">
<div class="classifai-wrap wrap classifai classifai-term-cleanup">
<h2><?php esc_html_e( 'Term Cleanup', 'classifai' ); ?></h2>
<h2 class="nav-tab-wrapper">
<?php
Expand All @@ -200,8 +200,8 @@ public function render_settings_page() {
}
?>
</h2>
<div class="classifai-wrapper">
<div class="classifai-content-wrapper">
<div class="classifai-term-cleanup-wrapper">
<div class="classifai-term-cleanup-content-wrapper">
<h3 class="screen-reader-text"><?php echo esc_html( $all_taxonomies[ $active_tax ] ); ?></h3>
<?php
if ( $this->background_process && $this->background_process->in_progress() ) {
Expand Down Expand Up @@ -280,6 +280,22 @@ public function get_feature_default_settings(): array {
return $settings;
}

/**
* Sanitizes the default feature settings.
*
* @param array $new_settings Settings being saved.
* @return array
*/
public function sanitize_default_feature_settings( array $new_settings ): array {
if ( empty( $new_settings['use_ep'] ) || 1 !== (int) $new_settings['use_ep'] ) {
$new_settings['use_ep'] = 'no';
} else {
$new_settings['use_ep'] = '1';
}

return $new_settings;
}

/**
* Get meta key for embeddings.
*
Expand Down Expand Up @@ -326,38 +342,6 @@ public function get_all_feature_taxonomies(): array {
return $enabled_taxonomies;
}

/**
* Return the list of taxonomies
*
* @return array
*/
public function get_taxonomies(): array {
$taxonomies = get_taxonomies( [], 'objects' );
$taxonomies = array_filter( $taxonomies, 'is_taxonomy_viewable' );
$supported = [];

foreach ( $taxonomies as $taxonomy ) {
if ( 'post_format' === $taxonomy->name ) {
continue;
}

$supported[ $taxonomy->name ] = $taxonomy->labels->name;
}

/**
* Filter taxonomies shown in settings.
*
* @since x.x.x
* @hook classifai_feature_term_cleanup_setting_taxonomies
*
* @param {array} $supported Array of supported taxonomies.
* @param {object} $this Current instance of the class.
*
* @return {array} Array of taxonomies.
*/
return apply_filters( 'classifai_' . static::ID . '_setting_taxonomies', $supported, $this );
}

/**
* Start the term cleanup process.
*/
Expand Down
46 changes: 25 additions & 21 deletions src/scss/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ input.classifai-button {
border: none;
margin-left: 0;
background: transparent;
padding: 10px 12px;
padding: 9px 12px;
position: relative;

&:after {
Expand Down Expand Up @@ -917,20 +917,20 @@ div.classifai-openai__result-disable-link {
padding: 0 1em 1.5em 1em;
}

.classifai-content .classifai-term-consolidation {
.classifai-content .classifai-term-cleanup {
margin-top: 20px;
}

.classifai-term-consolidation .classifai-tabs.tabs-center {
.classifai-term-cleanup .classifai-tabs.tabs-center {
margin-bottom: 24px
}

.classifai-term-consolidation .classifai-tabs.tabs-justify {
.classifai-term-cleanup .classifai-tabs.tabs-justify {
table-layout: fixed;
width: 100%
}

.classifai-term-consolidation .classifai-tabs a.tab {
.classifai-term-cleanup .classifai-tabs a.tab {
color: #1d2327;
cursor: pointer;
display: block;
Expand All @@ -944,84 +944,88 @@ div.classifai-openai__result-disable-link {
background: #f9f9f9;
}

.classifai-term-consolidation .classifai-tabs a.tab:focus {
.classifai-term-cleanup .classifai-tabs a.tab:focus {
box-shadow: none
}

.classifai-term-consolidation .classifai-tabs a.tab:hover {
.classifai-term-cleanup .classifai-tabs a.tab:hover {
color: var(--classifai-admin-theme-color)
}

.classifai-term-consolidation .classifai-tabs a.tab.active {
.classifai-term-cleanup .classifai-tabs a.tab.active {
background: #f0f0f0;
border-radius: 4px;
box-shadow: none;
font-weight: 600
}

.classifai-term-consolidation .classifai-tabs a.tab.active:after {
.classifai-term-cleanup .classifai-tabs a.tab.active:after {
opacity: 1;
transform: scale(1)
}

.classifai-term-consolidation .classifai-term-consolidation-wrapper {
.classifai-term-cleanup .classifai-term-cleanup-wrapper {
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin-top: 20px;
}


.classifai-term-consolidation .classifai-term-consolidation-content-wrapper .classifai-term-consolidation-content-wrapper-field-label {
.classifai-term-cleanup .classifai-term-cleanup-content-wrapper .classifai-term-cleanup-content-wrapper-field-label {
text-align: left
}

.classifai-term-consolidation .classifai-term-consolidation-content-wrapper .classifai-term-consolidation-content-wrapper-field {
.classifai-term-cleanup .classifai-term-cleanup-content-wrapper .classifai-term-cleanup-content-wrapper-field {
padding: 0
}

.classifai-term-consolidation .classifai-term-consolidation-content-wrapper .classifai-term-consolidation-content-wrapper-field-label>label {
.classifai-term-cleanup .classifai-term-cleanup-content-wrapper .classifai-term-cleanup-content-wrapper-field-label>label {
display: block;
font-weight: 700;
margin-bottom: 0;
text-transform: uppercase
}

.classifai-term-consolidation .classifai-term-consolidation-content-wrapper input[type=password],
.classifai-term-consolidation .classifai-term-consolidation-content-wrapper input[type=text] {
.classifai-term-cleanup .classifai-term-cleanup-content-wrapper input[type=password],
.classifai-term-cleanup .classifai-term-cleanup-content-wrapper input[type=text] {
font-size: 14px;
height: 38px;
margin-bottom: 4px;
width: 100%
}

.classifai-term-consolidation .classifai-term-consolidation-content-wrapper .classifai-setup-footer {
.classifai-term-cleanup .classifai-term-cleanup-content-wrapper .classifai-setup-footer {
margin-top: 40px
}

@media screen and (max-width: 782px) {
.classifai-term-consolidation .classifai-term-consolidation-content-wrapper {
.classifai-term-cleanup .classifai-term-cleanup-content-wrapper {
padding-left: 18px
}
}

@media screen and (max-width: 600px) {
.classifai-term-consolidation .classifai-term-consolidation-content-wrapper {
.classifai-term-cleanup .classifai-term-cleanup-content-wrapper {
margin-bottom: 20px;
padding-left: 0;
width: 100%
}
}

.classifai-term-consolidation-process-status p{
.classifai-term-cleanup-process-status p{
font-size: 14px;
}

.classifai-term-consolidation-process-status .dashicons-yes-alt{
.classifai-term-cleanup-process-status .dashicons-yes-alt{
color: #48be1e;
}

.classifai-term-consolidation .classifai-term-consolidation-content-wrapper input[type=text].current-page{
.classifai-term-cleanup-process-status .button-link-delete {
color: #cc0000;
}

.classifai-term-cleanup .classifai-term-cleanup-content-wrapper input[type=text].current-page{
width: auto;
height: auto;
}
Expand Down

0 comments on commit 35c9941

Please sign in to comment.