Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#46 edit: BFS Login new design #52

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/lang/fr_FR.mo
Binary file not shown.
161 changes: 83 additions & 78 deletions assets/lang/fr_FR.po
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: Beflex Sensei 2.2.0\n"
"POT-Creation-Date: 2023-03-03 15:48+0100\n"
"PO-Revision-Date: 2023-03-03 15:53+0100\n"
"POT-Creation-Date: 2024-05-23 16:12+0200\n"
"PO-Revision-Date: 2024-05-23 16:16+0200\n"
"Last-Translator: \n"
"Language-Team: [email protected]\n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 3.2.2\n"
"X-Generator: Poedit 3.4.4\n"
"X-Poedit-Basepath: ../..\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: esc_html__;__;_e;esc_html_e;_n;_x;_ex\n"
Expand All @@ -32,9 +32,9 @@ msgstr "Type d'animation"
msgid "Hide on mobile"
msgstr "Masquer sur mobile"

#: inc/block-blocks.php:31
msgid "Beflex"
msgstr "Beflex"
#: functions.php:90 functions.php:91
msgid "BeFlex Settings"
msgstr "Options Beflex"

#: inc/block-patterns.php:11
msgid "Design"
Expand All @@ -52,103 +52,55 @@ msgstr "Pieds de page"
msgid "Query"
msgstr "Requête"

#: inc/blocks/bfs-course-completion/bfs-course-completion.php:16
msgid "Course completion"
msgstr "Complétion du cours"

#: inc/blocks/bfs-course-completion/bfs-course-completion.php:17
msgid "Display completion length of a course"
msgstr "Affiche la durée complétion d'un cours"

#: inc/blocks/bfs-course-completion/view.php:14
msgid "Display course completion"
msgstr "Affiche la complétion d'un cours"

#: inc/blocks/bfs-course-lessons/bfs-course-lessons.php:16
msgid "Course lessons"
msgstr "Leçons du cours"

#: inc/blocks/bfs-course-lessons/bfs-course-lessons.php:17
msgid "Display lessons associated to a course"
msgstr "Afficher les leçons associées à un cours"
#: inc/blocks.php:29
msgid "Beflex"
msgstr "Beflex"

#: inc/blocks/bfs-course-lessons/view.php:14
#: inc/blocks/bfs-course-lesson/view.php:33
msgid "Display course lessons"
msgstr "Affiche les leçons du cours"

#: inc/blocks/bfs-course-lessons/view.php:40 sensei/content-course.php:68
#: inc/blocks/bfs-course-lesson/view.php:50 sensei/content-course.php:68
msgid "lessons"
msgstr "Leçons"

#: inc/blocks/bfs-course-signup/bfs-course-signup.php:16
msgid "Sensei Course signup"
msgstr "Sensei inscription au cours"

#: inc/blocks/bfs-course-signup/bfs-course-signup.php:17
msgid "Display button to take course"
msgstr "Affiche le bouton d'inscription au cours"

#: inc/blocks/bfs-course-signup/view.php:14
#: inc/blocks/bfs-course-signup/view.php:33
msgid "Display course signup button"
msgstr "Affiche le bouton d'enregistrement"

#: inc/blocks/bfs-course-signup/view.php:26
#: inc/blocks/bfs-course-signup/view.php:47
msgid "Start course"
msgstr "Commencer le cours"

#: inc/blocks/bfs-course-signup/view.php:29
#: inc/blocks/bfs-course-signup/view.php:50
msgid "Take course"
msgstr "S'inscrire au cours"

#: inc/blocks/bfs-course-tax/bfs-course-tax.php:16
msgid "Course categories"
msgstr "Catégories de cours"

#: inc/blocks/bfs-course-tax/bfs-course-tax.php:17
msgid "Display categories associated to a course"
msgstr "Affiche les catégories associées à un cours"
#: inc/blocks/bfs-course-tax/view.php:33
msgid "Display course taxonomies"
msgstr "Afficher les catégories du cours"

#: inc/blocks/bfs-course-tax/view.php:14
msgid "Display course categories"
msgstr "Affiche les catégories de cours"

#: inc/blocks/bfs-course-time/bfs-course-time.php:16
msgid "Course time"
msgstr "Durée du cours"

#: inc/blocks/bfs-course-time/bfs-course-time.php:17
msgid "Display time length of a course"
msgstr "Affiche la durée d'un cours"

#: inc/blocks/bfs-course-time/view.php:14
#: inc/blocks/bfs-course-time/view.php:33
msgid "Display course time"
msgstr "Afficher la durée du cours"

#: inc/blocks/bfs-course-time/view.php:40 sensei/content-course.php:84
#: inc/blocks/bfs-course-time/view.php:50 sensei/content-course.php:84
msgid "min"
msgstr "min"

