!wip on the new custom page

pull/2728/head
TidusJar 6 years ago
parent 2e05d90a98
commit edf87bf296

@ -0,0 +1,9 @@
namespace Ombi.Settings.Settings.Models
{
public class CustomPageSettings : Settings
{
public bool Enabled { get; set; }
public string Title { get; set; }
public string Html { get; set; }
}
}

@ -14,13 +14,16 @@ import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
import { TranslateLoader, TranslateModule } from "@ngx-translate/core";
import { TranslateHttpLoader } from "@ngx-translate/http-loader";
import { CookieService } from "ng2-cookies";
import { NgxEditorModule } from "ngx-editor";
import { GrowlModule } from "primeng/components/growl/growl";
import { ButtonModule, CaptchaModule, ConfirmationService, ConfirmDialogModule, DataTableModule, DialogModule, OverlayPanelModule, SharedModule, SidebarModule, TooltipModule } from "primeng/primeng";
import { ButtonModule, CaptchaModule, ConfirmationService, ConfirmDialogModule, DataTableModule, DialogModule, OverlayPanelModule, SharedModule, SidebarModule,
TooltipModule } from "primeng/primeng";
// Components
import { AppComponent } from "./app.component";
import { CookieComponent } from "./auth/cookie.component";
import { CustomPageComponent } from "./custompage/custompage.component";
import { PageNotFoundComponent } from "./errors/not-found.component";
import { LandingPageComponent } from "./landingpage/landingpage.component";
import { LoginComponent } from "./login/login.component";
@ -43,6 +46,7 @@ const routes: Routes = [
{ path: "", redirectTo: "/search", pathMatch: "full" },
{ path: "login", component: LoginComponent },
{ path: "Login/OAuth/:pin", component: LoginOAuthComponent },
{ path: "Custom", component: CustomPageComponent },
{ path: "login/:landing", component: LoginComponent },
{ path: "reset", component: ResetPasswordComponent },
{ path: "token", component: TokenResetPasswordComponent },
@ -88,6 +92,7 @@ export function JwtTokenGetter() {
FormsModule,
DataTableModule,
SharedModule,
NgxEditorModule,
DialogModule,
MatButtonModule,
NgbModule.forRoot(),
@ -121,6 +126,7 @@ export function JwtTokenGetter() {
LandingPageComponent,
ResetPasswordComponent,
TokenResetPasswordComponent,
CustomPageComponent,
CookieComponent,
LoginOAuthComponent,
],

@ -0,0 +1,7 @@
<button class="btn btn-info-outline" (click)="isEditing = !isEditing">Edit</button>
<div *ngIf="isEditing" >
<app-ngx-editor [placeholder]="'Enter text here...'" [minHeight]="100" [(ngModel)]="html"></app-ngx-editor>
<button class="btn btn-primary-outline" (click)="isEditing = !isEditing">Save</button>
<hr />
</div>
<div [innerHTML]="html"></div>

@ -0,0 +1,44 @@
$primary-colour: #df691a;
$primary-colour-outline: #ff761b;
$bg-colour: #333333;
$bg-colour-disabled: #252424;
:host app-ngx-editor /deep/ .ngx-toolbar {
background-color: $bg-colour;
border: 1px solid $primary-colour-outline;
}
:host app-ngx-editor /deep/ .ngx-toolbar-set {
background-color: transparent !important;
border: 1px solid $primary-colour-outline !important;
}
:host app-ngx-editor /deep/ .ngx-editor-button {
-o-transition: all 0.218s;
-moz-transition: all 0.218s;
-webkit-transition: all 0.218s;
transition: all 0.218s;
color: $primary-colour-outline;
background-color: transparent;
background-image: none;
border-color: $primary-colour-outline !important;
}
:host app-ngx-editor /deep/ .ngx-editor-button:hover {
color: black;
background-color: $primary-colour !important;
border-color: $primary-colour-outline !important;
}
:host app-ngx-editor /deep/ .ngx-editor-grippie {
background-color: $bg-colour;
border: 1px solid $primary-colour-outline;
}
:host app-ngx-editor /deep/ .ngx-editor-textarea {
border: 1px solid $primary-colour-outline !important;
}
:host app-ngx-editor /deep/ .ngx-editor-message {
display:none !important;
}

@ -0,0 +1,19 @@
import { Component, OnInit } from "@angular/core";
@Component({
templateUrl: "./custompage.component.html",
styleUrls: ["./custompage.component.scss"],
})
export class CustomPageComponent implements OnInit {
public html: string;
public isEditing: boolean;
constructor() {
//
}
public ngOnInit() {
//
}
}

@ -706,6 +706,27 @@ namespace Ombi.Controllers
return emailSettings.Enabled;
}
/// <summary>
/// Gets the Custom Page Settings.
/// </summary>
/// <returns></returns>
[HttpGet("CustomPage")]
[AllowAnonymous]
public async Task<CustomPageSettings> CustomPageSettings()
{
return await Get<CustomPageSettings>();
}
/// <summary>
/// Saves the Custom Page Settings.
/// </summary>
/// <returns></returns>
[HttpGet("CustomPage")]
public async Task<bool> CustomPageSettings([FromBody] CustomPageSettings page)
{
return await Save(page);
}
/// <summary>
/// Saves the discord notification settings.
/// </summary>

@ -15,20 +15,20 @@
"@angular/animations": "^7.1.4",
"@angular/cdk": "^7.2.0",
"@angular/common": "^7.1.4",
"@angular/compiler":"^7.1.4",
"@angular/compiler": "^7.1.4",
"@angular/compiler-cli": "^7.1.4",
"@angular/core": "^7.1.4",
"@angular/forms":"^7.1.4",
"@angular/forms": "^7.1.4",
"@angular/http": "^7.1.4",
"@angular/material":"^7.2.0",
"@angular/material": "^7.2.0",
"@angular/platform-browser": "^7.1.4",
"@angular/platform-browser-dynamic": "^7.1.4",
"@angular/platform-server":"^7.1.4",
"@angular/router":"^7.1.4",
"@angular/platform-server": "^7.1.4",
"@angular/router": "^7.1.4",
"@auth0/angular-jwt": "^2.0.0",
"@ng-bootstrap/ng-bootstrap": "^3.3.1",
"@ngtools/webpack":"^7.1.4",
"@ngu/carousel": "^1.4.9-beta-2",
"@ngtools/webpack": "^7.1.4",
"@ngu/carousel": "^1.4.9-beta-2",
"@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0",
"@types/core-js": "^2.5.0",
@ -62,7 +62,9 @@
"moment": "^2.22.2",
"natives": "1.1.6",
"ng2-cookies": "^1.0.12",
"ngx-bootstrap": "^3.1.4",
"ngx-clipboard": "^11.1.1",
"ngx-editor": "^4.1.0",
"ngx-infinite-scroll": "^6.0.1",
"ngx-moment": "^3.0.1",
"ngx-order-pipe": "^2.0.1",

@ -53,6 +53,8 @@ module.exports = (env: any) => {
"@ngx-translate/http-loader",
"ngx-order-pipe",
"@yellowspot/ng-truncate",
"ngx-editor",
"ngx-bootstrap",
]),
},
plugins: prod ? [] : [

@ -4182,6 +4182,10 @@ ng2-cookies@^1.0.12:
version "1.0.12"
resolved "https://registry.yarnpkg.com/ng2-cookies/-/ng2-cookies-1.0.12.tgz#3f3e613e0137b0649b705c678074b4bd08149ccc"
ngx-bootstrap@^3.1.4:
version "3.1.4"
resolved "https://registry.yarnpkg.com/ngx-bootstrap/-/ngx-bootstrap-3.1.4.tgz#5105c0227da3b51a1972d04efa1504a79474fd57"
ngx-clipboard@^11.1.1:
version "11.1.9"
resolved "https://registry.yarnpkg.com/ngx-clipboard/-/ngx-clipboard-11.1.9.tgz#a391853dc49e436de407260863a2c814d73a9332"
@ -4189,6 +4193,12 @@ ngx-clipboard@^11.1.1:
ngx-window-token "^1.0.2"
tslib "^1.9.0"
ngx-editor@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/ngx-editor/-/ngx-editor-4.1.0.tgz#3ec5820627f25a2239094747cccf88a7ca02f79f"
dependencies:
tslib "^1.9.0"
ngx-infinite-scroll@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/ngx-infinite-scroll/-/ngx-infinite-scroll-6.0.1.tgz#571e54860ce32839451569bcf6e7a63cfae327bd"

Loading…
Cancel
Save