Skip to content

Commit

Permalink
Merge pull request #36 from m0ham4d/add-more-language-copy
Browse files Browse the repository at this point in the history
add more language copy to login and register page
  • Loading branch information
tnylea authored Jun 15, 2024
2 parents 94cbf12 + 210c2a7 commit 4531ba9
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 84 deletions.
12 changes: 12 additions & 0 deletions config/devdojo/auth/language.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,24 @@
'headline' => 'Sign in',
'subheadline' => 'Login to your account below',
'show_subheadline' => false,
'email_address' => 'Email Address',
'password' => 'Password',
'edit' => 'Edit',
'button' => 'Continue',
'dont_have_an_account?' => 'Don\'t have an account?',
'sign_up' => 'Sign up',
],
'register' => [
'page_title' => 'Sign up',
'headline' => 'Sign up',
'subheadline' => 'Register for your free account below.',
'show_subheadline' => false,
'name' => 'Name',
'email_address' => 'Email Address',
'password' => 'Password',
'already_have_an_account?' => 'Already have an account?',
'sign_in' => 'Sign in',
'button' => 'Continue',
],
'verify' => [
'page_title' => 'Verify Your Account',
Expand Down
114 changes: 58 additions & 56 deletions resources/views/pages/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,67 +118,69 @@ public function authenticate()

<x-auth::layouts.app title="{{ config('devdojo.auth.language.login.page_title') }}">
<div class="relative w-full h-full">
@volt('auth.login')
<div class="relative w-full">
<x-auth::elements.container>

<x-auth::elements.heading
:text="($language->login->headline ?? 'No Heading')"
:description="($language->login->subheadline ?? 'No Description')"
:show_subheadline="($language->login->show_subheadline ?? false)" />

@if(config('devdojo.auth.settings.login_show_social_providers') && config('devdojo.auth.settings.social_providers_location') == 'top')
<x-auth::elements.social-providers />
@volt('auth.login')
<div class="relative w-full">
<x-auth::elements.container>

<x-auth::elements.heading
:text="($language->login->headline ?? 'No Heading')"
:description="($language->login->subheadline ?? 'No Description')"
:show_subheadline="($language->login->show_subheadline ?? false)" />

@if(config('devdojo.auth.settings.login_show_social_providers') && config('devdojo.auth.settings.social_providers_location') == 'top')
<x-auth::elements.social-providers />
@endif

<form wire:submit="authenticate" class="space-y-5">

@if($showPasswordField)
<x-auth::elements.input-placeholder value="{{ $email }}">
<button type="button" data-auth="edit-email-button" wire:click="editIdentity" class="font-medium text-blue-500">Edit</button>
</x-auth::elements.input-placeholder>
@else
@if($showIdentifierInput)
<x-auth::elements.input :label="config('devdojo.auth.language.login.email_address')" type="email" wire:model="email" autofocus="true" data-auth="email-input" id="email" required />
@endif
@endif

<form wire:submit="authenticate" class="space-y-5">

@if($showPasswordField)
<x-auth::elements.input-placeholder value="{{ $email }}">
<button type="button" data-auth="edit-email-button" wire:click="editIdentity" class="font-medium text-blue-500">Edit</button>
</x-auth::elements.input-placeholder>
@else
@if($showIdentifierInput)
<x-auth::elements.input label="Email Address" type="email" wire:model="email" autofocus="true" data-auth="email-input" id="email" required />
@endif
@endif

@if($showSocialProviderInfo)
<div class="p-4 text-sm rounded-md border bg-zinc-50 border-zinc-200">
<span>You have been authenticated via {{ implode(', ', $userSocialProviders) }}. Please login to that network below.</span>
<button wire:click="editIdentity" type="button" class="underline translate-x-1.5">Change Email</button>
</div>

@if(!config('devdojo.auth.settings.login_show_social_providers'))
<x-auth::elements.social-providers
:socialProviders="\Devdojo\Auth\Helper::getProvidersFromArray($userSocialProviders)"
:separator="false"
/>
@endif
@endif

@if($showPasswordField)
<x-auth::elements.input label="Password" type="password" wire:model="password" id="password" data-auth="password-input" />
<div class="flex justify-between items-center mt-6 text-sm leading-5">
<x-auth::elements.text-link href="{{ route('auth.password.request') }}" data-auth="forgot-password-link">Forgot your password?</x-auth::elements.text-link>
</div>
@endif

<x-auth::elements.button type="primary" data-auth="submit-button" rounded="md" size="md" submit="true">Continue</x-auth::elements.button>
</form>


<div class="mt-3 space-x-0.5 text-sm leading-5 text-left" style="color:{{ config('devdojo.auth.appearance.color.text') }}">
<span class="opacity-[47%]">Don't have an account?</span>
<x-auth::elements.text-link data-auth="register-link" href="{{ route('auth.register') }}">Sign up</x-auth::elements.text-link>
@if($showSocialProviderInfo)
<div class="p-4 text-sm rounded-md border bg-zinc-50 border-zinc-200">
<span>You have been authenticated via {{ implode(', ', $userSocialProviders) }}. Please login to that network below.</span>
<button wire:click="editIdentity" type="button" class="underline translate-x-1.5">Change Email</button>
</div>

@if(config('devdojo.auth.settings.login_show_social_providers') && config('devdojo.auth.settings.social_providers_location') != 'top')
<x-auth::elements.social-providers />

@if(!config('devdojo.auth.settings.login_show_social_providers'))
<x-auth::elements.social-providers
:socialProviders="\Devdojo\Auth\Helper::getProvidersFromArray($userSocialProviders)"
:separator="false"
/>
@endif
@endif

@if($showPasswordField)
<x-auth::elements.input label="Password" type="password" wire:model="password" id="password" data-auth="password-input" />
<div class="flex justify-between items-center mt-6 text-sm leading-5">
<x-auth::elements.text-link href="{{ route('auth.password.request') }}" data-auth="forgot-password-link">Forgot your password?</x-auth::elements.text-link>
</div>
@endif

<x-auth::elements.button type="primary" data-auth="submit-button" rounded="md" size="md" submit="true">
{{ config('devdojo.auth.language.login.button') }}
</x-auth::elements.button>
</form>


<div class="mt-3 space-x-0.5 text-sm leading-5 text-left" style="color:{{ config('devdojo.auth.appearance.color.text') }}">
<span class="opacity-[47%]"> {{ config('devdojo.auth.language.login.button') }} </span>
<x-auth::elements.text-link data-auth="register-link" href="{{ route('auth.register') }}">{{ config('devdojo.auth.language.login.sign_up') }}</x-auth::elements.text-link>
</div>

@if(config('devdojo.auth.settings.login_show_social_providers') && config('devdojo.auth.settings.social_providers_location') != 'top')
<x-auth::elements.social-providers />
@endif

</x-auth::elements.container>
</div>
</x-auth::elements.container>
</div>
@endvolt
</div>
</x-auth::layouts.app>
56 changes: 28 additions & 28 deletions resources/views/pages/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,48 +107,48 @@ public function register()
<x-auth::layouts.app title="{{ config('devdojo.auth.language.register.page_title') }}">

@volt('auth.register')
<x-auth::elements.container>
<x-auth::elements.container>

<x-auth::elements.heading
<x-auth::elements.heading
:text="($language->register->headline ?? 'No Heading')"
:description="($language->register->subheadline ?? 'No Description')"
:show_subheadline="($language->register->show_subheadline ?? false)" />

@if(config('devdojo.auth.settings.social_providers_location') == 'top')
<x-auth::elements.social-providers />
@endif
@if(config('devdojo.auth.settings.social_providers_location') == 'top')
<x-auth::elements.social-providers />
@endif

<form wire:submit="register" class="space-y-5">
<form wire:submit="register" class="space-y-5">

@if($showNameField)
<x-auth::elements.input label="Name" type="text" wire:model="name" autofocus="true" required />
@endif
@if($showNameField)
<x-auth::elements.input :label="config('devdojo.auth.language.register.name')" type="text" wire:model="name" autofocus="true" required />
@endif

@if($showEmailField)
@php
$autofocusEmail = ($showNameField) ? false : true;
@endphp
<x-auth::elements.input label="Email Address" id="email" type="email" wire:model="email" data-auth="email-input" :autofocus="$autofocusEmail" required />
@endif
@if($showEmailField)
@php
$autofocusEmail = ($showNameField) ? false : true;
@endphp
<x-auth::elements.input :label="config('devdojo.auth.language.register.email_address')" id="email" type="email" wire:model="email" data-auth="email-input" :autofocus="$autofocusEmail" required />
@endif

@if($showPasswordField)
<x-auth::elements.input label="Password" type="password" wire:model="password" id="password" data-auth="password-input" required />
@endif
@if($showPasswordField)
<x-auth::elements.input :label="config('devdojo.auth.language.register.password')" type="password" wire:model="password" id="password" data-auth="password-input" required />
@endif

<x-auth::elements.button data-auth="submit-button" rounded="md" submit="true">Continue</x-auth::elements.button>
</form>
<x-auth::elements.button data-auth="submit-button" rounded="md" submit="true">{{config('devdojo.auth.language.register.button')}}</x-auth::elements.button>
</form>

<div class="mt-3 space-x-0.5 text-sm leading-5 text-left" style="color:{{ config('devdojo.auth.appearance.color.text') }}">
<span class="opacity-[47%]">Already have an account?</span>
<x-auth::elements.text-link data-auth="login-link" href="{{ route('auth.login') }}">Sign in</x-auth::elements.text-link>
</div>
<div class="mt-3 space-x-0.5 text-sm leading-5 text-left" style="color:{{ config('devdojo.auth.appearance.color.text') }}">
<span class="opacity-[47%]">{{config('devdojo.auth.language.register.already_have_an_account?')}}</span>
<x-auth::elements.text-link data-auth="login-link" href="{{ route('auth.login') }}">{{config('devdojo.auth.language.register.sign_in')}}</x-auth::elements.text-link>
</div>

@if(config('devdojo.auth.settings.social_providers_location') != 'top')
<x-auth::elements.social-providers />
@endif
@if(config('devdojo.auth.settings.social_providers_location') != 'top')
<x-auth::elements.social-providers />
@endif


</x-auth::elements.container>
</x-auth::elements.container>
@endvolt

</x-auth::layouts.app>

0 comments on commit 4531ba9

Please sign in to comment.