Compare commits
3 Commits
b7c6bb79e7
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 148cd7c5c6 | |||
| 7d14914b02 | |||
| c21d7000ef |
165
assets/css/auth-forms.css
Normal file
165
assets/css/auth-forms.css
Normal file
@@ -0,0 +1,165 @@
|
||||
/**
|
||||
* Auth Forms Styles — Anbieter Login Page
|
||||
*
|
||||
* Matches the Mentor:innen Login styles from general.css.
|
||||
* Loaded only on the anbieter-login page to override baked-in inline CSS.
|
||||
*
|
||||
* @package DDHH_Job_Manager
|
||||
*/
|
||||
|
||||
/* -----------------------------------------------
|
||||
Layout: two-column container
|
||||
----------------------------------------------- */
|
||||
.ddhh-auth-container {
|
||||
display: flex;
|
||||
gap: 2rem;
|
||||
margin: 2rem 0;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.ddhh-auth-container {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
/* -----------------------------------------------
|
||||
Sections: remove gray card backgrounds
|
||||
----------------------------------------------- */
|
||||
.ddhh-register-section,
|
||||
.ddhh-login-section {
|
||||
flex: 1;
|
||||
padding: 2rem;
|
||||
background: transparent;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.ddhh-register-section h2,
|
||||
.ddhh-login-section h2 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1.5rem;
|
||||
color: #333;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------
|
||||
Labels: match Mentor Login (color #333, 18px, bold)
|
||||
High specificity to override Formidable's
|
||||
.with_frm_style .frm_primary_label selectors
|
||||
----------------------------------------------- */
|
||||
.ddhh-auth-container label,
|
||||
.ddhh-auth-container .frm_forms.with_frm_style .frm_primary_label {
|
||||
color: #333;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
line-height: 18px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------
|
||||
Inputs: match Mentor Login field sizing
|
||||
----------------------------------------------- */
|
||||
.ddhh-auth-container input[type="text"],
|
||||
.ddhh-auth-container input[type="email"],
|
||||
.ddhh-auth-container input[type="password"],
|
||||
.ddhh-auth-container input[type="url"],
|
||||
.ddhh-auth-container input[type="tel"],
|
||||
.ddhh-auth-container select {
|
||||
width: 100%;
|
||||
min-height: 40px;
|
||||
max-width: 350px;
|
||||
border: 0.0625rem solid;
|
||||
border-radius: 3px;
|
||||
padding: 0.1875rem 0.3125rem;
|
||||
margin: 0 6px 16px 0;
|
||||
box-sizing: border-box;
|
||||
font-size: 16px;
|
||||
line-height: normal;
|
||||
font-family: "Poppins", Sans, Helvetica, Arial;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------
|
||||
Formidable submit wrapper: override flex-row
|
||||
so the button stretches to full width
|
||||
----------------------------------------------- */
|
||||
.ddhh-auth-container .frm_submit.frm_flex {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------
|
||||
Buttons: navy pill with red hover
|
||||
High specificity to override Formidable's
|
||||
.frm_style_formidable-style.with_frm_style selectors
|
||||
----------------------------------------------- */
|
||||
.ddhh-auth-container input[type="submit"],
|
||||
.ddhh-auth-container button[type="submit"],
|
||||
.ddhh-auth-container .frm_forms.with_frm_style .frm_submit button.frm_button_submit {
|
||||
background-color: var(--wp--preset--color--primary, #003063);
|
||||
border-width: 0;
|
||||
color: #fff;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
padding: 0.4em 1.333em;
|
||||
border-radius: 100px;
|
||||
text-decoration: none;
|
||||
width: 100%;
|
||||
max-width: 350px;
|
||||
cursor: pointer;
|
||||
transition: all 0.7s ease;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ddhh-auth-container input[type="submit"]:hover,
|
||||
.ddhh-auth-container button[type="submit"]:hover,
|
||||
.ddhh-auth-container .frm_forms.with_frm_style .frm_submit button.frm_button_submit:hover {
|
||||
background-color: var(--wp--preset--color--hhred, #E40613);
|
||||
}
|
||||
|
||||
/* -----------------------------------------------
|
||||
wp_login_form() specific: style the <p> wrappers
|
||||
----------------------------------------------- */
|
||||
.ddhh-login-section .login-username,
|
||||
.ddhh-login-section .login-password {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.ddhh-login-section .login-remember,
|
||||
.ddhh-login-section .login-submit {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.ddhh-login-section .login-username br,
|
||||
.ddhh-login-section .login-password br {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ddhh-login-section .login-username label,
|
||||
.ddhh-login-section .login-password label {
|
||||
display: block;
|
||||
font-weight: 700;
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
|
||||
.ddhh-login-section .login-remember label {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------
|
||||
Passwort vergessen link
|
||||
----------------------------------------------- */
|
||||
.ddhh-login-section .login-lost-password {
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
|
||||
.ddhh-login-section .login-lost-password a {
|
||||
color: var(--wp--preset--color--primary, #003063);
|
||||
text-decoration: underline;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.ddhh-login-section .login-lost-password a:hover {
|
||||
color: var(--wp--preset--color--hhred, #E40613);
|
||||
}
|
||||
@@ -21,6 +21,58 @@ class DDHH_JM_Pages {
|
||||
public static function setup_hooks() {
|
||||
// Redirect logged-in providers from login page to dashboard
|
||||
add_action( 'template_redirect', array( __CLASS__, 'maybe_redirect_logged_in_from_login' ) );
|
||||
|
||||
// Enqueue auth form styles on anbieter-login page
|
||||
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_auth_styles' ) );
|
||||
|
||||
// Clean up legacy inline styles and inject missing elements on login page
|
||||
add_filter( 'the_content', array( __CLASS__, 'filter_login_page_content' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue auth form styles on the anbieter-login page
|
||||
*/
|
||||
public static function enqueue_auth_styles() {
|
||||
$login_page_id = get_option( 'ddhh_jm_login_page_id' );
|
||||
if ( ! $login_page_id || ! is_page( $login_page_id ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
wp_enqueue_style(
|
||||
'ddhh-jm-auth-forms',
|
||||
DDHH_JM_PLUGIN_URL . 'assets/css/auth-forms.css',
|
||||
array(),
|
||||
DDHH_JM_VERSION
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter login page content to remove legacy inline styles and inject missing elements
|
||||
*
|
||||
* @param string $content Page content.
|
||||
* @return string Filtered content.
|
||||
*/
|
||||
public static function filter_login_page_content( $content ) {
|
||||
$login_page_id = get_option( 'ddhh_jm_login_page_id' );
|
||||
if ( ! $login_page_id || ! is_page( $login_page_id ) ) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
// Strip legacy inline <style> blocks baked into the page content
|
||||
$content = preg_replace( '/<style[^>]*>.*?<\/style>/s', '', $content );
|
||||
|
||||
// Inject "Passwort vergessen?" link after the login form if not already present
|
||||
if ( strpos( $content, 'login-lost-password' ) === false ) {
|
||||
$lost_pw_html = '<p class="login-lost-password"><a href="' . esc_url( wp_lostpassword_url() ) . '">Passwort vergessen?</a></p>';
|
||||
|
||||
// Insert after the closing </form> inside the login section
|
||||
$pos = strrpos( $content, '</form>' );
|
||||
if ( false !== $pos ) {
|
||||
$content = substr_replace( $content, '</form>' . $lost_pw_html, $pos, strlen( '</form>' ) );
|
||||
}
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,66 +161,8 @@ class DDHH_JM_Pages {
|
||||
// Get registration form ID
|
||||
$registration_form_id = DDHH_JM_Formidable::get_registration_form_id();
|
||||
|
||||
// Build page content with inline CSS and two sections
|
||||
$content = '<style>
|
||||
.ddhh-auth-container {
|
||||
display: flex;
|
||||
gap: 2rem;
|
||||
margin: 2rem 0;
|
||||
}
|
||||
|
||||
.ddhh-register-section,
|
||||
.ddhh-login-section {
|
||||
flex: 1;
|
||||
padding: 2rem;
|
||||
background: #f9f9f9;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.ddhh-register-section h2,
|
||||
.ddhh-login-section h2 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1.5rem;
|
||||
color: #333;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
/* Mobile responsive - stacked layout */
|
||||
@media (max-width: 768px) {
|
||||
.ddhh-auth-container {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
/* Form styling for consistency */
|
||||
.ddhh-auth-container input[type="text"],
|
||||
.ddhh-auth-container input[type="email"],
|
||||
.ddhh-auth-container input[type="password"] {
|
||||
width: 100%;
|
||||
padding: 0.75rem;
|
||||
margin-bottom: 1rem;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ddhh-auth-container input[type="submit"],
|
||||
.ddhh-auth-container button[type="submit"] {
|
||||
background: #0073aa;
|
||||
color: white;
|
||||
padding: 0.75rem 1.5rem;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.ddhh-auth-container input[type="submit"]:hover,
|
||||
.ddhh-auth-container button[type="submit"]:hover {
|
||||
background: #005a87;
|
||||
}
|
||||
</style>';
|
||||
// Build page content — styles are loaded via enqueued auth-forms.css
|
||||
$content = '';
|
||||
|
||||
$content .= '<div class="ddhh-auth-container">';
|
||||
|
||||
@@ -197,6 +191,7 @@ class DDHH_JM_Pages {
|
||||
);
|
||||
|
||||
$content .= wp_login_form( $login_args );
|
||||
$content .= '<p class="login-lost-password"><a href="' . esc_url( wp_lostpassword_url() ) . '">Passwort vergessen?</a></p>';
|
||||
$content .= '</div>';
|
||||
|
||||
$content .= '</div>'; // .ddhh-auth-container
|
||||
|
||||
@@ -47,6 +47,9 @@ class DDHH_JM_Template {
|
||||
$author = get_userdata( $post->post_author );
|
||||
$author_name = $author ? $author->display_name : '';
|
||||
$author_org = get_user_meta( $post->post_author, 'ddhh_org_name', true );
|
||||
if ( ! $author_org ) {
|
||||
$author_org = $author_name;
|
||||
}
|
||||
|
||||
// Build job details HTML
|
||||
ob_start();
|
||||
@@ -55,9 +58,16 @@ class DDHH_JM_Template {
|
||||
<a href="<?php echo esc_url( get_post_type_archive_link( 'job_offer' ) ); ?>">← Alle Jobangebote</a>
|
||||
</div>
|
||||
<div class="ddhh-job-offer-details">
|
||||
<?php if ( $job_logo ) : ?>
|
||||
<div class="job-logo">
|
||||
<?php echo $job_logo; ?>
|
||||
<?php if ( $job_logo || $author_org ) : ?>
|
||||
<div class="job-header">
|
||||
<?php if ( $job_logo ) : ?>
|
||||
<div class="job-logo">
|
||||
<?php echo $job_logo; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ( $author_org ) : ?>
|
||||
<span class="job-header-org"><?php echo esc_html( $author_org ); ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -137,13 +147,20 @@ class DDHH_JM_Template {
|
||||
.ddhh-job-offer-details {
|
||||
margin: 2em 0;
|
||||
}
|
||||
.ddhh-job-offer-details .job-logo {
|
||||
.ddhh-job-offer-details .job-header {
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
.ddhh-job-offer-details .job-logo img {
|
||||
max-width: 200px;
|
||||
height: auto;
|
||||
}
|
||||
.ddhh-job-offer-details .job-header-org {
|
||||
display: block;
|
||||
margin-top: 0.5em;
|
||||
font-size: 1.4em;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
.ddhh-job-offer-details .job-meta {
|
||||
background: #f5f5f5;
|
||||
padding: 1.5em;
|
||||
|
||||
Reference in New Issue
Block a user