mirror of https://github.com/Squidex/squidex.git
47 changed files with 562 additions and 232 deletions
@ -0,0 +1,17 @@ |
|||||
|
// ==========================================================================
|
||||
|
// ExtendedClaimTypes.cs
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex Group
|
||||
|
// All rights reserved.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
namespace Squidex.Infrastructure.Security |
||||
|
{ |
||||
|
public class ExtendedClaimTypes |
||||
|
{ |
||||
|
public const string SquidexDisplayName = "urn:squidex:name"; |
||||
|
|
||||
|
public const string SquidexPictureUrl = "urn:squidex:picture"; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
rules: |
||||
|
no-ids: |
||||
|
- 0 |
||||
|
final-newline: |
||||
|
- 0 |
||||
|
clean-import-paths: |
||||
|
- 0 |
||||
|
property-sort-order: |
||||
|
- 0 |
||||
|
indentation: |
||||
|
- 2 |
||||
|
- |
||||
|
size: 4 |
||||
|
|
||||
|
leading-underscore: false |
||||
|
|
||||
|
files: |
||||
|
ignore: |
||||
|
- 'app/theme/_mixins.scss' |
||||
@ -1,5 +0,0 @@ |
|||||
<div *ngIf="showError"> |
|
||||
<div class="simple-error"> |
|
||||
Failed to login |
|
||||
</div> |
|
||||
</div> |
|
||||
@ -1,5 +0,0 @@ |
|||||
<div *ngIf="showError"> |
|
||||
<div class="simple-error"> |
|
||||
Failed to login |
|
||||
</div> |
|
||||
</div> |
|
||||
@ -0,0 +1,13 @@ |
|||||
|
<ul class="nav navbar-nav"> |
||||
|
<li class="nav-item dropdown"> |
||||
|
<span class="nav-link dropdown-toggle" (click)="modalMenu.toggle()"> |
||||
|
<img [attr.src]="(pictureUrl | async)" /> |
||||
|
|
||||
|
<span>{{displayName | async}}</span> |
||||
|
</span> |
||||
|
|
||||
|
<div class="dropdown-menu" *sqxModalView="modalMenu"> |
||||
|
<a class="dropdown-item" (click)="logout()">Logout</a> |
||||
|
</div> |
||||
|
</li> |
||||
|
</ul> |
||||
@ -0,0 +1,39 @@ |
|||||
|
@import '_mixins'; |
||||
|
@import '_vars'; |
||||
|
|
||||
|
$size: 2.2rem; |
||||
|
|
||||
|
a { |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
|
||||
|
img { |
||||
|
@include border-radius($size * .5); |
||||
|
height: $size; |
||||
|
width: $size; |
||||
|
} |
||||
|
|
||||
|
.navbar-nav { |
||||
|
.nav-link { |
||||
|
padding: 0; |
||||
|
cursor: pointer; |
||||
|
color: $accent-dark; |
||||
|
line-height: 2.2rem; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.dropdown-menu { |
||||
|
& { |
||||
|
@include absolute(44px, 0, auto, auto); |
||||
|
} |
||||
|
|
||||
|
&::before { |
||||
|
@include absolute(-18px, 10px, auto, auto); |
||||
|
border-color: transparent transparent $accent-dark; |
||||
|
border-style: solid; |
||||
|
border-width: 10px; |
||||
|
content: ''; |
||||
|
height: 0; |
||||
|
width: 0; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
/* |
||||
|
* Squidex Headless CMS |
||||
|
* |
||||
|
* @license |
||||
|
* Copyright (c) Sebastian Stehle. All rights reserved |
||||
|
*/ |
||||
|
|
||||
|
import * as Ng2 from '@angular/core'; |
||||
|
|
||||
|
import { AuthService, ModalView } from 'shared'; |
||||
|
|
||||
|
@Ng2.Component({ |
||||
|
selector: 'sqx-profile-menu', |
||||
|
styles, |
||||
|
template |
||||
|
}) |
||||
|
export class ProfileMenuComponent { |
||||
|
public modalMenu = new ModalView(); |
||||
|
|
||||
|
public displayName |
||||
|
= this.auth.isAuthenticatedChanges.map(t => t ? this.auth.user.displayName : null); |
||||
|
|
||||
|
public pictureUrl |
||||
|
= this.auth.isAuthenticatedChanges.map(t => t ? this.auth.user.pictureUrl : null); |
||||
|
|
||||
|
constructor( |
||||
|
private readonly auth: AuthService |
||||
|
) { |
||||
|
} |
||||
|
|
||||
|
public logout() { |
||||
|
this.auth.logout(); |
||||
|
} |
||||
|
} |
||||
@ -1,16 +1,16 @@ |
|||||
@import '_vars.scss'; |
@import '_vars'; |
||||
@import '_mixins.scss'; |
@import '_mixins'; |
||||
|
|
||||
.search { |
.search { |
||||
& { |
& { |
||||
@include transition(background 0.4s ease); |
@include transition(background .4s ease); |
||||
color: white; |
background: $theme-blue-dark; |
||||
background: $accent-blue-dark; |
border-color: $theme-blue-dark; |
||||
border-color: $accent-blue-dark; |
|
||||
border-width: 1px; |
border-width: 1px; |
||||
|
color: $accent-dark; |
||||
} |
} |
||||
|
|
||||
&:focus { |
&:focus { |
||||
background: darken($accent-blue-dark, 5%); |
background: darken($theme-blue-dark, 5%); |
||||
} |
} |
||||
} |
} |
||||
@ -0,0 +1,2 @@ |
|||||
|
|
||||
|
<button class="btn btn-primary" (click)="login()">Login</button> |
||||
@ -1,37 +1,39 @@ |
|||||
@import '../../theme/_mixins.scss'; |
@import '_mixins'; |
||||
|
|
||||
$bar-height: 12px; |
$bar-height: 12px; |
||||
|
|
||||
$thumb-size: 20px; |
$thumb-size: 20px; |
||||
$thumb-margin: ($thumb-size - $bar-height) * 0.5; |
$thumb-margin: ($thumb-size - $bar-height) * .5; |
||||
|
|
||||
$color-border: #ccc; |
$color-border: #ccc; |
||||
$color-focus: #66afe9; |
$color-focus: #66afe9; |
||||
|
|
||||
.slider { |
.slider { |
||||
&-bar { |
&-bar { |
||||
@include border-radius($bar-height * 0.5); |
@include border-radius($bar-height * .5); |
||||
position: relative; |
position: relative; |
||||
border: 1px solid $color-border; |
border: 1px solid $color-border; |
||||
margin-bottom: 20px; |
margin-bottom: 20px; |
||||
margin-top: 5px; |
margin-top: 5px; |
||||
margin-right: $thumb-size * 0.5; |
margin-right: $thumb-size * .5; |
||||
background: white; |
background: $color-border; |
||||
height: $bar-height; |
height: $bar-height; |
||||
} |
} |
||||
|
|
||||
&-thumb { |
&-thumb { |
||||
@include border-radius($thumb-size * 0.5); |
& { |
||||
|
@include border-radius($thumb-size * .5); |
||||
position: absolute; |
position: absolute; |
||||
width: $thumb-size; |
width: $thumb-size; |
||||
height: $thumb-size; |
height: $thumb-size; |
||||
border: 1px solid $color-border; |
border: 1px solid $color-border; |
||||
background: white; |
background: $color-border; |
||||
margin-top: -$thumb-margin; |
margin-top: -$thumb-margin; |
||||
margin-left: -$thumb-size * 0.5; |
margin-left: -$thumb-size * .5; |
||||
} |
} |
||||
|
|
||||
&-thumb.focused { |
&.focused { |
||||
border-color: $color-focus; |
border-color: $color-focus; |
||||
} |
} |
||||
|
} |
||||
} |
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
/* |
||||
|
* Squidex Headless CMS |
||||
|
* |
||||
|
* @license |
||||
|
* Copyright (c) Sebastian Stehle. All rights reserved |
||||
|
*/ |
||||
|
|
||||
|
import * as Ng2 from '@angular/core'; |
||||
|
import * as Ng2Router from '@angular/router'; |
||||
|
|
||||
|
import { AuthService } from './../services/auth.service'; |
||||
|
|
||||
|
@Ng2.Injectable() |
||||
|
export class MustBeNotAuthenticatedGuard implements Ng2Router.CanActivate { |
||||
|
constructor( |
||||
|
private readonly auth: AuthService, |
||||
|
private readonly router: Ng2Router.Router |
||||
|
) { |
||||
|
} |
||||
|
|
||||
|
public canActivate(route: Ng2Router.ActivatedRouteSnapshot, state: Ng2Router.RouterStateSnapshot): Promise<boolean> | boolean { |
||||
|
return this.auth.checkLogin().then(isAuthenticated => { |
||||
|
if (isAuthenticated) { |
||||
|
this.router.navigate(['app']); |
||||
|
|
||||
|
return false; |
||||
|
} |
||||
|
return true; |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
@ -1,15 +1,18 @@ |
|||||
$nav-text-color: #333; |
$nav-text-color: #333; |
||||
|
|
||||
$background: #F4F8F9; |
$background: #f4f8f9; |
||||
$border: #EAEEEF; |
$border: #eaeeef; |
||||
|
|
||||
$accent-blue: #438CEF; |
$theme-blue: #438cef; |
||||
$accent-blue-dark: #3F83DF; |
$theme-blue-dark: #3f83df; |
||||
$accent-blue-light: #A1C6F7; |
$theme-blue-light: #a1c6f7; |
||||
$accent-blue-lighter: #D9E8FC; |
$theme-blue-lighter: #d9e8fc; |
||||
|
|
||||
$accent-green: #4CC159; |
$theme-green: #4cc159; |
||||
$accent-green-dark: #47B353; |
$theme-green-dark: #47b353; |
||||
|
|
||||
|
$theme-error: #f00; |
||||
|
$theme-error-dark: darken($theme-error, 5%); |
||||
|
|
||||
|
$accent-dark: #fff; |
||||
|
|
||||
$accent-error: red; |
|
||||
$accent-error-dark: darken(red, 5%); |
|
||||
@ -1,7 +1,7 @@ |
|||||
@import '_mixins.scss'; |
@import '_mixins.scss'; |
||||
@import '_vars.scss'; |
@import '_vars.scss'; |
||||
|
|
||||
$fa-font-path: "~font-awesome/fonts"; |
$fa-font-path: '~font-awesome/fonts'; |
||||
|
|
||||
$brand-primary: $accent-blue; |
$brand-primary: $theme-blue; |
||||
$brand-success: $accent-green; |
$brand-success: $theme-green; |
||||
|
After Width: | Height: | Size: 15 KiB |
Loading…
Reference in new issue