Skip to content

Commit

Permalink
Episode edit screen updates
Browse files Browse the repository at this point in the history
  • Loading branch information
hlashbrooke committed Jul 21, 2016
1 parent b0f2306 commit d1e91fb
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 25 deletions.
Binary file modified _repo_assets/screenshot-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion assets/css/admin.css
Expand Up @@ -10,4 +10,8 @@
.view-feed-link span{font-size:100%;margin-top:2px;margin-bottom:-2px;}
#podcast_settings .update-nag{margin:0;padding:1px 9pt;}
textarea#episode_embed_code{width:100%;height:60px;}
.episode_embed_code_size_option{width:50px;}
.episode_embed_code_size_option{width:50px;}
#podcast-episode-data p{line-height:1.8;}
#podcast-episode-data input[type="radio"]{vertical-align: middle!important;}
#podcast-episode-data input[type="text"]{min-width:50%;}
.ssp-episode-details-label{font-weight:bold;}
55 changes: 32 additions & 23 deletions includes/class-ssp-admin.php
Expand Up @@ -446,8 +446,6 @@ public function meta_box_content() {
$html .= '<input type="hidden" name="seriouslysimple_' . $this->token . '_nonce" id="seriouslysimple_' . $this->token . '_nonce" value="' . wp_create_nonce( plugin_basename( $this->dir ) ) . '" />';

if ( 0 < count( $field_data ) ) {
$html .= '<table class="form-table">' . "\n";
$html .= '<tbody>' . "\n";

$html .= '<input id="seriouslysimple_post_id" type="hidden" value="'. $post_id . '" />';

Expand All @@ -470,47 +468,58 @@ public function meta_box_content() {

switch( $v['type'] ) {
case 'file':
$html .= '<tr valign="top"><th scope="row"><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td><input name="' . esc_attr( $k ) . '" type="text" id="upload_' . esc_attr( $k ) . '" class="regular-text" value="' . esc_attr( $data ) . '" /> <input type="button" class="button" id="upload_' . esc_attr( $k ) . '_button" value="' . __( 'Upload File' , 'seriously-simple-podcasting' ) . '" data-uploader_title="' . __( 'Choose a file', 'seriously-simple-podcasting' ) . '" data-uploader_button_text="' . __( 'Insert podcast file', 'seriously-simple-podcasting' ) . '" />' . "\n";
$html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
$html .= '</td><tr/>' . "\n";
$html .= '<p>
<label class="ssp-episode-details-label" for="' . esc_attr( $k ) . '">' . $v['name'] . '</label>
<br/>
<input name="' . esc_attr( $k ) . '" type="text" id="upload_' . esc_attr( $k ) . '" value="' . esc_attr( $data ) . '" />
<input type="button" class="button" id="upload_' . esc_attr( $k ) . '_button" value="' . __( 'Upload File' , 'seriously-simple-podcasting' ) . '" data-uploader_title="' . __( 'Choose a file', 'seriously-simple-podcasting' ) . '" data-uploader_button_text="' . __( 'Insert podcast file', 'seriously-simple-podcasting' ) . '" />
<br/>
<span class="description">' . $v['description'] . '</span>
</p>' . "\n";
break;

case 'checkbox':
$html .= '<tr valign="top"><th scope="row">' . $v['name'] . '</th><td><input name="' . esc_attr( $k ) . '" type="checkbox" class="' . esc_attr( $class ) . '" id="' . esc_attr( $k ) . '" ' . checked( 'on' , $data , false ) . ' /> <label for="' . esc_attr( $k ) . '"><span class="description">' . $v['description'] . '</span></label>' . "\n";
$html .= '</td><tr/>' . "\n";
$html .= '<p><input name="' . esc_attr( $k ) . '" type="checkbox" class="' . esc_attr( $class ) . '" id="' . esc_attr( $k ) . '" ' . checked( 'on' , $data , false ) . ' /> <label for="' . esc_attr( $k ) . '"><span>' . $v['description'] . '</span></label></p>' . "\n";
break;

case 'radio':
$html .= '<tr valign="top"><th scope="row">' . $v['name'] . '</th><td>' ."\n";
foreach( $v['options'] as $option => $label ) {
$html .= '<input style="vertical-align: bottom;" name="' . esc_attr( $k ) . '" type="radio" class="' . esc_attr( $class ) . '" id="' . esc_attr( $k ) . '_' . esc_attr( $option ) . '" ' . checked( $option , $data , false ) . ' value="' . esc_attr( $option ) . '" /> <label style="margin-right:10px;" for="' . esc_attr( $k ) . '_' . esc_attr( $option ) . '">' . esc_html( $label ) . '</label>' . "\n";
}
$html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
$html .= '</td><tr/>' . "\n";
$html .= '<p>
<span class="ssp-episode-details-label">' . $v['name'] . '</span><br/>';
foreach( $v['options'] as $option => $label ) {
$html .= '<input style="vertical-align: bottom;" name="' . esc_attr( $k ) . '" type="radio" class="' . esc_attr( $class ) . '" id="' . esc_attr( $k ) . '_' . esc_attr( $option ) . '" ' . checked( $option , $data , false ) . ' value="' . esc_attr( $option ) . '" />
<label style="margin-right:10px;" for="' . esc_attr( $k ) . '_' . esc_attr( $option ) . '">' . esc_html( $label ) . '</label>' . "\n";
}
$html .= '<span class="description">' . $v['description'] . '</span>
</p>' . "\n";
break;

case 'datepicker':
$display_date = '';
if( $data ) {
$display_date = date( 'j F, Y', strtotime( $data ) );
}
$html .= '<tr valign="top"><th scope="row"><label for="' . esc_attr( $k ) . '_display">' . $v['name'] . '</label></th><td class="hasDatepicker"><input type="text" id="' . esc_attr( $k ) . '_display" class="ssp-datepicker ' . esc_attr( $class ) . '" value="' . esc_attr( $display_date ) . '" />' . "\n";
$html .= '<input name="' . esc_attr( $k ) . '" id="' . esc_attr( $k ) . '" type="hidden" value="' . esc_attr( $data ) . '" />' . "\n";
$html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
$html .= '</td><tr/>' . "\n";
$html .= '<p class="hasDatepicker">
<label class="ssp-episode-details-label" for="' . esc_attr( $k ) . '_display">' . $v['name'] . '</label>
<br/>
<input type="text" id="' . esc_attr( $k ) . '_display" class="ssp-datepicker ' . esc_attr( $class ) . '" value="' . esc_attr( $display_date ) . '" />
<input name="' . esc_attr( $k ) . '" id="' . esc_attr( $k ) . '" type="hidden" value="' . esc_attr( $data ) . '" />
<br/>
<span class="description">' . $v['description'] . '</span>
</p>' . "\n";
break;

default:
$html .= '<tr valign="top"><th scope="row"><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td><input name="' . esc_attr( $k ) . '" type="text" id="' . esc_attr( $k ) . '" class="' . esc_attr( $class ) . '" value="' . esc_attr( $data ) . '" />' . "\n";
$html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
$html .= '</td><tr/>' . "\n";
$html .= '<p>
<label class="ssp-episode-details-label" for="' . esc_attr( $k ) . '">' . $v['name'] . '</label>
<br/>
<input name="' . esc_attr( $k ) . '" type="text" id="' . esc_attr( $k ) . '" class="' . esc_attr( $class ) . '" value="' . esc_attr( $data ) . '" />
<br/>
<span class="description">' . $v['description'] . '</span>
</p>' . "\n";
break;
}

}

$html .= '</tbody>' . "\n";
$html .= '</table>' . "\n";
}

echo $html;
Expand Down
3 changes: 2 additions & 1 deletion readme.txt
Expand Up @@ -88,8 +88,9 @@ You can find complete user and developer documentation (along with the FAQs) on
= 1.14.9 =
* 2016-07-21
* UPDATE SUMMARY: Improving accessibility and allowing for more frontend customisation.
* [TWEAK] Adding `download` attribute to episode download links
* [TWEAK] Adding `download` attribute to episode download links (props [Chris Christoff](https://github.com/chriscct7))
* [TWEAK] Adding HTML tags and classes to episode meta details
* [TWEAK] Improving layout of episode details fields on edit screen for design and accessibility

= 1.14.8 =
* 2016-06-06
Expand Down

0 comments on commit d1e91fb

Please sign in to comment.