Skip to content

Commit

Permalink
UX: some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdharmesh committed Oct 11, 2024
1 parent 1334e69 commit 32b40bf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
15 changes: 6 additions & 9 deletions includes/Classifai/Admin/SimilarTermsListTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function get_columns() {
'term' => $label,
// translators: %s: Singular label of the taxonomy.
'similar_term' => sprintf( __( 'Similar %s', 'classifai' ), $label ),
'actions' => __( 'Actions', 'classifai' ),
'actions' => __( 'Action', 'classifai' ),
);
}

Expand Down Expand Up @@ -155,25 +155,22 @@ public function generate_term_html( $term, $similar_term, $score = null ) {

return sprintf(
// translators: %s: Term name, %d: Term ID.
__( '<span><strong>%1$s</strong> (ID: %2$d)</span><br/><br/>', 'classifai' ) .
__( '<span><strong>%1$s</strong> (ID: %2$s)</span><br/><br/>', 'classifai' ) .
// translators: %s: Term slug.
__( '<span><strong>Slug:</strong> %3$s</span><br/>', 'classifai' ) .
// translators: %s: Term count.
__( '<span><strong>Count:</strong> %4$s</span><br/>', 'classifai' ) .
__( '<span><strong>Used:</strong> %4$s</span><br/>', 'classifai' ) .
// translators: %s: Term parent name.
__( '<span><strong>Parent:</strong> %5$s</span><br/>', 'classifai' ) .
// translators: %s: Similarity score.
( $score ? __( '<span><strong>Similarity:</strong> %6$s</span><br/>', 'classifai' ) : '%6$s' ) .
// translators: %s: Term description.
__( '<span><strong>Description:</strong> %7$s</span><br/><br/>', 'classifai' ) .
'<a href="%8$s" class="button button-primary">%9$s</a>',
'<a href="%7$s" class="button button-primary term-merge-button">%8$s</a>',
esc_html( $term->name ),
esc_html( $term->term_id ),
'<a href="' . esc_url( get_edit_term_link( $term->term_id, $term->taxonomy ) ) . '" target="_blank">' . esc_html( $term->term_id ) . '</a>',
esc_html( $term->slug ),
esc_html( $term->count ),
'<a href="' . esc_url( admin_url( 'edit.php?tag=' . $term->slug ) ) . '" target="_blank">' . esc_html( sprintf( _n( '%d time', '%d times', $term->count, 'classifai' ), $term->count ) ) . '</a>',
esc_html( $term->parent > 0 ? get_term( $term->parent )->name : 'None' ),
$score ? esc_html( round( $score * 100, 2 ) . '%' ) : '',
esc_html( $term->description ),
esc_url( $merge_url ),
esc_html__( 'Merge and keep this', 'classifai' )
);
Expand Down
15 changes: 15 additions & 0 deletions src/scss/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1055,3 +1055,18 @@ table.similar_terms tbody tr.border:last-child {
table.similar_terms th#actions {
width: 15%;
}

table.similar_terms .term-merge-button {
margin-top: 16px;
margin-bottom: 8px;
}

table.similar_terms.widefat td,
table.similar_terms.widefat th {
padding: 14px;
font-size: 14px;
}

table.similar_terms.widefat thead th {
font-weight: bold;
}

0 comments on commit 32b40bf

Please sign in to comment.