mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-02 09:11:17 +03:00
Hide contributor editing fields when$readonly
is true
This commit is contained in:
parent
0584caed99
commit
258e86dc0b
|
@ -52,6 +52,7 @@
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pledge-contributors.pledge-status__5ftf-deactivated .resend-confirm,
|
||||||
.pledge-contributors.pledge-status__draft .resend-confirm {
|
.pledge-contributors.pledge-status__draft .resend-confirm {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,8 @@ use function WordPressDotOrg\FiveForTheFuture\get_views_path;
|
||||||
|
|
||||||
/** @var array $contributors */
|
/** @var array $contributors */
|
||||||
/** @var int $pledge_id */
|
/** @var int $pledge_id */
|
||||||
|
/** @var bool $readonly */
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/template" id="tmpl-5ftf-contributor-lists">
|
<script type="text/template" id="tmpl-5ftf-contributor-lists">
|
||||||
<# if ( data.publish.length ) { #>
|
<# if ( data.publish.length ) { #>
|
||||||
<h3 class="contributor-list-heading"><?php esc_html_e( 'Confirmed', 'wporg-5ftf' ); ?></h3>
|
<h3 class="contributor-list-heading"><?php esc_html_e( 'Confirmed', 'wporg-5ftf' ); ?></h3>
|
||||||
|
@ -14,7 +14,9 @@ use function WordPressDotOrg\FiveForTheFuture\get_views_path;
|
||||||
<thead>
|
<thead>
|
||||||
<th scope="col"><?php esc_html_e( 'Contributor', 'wporg-5ftf' ); ?></th>
|
<th scope="col"><?php esc_html_e( 'Contributor', 'wporg-5ftf' ); ?></th>
|
||||||
<th scope="col"><?php esc_html_e( 'Date Confirmed', 'wporg-5ftf' ); ?></th>
|
<th scope="col"><?php esc_html_e( 'Date Confirmed', 'wporg-5ftf' ); ?></th>
|
||||||
|
<?php if ( ! $readonly ) : ?>
|
||||||
<th scope="col"><?php esc_html_e( 'Remove Contributor', 'wporg-5ftf' ); ?></th>
|
<th scope="col"><?php esc_html_e( 'Remove Contributor', 'wporg-5ftf' ); ?></th>
|
||||||
|
<?php endif; ?>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>{{{ data.publish }}}</tbody>
|
<tbody>{{{ data.publish }}}</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -26,7 +28,9 @@ use function WordPressDotOrg\FiveForTheFuture\get_views_path;
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col"><?php esc_html_e( 'Contributor', 'wporg-5ftf' ); ?></th>
|
<th scope="col"><?php esc_html_e( 'Contributor', 'wporg-5ftf' ); ?></th>
|
||||||
<th scope="col" class="resend-confirm"><?php esc_html_e( 'Resend Confirmation', 'wporg-5ftf' ); ?></th>
|
<th scope="col" class="resend-confirm"><?php esc_html_e( 'Resend Confirmation', 'wporg-5ftf' ); ?></th>
|
||||||
|
<?php if ( ! $readonly ) : ?>
|
||||||
<th scope="col"><?php esc_html_e( 'Remove Contributor', 'wporg-5ftf' ); ?></th>
|
<th scope="col"><?php esc_html_e( 'Remove Contributor', 'wporg-5ftf' ); ?></th>
|
||||||
|
<?php endif; ?>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>{{{ data.pending }}}</tbody>
|
<tbody>{{{ data.pending }}}</tbody>
|
||||||
|
@ -58,6 +62,7 @@ use function WordPressDotOrg\FiveForTheFuture\get_views_path;
|
||||||
<# } else { #>
|
<# } else { #>
|
||||||
<td>{{ data.publishDate }}</td>
|
<td>{{ data.publishDate }}</td>
|
||||||
<# } #>
|
<# } #>
|
||||||
|
<?php if ( ! $readonly ) : ?>
|
||||||
<td>
|
<td>
|
||||||
<button
|
<button
|
||||||
class="button-link button-link-delete"
|
class="button-link button-link-delete"
|
||||||
|
@ -70,6 +75,7 @@ use function WordPressDotOrg\FiveForTheFuture\get_views_path;
|
||||||
<?php esc_html_e( 'Remove', 'wporg-5ftf' ); ?>
|
<?php esc_html_e( 'Remove', 'wporg-5ftf' ); ?>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
|
<?php endif; ?>
|
||||||
</tr>
|
</tr>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -88,16 +94,18 @@ use function WordPressDotOrg\FiveForTheFuture\get_views_path;
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$data = [ 'pledge-contributors' => '' ];
|
if ( ! $readonly ) :
|
||||||
require get_views_path() . 'inputs-pledge-contributors.php';
|
$data = [ 'pledge-contributors' => '' ];
|
||||||
?>
|
require get_views_path() . 'inputs-pledge-contributors.php';
|
||||||
|
?>
|
||||||
|
|
||||||
<div id="add-contrib-message" role="alert" aria-atomic="true"></div>
|
<div id="add-contrib-message" role="alert" aria-atomic="true"></div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="button-primary"
|
class="button-primary"
|
||||||
data-action="add-contributor"
|
data-action="add-contributor"
|
||||||
>
|
>
|
||||||
<?php esc_html_e( 'Add new contributors', 'wporg-5ftf' ); ?>
|
<?php esc_html_e( 'Add new contributors', 'wporg-5ftf' ); ?>
|
||||||
</button>
|
</button>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue