Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visually aligns elements in the settings page #3018

Merged
merged 1 commit into from
Sep 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion assets/css/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,14 @@ h2 .nav-tab.ep-credentials-tab {
border-top: 1px solid #ccc;
}

.ep-settings .ep-credentials-general {
padding: 0 1rem;
}

.ep-settings .button-primary {
margin: 0 1rem;
}

.ep-settings .description {
font-size: 0.75rem;
font-style: italic;
Expand All @@ -1010,9 +1018,17 @@ h2 .nav-tab.ep-credentials-tab {
width: auto;
}

.ep-credentials .form-table td {
.ep-credentials .form-table td,
.ep-credentials-general .form-table td {
padding-left: 0;
}

.ep-credentials .form-table td input,
.ep-credentials .form-table td select,
.ep-credentials-general .form-table td input,
.ep-credentials-general .form-table td select {
width: 250px;
JakePT marked this conversation as resolved.
Show resolved Hide resolved
}
}

.ep-flex-container {
Expand Down
86 changes: 44 additions & 42 deletions includes/partials/settings-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,54 +182,56 @@
</fieldset>
</div>

<table class="form-table">
<tbody>
<tr>
<th scope="row">
<label for="ep_language"><?php esc_html_e( 'Elasticsearch Language', 'elasticpress' ); ?></label>
</th>
<td>
<?php
$ep_language = Utils\get_language();

wp_dropdown_languages(
[
'id' => 'ep_language',
'name' => 'ep_language',
'selected' => $ep_language,
]
);
?>
<p class="description"><?php esc_html_e( 'Default language for your Elasticsearch mapping.', 'elasticpress' ); ?></p>
</td>
</tr>
<tr>
<th scope="row">
<label><?php esc_html_e( 'Elasticsearch Version', 'elasticpress' ); ?></label></th>
<td>
<?php if ( $is_epio ) : ?>
<?php esc_html_e( 'ElasticPress.io Managed Platform' ); ?>
<?php else : ?>
<?php if ( ! empty( $version ) ) : ?>
<?php echo esc_html( $version ); ?>
<?php else : ?>
&mdash;
<?php endif; ?>
<?php endif; ?>
</td>
</tr>
<?php if ( ! empty( $host ) && ! has_filter( 'ep_index_posts_per_page' ) ) : ?>
<div class="ep-credentials-general">
<table class="form-table">
<tbody>
<tr>
<th scope="row">
<label for="ep_bulk_setting"><?php esc_html_e( 'Content Items per Index Cycle ', 'elasticpress' ); ?></label>
<label for="ep_language"><?php esc_html_e( 'Elasticsearch Language', 'elasticpress' ); ?></label>
</th>
<td>
<input type="text" name="ep_bulk_setting" id="ep_bulk_setting" value="<?php echo absint( $bulk_setting ); ?>">
<?php
$ep_language = Utils\get_language();

wp_dropdown_languages(
[
'id' => 'ep_language',
'name' => 'ep_language',
'selected' => $ep_language,
]
);
?>
<p class="description"><?php esc_html_e( 'Default language for your Elasticsearch mapping.', 'elasticpress' ); ?></p>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<tr>
<th scope="row">
<label><?php esc_html_e( 'Elasticsearch Version', 'elasticpress' ); ?></label></th>
<td>
<?php if ( $is_epio ) : ?>
<?php esc_html_e( 'ElasticPress.io Managed Platform' ); ?>
<?php else : ?>
<?php if ( ! empty( $version ) ) : ?>
<?php echo esc_html( $version ); ?>
<?php else : ?>
&mdash;
<?php endif; ?>
<?php endif; ?>
</td>
</tr>
<?php if ( ! empty( $host ) && ! has_filter( 'ep_index_posts_per_page' ) ) : ?>
<tr>
<th scope="row">
<label for="ep_bulk_setting"><?php esc_html_e( 'Content Items per Index Cycle ', 'elasticpress' ); ?></label>
</th>
<td>
<input type="text" name="ep_bulk_setting" id="ep_bulk_setting" value="<?php echo absint( $bulk_setting ); ?>">
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>

<?php
/**
Expand Down