Added facebook, slack & twitter sign in options.
Also added icon svg blade helper. Closes #125. Starts #213. Requires documentation.
Showing
19 changed files
with
150 additions
and
79 deletions
| ... | @@ -17,6 +17,10 @@ class AppServiceProvider extends ServiceProvider | ... | @@ -17,6 +17,10 @@ class AppServiceProvider extends ServiceProvider |
| 17 | $imageMimes = ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/tiff', 'image/webp']; | 17 | $imageMimes = ['image/png', 'image/bmp', 'image/gif', 'image/jpeg', 'image/jpg', 'image/tiff', 'image/webp']; |
| 18 | return in_array($value->getMimeType(), $imageMimes); | 18 | return in_array($value->getMimeType(), $imageMimes); |
| 19 | }); | 19 | }); |
| 20 | + | ||
| 21 | + \Blade::directive('icon', function($expression) { | ||
| 22 | + return "<?php echo icon($expression); ?>"; | ||
| 23 | + }); | ||
| 20 | } | 24 | } |
| 21 | 25 | ||
| 22 | /** | 26 | /** | ... | ... |
| ... | @@ -4,6 +4,7 @@ namespace BookStack\Providers; | ... | @@ -4,6 +4,7 @@ namespace BookStack\Providers; |
| 4 | 4 | ||
| 5 | use Illuminate\Contracts\Events\Dispatcher as DispatcherContract; | 5 | use Illuminate\Contracts\Events\Dispatcher as DispatcherContract; |
| 6 | use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; | 6 | use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; |
| 7 | +use SocialiteProviders\Manager\SocialiteWasCalled; | ||
| 7 | 8 | ||
| 8 | class EventServiceProvider extends ServiceProvider | 9 | class EventServiceProvider extends ServiceProvider |
| 9 | { | 10 | { |
| ... | @@ -13,8 +14,8 @@ class EventServiceProvider extends ServiceProvider | ... | @@ -13,8 +14,8 @@ class EventServiceProvider extends ServiceProvider |
| 13 | * @var array | 14 | * @var array |
| 14 | */ | 15 | */ |
| 15 | protected $listen = [ | 16 | protected $listen = [ |
| 16 | - 'BookStack\Events\SomeEvent' => [ | 17 | + SocialiteWasCalled::class => [ |
| 17 | - 'BookStack\Listeners\EventListener', | 18 | + 'SocialiteProviders\Slack\SlackExtendSocialite@handle', |
| 18 | ], | 19 | ], |
| 19 | ]; | 20 | ]; |
| 20 | 21 | ... | ... |
| 1 | -<?php namespace BookStack\Providers; | ||
| 2 | - | ||
| 3 | - | ||
| 4 | -use Illuminate\Support\ServiceProvider; | ||
| 5 | - | ||
| 6 | -class SocialiteServiceProvider extends ServiceProvider | ||
| 7 | -{ | ||
| 8 | - /** | ||
| 9 | - * Indicates if loading of the provider is deferred. | ||
| 10 | - * | ||
| 11 | - * @var bool | ||
| 12 | - */ | ||
| 13 | - protected $defer = true; | ||
| 14 | - | ||
| 15 | - /** | ||
| 16 | - * Register the service provider. | ||
| 17 | - * | ||
| 18 | - * @return void | ||
| 19 | - */ | ||
| 20 | - public function register() | ||
| 21 | - { | ||
| 22 | - $this->app->bindShared('Laravel\Socialite\Contracts\Factory', function ($app) { | ||
| 23 | - return new SocialiteManager($app); | ||
| 24 | - }); | ||
| 25 | - } | ||
| 26 | - | ||
| 27 | - /** | ||
| 28 | - * Get the services provided by the provider. | ||
| 29 | - * | ||
| 30 | - * @return array | ||
| 31 | - */ | ||
| 32 | - public function provides() | ||
| 33 | - { | ||
| 34 | - return ['Laravel\Socialite\Contracts\Factory']; | ||
| 35 | - } | ||
| 36 | -} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -14,7 +14,7 @@ class SocialAuthService | ... | @@ -14,7 +14,7 @@ class SocialAuthService |
| 14 | protected $socialite; | 14 | protected $socialite; |
| 15 | protected $socialAccount; | 15 | protected $socialAccount; |
| 16 | 16 | ||
| 17 | - protected $validSocialDrivers = ['google', 'github']; | 17 | + protected $validSocialDrivers = ['google', 'github', 'facebook', 'slack', 'twitter']; |
| 18 | 18 | ||
| 19 | /** | 19 | /** |
| 20 | * SocialAuthService constructor. | 20 | * SocialAuthService constructor. |
| ... | @@ -211,7 +211,6 @@ class SocialAuthService | ... | @@ -211,7 +211,6 @@ class SocialAuthService |
| 211 | */ | 211 | */ |
| 212 | public function detachSocialAccount($socialDriver) | 212 | public function detachSocialAccount($socialDriver) |
| 213 | { | 213 | { |
| 214 | - session(); | ||
| 215 | user()->socialAccounts()->where('driver', '=', $socialDriver)->delete(); | 214 | user()->socialAccounts()->where('driver', '=', $socialDriver)->delete(); |
| 216 | session()->flash('success', trans('settings.users_social_disconnected', ['socialAccount' => title_case($socialDriver)])); | 215 | session()->flash('success', trans('settings.users_social_disconnected', ['socialAccount' => title_case($socialDriver)])); |
| 217 | return redirect(user()->getEditUrl()); | 216 | return redirect(user()->getEditUrl()); | ... | ... |
| ... | @@ -117,6 +117,16 @@ function redirect($to = null, $status = 302, $headers = [], $secure = null) | ... | @@ -117,6 +117,16 @@ function redirect($to = null, $status = 302, $headers = [], $secure = null) |
| 117 | return app('redirect')->to($to, $status, $headers, $secure); | 117 | return app('redirect')->to($to, $status, $headers, $secure); |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | +function icon($name, $attrs = []) { | ||
| 121 | + $iconPath = resource_path('assets/icons/' . $name . '.svg'); | ||
| 122 | + $attrString = ' '; | ||
| 123 | + foreach ($attrs as $attrName => $attr) { | ||
| 124 | + $attrString .= $attrName . '="' . $attr . '" '; | ||
| 125 | + } | ||
| 126 | + $fileContents = file_get_contents($iconPath); | ||
| 127 | + return str_replace('<svg', '<svg' . $attrString, $fileContents); | ||
| 128 | +} | ||
| 129 | + | ||
| 120 | /** | 130 | /** |
| 121 | * Generate a url with multiple parameters for sorting purposes. | 131 | * Generate a url with multiple parameters for sorting purposes. |
| 122 | * Works out the logic to set the correct sorting direction | 132 | * Works out the logic to set the correct sorting direction |
| ... | @@ -147,4 +157,4 @@ function sortUrl($path, $data, $overrideData = []) | ... | @@ -147,4 +157,4 @@ function sortUrl($path, $data, $overrideData = []) |
| 147 | if (count($queryStringSections) === 0) return $path; | 157 | if (count($queryStringSections) === 0) return $path; |
| 148 | 158 | ||
| 149 | return baseUrl($path . '?' . implode('&', $queryStringSections)); | 159 | return baseUrl($path . '?' . implode('&', $queryStringSections)); |
| 150 | -} | 160 | +} |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -17,7 +17,8 @@ | ... | @@ -17,7 +17,8 @@ |
| 17 | "predis/predis": "^1.1", | 17 | "predis/predis": "^1.1", |
| 18 | "gathercontent/htmldiff": "^0.2.1", | 18 | "gathercontent/htmldiff": "^0.2.1", |
| 19 | "barryvdh/laravel-snappy": "^0.3.1", | 19 | "barryvdh/laravel-snappy": "^0.3.1", |
| 20 | - "laravel/browser-kit-testing": "^1.0" | 20 | + "laravel/browser-kit-testing": "^1.0", |
| 21 | + "socialiteproviders/slack": "^3.0" | ||
| 21 | }, | 22 | }, |
| 22 | "require-dev": { | 23 | "require-dev": { |
| 23 | "fzaninotto/faker": "~1.4", | 24 | "fzaninotto/faker": "~1.4", | ... | ... |
| ... | @@ -4,8 +4,8 @@ | ... | @@ -4,8 +4,8 @@ |
| 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", | 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", |
| 5 | "This file is @generated automatically" | 5 | "This file is @generated automatically" |
| 6 | ], | 6 | ], |
| 7 | - "hash": "c0bb098e9430247688c61ebd66d3d51c", | 7 | + "hash": "27dd30e92f700ea9a8c2a0a2327d4f9f", |
| 8 | - "content-hash": "3bb8bb2f252327c32aa40c686d1327cc", | 8 | + "content-hash": "e851e9fd06efac8362604c39b0a17542", |
| 9 | "packages": [ | 9 | "packages": [ |
| 10 | { | 10 | { |
| 11 | "name": "aws/aws-sdk-php", | 11 | "name": "aws/aws-sdk-php", |
| ... | @@ -1984,6 +1984,85 @@ | ... | @@ -1984,6 +1984,85 @@ |
| 1984 | "time": "2016-11-22 19:21:44" | 1984 | "time": "2016-11-22 19:21:44" |
| 1985 | }, | 1985 | }, |
| 1986 | { | 1986 | { |
| 1987 | + "name": "socialiteproviders/manager", | ||
| 1988 | + "version": "v3.0.2", | ||
| 1989 | + "source": { | ||
| 1990 | + "type": "git", | ||
| 1991 | + "url": "https://github.com/SocialiteProviders/Manager.git", | ||
| 1992 | + "reference": "3bf2b405b6bfd4bec66f706f5390323f51033eb1" | ||
| 1993 | + }, | ||
| 1994 | + "dist": { | ||
| 1995 | + "type": "zip", | ||
| 1996 | + "url": "https://api.github.com/repos/SocialiteProviders/Manager/zipball/3bf2b405b6bfd4bec66f706f5390323f51033eb1", | ||
| 1997 | + "reference": "3bf2b405b6bfd4bec66f706f5390323f51033eb1", | ||
| 1998 | + "shasum": "" | ||
| 1999 | + }, | ||
| 2000 | + "require": { | ||
| 2001 | + "laravel/socialite": "~3.0", | ||
| 2002 | + "php": "^5.6 || ^7.0" | ||
| 2003 | + }, | ||
| 2004 | + "require-dev": { | ||
| 2005 | + "mockery/mockery": "^0.9.4", | ||
| 2006 | + "phpunit/phpunit": "^5.0" | ||
| 2007 | + }, | ||
| 2008 | + "type": "library", | ||
| 2009 | + "autoload": { | ||
| 2010 | + "psr-4": { | ||
| 2011 | + "SocialiteProviders\\Manager\\": "src/", | ||
| 2012 | + "SocialiteProviders\\Manager\\Test\\": "tests/" | ||
| 2013 | + } | ||
| 2014 | + }, | ||
| 2015 | + "notification-url": "https://packagist.org/downloads/", | ||
| 2016 | + "license": [ | ||
| 2017 | + "MIT" | ||
| 2018 | + ], | ||
| 2019 | + "authors": [ | ||
| 2020 | + { | ||
| 2021 | + "name": "Andy Wendt", | ||
| 2022 | + "email": "andy@awendt.com" | ||
| 2023 | + } | ||
| 2024 | + ], | ||
| 2025 | + "description": "Easily add new or override built-in providers in Laravel Socialite.", | ||
| 2026 | + "time": "2017-01-27 08:35:03" | ||
| 2027 | + }, | ||
| 2028 | + { | ||
| 2029 | + "name": "socialiteproviders/slack", | ||
| 2030 | + "version": "v3.0.0", | ||
| 2031 | + "source": { | ||
| 2032 | + "type": "git", | ||
| 2033 | + "url": "https://github.com/SocialiteProviders/Slack.git", | ||
| 2034 | + "reference": "a0d676a07bb8293547df6678f1da0258ac40bfec" | ||
| 2035 | + }, | ||
| 2036 | + "dist": { | ||
| 2037 | + "type": "zip", | ||
| 2038 | + "url": "https://api.github.com/repos/SocialiteProviders/Slack/zipball/a0d676a07bb8293547df6678f1da0258ac40bfec", | ||
| 2039 | + "reference": "a0d676a07bb8293547df6678f1da0258ac40bfec", | ||
| 2040 | + "shasum": "" | ||
| 2041 | + }, | ||
| 2042 | + "require": { | ||
| 2043 | + "php": "^5.6 || ^7.0", | ||
| 2044 | + "socialiteproviders/manager": "~3.0" | ||
| 2045 | + }, | ||
| 2046 | + "type": "library", | ||
| 2047 | + "autoload": { | ||
| 2048 | + "psr-4": { | ||
| 2049 | + "SocialiteProviders\\Slack\\": "" | ||
| 2050 | + } | ||
| 2051 | + }, | ||
| 2052 | + "notification-url": "https://packagist.org/downloads/", | ||
| 2053 | + "license": [ | ||
| 2054 | + "MIT" | ||
| 2055 | + ], | ||
| 2056 | + "authors": [ | ||
| 2057 | + { | ||
| 2058 | + "name": "Brian Faust", | ||
| 2059 | + "email": "hello@brianfaust.de" | ||
| 2060 | + } | ||
| 2061 | + ], | ||
| 2062 | + "description": "Slack OAuth2 Provider for Laravel Socialite", | ||
| 2063 | + "time": "2017-01-25 09:48:29" | ||
| 2064 | + }, | ||
| 2065 | + { | ||
| 1987 | "name": "swiftmailer/swiftmailer", | 2066 | "name": "swiftmailer/swiftmailer", |
| 1988 | "version": "v5.4.5", | 2067 | "version": "v5.4.5", |
| 1989 | "source": { | 2068 | "source": { | ... | ... |
| ... | @@ -139,7 +139,7 @@ return [ | ... | @@ -139,7 +139,7 @@ return [ |
| 139 | Illuminate\Validation\ValidationServiceProvider::class, | 139 | Illuminate\Validation\ValidationServiceProvider::class, |
| 140 | Illuminate\View\ViewServiceProvider::class, | 140 | Illuminate\View\ViewServiceProvider::class, |
| 141 | Illuminate\Notifications\NotificationServiceProvider::class, | 141 | Illuminate\Notifications\NotificationServiceProvider::class, |
| 142 | - Laravel\Socialite\SocialiteServiceProvider::class, | 142 | + SocialiteProviders\Manager\ServiceProvider::class, |
| 143 | 143 | ||
| 144 | /** | 144 | /** |
| 145 | * Third Party | 145 | * Third Party | ... | ... |
| ... | @@ -49,6 +49,24 @@ return [ | ... | @@ -49,6 +49,24 @@ return [ |
| 49 | 'redirect' => env('APP_URL') . '/login/service/google/callback', | 49 | 'redirect' => env('APP_URL') . '/login/service/google/callback', |
| 50 | ], | 50 | ], |
| 51 | 51 | ||
| 52 | + 'slack' => [ | ||
| 53 | + 'client_id' => env('SLACK_APP_ID', false), | ||
| 54 | + 'client_secret' => env('SLACK_APP_SECRET', false), | ||
| 55 | + 'redirect' => env('APP_URL') . '/login/service/slack/callback', | ||
| 56 | + ], | ||
| 57 | + | ||
| 58 | + 'facebook' => [ | ||
| 59 | + 'client_id' => env('FACEBOOK_APP_ID', false), | ||
| 60 | + 'client_secret' => env('FACEBOOK_APP_SECRET', false), | ||
| 61 | + 'redirect' => env('APP_URL') . '/login/service/facebook/callback', | ||
| 62 | + ], | ||
| 63 | + | ||
| 64 | + 'twitter' => [ | ||
| 65 | + 'client_id' => env('TWITTER_APP_ID', false), | ||
| 66 | + 'client_secret' => env('TWITTER_APP_SECRET', false), | ||
| 67 | + 'redirect' => env('APP_URL') . '/login/service/twitter/callback', | ||
| 68 | + ], | ||
| 69 | + | ||
| 52 | 'ldap' => [ | 70 | 'ldap' => [ |
| 53 | 'server' => env('LDAP_SERVER', false), | 71 | 'server' => env('LDAP_SERVER', false), |
| 54 | 'dn' => env('LDAP_DN', false), | 72 | 'dn' => env('LDAP_DN', false), | ... | ... |
resources/assets/icons/facebook.svg
0 → 100644
| 1 | +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 266.893 266.895"><path fill="#3C5A99" d="M248.082 262.307c7.854 0 14.223-6.37 14.223-14.225V18.812c0-7.857-6.368-14.224-14.223-14.224H18.812c-7.857 0-14.224 6.367-14.224 14.224v229.27c0 7.855 6.366 14.225 14.224 14.225h229.27z"/><path fill="#FFF" d="M182.41 262.307v-99.803h33.498l5.016-38.895H182.41V98.775c0-11.26 3.126-18.935 19.274-18.935l20.596-.01V45.047c-3.562-.474-15.788-1.533-30.012-1.533-29.695 0-50.025 18.126-50.025 51.413v28.684h-33.585v38.894h33.585v99.803h40.166z"/></svg> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
resources/assets/icons/github.svg
0 → 100644
| 1 | +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path fill="#333333" fill-rule="evenodd" d="M31.9.693c-17.672 0-32 14.327-32 32 0 14.14 9.17 26.132 21.886 30.365 1.6.293 2.184-.695 2.184-1.544 0-.758-.028-2.77-.043-5.44-8.9 1.932-10.78-4.292-10.78-4.292-1.455-3.695-3.553-4.68-3.553-4.68-2.905-1.985.22-1.946.22-1.946 3.212.228 4.9 3.3 4.9 3.3 2.856 4.888 7.492 3.476 9.315 2.66.29-2.07 1.11-3.48 2.03-4.28-7.11-.807-14.58-3.554-14.58-15.816 0-3.493 1.243-6.35 3.29-8.586-.33-.81-1.428-4.063.313-8.47 0 0 2.687-.86 8.8 3.28 2.552-.708 5.29-1.063 8.01-1.075 2.718.01 5.457.36 8.01 1.07 6.11-4.14 8.793-3.28 8.793-3.28 1.747 4.403.65 7.66.32 8.47 2.05 2.233 3.29 5.09 3.29 8.582 0 12.293-7.483 15-14.61 15.79 1.15.99 2.17 2.94 2.17 5.926 0 4.277-.04 7.73-.04 8.777 0 .857.578 1.853 2.2 1.54 12.71-4.235 21.87-16.22 21.87-30.355 0-17.674-14.326-32-32-32"/></svg> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
resources/assets/icons/google.svg
0 → 100644
| 1 | +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><g fill="none" fill-rule="evenodd"><path fill="#4285f4" d="M62.735 32.712c0-2.27-.204-4.45-.582-6.545H32.015v12.378h17.222c-.742 4-2.997 7.39-6.386 9.658v8.03h10.344c6.05-5.57 9.542-13.775 9.542-23.52z"/><path fill="#34a853" d="M32.015 63.985c8.64 0 15.883-2.865 21.178-7.753l-10.342-8.03c-2.863 1.92-6.53 3.056-10.834 3.056-8.335 0-15.39-5.63-17.906-13.193H3.417v8.29c5.266 10.46 16.088 17.63 28.597 17.63z"/><path fill="#fbbc05" d="M14.11 38.065c-.64-1.92-1.004-3.97-1.004-6.08s.363-4.16 1.003-6.08v-8.29H3.416C1.25 21.935.015 26.82.015 31.985c0 5.163 1.236 10.05 3.403 14.37l10.69-8.29z"/><path fill="#ea4335" d="M32.015 12.712c4.698 0 8.916 1.615 12.233 4.786l9.178-9.178C47.884 3.156 40.64-.015 32.016-.015c-12.51 0-23.332 7.17-28.598 17.63l10.69 8.29c2.518-7.563 9.572-13.193 17.907-13.193z"/><path d="M.015-.015h64v64h-64v-64z"/></g></svg> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
resources/assets/icons/slack.svg
0 → 100644
| 1 | +<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" viewBox="0 0 64 64"><style id="style3">.st0{fill:#ECB32D;} .st1{fill:#63C1A0;} .st2{fill:#E01A59;} .st3{fill:#331433;} .st4{fill:#D62027;} .st5{fill:#89D3DF;} .st6{fill:#258B74;} .st7{fill:#819C3C;}</style><g id="g5"><g id="g7"><path id="path9" fill="#ecb32d" d="M41.478 3.945C40.48.95 37.28-.677 34.288.27c-2.992.997-4.62 4.2-3.674 7.195l14.748 45.383c.997 2.784 4.042 4.36 6.928 3.52 3.044-.893 4.88-4.098 3.884-7.04 0-.104-14.696-45.383-14.696-45.383z" class="st0"/><path id="path11" fill="#63c1a0" d="M18.648 11.352c-.997-2.994-4.2-4.623-7.19-3.677-2.992.998-4.62 4.202-3.674 7.196l14.748 45.39c.997 2.784 4.04 4.36 6.928 3.52 3.044-.894 4.88-4.098 3.883-7.04 0-.105-14.695-45.383-14.695-45.383z" class="st1"/><path id="path13" fill="#e01a59" d="M60.058 41.502c2.99-.998 4.618-4.202 3.674-7.196-.997-2.994-4.2-4.622-7.19-3.677L11.14 45.44c-2.78.998-4.356 4.045-3.516 6.934.892 3.046 4.094 4.885 7.033 3.887.104 0 45.398-14.76 45.398-14.76z" class="st2"/><path id="path15" fill="#331433" d="M20.59 54.372c2.94-.946 6.77-2.207 10.864-3.52-.945-2.94-2.204-6.776-3.516-10.873l-10.865 3.514L20.59 54.37z" class="st3"/><path id="path17" fill="#d62027" d="M43.473 46.913c4.094-1.313 7.925-2.574 10.864-3.52-.945-2.94-2.204-6.776-3.516-10.873l-10.86 3.52 3.518 10.873z" class="st4"/><path id="path19" fill="#89d3df" d="M52.605 18.653c2.992-.998 4.62-4.202 3.674-7.196-1-2.994-4.2-4.623-7.19-3.677L3.74 22.54c-2.78.998-4.356 4.045-3.516 6.934.892 3.046 4.094 4.885 7.033 3.887.104 0 45.345-14.703 45.345-14.703z" class="st5"/><path id="path21" fill="#258b74" d="M13.19 31.47c2.94-.946 6.77-2.206 10.864-3.52-1.312-4.097-2.572-7.93-3.517-10.873l-10.864 3.52L13.19 31.47z" class="st6"/><path id="path23" fill="#819c3c" d="M36.02 24.063c4.094-1.313 7.925-2.573 10.864-3.52-1.312-4.096-2.57-7.93-3.516-10.872l-10.864 3.52 3.516 10.877z" class="st7"/></g></g></svg> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
resources/assets/icons/twitter.svg
0 → 100644
| 1 | +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path fill="#00aced" d="M64 12.145c-2.355 1.045-4.886 1.75-7.54 2.068 2.71-1.625 4.79-4.198 5.772-7.265-2.538 1.505-5.347 2.598-8.338 3.187-2.395-2.552-5.808-4.147-9.584-4.147-7.252 0-13.13 5.88-13.13 13.13 0 1.03.115 2.032.34 2.993-10.914-.543-20.59-5.77-27.065-13.714-1.13 1.94-1.777 4.195-1.777 6.6 0 4.556 2.317 8.575 5.84 10.93-2.15-.068-4.176-.66-5.946-1.642v.166c0 6.36 4.525 11.667 10.53 12.874-1.1.3-2.26.46-3.458.46-.846 0-1.67-.08-2.47-.234 1.67 5.215 6.52 9.012 12.265 9.117-4.498 3.522-10.16 5.62-16.31 5.62-1.06 0-2.107-.06-3.13-.183C5.81 55.827 12.71 58 20.124 58c24.15 0 37.358-20.008 37.358-37.36 0-.568-.013-1.134-.038-1.698 2.566-1.85 4.792-4.163 6.552-6.797"/></svg> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -16,7 +16,7 @@ h2 { | ... | @@ -16,7 +16,7 @@ h2 { |
| 16 | } | 16 | } |
| 17 | h3 { | 17 | h3 { |
| 18 | font-size: 2.333em; | 18 | font-size: 2.333em; |
| 19 | - line-height: 1.571428572em; | 19 | + line-height: 1.221428572em; |
| 20 | margin-top: 0.78571429em; | 20 | margin-top: 0.78571429em; |
| 21 | margin-bottom: 0.43137255em; | 21 | margin-bottom: 0.43137255em; |
| 22 | } | 22 | } |
| ... | @@ -71,6 +71,13 @@ a, .link { | ... | @@ -71,6 +71,13 @@ a, .link { |
| 71 | padding-right: 0; | 71 | padding-right: 0; |
| 72 | padding-left: $-s; | 72 | padding-left: $-s; |
| 73 | } | 73 | } |
| 74 | + &.icon { | ||
| 75 | + display: inline-block; | ||
| 76 | + } | ||
| 77 | + svg { | ||
| 78 | + position: relative; | ||
| 79 | + display: inline-block; | ||
| 80 | + } | ||
| 74 | } | 81 | } |
| 75 | 82 | ||
| 76 | /* | 83 | /* |
| ... | @@ -84,7 +91,6 @@ p, ul, ol, pre, table, blockquote { | ... | @@ -84,7 +91,6 @@ p, ul, ol, pre, table, blockquote { |
| 84 | hr { | 91 | hr { |
| 85 | border: 0; | 92 | border: 0; |
| 86 | height: 1px; | 93 | height: 1px; |
| 87 | - border: 0; | ||
| 88 | background: #EAEAEA; | 94 | background: #EAEAEA; |
| 89 | margin-bottom: $-l; | 95 | margin-bottom: $-l; |
| 90 | &.faded { | 96 | &.faded { | ... | ... |
| ... | @@ -33,12 +33,10 @@ | ... | @@ -33,12 +33,10 @@ |
| 33 | @if(count($socialDrivers) > 0) | 33 | @if(count($socialDrivers) > 0) |
| 34 | <hr class="margin-top"> | 34 | <hr class="margin-top"> |
| 35 | <h3 class="text-muted">{{ trans('auth.social_login') }}</h3> | 35 | <h3 class="text-muted">{{ trans('auth.social_login') }}</h3> |
| 36 | - @if(isset($socialDrivers['google'])) | 36 | + @foreach($socialDrivers as $driver => $enabled) |
| 37 | - <a id="social-login-google" href="{{ baseUrl("/login/service/google") }}" style="color: #DC4E41;"><i class="zmdi zmdi-google-plus-box zmdi-hc-4x"></i></a> | 37 | + <a id="social-login-{{$driver}}" href="{{ baseUrl("/login/service/" . $driver) }}">@icon($driver, ['width' => 56])</a> |
| 38 | - @endif | 38 | + |
| 39 | - @if(isset($socialDrivers['github'])) | 39 | + @endforeach |
| 40 | - <a id="social-login-github" href="{{ baseUrl("/login/service/github") }}" style="color:#444;"><i class="zmdi zmdi-github zmdi-hc-4x"></i></a> | ||
| 41 | - @endif | ||
| 42 | @endif | 40 | @endif |
| 43 | </div> | 41 | </div> |
| 44 | </div> | 42 | </div> | ... | ... |
| ... | @@ -37,12 +37,10 @@ | ... | @@ -37,12 +37,10 @@ |
| 37 | <hr class="margin-top"> | 37 | <hr class="margin-top"> |
| 38 | <h3 class="text-muted">{{ trans('auth.social_registration') }}</h3> | 38 | <h3 class="text-muted">{{ trans('auth.social_registration') }}</h3> |
| 39 | <p class="text-small">{{ trans('auth.social_registration_text') }}</p> | 39 | <p class="text-small">{{ trans('auth.social_registration_text') }}</p> |
| 40 | - @if(isset($socialDrivers['google'])) | 40 | + @foreach($socialDrivers as $driver => $enabled) |
| 41 | - <a href="{{ baseUrl("/register/service/google") }}" style="color: #DC4E41;"><i class="zmdi zmdi-google-plus-box zmdi-hc-4x"></i></a> | 41 | + <a href="{{ baseUrl("/register/service/" . $driver) }}">@icon($driver, ['width' => 56])</a> |
| 42 | - @endif | 42 | + |
| 43 | - @if(isset($socialDrivers['github'])) | 43 | + @endforeach |
| 44 | - <a href="{{ baseUrl("/register/service/github") }}" style="color:#444;"><i class="zmdi zmdi-github zmdi-hc-4x"></i></a> | ||
| 45 | - @endif | ||
| 46 | @endif | 44 | @endif |
| 47 | </div> | 45 | </div> |
| 48 | </div> | 46 | </div> | ... | ... |
| ... | @@ -30,7 +30,7 @@ | ... | @@ -30,7 +30,7 @@ |
| 30 | <header id="header"> | 30 | <header id="header"> |
| 31 | <div class="container"> | 31 | <div class="container"> |
| 32 | <div class="row"> | 32 | <div class="row"> |
| 33 | - <div class="col-md-6"> | 33 | + <div class="col-sm-6"> |
| 34 | 34 | ||
| 35 | <a href="{{ baseUrl('/') }}" class="logo"> | 35 | <a href="{{ baseUrl('/') }}" class="logo"> |
| 36 | @if(setting('app-logo', '') !== 'none') | 36 | @if(setting('app-logo', '') !== 'none') |
| ... | @@ -41,7 +41,7 @@ | ... | @@ -41,7 +41,7 @@ |
| 41 | @endif | 41 | @endif |
| 42 | </a> | 42 | </a> |
| 43 | </div> | 43 | </div> |
| 44 | - <div class="col-md-6"> | 44 | + <div class="col-sm-6"> |
| 45 | <div class="float right"> | 45 | <div class="float right"> |
| 46 | <div class="links text-center"> | 46 | <div class="links text-center"> |
| 47 | @yield('header-buttons') | 47 | @yield('header-buttons') | ... | ... |
| ... | @@ -59,30 +59,18 @@ | ... | @@ -59,30 +59,18 @@ |
| 59 | <h3>{{ trans('settings.users_social_accounts') }}</h3> | 59 | <h3>{{ trans('settings.users_social_accounts') }}</h3> |
| 60 | <p class="text-muted">{{ trans('settings.users_social_accounts_info') }}</p> | 60 | <p class="text-muted">{{ trans('settings.users_social_accounts_info') }}</p> |
| 61 | <div class="row"> | 61 | <div class="row"> |
| 62 | - @if(isset($activeSocialDrivers['google'])) | 62 | + @foreach($activeSocialDrivers as $driver => $enabled) |
| 63 | <div class="col-md-3 text-center"> | 63 | <div class="col-md-3 text-center"> |
| 64 | - <div><i class="zmdi zmdi-google-plus-box zmdi-hc-4x" style="color: #DC4E41;"></i></div> | 64 | + <div>@icon($driver, ['width' => 56])</div> |
| 65 | <div> | 65 | <div> |
| 66 | - @if($user->hasSocialAccount('google')) | 66 | + @if($user->hasSocialAccount($driver)) |
| 67 | - <a href="{{ baseUrl("/login/service/google/detach") }}" class="button neg">{{ trans('settings.users_social_disconnect') }}</a> | 67 | + <a href="{{ baseUrl("/login/service/{$driver}/detach") }}" class="button neg">{{ trans('settings.users_social_disconnect') }}</a> |
| 68 | @else | 68 | @else |
| 69 | - <a href="{{ baseUrl("/login/service/google") }}" class="button pos">{{ trans('settings.users_social_connect') }}</a> | 69 | + <a href="{{ baseUrl("/login/service/{$driver}") }}" class="button pos">{{ trans('settings.users_social_connect') }}</a> |
| 70 | @endif | 70 | @endif |
| 71 | </div> | 71 | </div> |
| 72 | </div> | 72 | </div> |
| 73 | - @endif | 73 | + @endforeach |
| 74 | - @if(isset($activeSocialDrivers['github'])) | ||
| 75 | - <div class="col-md-3 text-center"> | ||
| 76 | - <div><i class="zmdi zmdi-github zmdi-hc-4x" style="color: #444;"></i></div> | ||
| 77 | - <div> | ||
| 78 | - @if($user->hasSocialAccount('github')) | ||
| 79 | - <a href="{{ baseUrl("/login/service/github/detach") }}" class="button neg">{{ trans('settings.users_social_disconnect') }}</a> | ||
| 80 | - @else | ||
| 81 | - <a href="{{ baseUrl("/login/service/github") }}" class="button pos">{{ trans('settings.users_social_connect') }}</a> | ||
| 82 | - @endif | ||
| 83 | - </div> | ||
| 84 | - </div> | ||
| 85 | - @endif | ||
| 86 | </div> | 74 | </div> |
| 87 | @endif | 75 | @endif |
| 88 | 76 | ... | ... |
-
Please register or sign in to post a comment