#: inc/blocks/bfs-login/bfs-login.php:16
msgid "Sensei login navigation"
msgstr "Sensei login navigation"

#: inc/blocks/bfs-login/bfs-login.php:17
msgid "Display login and profile link"
msgstr "Affiche le bouton connexion et profile"

#: inc/blocks/bfs-login/view.php:19 sensei/functions.php:76
msgid "My courses"
msgstr "Mes cours"
#: inc/blocks/bfs-login/view.php:33
msgid "Display Sensei login navigation"
msgstr "Afficher le bloc Connexion"

#: inc/blocks/bfs-login/view.php:25 sensei/functions.php:84
msgid "Logout"
msgstr "Deconnexion"
#: inc/blocks/bfs-login/view.php:47
msgid "Check my profile"
msgstr "Voir mon profile"

#: inc/blocks/bfs-login/view.php:38
#: inc/blocks/bfs-login/view.php:69
msgid "Login"
msgstr "Connexion"

#: inc/patterns/course-default.php:6
#: inc/patterns/course-default.php:7
msgid "BFS Sensei - course template"
msgstr "BFS Sensei - course template"

Expand Down Expand Up @@ -176,22 +128,30 @@ msgstr "Sensei course grid"
msgid "Call To Action - Standard"
msgstr "Call To Action - Standard"

#: sensei/archive-message.php:40
#: sensei/archive-message.php:37
msgid "Messages"
msgstr "Messages"

#: sensei/archive-message.php:48
#: sensei/archive-message.php:45
msgid "You do not have any messages."
msgstr "Vous n'avez pas de messages."

#: sensei/functions.php:20 sensei/functions.php:24
msgid "Beflex style"
msgstr "Beflex style"

#: sensei/functions.php:76
msgid "My courses"
msgstr "Mes cours"

#: sensei/functions.php:81
msgid "My messages"
msgstr "Mes messages"

#: sensei/functions.php:84
msgid "Logout"
msgstr "Deconnexion"

#: sensei/functions.php:139
msgid "Your informations can no longer be modified"
msgstr "Vos informations ne peuvent plus êtres modifiées"
Expand Down Expand Up @@ -220,11 +180,56 @@ msgstr "Email"
msgid "The user requested does not exist."
msgstr "L'utilisateur demandé n'existe pas"

#: sensei/loop-message.php:51 sensei/single-message.php:40
#: sensei/loop-message.php:51
#, php-format
msgid "Conversation du cours : %s"
msgstr "Conversation du cours : %s"

#: sensei/single-message.php:43
#, php-format
msgid "Conversation de : %s"
msgstr "Conversation de : %s"

#: sensei/single-message.php:52
msgid "Cours"
msgstr "Cours"

#~ msgid "Course completion"
#~ msgstr "Complétion du cours"

#~ msgid "Display completion length of a course"
#~ msgstr "Affiche la durée complétion d'un cours"

#~ msgid "Display course completion"
#~ msgstr "Affiche la complétion d'un cours"

#~ msgid "Course lessons"
#~ msgstr "Leçons du cours"

#~ msgid "Display lessons associated to a course"
#~ msgstr "Afficher les leçons associées à un cours"

#~ msgid "Sensei Course signup"
#~ msgstr "Sensei inscription au cours"

#~ msgid "Display button to take course"
#~ msgstr "Affiche le bouton d'inscription au cours"

#~ msgid "Course categories"
#~ msgstr "Catégories de cours"

#~ msgid "Display categories associated to a course"
#~ msgstr "Affiche les catégories associées à un cours"

#~ msgid "Display course categories"
#~ msgstr "Affiche les catégories de cours"

#~ msgid "Display time length of a course"
#~ msgstr "Affiche la durée d'un cours"

#~ msgid "Display login and profile link"
#~ msgstr "Affiche le bouton connexion et profile"

#~ msgid "Write a new message..."
#~ msgstr "Écrire un nouveau message..."

