First step of the settings redesign

thanks @nuriapenya for your help and the nice Screens!
This commit is contained in:
Matthias Pfefferle 2023-07-21 14:52:18 +02:00
parent dd1c0a3bb5
commit 426ddffba0
4 changed files with 341 additions and 315 deletions

View file

@ -1,4 +1,4 @@
.activitypub-settings-body {
.activitypub-settings {
max-width: 800px;
margin: 0 auto;
}
@ -151,12 +151,12 @@ summary {
background-color: #f6f7f7;
}
.activitypub-settings-body
.activitypub-settings
input.blog-user-identifier {
text-align: right;
}
.activitypub-settings-body
.activitypub-settings
.header-image {
width: 100%;
height: 80px;
@ -168,7 +168,7 @@ input.blog-user-identifier {
background-size: cover;
}
.activitypub-settings-body
.activitypub-settings
.logo {
height: 80px;
width: 80px;
@ -176,3 +176,19 @@ input.blog-user-identifier {
top: 40px;
left: 40px;
}
.settings_page_activitypub .box {
border: 1px solid #c3c4c7;
background-color: #fff;
padding: 1em 1.5em;
margin-bottom: 1.5em;
}
.settings_page_activitypub .activitypub-welcome-page .box label {
font-weight: bold;
}
.settings_page_activitypub .plugin-recommendations {
border-bottom: none;
margin-bottom: 0;
}

View file

@ -1,6 +1,6 @@
<?php
\load_template(
\dirname( __FILE__ ) . '/admin-header.php',
__DIR__ . '/admin-header.php',
true,
array(
'settings' => '',
@ -10,7 +10,7 @@
);
?>
<div class="wrap">
<div class="wrap activitypub-followers-page">
<h1><?php \esc_html_e( 'Followers', 'activitypub' ); ?></h1>
<?php $table = new \Activitypub\Table\Followers(); ?>

View file

@ -10,7 +10,7 @@
);
?>
<div class="activitypub-settings-body hide-if-no-js">
<div class="activitypub-settings activitypub-settings-page hide-if-no-js">
<div class="notice notice-info">
<p>
<?php
@ -28,39 +28,11 @@
<p><?php \esc_html_e( 'Customize your ActivityPub settings to suit your needs.', 'activitypub' ); ?></p>
<hr />
<form method="post" action="options.php">
<?php \settings_fields( 'activitypub' ); ?>
<h3 class="dashicons-before dashicons-admin-users"><?php \esc_html_e( 'Blog-User', 'activitypub' ); ?></h3>
<p><?php \esc_html_e( 'All settings for the Blog-User (Catch-All Account)', 'activitypub' ); ?></p>
<table class="form-table">
<tbody>
<tr>
<th scope="row">
<?php \esc_html_e( 'User-Identifier', 'activitypub' ); ?>
</th>
<td>
<label for="activitypub_blog_user_identifier">
<input class="blog-user-identifier" name="activitypub_blog_user_identifier" id="activitypub_blog_user_identifier" type="text" value="<?php echo esc_attr( \get_option( 'activitypub_blog_user_identifier', \Activitypub\Model\Blog_User::get_default_username() ) ); ?>" />
@<?php echo esc_html( \wp_parse_url( \home_url(), PHP_URL_HOST ) ); ?>
</label>
<p class="description">
</p>
</td>
</tr>
</tbody>
</table>
<?php \do_settings_fields( 'activitypub', 'blog-user' ); ?>
<hr />
<h3 class="dashicons-before dashicons-groups"><?php \esc_html_e( 'Users', 'activitypub' ); ?></h3>
<div class="box">
<h3><?php \esc_html_e( 'Users', 'activitypub' ); ?></h3>
<p><?php \esc_html_e( 'All user related settings.', 'activitypub' ); ?></p>
@ -91,12 +63,28 @@
</p>
</td>
</tr>
<tr>
<th scope="row">
<?php \esc_html_e( 'Change Blog-User Identifier', 'activitypub' ); ?>
</th>
<td>
<label for="activitypub_blog_user_identifier">
<input class="blog-user-identifier" name="activitypub_blog_user_identifier" id="activitypub_blog_user_identifier" type="text" value="<?php echo esc_attr( \get_option( 'activitypub_blog_user_identifier', \Activitypub\Model\Blog_User::get_default_username() ) ); ?>" />
@<?php echo esc_html( \wp_parse_url( \home_url(), PHP_URL_HOST ) ); ?>
</label>
<p class="description">
<?php \esc_html_e( 'This Blog-User will federate all posts written on your Blog, regardless of the User who posted it.', 'activitypub' ); ?>
</p>
</td>
</tr>
</tbody>
</table>
<?php \do_settings_fields( 'activitypub', 'user' ); ?>
</div>
<h3 class="dashicons-before dashicons-format-chat"><?php \esc_html_e( 'Activities', 'activitypub' ); ?></h3>
<div class="box">
<h3><?php \esc_html_e( 'Activities', 'activitypub' ); ?></h3>
<p><?php \esc_html_e( 'All activity related settings.', 'activitypub' ); ?></p>
@ -257,8 +245,10 @@
</table>
<?php \do_settings_fields( 'activitypub', 'activity' ); ?>
</div>
<h3 class="dashicons-before dashicons-database"><?php \esc_html_e( 'Server', 'activitypub' ); ?></h3>
<div class="box">
<h3><?php \esc_html_e( 'Server', 'activitypub' ); ?></h3>
<p><?php \esc_html_e( 'Server related settings.', 'activitypub' ); ?></p>
@ -287,7 +277,7 @@
</table>
<?php \do_settings_fields( 'activitypub', 'server' ); ?>
</div>
<?php \do_settings_sections( 'activitypub' ); ?>
<?php \submit_button(); ?>

View file

@ -1,6 +1,6 @@
<?php
\load_template(
\dirname( __FILE__ ) . '/admin-header.php',
__DIR__ . '/admin-header.php',
true,
array(
'settings' => '',
@ -10,60 +10,79 @@
);
?>
<div class="privacy-settings-body hide-if-no-js">
<div class="activitypub-settings activitypub-welcome-page hide-if-no-js">
<div class="box">
<h2><?php \esc_html_e( 'Welcome', 'activitypub' ); ?></h2>
<p><?php \esc_html_e( 'With ActivityPub your blog becomes part of a federated social network. This means you can share and talk to everyone using the ActivityPub protocol, including users of Friendica, Pleroma and Mastodon.', 'activitypub' ); ?></p>
<p><?php echo wp_kses( \__( 'With ActivityPub your blog becomes part of a federated social network. This means you can share and talk to everyone using the <strong>ActivityPub</strong> protocol, including users of <strong>Friendica</strong>, <strong>Pleroma</strong>, <strong>Pixelfed</strong> and <strong>Mastodon</strong>.', 'activitypub' ), array( 'strong' => array() ) ); ?></p>
</div>
<?php if ( ! \Activitypub\is_user_disabled( \Activitypub\Collection\Users::BLOG_USER_ID ) ) : ?>
<h3 class="dashicons-before dashicons-admin-users"><?php \esc_html_e( 'Blog Account', 'activitypub' ); ?></h3>
<p>
<?php
if ( ! \Activitypub\is_user_disabled( \Activitypub\Collection\Users::BLOG_USER_ID ) ) :
$blog_user = new \Activitypub\Model\Blog_User();
echo wp_kses(
\sprintf(
// translators:
\__(
'People can follow your Blog by using the username <code>%1$s</code> or the URL <code>%2$s</code>. This Blog-User will federate all posts written on your Blog, regardless of the User who posted it. You can customize the Blog-User on the <a href="%3$s">Settings</a> page.',
'activitypub'
),
\esc_attr( $blog_user->get_resource() ),
\esc_url_raw( $blog_user->get_url() ),
\esc_url_raw( \admin_url( '/options-general.php?page=activitypub&tab=settings' ) )
),
'default'
);
?>
</p>
<?php endif; ?>
<?php if ( ! \Activitypub\is_user_disabled( get_current_user_id() ) ) : ?>
<h3 class="dashicons-before dashicons-groups"><?php \esc_html_e( 'Personal Account', 'activitypub' ); ?></h3>
<div class="box">
<h3><?php \esc_html_e( 'Blog Account', 'activitypub' ); ?></h3>
<p>
<?php
$user = \Activitypub\Collection\Users::get_by_id( wp_get_current_user()->ID );
echo wp_kses(
\sprintf(
// translators:
\__(
'People can also follow you by using your Username <code>%1$s</code> or your Author-URL <code>%2$s</code>. Users who can not access this settings page will find their username on the <a href="%3$s">Edit Profile</a> page.',
'activitypub'
),
\esc_attr( $user->get_resource() ),
\esc_url_raw( $user->get_url() ),
\esc_url_raw( \admin_url( 'profile.php#activitypub' ) )
),
'default'
);
?>
<?php \esc_html_e( 'People can follow your Blog by using:', 'activitypub' ); ?>
</p>
<p>
<label for="activitypub-blog-username"><?php \esc_html_e( 'Username', 'activitypub' ); ?></label>
</p>
<p>
<input type="text" class="regular-text" id="activitypub-blog-username" value="<?php echo \esc_attr( $blog_user->get_resource() ); ?>" />
</p>
<p>
<label for="activitypub-blog-url"><?php \esc_html_e( 'Profile-URL', 'activitypub' ); ?></label>
</p>
<p>
<input type="text" class="regular-text" id="activitypub-blog-url" value="<?php echo \esc_attr( $blog_user->get_url() ); ?>" />
</p>
<p>
<?php \esc_html_e( 'This Blog-User will federate all posts written on your Blog, regardless of the User who posted it.', 'activitypub' ); ?>
<p>
<p>
<a href="<?php echo \esc_url_raw( \admin_url( '/options-general.php?page=activitypub&tab=settings' ) ); ?>">
<?php \esc_html_e( 'Customize Blog-User on Settings page.', 'activitypub' ); ?>
</a>
</p>
</div>
<?php endif; ?>
<h3 class="dashicons-before dashicons-admin-tools"><?php \esc_html_e( 'Troubleshooting', 'activitypub' ); ?></h3>
<?php
if ( ! \Activitypub\is_user_disabled( get_current_user_id() ) ) :
$user = \Activitypub\Collection\Users::get_by_id( wp_get_current_user()->ID );
?>
<div class="box">
<h3><?php \esc_html_e( 'Personal Account', 'activitypub' ); ?></h3>
<p>
<?php \esc_html_e( 'People can follow you by using your Username:', 'activitypub' ); ?>
</p>
<p>
<label for="activitypub-user-username"><?php \esc_html_e( 'Username', 'activitypub' ); ?></label>
</p>
<p>
<input type="text" class="regular-text" id="activitypub-user-username" value="<?php echo \esc_attr( $user->get_resource() ); ?>" />
</p>
<p>
<label for="activitypub-user-url"><?php \esc_html_e( 'Profile-URL', 'activitypub' ); ?></label>
</p>
<p>
<input type="text" class="regular-text" id="activitypub-user-url" value="<?php echo \esc_attr( $user->get_url() ); ?>" />
</p>
<p>
<?php \esc_html_e( 'Users who can not access this settings page will find their username on the "Edit Profile" page.', 'activitypub' ); ?>
<p>
<p>
<a href="<?php echo \esc_url_raw( \admin_url( '/options-general.php?page=activitypub&tab=settings' ) ); ?>">
<?php \esc_html_e( 'Customize Username on "Edit Profile" page.', 'activitypub' ); ?>
</a>
</p>
</div>
<?php endif; ?>
<div class="box">
<h3><?php \esc_html_e( 'Troubleshooting', 'activitypub' ); ?></h3>
<p>
<?php
echo wp_kses(
@ -79,13 +98,14 @@
);
?>
</p>
<?php if ( ACTIVITYPUB_SHOW_PLUGIN_RECOMMENDATIONS ) : ?>
<hr />
</div>
<h3 class="dashicons-before dashicons-admin-plugins"><?php \esc_html_e( 'Recommended Plugins', 'activitypub' ); ?></h3>
<?php if ( ACTIVITYPUB_SHOW_PLUGIN_RECOMMENDATIONS ) : ?>
<div class="box plugin-recommendations">
<h3><?php \esc_html_e( 'Recommended Plugins', 'activitypub' ); ?></h3>
<p><?php \esc_html_e( 'ActivityPub works as is and there is no need for you to install additional plugins, nevertheless there are some plugins that extends the functionality of ActivityPub.', 'activitypub' ); ?></p>
</div>
<div class="activitypub-settings-accordion">
<?php if ( ! \defined( 'FRIENDS_VERSION' ) ) : ?>
<h4 class="activitypub-settings-accordion-heading">