Skip to content

Commit 93e8ba3

Browse files
committed
Improve settings page UI
1 parent 1c44d07 commit 93e8ba3

4 files changed

Lines changed: 69 additions & 28 deletions

File tree

assets/js/wpcable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ jQuery(document).ready(function () {
514514
filterCb.on( 'click', function() { updateFilters(); initFilters(); } );
515515
flagCb.on( 'click', function() { updateFilters(); initFilters(); } );
516516

517-
filterTxt.on( 'change keyup', function() {
517+
filterTxt.on( 'change keyup search', function() {
518518
if ( filterTxtVal !== filterTxt.val() ) {
519519
updateFilters();
520520
initFilters();

functions/admin-estimate.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ function codeable_estimate_callback() {
5252

5353
<div id="fees" class="postbox">
5454
<h2 class="hndle">
55-
<span>Rate and Fees</span>
55+
<span>
56+
Rate and Fees
57+
<a href="<?php echo esc_url( admin_url( 'admin.php?page=codeable_settings' ) ); ?>"><?php esc_html_e( 'Change', 'wpcable' ); ?></a>
58+
</span>
5659
</h2>
5760
<div class="inside">
5861
<div class="field">

functions/admin-settings.php

Lines changed: 63 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,57 @@ function codeable_settings_callback() {
115115
?>
116116
<div class="wrap wpcable_wrap">
117117
<form method="post" action="options.php">
118-
<h2><?php esc_html_e( 'Codeable settings', 'wpcable' ); ?></h2>
118+
<?php settings_fields( 'wpcable_group', '_wpnonce', false ); ?>
119+
<input
120+
type="hidden"
121+
name="_wp_http_referer"
122+
value="<?php echo remove_query_arg( ['success', 'error' ] ); ?>"
123+
/>
124+
<?php do_settings_sections( 'wpcable_group' ); ?>
125+
126+
<h2><?php esc_html_e( 'Task list', 'wpcable' ); ?></h2>
127+
<p>
128+
<?php
129+
printf(
130+
esc_html__( 'Adjust behavior of %syour task list%s.', 'wpcable' ),
131+
'<a href="' . admin_url( 'admin.php?page=codeable_tasks') . '">',
132+
'</a>'
133+
);
134+
?>
135+
</p>
119136

120137
<table class="form-table">
121138
<tbody>
139+
<tr>
140+
<th scope="row">
141+
<label class="wpcable_label" for="wpcable_cancel_after_days">
142+
<?php esc_html_e( 'Flag task as canceled', 'wpcable' ); ?>
143+
</label>
144+
</th>
145+
<td>
146+
<input type="number" name="wpcable_cancel_after_days" id="wpcable_cancel_after_days" min="14" max="720" value="<?php echo (int) $wpcable_cancel_after_days; ?>" /> hours
147+
<p class="description">
148+
<?php esc_html_e( 'Adds the "canceled" flag to a task that had no activity for the given number of days. Default is 180 days.', 'wpcable' ); ?>
149+
</p>
150+
</td>
151+
</tr>
152+
</tbody>
153+
</table>
122154

123-
<?php settings_fields( 'wpcable_group', '_wpnonce', false ); ?>
124-
<input
125-
type="hidden"
126-
name="_wp_http_referer"
127-
value="<?php echo remove_query_arg( ['success', 'error' ] ); ?>"
128-
/>
129-
<?php do_settings_sections( 'wpcable_group' ); ?>
155+
<hr />
156+
<h2><?php esc_html_e( 'Estimates', 'wpcable' ); ?></h2>
157+
<p>
158+
<?php
159+
printf(
160+
esc_html__( 'Customize the defaults for %syour estimates%s.', 'wpcable' ),
161+
'<a href="' . admin_url( 'admin.php?page=codeable_estimate') . '">',
162+
'</a>'
163+
);
164+
?>
165+
</p>
130166

167+
<table class="form-table">
168+
<tbody>
131169
<tr>
132170
<th scope="row">
133171
<label class="wpcable_label" for="wpcable_rate">
@@ -172,19 +210,18 @@ function codeable_settings_callback() {
172210
</p>
173211
</td>
174212
</tr>
175-
<tr>
176-
<th scope="row">
177-
<label class="wpcable_label" for="wpcable_cancel_after_days">
178-
<?php esc_html_e( 'Flag task as canceled', 'wpcable' ); ?>
179-
</label>
180-
</th>
181-
<td>
182-
<input type="number" name="wpcable_cancel_after_days" id="wpcable_cancel_after_days" min="14" max="720" value="<?php echo (int) $wpcable_cancel_after_days; ?>" /> hours
183-
<p class="description">
184-
<?php esc_html_e( 'Adds the "canceled" flag to a task that had no activity for the given number of days. Default is 180 days.', 'wpcable' ); ?>
185-
</p>
186-
</td>
187-
</tr>
213+
</tbody>
214+
</table>
215+
216+
<hr />
217+
<h2><?php esc_html_e( 'Codeable API', 'wpcable' ); ?></h2>
218+
<p>
219+
<?php esc_html_e( 'Log into your Codeable account.', 'wpcable' ); ?><br />
220+
<?php esc_html_e( 'During login this plugin obtains a user-specific auth-token which is used to fetch data from the API later. Your password is not saved anywhere!', 'wpcable' ); ?>
221+
</p>
222+
223+
<table class="form-table">
224+
<tbody>
188225
<?php if ( codeable_api_logged_in() ) : ?>
189226
<tr>
190227
<th scope="row">
@@ -196,13 +233,14 @@ function codeable_settings_callback() {
196233
<p>
197234
<?php
198235
printf(
199-
__( 'You are currently logged in as %s. %sLog out and clear all data%s', 'wpcable' ),
200-
'<b>' . $wpcable_email . '</b>',
201-
'<a href="' . esc_url( $logout_url ) . '" onclick="return confirm(\'' . esc_attr( $logout_warning ) . '\')">',
202-
'</a>'
236+
__( 'You are currently logged in as %s', 'wpcable' ),
237+
'<b>' . $wpcable_email . '</b>'
203238
);
204239
?>
205240
</p>
241+
<p>
242+
<a href="<?php echo esc_url( $logout_url ); ?>" class="button" onclick="return confirm('<?php echo esc_attr( $logout_warning ); ?>')"><?php esc_html_e( 'Log out and clear all data', 'wpcable' ); ?></a>
243+
</p>
206244
</td>
207245
</tr>
208246
<?php else : ?>

functions/admin-tasks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ class="list-item state-{{{ data.state }}}<# if (data.preferred ) { #> task-prefe
332332
</span>
333333
</div>
334334
<div class="row-actions">
335-
<a href="<?php echo esc_url( admin_url( 'admin.php?page=codeable_estimate') ); ?>&fee_client={{{ data.client_fee }}}"><?php esc_html_e( 'Estimate', 'wpcable' ); ?></a>
335+
<a href="<?php echo esc_url( admin_url( 'admin.php?page=codeable_estimate' ) ); ?>&fee_client={{{ data.client_fee }}}"><?php esc_html_e( 'Estimate', 'wpcable' ); ?></a>
336336
<ul class="color-flag">
337337
<?php
338338
foreach ( $color_flags as $flag => $info ) {

0 commit comments

Comments
 (0)