Skip to content

Commit 0a63d85

Browse files
Settings: Use permalink settings design for actor mode (#1472)
* Settings: Use permalink settings design for actor mode * Add fieldset element for parity * Add changelog --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 62a6a0c commit 0a63d85

File tree

3 files changed

+62
-42
lines changed

3 files changed

+62
-42
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: changed
3+
4+
Improved readability for actor mode setting.

assets/css/activitypub-admin.css

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,20 @@
6565
transition: box-shadow .5s ease-in-out;
6666
}
6767

68+
.activitypub-settings .row {
69+
margin-bottom: 16px;
70+
}
71+
72+
.activitypub-settings .row > div {
73+
max-width: calc(100% - 24px);
74+
display: inline-flex;
75+
flex-direction: column;
76+
}
77+
78+
.activitypub-settings .row .description {
79+
margin-top: 0;
80+
}
81+
6882
.wp-header-end {
6983
visibility: hidden;
7084
margin: -2px 0 0;
@@ -179,8 +193,7 @@ input.blog-user-identifier {
179193
background-size: cover;
180194
}
181195

182-
.activitypub-settings
183-
.logo {
196+
.activitypub-settings .logo {
184197
height: 80px;
185198
width: 80px;
186199
position: relative;

includes/wp-admin/class-settings-fields.php

Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -225,46 +225,49 @@ public static function render_notifications_section() {
225225
public static function render_actor_mode_field() {
226226
$value = get_option( 'activitypub_actor_mode', ACTIVITYPUB_ACTOR_MODE );
227227
?>
228-
<p>
229-
<label>
230-
<input type="radio" name="activitypub_actor_mode" value="<?php echo esc_attr( ACTIVITYPUB_ACTOR_MODE ); ?>" <?php checked( ACTIVITYPUB_ACTOR_MODE, $value ); ?> />
231-
<strong><?php esc_html_e( 'Author Profiles Only', 'activitypub' ); ?></strong>
232-
</label>
233-
</p>
234-
<p class="description">
235-
<?php echo wp_kses( __( 'Every author on this blog (with the <code>activitypub</code> capability) gets their own ActivityPub profile.', 'activitypub' ), array( 'code' => array() ) ); ?>
236-
<strong>
237-
<?php
238-
echo wp_kses(
239-
sprintf(
240-
// translators: %s is a URL.
241-
__( 'You can add/remove the capability in the <a href="%s">user settings.</a>', 'activitypub' ),
242-
admin_url( '/users.php' )
243-
),
244-
array( 'a' => array( 'href' => array() ) )
245-
);
246-
?>
247-
</strong>
248-
<?php echo wp_kses( __( 'Select all the users you want to update, choose the method from the drop-down list and click on the "Apply" button.', 'activitypub' ), array( 'code' => array() ) ); ?>
249-
</p>
250-
<p>
251-
<label>
252-
<input type="radio" name="activitypub_actor_mode" value="<?php echo esc_attr( ACTIVITYPUB_BLOG_MODE ); ?>" <?php checked( ACTIVITYPUB_BLOG_MODE, $value ); ?> />
253-
<strong><?php esc_html_e( 'Blog profile only', 'activitypub' ); ?></strong>
254-
</label>
255-
</p>
256-
<p class="description">
257-
<?php esc_html_e( 'Your blog becomes a single ActivityPub profile and every post will be published under this profile instead of the individual author profiles.', 'activitypub' ); ?>
258-
</p>
259-
<p>
260-
<label>
261-
<input type="radio" name="activitypub_actor_mode" value="<?php echo esc_attr( ACTIVITYPUB_ACTOR_AND_BLOG_MODE ); ?>" <?php checked( ACTIVITYPUB_ACTOR_AND_BLOG_MODE, $value ); ?> />
262-
<strong><?php esc_html_e( 'Both author and blog profiles', 'activitypub' ); ?></strong>
263-
</label>
264-
</p>
265-
<p class="description">
266-
<?php esc_html_e( "This combines both modes. Users can be followed individually, while following the blog will show boosts of individual user's posts.", 'activitypub' ); ?>
267-
</p>
228+
<fieldset class="actor-mode-selection">
229+
<div class="row">
230+
<input type="radio" id="actor-mode" name="activitypub_actor_mode" value="<?php echo esc_attr( ACTIVITYPUB_ACTOR_MODE ); ?>" <?php checked( ACTIVITYPUB_ACTOR_MODE, $value ); ?> />
231+
<div>
232+
<label for="actor-mode"><strong><?php esc_html_e( 'Author Profiles Only', 'activitypub' ); ?></strong></label>
233+
<p class="description">
234+
<?php echo wp_kses( __( 'Every author on this blog (with the <code>activitypub</code> capability) gets their own ActivityPub profile.', 'activitypub' ), array( 'code' => array() ) ); ?>
235+
<strong>
236+
<?php
237+
echo wp_kses(
238+
sprintf(
239+
// translators: %s is a URL.
240+
__( 'You can add/remove the capability in the <a href="%s">user settings.</a>', 'activitypub' ),
241+
admin_url( '/users.php' )
242+
),
243+
array( 'a' => array( 'href' => array() ) )
244+
);
245+
?>
246+
</strong>
247+
<?php echo wp_kses( __( 'Select all the users you want to update, choose the method from the drop-down list and click on the "Apply" button.', 'activitypub' ), array( 'code' => array() ) ); ?>
248+
</p>
249+
</div>
250+
</div>
251+
<div class="row">
252+
<input type="radio" id="blog-mode" name="activitypub_actor_mode" value="<?php echo esc_attr( ACTIVITYPUB_BLOG_MODE ); ?>" <?php checked( ACTIVITYPUB_BLOG_MODE, $value ); ?> />
253+
<div>
254+
<label for="blog-mode"><strong><?php esc_html_e( 'Blog profile only', 'activitypub' ); ?></strong></label>
255+
<p class="description">
256+
<?php esc_html_e( 'Your blog becomes a single ActivityPub profile and every post will be published under this profile instead of the individual author profiles.', 'activitypub' ); ?>
257+
</p>
258+
</div>
259+
</div>
260+
<div class="row">
261+
<input type="radio" id="actor-blog-mode" name="activitypub_actor_mode" value="<?php echo esc_attr( ACTIVITYPUB_ACTOR_AND_BLOG_MODE ); ?>" <?php checked( ACTIVITYPUB_ACTOR_AND_BLOG_MODE, $value ); ?> />
262+
<div>
263+
<label for="actor-blog-mode"><strong><?php esc_html_e( 'Both author and blog profiles', 'activitypub' ); ?></strong></label>
264+
<p class="description">
265+
<?php esc_html_e( "This combines both modes. Users can be followed individually, while following the blog will show boosts of individual user's posts.", 'activitypub' ); ?>
266+
</p>
267+
</div>
268+
</div>
269+
</fieldset>
270+
268271
<?php
269272
}
270273

0 commit comments

Comments
 (0)