From fbcaa382f4f362b0174c0fd23799605ff2cbd8f6 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 20 Sep 2018 10:00:23 -0500 Subject: [PATCH] add the opt-in button for emails #244 --- resources/lang/en/common.php | 2 + resources/lang/en/profile.php | 2 + resources/lang/es/common.php | 2 + resources/lang/es/profile.php | 2 + resources/lang/it/common.php | 2 + resources/lang/it/profile.php | 2 + resources/views/admin/users/fields.blade.php | 4 ++ .../layouts/default/profile/fields.blade.php | 38 +++++++++++++------ .../layouts/default/profile/index.blade.php | 4 ++ 9 files changed, 47 insertions(+), 11 deletions(-) diff --git a/resources/lang/en/common.php b/resources/lang/en/common.php index 42c81bc2..e8b5859a 100644 --- a/resources/lang/en/common.php +++ b/resources/lang/en/common.php @@ -45,6 +45,8 @@ return [ 'rightsreserved' => 'All Rights Reserved', 'active' => 'Active', 'inactive' => 'Inactive', + 'yes' => 'Yes', + 'no' => 'No', 'days' => [ 'mon' => 'Monday', 'tues' => 'Tuesday', diff --git a/resources/lang/en/profile.php b/resources/lang/en/profile.php index 9c7be356..996b32b7 100644 --- a/resources/lang/en/profile.php +++ b/resources/lang/en/profile.php @@ -15,4 +15,6 @@ return [ 'editprofile' => 'Edit Profile', 'edityourprofile' => 'Edit Your Profile', 'transferhours' => 'Transferred Hours', + 'opt-in' => 'Opt-In', + 'opt-in-descrip' => 'Yes, include me on non-administrative emails', ]; diff --git a/resources/lang/es/common.php b/resources/lang/es/common.php index 2ce3dc57..3d0d8d90 100644 --- a/resources/lang/es/common.php +++ b/resources/lang/es/common.php @@ -45,6 +45,8 @@ return [ 'rightsreserved' => 'Todos los derechos reservados', 'active' => 'Activo', 'inactive' => 'Inactivo', + 'yes' => 'Sí', + 'no' => 'No', 'days' => [ 'mon' => 'lunes', 'tues' => 'martes', diff --git a/resources/lang/es/profile.php b/resources/lang/es/profile.php index 9f972080..7c899cbd 100644 --- a/resources/lang/es/profile.php +++ b/resources/lang/es/profile.php @@ -14,4 +14,6 @@ return [ 'updateprofile' => 'Actualizar perfil', 'editprofile' => 'Editar perfil', 'edityourprofile' => 'Editar tu perfil', + 'opt-in' => 'Optar En', + 'opt-in-descrip' => 'Sí, incluirme en correos electrónicos no administrativos', ]; diff --git a/resources/lang/it/common.php b/resources/lang/it/common.php index 6f86879c..0bf5e297 100644 --- a/resources/lang/it/common.php +++ b/resources/lang/it/common.php @@ -45,6 +45,8 @@ return [ 'rightsreserved' => 'Tutti i Diritti Riservati', 'active' => 'Attivo', 'inactive' => 'Inattivo', + 'yes' => 'Sì', + 'no' => 'No', 'days' => [ 'mon' => 'Lunedì', 'tues' => 'Martedì', diff --git a/resources/lang/it/profile.php b/resources/lang/it/profile.php index 196553d9..fb76f2b9 100644 --- a/resources/lang/it/profile.php +++ b/resources/lang/it/profile.php @@ -14,4 +14,6 @@ return [ 'editprofile' => 'Modifica Profilo', 'edityourprofile' => 'Modifica Il Tuo Profilo', 'transferhours' => 'Ore trasferite', + 'opt-in' => 'Partecipa', + 'opt-in-descrip' => 'Sì, includimi nelle e-mail non amministrative', ]; diff --git a/resources/views/admin/users/fields.blade.php b/resources/views/admin/users/fields.blade.php index 42255d70..eb289c41 100644 --- a/resources/views/admin/users/fields.blade.php +++ b/resources/views/admin/users/fields.blade.php @@ -111,6 +111,10 @@ Last Login {{ show_datetime($user->updated_at) }} + + @lang('profile.opt-in') + {{ $user->opt_in ? __('common.yes') : __('common.no') }} + diff --git a/resources/views/layouts/default/profile/fields.blade.php b/resources/views/layouts/default/profile/fields.blade.php index 829b8544..50dac2c0 100644 --- a/resources/views/layouts/default/profile/fields.blade.php +++ b/resources/views/layouts/default/profile/fields.blade.php @@ -93,18 +93,34 @@ @endif - @lang('profile.avatar') - -
- {{ Form::file('avatar', null) }} -
-

@lang('profile.avatarresize', ['width' => config('phpvms.avatar.width'), 'height' => config('phpvms.avatar.height')])

- @if ($errors->has('avatar')) -

{{ $errors->first('avatar') }}

- @endif - + + @lang('profile.avatar') + +
+ {{ Form::file('avatar', null) }} +
+

@lang('profile.avatarresize', [ + 'width' => config('phpvms.avatar.width'), + 'height' => config('phpvms.avatar.height')]) +

+ @if ($errors->has('avatar')) +

{{ $errors->first('avatar') }}

+ @endif + + + + @lang('profile.opt-in') + +
+ {{ Form::hidden('opt_in', 0, false) }} + {{ Form::checkbox('opt_in', 1, null) }} +
+

@lang('profile.opt-in-descrip') +

+ + - +
{{ Form::submit(__('profile.updateprofile'), ['class' => 'btn btn-primary']) }} diff --git a/resources/views/layouts/default/profile/index.blade.php b/resources/views/layouts/default/profile/index.blade.php index 6b7eab02..8a90fb8d 100644 --- a/resources/views/layouts/default/profile/index.blade.php +++ b/resources/views/layouts/default/profile/index.blade.php @@ -85,6 +85,10 @@ @lang('common.timezone') {{ $user->timezone }} + + @lang('profile.opt-in') + {{ $user->opt_in ? __('common.yes') : __('common.no') }} +