Expand Down
33 changes: 31 additions & 2 deletions inc/blocks/bfs-login/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,28 @@
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
gap: 10px;
gap: 30px;
}
.bfs-login .bfs-login__profile {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
line-height: 1.2;
}
.bfs-login .bfs-login__profile .avatar {
border-radius: 50%;
margin-right: 0.6em;
}
.bfs-login .bfs-login__profile .bfs-login__profile-name {
color: var(--wp--preset--color--black);
font-weight: 600;
}
.bfs-login .bfs-login__profile .bfs-login__profile-label {
font-size: 12px;
color: rgba(0, 0, 0, 0.4);
}
.bfs-login .bf-button__style-outline {
background-color: transparent;
Expand All @@ -35,12 +56,20 @@
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.bfs-login .bf-button.bf-button__square {
width: 40px;
height: 40px;
padding: 0;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
border-radius: 50%;
}
.bfs-login .bf-button .bfs-login__icon, .bfs-login .bf-button .bfs-login__label {
display: inline-block;
}
.bfs-login .bf-button .bfs-login__icon {
width: 15px;
margin-right: 6px;
}
.bfs-login .bf-button .bfs-login__icon.bfs-login__courses-icon {
fill: var(--wp--preset--color--primary);
Expand Down
2 changes: 1 addition & 1 deletion inc/blocks/bfs-login/assets/css/style.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 27 additions & 2 deletions inc/blocks/bfs-login/assets/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,26 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 10px;
gap: 30px;

.bfs-login__profile {
display: flex;
align-items: center;
line-height: 1.2;

.avatar {
border-radius: 50%;
margin-right: 0.6em;
}
.bfs-login__profile-name {
color: var(--wp--preset--color--black);
font-weight: 600;
}
.bfs-login__profile-label {
font-size: 12px;
color: rgba(0,0,0,0.4);
}
}

.bf-button__style-outline {
background-color: transparent;
Expand All @@ -25,13 +44,19 @@
word-break: break-word;
box-sizing: border-box;

&.bf-button__square {
width: 40px;
height: 40px;
padding: 0;
justify-content: center;
border-radius: 50%;
}

.bfs-login__icon, .bfs-login__label {
display: inline-block;
}
.bfs-login__icon {
width: 15px;
margin-right: 6px;

&.bfs-login__courses-icon {
fill: var(--wp--preset--color--primary);
Expand Down
16 changes: 10 additions & 6 deletions inc/blocks/bfs-login/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,22 @@

if ( is_user_logged_in() ) :
$profile_url = Sensei()->learner_profiles->get_permalink( get_current_user_id() );
$user = wp_get_current_user();
?>

<div <?php echo $anchor; ?> class="<?php echo esc_attr( $class_name ); ?>">
<?php if ( ! empty( $profile_url ) ) : ?>
<a href="<?php echo esc_url( $profile_url ); ?>" class="bf-button bf-button__style-outline bf-button__color-primary">
<svg xmlns="http://www.w3.org/2000/svg" class="bfs-login__icon bfs-login__courses-icon" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M304 128a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM49.3 464H398.7c-8.9-63.3-63.3-112-129-112H178.3c-65.7 0-120.1 48.7-129 112zM0 482.3C0 383.8 79.8 304 178.3 304h91.4C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7H29.7C13.3 512 0 498.7 0 482.3z"/></svg>
<span class="bfs-login__label bfs-login__courses-label"><?php esc_html_e( 'My courses', 'beflex' ); ?></span>
<a href="<?php echo esc_url( $profile_url ); ?>" class="bfs-login__profile">
<?php echo get_avatar( $user->data->ID, 32 ); ?>
<div class="bfs-login__profile-data">
<div class="bfs-login__profile-name"><?php echo esc_html( $user->data->display_name ); ?></div>
<div class="bfs-login__profile-label"><?php esc_html_e( 'Check my profile', 'beflex' ); ?></div>
</div>
</a>
<?php endif; ?>

<a href="<?php echo esc_url( wp_logout_url( home_url() ) ); ?>" class="bf-button bf-button__color-light-grey">
<svg xmlns="http://www.w3.org/2000/svg" class="bfs-login__icon bfs-login__logout-icon" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 192 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l210.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128zM160 96c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 32C43 32 0 75 0 128L0 384c0 53 43 96 96 96l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l64 0z"/></svg>
<span class="bfs-login__label bfs-login__logout-label"><?php esc_html_e( 'Logout', 'beflex' ); ?></span>
<a href="<?php echo esc_url( wp_logout_url( home_url() ) ); ?>" class="bf-button bf-button__square bf-button__color-light-grey">
<svg xmlns="http://www.w3.org/2000/svg" class="bfs-login__icon bfs-login__logout-icon" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V256c0 17.7 14.3 32 32 32s32-14.3 32-32V32zM143.5 120.6c13.6-11.3 15.4-31.5 4.1-45.1s-31.5-15.4-45.1-4.1C49.7 115.4 16 181.8 16 256c0 132.5 107.5 240 240 240s240-107.5 240-240c0-74.2-33.8-140.6-86.6-184.6c-13.6-11.3-33.8-9.4-45.1 4.1s-9.4 33.8 4.1 45.1c38.9 32.3 63.5 81 63.5 135.4c0 97.2-78.8 176-176 176s-176-78.8-176-176c0-54.4 24.7-103.1 63.5-135.4z"/></svg>
</a>
</div>
<?php
Expand Down