Compare commits
9 Commits
073bb88703
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98dacb7133 | ||
|
|
b3f783f407 | ||
|
|
b8c7d7b200 | ||
|
|
5e29cd335d | ||
|
|
023d210a16 | ||
|
|
c6d14525de | ||
|
|
dda4b613f8 | ||
|
|
172626c8ee | ||
|
|
4ea291622a |
3
.gitignore
vendored
@@ -185,7 +185,8 @@ publish/
|
|||||||
*.azurePubxml
|
*.azurePubxml
|
||||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||||
# but database connection strings (with potential passwords) will be unencrypted
|
# but database connection strings (with potential passwords) will be unencrypted
|
||||||
*.pubxml
|
#Uposevamo publish profile
|
||||||
|
#*.pubxml
|
||||||
*.publishproj
|
*.publishproj
|
||||||
|
|
||||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ RUN dotnet build "./ZpcBulletinBoard.csproj" -c $BUILD_CONFIGURATION -o /app/bui
|
|||||||
FROM build AS publish
|
FROM build AS publish
|
||||||
ARG BUILD_CONFIGURATION=Release
|
ARG BUILD_CONFIGURATION=Release
|
||||||
RUN dotnet publish "./ZpcBulletinBoard.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
RUN dotnet publish "./ZpcBulletinBoard.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||||
|
COPY ["./ZpcBulletinBoard/Keys/key-3a63e3da-2ef0-49c2-9e68-30571c991f22.xml", "ZpcBulletinBoard/Keys/key-3a63e3da-2ef0-49c2-9e68-30571c991f22.xml"]
|
||||||
|
|
||||||
FROM base AS final
|
FROM base AS final
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Edit board";
|
ViewData["Title"] = "Edit board";
|
||||||
Layout = "~/Pages/Shared/_Layout.cshtml";
|
Layout = "~/Pages/Layouts/_Layout.cshtml";
|
||||||
}
|
}
|
||||||
|
|
||||||
<!-- Editor -->
|
<!-- Editor -->
|
||||||
|
|||||||
@@ -3,20 +3,11 @@
|
|||||||
|
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Oglasne deske - Pregled";
|
ViewData["Title"] = "Oglasne deske - Pregled";
|
||||||
Layout = "~/Pages/Shared/_Layout.cshtml";
|
Layout = "~/Pages/Layouts/_Layout.cshtml";
|
||||||
}
|
}
|
||||||
|
|
||||||
@section Styles {
|
@section Styles {
|
||||||
<link rel="stylesheet" href="~/vendor/libs/bootstrap-material-datetimepicker/bootstrap-material-datetimepicker.css">
|
<link rel="stylesheet" href="~/css/boards/index.css" asp-append-version="true" />
|
||||||
|
|
||||||
<style type="text/css">
|
|
||||||
.table > tbody > tr > td:nth-child(2),
|
|
||||||
.table > thead > tr > th:nth-child(2),
|
|
||||||
.table > tbody > tr > td:nth-child(3),
|
|
||||||
.table > thead > tr > th:nth-child(3) {
|
|
||||||
width: 100px
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<h4 class="d-flex justify-content-between align-items-center w-100 font-weight-bold py-1 mb-4">
|
<h4 class="d-flex justify-content-between align-items-center w-100 font-weight-bold py-1 mb-4">
|
||||||
@@ -27,43 +18,59 @@
|
|||||||
</span>
|
</span>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 mb-2 text-right">
|
||||||
|
<div class="btn-group">
|
||||||
|
<input id="inpSearchBoard" class="form-control" type="text" value="" placeholder="Iskanje..." autocomplete="off">
|
||||||
|
<button id="btnRefresh" type="submit" class="btn btn-secondary" aria-label="Osveži" title="Osveži">
|
||||||
|
<i class="opacity-75 ion ion-md-refresh"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h6 class="card-header">
|
<h6 class="card-header">
|
||||||
Seznam oglasnih desk
|
Seznam oglasnih desk
|
||||||
</h6>
|
</h6>
|
||||||
<table class="table card-table">
|
<div class="div-boards">
|
||||||
<thead>
|
<table class="table card-table table-hover">
|
||||||
<tr>
|
<thead>
|
||||||
<th>
|
|
||||||
@Html.DisplayNameFor(model => model.Boards[0].Name)
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
@Html.DisplayNameFor(model => model.Boards[0].Ratio)
|
|
||||||
</th>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach (var item in Model.Boards)
|
|
||||||
{
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<th>
|
||||||
@Html.DisplayFor(modelItem => item.Name)
|
@Html.DisplayNameFor(model => model.Boards[0].Name)
|
||||||
</td>
|
</th>
|
||||||
<td>
|
<th>
|
||||||
@Html.DisplayFor(modelItem => item.Ratio)
|
@Html.DisplayNameFor(model => model.Boards[0].Ratio)
|
||||||
</td>
|
</th>
|
||||||
<td>
|
<th></th>
|
||||||
<a class="btn btn-xs icon-btn btn-outline-secondary borderless" asp-page="AddEdit" asp-route-guid="@item.Guid" data-toggle="tooltip" data-placement="top" title="Urejanje" data-state="secondary"><i class="fas fa-pencil-alt"></i></a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
}
|
</thead>
|
||||||
</tbody>
|
<tbody>
|
||||||
</table>
|
@foreach (var item in Model.Boards)
|
||||||
|
{
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.Name)
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.Ratio)
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a class="btn btn-xs icon-btn btn-outline-success borderless" asp-page="View" asp-route-guid="@item.Guid" data-toggle="tooltip" data-placement="top" title="Urejanje" data-state="secondary"><i class="fas fa-external-link"></i></a>
|
||||||
|
<a class="btn btn-xs icon-btn btn-outline-secondary borderless" asp-page="AddEdit" asp-route-guid="@item.Guid" data-toggle="tooltip" data-placement="top" title="Urejanje" data-state="secondary"><i class="fas fa-pencil-alt"></i></a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
<div class="card-footer py-3 text-right">
|
<div class="card-footer py-3 text-right">
|
||||||
<a asp-page="AddEdit" class="btn btn-primary">Dodaj novo</a>
|
<a asp-page="AddEdit" class="btn btn-primary">Dodaj novo</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@section Scripts {
|
@section Scripts {
|
||||||
|
<script src="~/js/boards/index.js" asp-append-version="true"></script>
|
||||||
|
|
||||||
}
|
}
|
||||||
26
ZpcBulletinBoard/Pages/Boards/View.cshtml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
@page "{handler?}"
|
||||||
|
@model ZpcBulletinBoard.Pages.Boards.ViewModel
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Board view";
|
||||||
|
Layout = "~/Pages/Layouts/_LayoutBlank.cshtml";
|
||||||
|
}
|
||||||
|
|
||||||
|
@section Styles {
|
||||||
|
<link rel="stylesheet" href="~/css/boards/view.css" asp-append-version="true" />
|
||||||
|
}
|
||||||
|
|
||||||
|
<input id="inpGuidBoard" type="hidden" asp-for="Guid"/>
|
||||||
|
|
||||||
|
<div class="div-placeholder">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="div-no-pages">
|
||||||
|
<i class="fal fa-exclamation-triangle fa-10x text-danger"></i>
|
||||||
|
<h2>Ni prosojnic za @Model.Guid</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@section Scripts {
|
||||||
|
<script src="~/js/boards/view.js" asp-append-version="true"></script>
|
||||||
|
}
|
||||||
64
ZpcBulletinBoard/Pages/Boards/View.cshtml.cs
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Identity;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using ZpcBulletinBoard.Data;
|
||||||
|
using ZpcBulletinBoard.Models;
|
||||||
|
using ZpcBulletinBoard.Models.Editor;
|
||||||
|
|
||||||
|
namespace ZpcBulletinBoard.Pages.Boards
|
||||||
|
|
||||||
|
{
|
||||||
|
[AllowAnonymous]
|
||||||
|
public class ViewModel(ApplicationDbContext context)
|
||||||
|
: PageModel
|
||||||
|
{
|
||||||
|
[BindProperty] public string Guid { get; set; } = "";
|
||||||
|
public IActionResult OnGet(string? guid)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(guid))
|
||||||
|
{
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
Guid = guid;
|
||||||
|
|
||||||
|
return Page();
|
||||||
|
}
|
||||||
|
|
||||||
|
//GET
|
||||||
|
|
||||||
|
public IActionResult OnGetPages(string guid)
|
||||||
|
{
|
||||||
|
var board = context.BulletinBoards
|
||||||
|
.Include(x => x.Links.OrderBy(x => x.Order))
|
||||||
|
.ThenInclude(x => x.BulletinBoardPage)
|
||||||
|
.FirstOrDefault(x => x.Guid.ToString() == guid);
|
||||||
|
|
||||||
|
var links = new List<BulletinBoardPageLink>();
|
||||||
|
|
||||||
|
if (board is not { Links: not null }) return new JsonResult(new { successful = true, links });
|
||||||
|
|
||||||
|
links.AddRange(board.Links);
|
||||||
|
|
||||||
|
foreach (var link in links)
|
||||||
|
{
|
||||||
|
link.BulletinBoardPage.Links = null;
|
||||||
|
link.BulletinBoard.Links = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new JsonResult(new { successful = true, links });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Oglasne deske - Povezave";
|
ViewData["Title"] = "Oglasne deske - Povezave";
|
||||||
Layout = "~/Pages/Shared/_Layout.cshtml";
|
Layout = "~/Pages/Layouts/_Layout.cshtml";
|
||||||
}
|
}
|
||||||
|
|
||||||
@section Styles
|
@section Styles
|
||||||
@@ -20,13 +20,13 @@
|
|||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="header">
|
||||||
<div class="div-content">
|
<div class="div-content">
|
||||||
<div class="div-content-boards">
|
<div class="div-content-boards">
|
||||||
<h6>Oglasne deske</h6>
|
<input id="inpSearchBoard" class="form-control form-control-sm" placeholder="Iskanje oglasnik desk..." />
|
||||||
</div>
|
</div>
|
||||||
<div class="div-content-pages">
|
<div class="div-content-pages">
|
||||||
<h6>Strani</h6>
|
<input id="inpSearchPage" class="form-control form-control-sm" placeholder="Iskanje strani..." />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -48,11 +48,19 @@
|
|||||||
@foreach (var tmpPage in Model.Pages)
|
@foreach (var tmpPage in Model.Pages)
|
||||||
{
|
{
|
||||||
<div class="div-page available-page" draggable="true" ondragstart="dragPage(event, this)" data-id="@tmpPage.IdBulletinBoardPage">
|
<div class="div-page available-page" draggable="true" ondragstart="dragPage(event, this)" data-id="@tmpPage.IdBulletinBoardPage">
|
||||||
<img class="img-thumbnail rounded" src="/bulletin-board-images/pages/@tmpPage.Image" alt="page image" />
|
@if ((int)tmpPage.Type == 3)
|
||||||
|
{
|
||||||
|
<div class='img-link'><i class="fas fa-link fa-5x"></i></div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<img class="img-thumbnail rounded" src="/bulletin-board-images/pages/@tmpPage.Image" onerror="this.src='/img/imgNotExists.jpg'" alt="page image" />
|
||||||
|
|
||||||
|
}
|
||||||
<small>@tmpPage.Name</small>
|
<small>@tmpPage.Name</small>
|
||||||
<div class="tools">
|
<div class="tools">
|
||||||
<a href="javascript:;" class="btn btn-xs icon-btn btn-outline-primary borderless"><i class="fas fa-reply"></i></a>
|
@* <a href="javascript:;" class="btn btn-xs icon-btn btn-outline-primary borderless"><i class="fas fa-reply"></i></a> *@
|
||||||
<a href="javascript:;" class="btn btn-xs icon-btn btn-outline-secondary borderless"><i class="fas fa-reply-all"></i></a>
|
<a href="javascript:;" class="btn btn-xs icon-btn btn-outline-secondary borderless" onclick="addPageToAllBoards(this)"><i class="fas fa-reply-all"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace ZpcBulletinBoard.Pages.BoardsLinks
|
|||||||
var order = 1;
|
var order = 1;
|
||||||
var links = context.BulletinBoardPageLinks.Where(x => x.IdBulletinBoardFk == idBoard).ToList();
|
var links = context.BulletinBoardPageLinks.Where(x => x.IdBulletinBoardFk == idBoard).ToList();
|
||||||
if (links.Any())
|
if (links.Any())
|
||||||
order = links.Max(x => x.IdLink) + 1;
|
order = links.Max(x => x.Order) + 1;
|
||||||
|
|
||||||
var link = new BulletinBoardPageLink
|
var link = new BulletinBoardPageLink
|
||||||
{
|
{
|
||||||
@@ -68,5 +68,58 @@ namespace ZpcBulletinBoard.Pages.BoardsLinks
|
|||||||
|
|
||||||
return new JsonResult(new { successful = true, error = $"", link });
|
return new JsonResult(new { successful = true, error = $"", link });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IActionResult OnPostSwapLinkOrder(int idLinkStart, int idLinkEnd)
|
||||||
|
{
|
||||||
|
var linkStart = context.BulletinBoardPageLinks.FirstOrDefault(x => x.IdLink == idLinkStart);
|
||||||
|
var linkEnd = context.BulletinBoardPageLinks.FirstOrDefault(x => x.IdLink == idLinkEnd);
|
||||||
|
|
||||||
|
if (linkStart == null)
|
||||||
|
return new JsonResult(new { successful = false, error = $"Link with ID {idLinkStart} not exists!" });
|
||||||
|
|
||||||
|
if (linkEnd == null)
|
||||||
|
return new JsonResult(new { successful = false, error = $"Link with ID {idLinkEnd} not exists!" });
|
||||||
|
|
||||||
|
(linkStart.Order, linkEnd.Order) = (linkEnd.Order, linkStart.Order);
|
||||||
|
|
||||||
|
context.SaveChanges();
|
||||||
|
|
||||||
|
return new JsonResult(new { successful = true, error = $"", linkStart, linkEnd });
|
||||||
|
}
|
||||||
|
|
||||||
|
public IActionResult OnPostLinkDuration(int idLink, int duration)
|
||||||
|
{
|
||||||
|
var link = context.BulletinBoardPageLinks.FirstOrDefault(x => x.IdLink == idLink);
|
||||||
|
|
||||||
|
if (link == null)
|
||||||
|
return new JsonResult(new { successful = false, error = $"Link with ID {idLink} not exists!" });
|
||||||
|
|
||||||
|
link.Duration = duration;
|
||||||
|
|
||||||
|
context.SaveChanges();
|
||||||
|
|
||||||
|
return new JsonResult(new { successful = true, error = $"", link });
|
||||||
|
}
|
||||||
|
|
||||||
|
//Delete
|
||||||
|
public IActionResult OnDeleteLink(int idLink)
|
||||||
|
{
|
||||||
|
var link = context.BulletinBoardPageLinks.FirstOrDefault(x => x.IdLink == idLink);
|
||||||
|
if (link == null)
|
||||||
|
return new JsonResult(new { successful = false, error = $"Link with ID {idLink} not exists!", link });
|
||||||
|
|
||||||
|
var links = context.BulletinBoardPageLinks
|
||||||
|
.Where(x => x.IdBulletinBoardFk == link.IdBulletinBoardFk && x.Order > link.Order).ToList();
|
||||||
|
foreach (var tmpLink in links)
|
||||||
|
{
|
||||||
|
tmpLink.Order -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
context.BulletinBoardPageLinks.Remove(link);
|
||||||
|
|
||||||
|
context.SaveChanges();
|
||||||
|
|
||||||
|
return new JsonResult(new { successful = true, error = $"", link });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,25 +4,31 @@
|
|||||||
|
|
||||||
<div class="app-brand demo">
|
<div class="app-brand demo">
|
||||||
<span class="app-brand-logo demo bg-secondary">
|
<span class="app-brand-logo demo bg-secondary">
|
||||||
<i class="fas fa-draw-circle text-white"></i>
|
<i class="fas fa-thumbtack text-white"></i>
|
||||||
</span>
|
</span>
|
||||||
<a href="/" class="app-brand-text demo sidenav-text font-weight-normal ml-2">Bulletin board</a>
|
<a href="/" class="app-brand-text demo sidenav-text font-weight-normal ml-2">ZPC Bulletin board</a>
|
||||||
<a href="javascript:void(0)" class="layout-sidenav-toggle sidenav-link text-large ml-auto">
|
|
||||||
<i class="ion ion-md-menu align-middle"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="sidenav-divider mt-0"></div>
|
<div class="sidenav-divider mt-0"></div>
|
||||||
|
|
||||||
<ul class="sidenav-inner">
|
<ul class="sidenav-inner">
|
||||||
<li class="sidenav-item@(currentPage.StartsWith("/Pages/")? " active" : "")">
|
<li class="sidenav-item@(currentPage.StartsWith("/Pages/")? " active" : "")">
|
||||||
<a asp-page="/Pages/Index" class="sidenav-link"><i class="sidenav-icon fas fa-home"></i><div>Strani</div></a>
|
<a asp-page="/Pages/Index" class="sidenav-link"><i class="sidenav-icon far fa-file"></i><div>Strani</div></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidenav-item@(currentPage.StartsWith("/Boards/") ? " active" : "")">
|
<li class="sidenav-item@(currentPage.StartsWith("/Boards/") ? " active" : "")">
|
||||||
<a asp-page="/Boards/Index" class="sidenav-link"><i class="sidenav-icon fas fa-home"></i><div>Oglasne deske</div></a>
|
<a asp-page="/Boards/Index" class="sidenav-link"><i class="sidenav-icon fab fa-flipboard"></i><div>Oglasne deske</div></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="sidenav-item@(currentPage.StartsWith("/BoardsLinks/") ? " active" : "")">
|
<li class="sidenav-item@(currentPage.StartsWith("/BoardsLinks/") ? " active" : "")">
|
||||||
<a asp-page="/BoardsLinks/Index" class="sidenav-link"><i class="sidenav-icon fas fa-home"></i><div>Povezave</div></a>
|
<a asp-page="/BoardsLinks/Index" class="sidenav-link"><i class="sidenav-icon fas fa-link"></i><div>Povezave</div></a>
|
||||||
</li>
|
</li>
|
||||||
|
@if (User.IsInRole("Administrator") || User.IsInRole("TransportThingUser"))
|
||||||
|
{
|
||||||
|
<li class="sidenav-divider mb-1"></li>
|
||||||
|
<li class="sidenav-header small font-weight-semibold">ADMINISTRACIJA</li>
|
||||||
|
|
||||||
|
<li class="sidenav-item@(currentPage.StartsWith("/TransportLoadingOrder/") ? " active" : "")">
|
||||||
|
<a asp-page="/TransportLoadingOrder/Index" class="sidenav-link"><i class="sidenav-icon far fa-u"></i><div>Uporabniki</div></a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -7,7 +7,8 @@
|
|||||||
<meta name="description" content="" />
|
<meta name="description" content="" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
|
||||||
|
|
||||||
<title>ZPC-BB - @ViewData["Title"]</title>
|
<title>ZPC BB - @ViewData["Title"]</title>
|
||||||
|
<link rel="icon" type="image/x-icon" href="/pin.ico">
|
||||||
|
|
||||||
<!-- Fonts -->
|
<!-- Fonts -->
|
||||||
<link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i,900" rel="stylesheet" crossorigin="anonymous" />
|
<link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i,900" rel="stylesheet" crossorigin="anonymous" />
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
@{
|
@{
|
||||||
Layout = "Shared/_Application";
|
Layout = "Layouts/_Application";
|
||||||
}
|
}
|
||||||
|
|
||||||
@section Styles {
|
@section Styles {
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
@{
|
@{
|
||||||
Layout = "Shared/_Application";
|
Layout = "Layouts/_Application";
|
||||||
}
|
}
|
||||||
|
|
||||||
@section Styles {
|
@section Styles {
|
||||||
@@ -3,23 +3,12 @@
|
|||||||
|
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Strani - Pregled";
|
ViewData["Title"] = "Strani - Pregled";
|
||||||
Layout = "~/Pages/Shared/_Layout.cshtml";
|
Layout = "~/Pages/Layouts/_Layout.cshtml";
|
||||||
}
|
}
|
||||||
|
|
||||||
@section Styles {
|
@section Styles {
|
||||||
|
<link rel="stylesheet" href="~/css/pages/index.css" asp-append-version="true" />
|
||||||
<style type="text/css">
|
|
||||||
.table > tbody > tr > td:nth-child(2),
|
|
||||||
.table > thead > tr > th:nth-child(2){
|
|
||||||
width: 200px
|
|
||||||
}
|
|
||||||
.table > tbody > tr > td:nth-child(3),
|
|
||||||
.table > thead > tr > th:nth-child(3),
|
|
||||||
.table > tbody > tr > td:nth-child(4),
|
|
||||||
.table > thead > tr > th:nth-child(4) {
|
|
||||||
width: 100px
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<h4 class="d-flex justify-content-between align-items-center w-100 font-weight-bold py-1 mb-4">
|
<h4 class="d-flex justify-content-between align-items-center w-100 font-weight-bold py-1 mb-4">
|
||||||
@@ -29,79 +18,25 @@
|
|||||||
/</span> Pregled
|
/</span> Pregled
|
||||||
</span>
|
</span>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 mb-2 text-right">
|
<div class="col-12 mb-2 text-right">
|
||||||
<form method="get">
|
<div class="btn-group">
|
||||||
<div class="btn-group">
|
<input id="inpSearchPage" class="form-control" type="text" value="" placeholder="Iskanje..." autocomplete="off">
|
||||||
<input class="form-control" type="text" value="" placeholder="Iskanje..." autocomplete="off">
|
<button id="btnRefresh" type="submit" class="btn btn-secondary" aria-label="Osveži" title="Osveži">
|
||||||
<input id="inpOpenEditorForPage" type="hidden" name="openEditorForPage" asp-for="OpenEditorForPage" />
|
<i class="opacity-75 ion ion-md-refresh"></i>
|
||||||
<div class="btn-group" title="Columns">
|
</button>
|
||||||
<button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-label="Nastavitve" title="Nastavitve">
|
</div>
|
||||||
<i class="opacity-75 ion ion-md-apps"></i>
|
|
||||||
<span class="caret"></span>
|
|
||||||
</button>
|
|
||||||
<div class="dropdown-menu dropdown-menu-right">
|
|
||||||
@* <label class="dropdown-item">
|
|
||||||
<input type="checkbox" name="openProjects" @ViewData["OpenProjects"]> <span>Odprti</span>
|
|
||||||
</label>
|
|
||||||
<label class="dropdown-item">
|
|
||||||
<input type="checkbox" name="inProductionProjects" @ViewData["InProductionProjects"]> <span>V izdelavi</span>
|
|
||||||
</label>
|
|
||||||
<label class="dropdown-item">
|
|
||||||
<input type="checkbox" name="finishedProjects" @ViewData["FinishedProjects"]> <span>Zaključeni projekti</span>
|
|
||||||
</label>
|
|
||||||
<label class="dropdown-item">
|
|
||||||
<input type="checkbox" name="offerProjects" @ViewData["OffersProjects"]> <span>Ponudbe</span>
|
|
||||||
</label> *@
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<button id="btnRefresh" type="submit" class="btn btn-secondary" aria-label="Osveži" title="Osveži">
|
|
||||||
<i class="opacity-75 ion ion-md-refresh"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h6 class="card-header">
|
<h6 class="card-header">
|
||||||
Seznam strani
|
Strani
|
||||||
</h6>
|
</h6>
|
||||||
<table class="table card-table table-hover">
|
<div class="div-pages">
|
||||||
<thead>
|
|
||||||
<tr>
|
</div>
|
||||||
<th>
|
|
||||||
@Html.DisplayNameFor(model => model.Pages[0].Name)
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
@Html.DisplayNameFor(model => model.Pages[0].Type)
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
@Html.DisplayNameFor(model => model.Pages[0].Ratio)
|
|
||||||
</th>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach (var item in Model.Pages)
|
|
||||||
{
|
|
||||||
<tr data-id="@item.IdBulletinBoardPage">
|
|
||||||
<td>
|
|
||||||
@Html.DisplayFor(modelItem => item.Name)
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@Html.DisplayFor(modelItem => item.Type)
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@Html.DisplayFor(modelItem => item.Ratio)
|
|
||||||
</td>
|
|
||||||
<td style="text-align:right;">
|
|
||||||
<a class="btn btn-xs icon-btn btn-outline-primary borderless" href="javascript:;" onclick="rowOpenEditor(this);" data-toggle="tooltip" data-placement="top" title="Urejevalnik" data-state="secondary"><i class="far fa-edit"></i></a>
|
|
||||||
<a class="btn btn-xs icon-btn btn-outline-secondary borderless" href="javascript:;" onclick="openModalEditPage(this);" data-toggle="tooltip" data-placement="top" title="Urejanje" data-state="secondary"><i class="fas fa-pencil-alt"></i></a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<div class="card-footer py-3 text-right">
|
<div class="card-footer py-3 text-right">
|
||||||
<a href="javascript:;" onclick="openModalAddPage();" class="btn btn-primary">Dodaj novo</a>
|
<a href="javascript:;" onclick="openModalAddPage();" class="btn btn-primary">Dodaj novo</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,17 +16,19 @@ namespace ZpcBulletinBoard.Pages.Pages
|
|||||||
[Authorize]
|
[Authorize]
|
||||||
public class IndexModel(ApplicationDbContext context, IWebHostEnvironment webHostEnvironment) : PageModel
|
public class IndexModel(ApplicationDbContext context, IWebHostEnvironment webHostEnvironment) : PageModel
|
||||||
{
|
{
|
||||||
public IList<BulletinBoardPage> Pages { get;set; }
|
|
||||||
|
|
||||||
public int OpenEditorForPage = 0;
|
|
||||||
|
|
||||||
public async Task OnGetAsync(int? openEditorForPage = null)
|
public void OnGet()
|
||||||
{
|
{
|
||||||
OpenEditorForPage = openEditorForPage ?? 0;
|
|
||||||
Pages = await context.BulletinBoardPage.ToListAsync();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get
|
//Get
|
||||||
|
public IActionResult OnGetPages()
|
||||||
|
{
|
||||||
|
var pages = context.BulletinBoardPage.ToList();
|
||||||
|
return new JsonResult(new { successful = true, error = $"", pages });
|
||||||
|
}
|
||||||
|
|
||||||
public IActionResult OnGetPage(int id)
|
public IActionResult OnGetPage(int id)
|
||||||
{
|
{
|
||||||
var page = context.BulletinBoardPage.Include(x => x.Links)
|
var page = context.BulletinBoardPage.Include(x => x.Links)
|
||||||
@@ -97,7 +99,25 @@ namespace ZpcBulletinBoard.Pages.Pages
|
|||||||
tmpPage.Image = imageName;
|
tmpPage.Image = imageName;
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
|
|
||||||
return new JsonResult(new { successful = true, error = $"" });
|
return new JsonResult(new { successful = true, error = $"", page = tmpPage });
|
||||||
|
}
|
||||||
|
|
||||||
|
//Delete
|
||||||
|
public IActionResult OnDeleteBoardPage(int idPage)
|
||||||
|
{
|
||||||
|
var tmpPage = context.BulletinBoardPage
|
||||||
|
.Include(x => x.Links)
|
||||||
|
.FirstOrDefault(x => x.IdBulletinBoardPage == idPage);
|
||||||
|
if (tmpPage == null)
|
||||||
|
return new JsonResult(new { successful = false, error = $"Page with ID {idPage} not exists!"});
|
||||||
|
|
||||||
|
if (tmpPage.Links.Any())
|
||||||
|
return new JsonResult(new { successful = false, error = $"Stran je v uporabi!\nBrisanje ni možno!" });
|
||||||
|
|
||||||
|
context.BulletinBoardPage.Remove(tmpPage);
|
||||||
|
context.SaveChanges();
|
||||||
|
|
||||||
|
return new JsonResult(new { successful = true, error = "" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
@model ZpcBulletinBoard.Pages.SetupNew.SetupModel
|
@model ZpcBulletinBoard.Pages.SetupNew.SetupModel
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "SetupNew";
|
ViewData["Title"] = "SetupNew";
|
||||||
Layout = "~/Pages/Shared/_LayoutBlank.cshtml";
|
Layout = "~/Pages/Layouts/_LayoutBlank.cshtml";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
@model ZpcBulletinBoard.Pages.User.LoginModel
|
@model ZpcBulletinBoard.Pages.User.LoginModel
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Prijava";
|
ViewData["Title"] = "Prijava";
|
||||||
Layout = "~/Pages/Shared/_LayoutBlank.cshtml";
|
Layout = "~/Pages/Layouts/_LayoutBlank.cshtml";
|
||||||
}
|
}
|
||||||
|
|
||||||
@section Styles {
|
@section Styles {
|
||||||
|
|||||||
@@ -119,8 +119,8 @@ namespace ZpcBulletinBoard.Pages.User
|
|||||||
if (ModelState.IsValid)
|
if (ModelState.IsValid)
|
||||||
{
|
{
|
||||||
//TODO samo za DEV
|
//TODO samo za DEV
|
||||||
//var result = await _loginManager.PasswordSignInAsync(Input.UserName, Input.Password, Input.RememberLogin, false);
|
var result = await _loginManager.PasswordSignInAsync(Input.UserName, Input.Password, Input.RememberLogin, false);
|
||||||
var result = await _loginManager.PasswordSignInAsync("Admin", "*zpcBulletinBoard2024*", Input.RememberLogin, false);
|
//var result = await _loginManager.PasswordSignInAsync("Admin", "*zpcBulletinBoard2024*", Input.RememberLogin, false);
|
||||||
|
|
||||||
if (result.Succeeded)
|
if (result.Succeeded)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
@model ZpcBulletinBoard.Pages.User.LogoutModel
|
@model ZpcBulletinBoard.Pages.User.LogoutModel
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Odjava";
|
ViewData["Title"] = "Odjava";
|
||||||
Layout = "~/Pages/Shared/_Layout.cshtml";
|
Layout = "~/Pages/Layouts/_Layout.cshtml";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
@{
|
@{
|
||||||
Layout = "_Layout";
|
Layout = "~/Pages/Layouts/_Layout.cshtml";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ builder.Services.Configure<IISOptions>(options =>
|
|||||||
options.AutomaticAuthentication = false;
|
options.AutomaticAuthentication = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
builder.Services.AddDataProtection().SetApplicationName("ZpcBulletinBoard").PersistKeysToFileSystem(new DirectoryInfo(@"Keys/"));
|
builder.Services.AddDataProtection().SetApplicationName("ZpcBulletinBoard").PersistKeysToFileSystem(new DirectoryInfo(@"wwwroot/keys/"));
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<WebPublishMethod>Container</WebPublishMethod>
|
||||||
|
<ContainerPublishMethod>NetSdk</ContainerPublishMethod>
|
||||||
|
<RegistryUrl>docker.zapecnik.com</RegistryUrl>
|
||||||
|
<UserName>david</UserName>
|
||||||
|
<PublishImageTag>latest</PublishImageTag>
|
||||||
|
<PublishProvider>ContainerRegistry</PublishProvider>
|
||||||
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
|
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
|
||||||
|
<ProjectGuid>707627f1-2251-4416-a5ea-93c98d8eed1a</ProjectGuid>
|
||||||
|
<_IsDockerfilePresent>true</_IsDockerfilePresent>
|
||||||
|
<_TargetId>NetSdkCustomContainerRegistry</_TargetId>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<WebPublishMethod>Container</WebPublishMethod>
|
||||||
|
<ContainerPublishMethod>NetSdk</ContainerPublishMethod>
|
||||||
|
<RegistryUrl>docker.zapecnik.com</RegistryUrl>
|
||||||
|
<UserName>david</UserName>
|
||||||
|
<PublishImageTag>latest</PublishImageTag>
|
||||||
|
<PublishProvider>ContainerRegistry</PublishProvider>
|
||||||
|
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||||
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
|
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
|
||||||
|
<ProjectGuid>707627f1-2251-4416-a5ea-93c98d8eed1a</ProjectGuid>
|
||||||
|
<_IsDockerfilePresent>true</_IsDockerfilePresent>
|
||||||
|
<_TargetId>NetSdkCustomContainerRegistry</_TargetId>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -34,9 +34,13 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Migrations\" />
|
<Folder Include="Migrations\" />
|
||||||
<Folder Include="Properties\PublishProfiles\" />
|
|
||||||
<Folder Include="wwwroot\bulletin-board-images\notes\" />
|
<Folder Include="wwwroot\bulletin-board-images\notes\" />
|
||||||
<Folder Include="wwwroot\bulletin-board-images\pages\" />
|
<Folder Include="wwwroot\bulletin-board-images\pages\" />
|
||||||
|
<Folder Include="wwwroot\img\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Properties\PublishProfiles\docker.zapecnik.com.pubxml.user" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
|
After Width: | Height: | Size: 6.4 MiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 22 MiB |
|
After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 12 KiB |
@@ -97,6 +97,25 @@
|
|||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-tool{
|
.img-link{
|
||||||
/* padding: 1px; */
|
height: 170px;
|
||||||
|
width: 170px;
|
||||||
|
margin-left: 15px;
|
||||||
|
margin-top: 5px;
|
||||||
|
padding-top: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#inpSearchBoard{
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header{
|
||||||
|
padding: 5px 5px 5px 5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
border-bottom: 1px solid rgba(24, 28, 33, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-boards{
|
||||||
|
height: 63vh;
|
||||||
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
14
ZpcBulletinBoard/wwwroot/css/boards/index.css
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
.table > tbody > tr > td:nth-child(2),
|
||||||
|
.table > thead > tr > th:nth-child(2) {
|
||||||
|
width: 100px
|
||||||
|
}
|
||||||
|
.table > tbody > tr > td:nth-child(3),
|
||||||
|
.table > thead > tr > th:nth-child(3) {
|
||||||
|
width: 100px;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-boards {
|
||||||
|
height: 63vh;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
38
ZpcBulletinBoard/wwwroot/css/boards/view.css
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
height: 100%;
|
||||||
|
overflow-y: hidden !important;
|
||||||
|
overflow-x: hidden !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-placeholder{
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-no-pages{
|
||||||
|
padding: 20%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-no-pages > h2{
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-placeholder > img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-placeholder > iframe {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: none;
|
||||||
|
/* width: 100%; */
|
||||||
|
/* height: calc(100% - 25px); */
|
||||||
|
overflow-y: hidden !important;
|
||||||
|
overflow-x: hidden !important;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
50
ZpcBulletinBoard/wwwroot/css/pages/index.css
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
.div-page {
|
||||||
|
float: left;
|
||||||
|
text-align: center;
|
||||||
|
width: 200px;
|
||||||
|
height: 230px;
|
||||||
|
border: 1px solid rgba(24, 28, 33, 0.06);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
margin-right: 5px;
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-page:hover {
|
||||||
|
/* background-color: rgba(24, 28, 33, 0.06); */
|
||||||
|
border-color: blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-active {
|
||||||
|
background-color: rgba(128, 171, 226, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-page > h5 {
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-bottom: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-page > i {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.img-thumbnail{
|
||||||
|
height: 170px;
|
||||||
|
width: 170px;
|
||||||
|
margin-left: 15px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img-link{
|
||||||
|
height: 170px;
|
||||||
|
width: 170px;
|
||||||
|
margin-left: 15px;
|
||||||
|
margin-top: 5px;
|
||||||
|
padding-top: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-pages{
|
||||||
|
height: 63vh;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 5.3 KiB |
BIN
ZpcBulletinBoard/wwwroot/img/imgNotExists.jpg
Normal file
|
After Width: | Height: | Size: 10 KiB |
@@ -1,7 +1,43 @@
|
|||||||
$(function(){
|
$(function(){
|
||||||
|
$('#inpSearchBoard').on('keyup', function(){
|
||||||
|
searchBoards();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#inpSearchPage').on('keyup', function(){
|
||||||
|
searchPages();
|
||||||
|
});
|
||||||
|
|
||||||
loadBoards();
|
loadBoards();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function searchBoards(){
|
||||||
|
let value = $('#inpSearchBoard').val().toLowerCase();
|
||||||
|
|
||||||
|
$(".div-board").each(function(i, e) {
|
||||||
|
let boardText = $(e).find('h5').text().toLowerCase();
|
||||||
|
if (boardText.indexOf(value) < 0){
|
||||||
|
$(e).hide();
|
||||||
|
$(e).next().hide();
|
||||||
|
} else {
|
||||||
|
$(e).show();
|
||||||
|
$(e).next().show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function searchPages(){
|
||||||
|
let value = $('#inpSearchPage').val().toLowerCase();
|
||||||
|
|
||||||
|
$(".available-page").each(function(i, e) {
|
||||||
|
let pageText = $(e).find('small').text().toLowerCase();
|
||||||
|
if (pageText.indexOf(value) < 0){
|
||||||
|
$(e).hide();
|
||||||
|
} else {
|
||||||
|
$(e).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function loadBoards(){
|
function loadBoards(){
|
||||||
$.blockUI();
|
$.blockUI();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -47,23 +83,30 @@ function loadBoards(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function allowDropPage(ev) {
|
function allowDropPage(ev) {
|
||||||
console.log('allowDrop');
|
|
||||||
if (ev.dataTransfer.getData("idPage")){
|
|
||||||
ev.preventDefault();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function dragPage(ev, el) {
|
|
||||||
console.log('drag');
|
|
||||||
ev.dataTransfer.setData("idPage", $(el).attr('data-id'));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function dropPage(ev, el) {
|
|
||||||
console.log('drop');
|
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
let idPage = parseInt(ev.dataTransfer.getData("idPage"));
|
|
||||||
|
// if (ev.dataTransfer.getData("idPage")){
|
||||||
|
// ev.preventDefault();
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
function dragPage(ev, el) {
|
||||||
|
$('.available-page[data-dragg="1"]').removeAttr('data-dragg');
|
||||||
|
$(el).attr('data-dragg', '1');
|
||||||
|
}
|
||||||
|
|
||||||
|
function dropPage(ev, el) {
|
||||||
|
ev.preventDefault();
|
||||||
|
let idPage = parseInt($('.available-page[data-dragg="1"]').attr('data-id'));
|
||||||
|
if (isNaN(idPage)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$('.available-page[data-dragg="1"]').removeAttr('data-dragg');
|
||||||
let idBoard = parseInt($(el).attr('data-idboard'));
|
let idBoard = parseInt($(el).attr('data-idboard'));
|
||||||
|
insertPageToBoard(idBoard, idPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
function insertPageToBoard(idBoard, idPage){
|
||||||
$.blockUI();
|
$.blockUI();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
@@ -90,20 +133,204 @@ function allowDropPage(ev) {
|
|||||||
alert(xhr.responseText);
|
alert(xhr.responseText);
|
||||||
$.unblockUI();
|
$.unblockUI();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function addPageToBoard(idBoard, link){
|
function addPageToAllBoards(el){
|
||||||
|
let idPage = parseInt($(el).parent().parent().attr('data-id'));
|
||||||
|
|
||||||
|
$('.div-pages').each(function (i, e){
|
||||||
|
let idBoard = parseInt($(e).attr('data-idboard'));
|
||||||
|
insertPageToBoard(idBoard, idPage);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function addPageToBoard(idBoard, link){
|
||||||
let div = $('.div-pages[data-idboard="' + idBoard + '"]');
|
let div = $('.div-pages[data-idboard="' + idBoard + '"]');
|
||||||
|
|
||||||
div.append(`<div class="div-page" data-id="${link.idLink}" data-idPage='${link.bulletinBoardPage.idBulletinBoardPage}'>
|
let preview;
|
||||||
<img class="img-thumbnail rounded" src="/bulletin-board-images/pages/${link.bulletinBoardPage.image}" alt="page image" />
|
if (link.bulletinBoardPage.type == 3){
|
||||||
|
preview = `<div class='img-link'><i class="fas fa-link fa-5x"></i></div>`;
|
||||||
|
} else {
|
||||||
|
preview = `<img class="img-thumbnail rounded" src="/bulletin-board-images/pages/${link.bulletinBoardPage.image}" onerror="this.src='/img/imgNotExists.jpg'" alt="page image" />`
|
||||||
|
}
|
||||||
|
|
||||||
|
div.append(`<div class="div-page" data-id="${link.idLink}" data-idPage='${link.bulletinBoardPage.idBulletinBoardPage}' data-duration='${link.duration}'>
|
||||||
|
${preview}
|
||||||
<small>${link.bulletinBoardPage.name}</small>
|
<small>${link.bulletinBoardPage.name}</small>
|
||||||
<div class="tools">
|
<div class="tools">
|
||||||
<a href="javascript:;" class="btn btn-xs icon-btn btn-outline-primary borderless"><i class="fas fa-chevron-left"></i></a>
|
<a href="javascript:;" class="btn btn-xs icon-btn btn-outline-primary borderless" onclick="moveLink(this, -1)"><i class="fas fa-chevron-left"></i></a>
|
||||||
<a href="javascript:;" class="btn btn-xs icon-btn btn-outline-secondary borderless"><i class="far fa-clock"></i></a>
|
<a href="javascript:;" class="btn btn-xs icon-btn btn-outline-secondary borderless" onclick="setDuration(this)"><i class="far fa-clock"></i></a>
|
||||||
<a href="javascript:;" class="btn btn-xs icon-btn btn-outline-danger borderless"><i class="fas fa-trash-alt"></i></a>
|
<a href="javascript:;" class="btn btn-xs icon-btn btn-outline-danger borderless" onclick="deleteLink(this)"><i class="fas fa-trash-alt"></i></a>
|
||||||
<a href="javascript:;" class="btn btn-xs icon-btn btn-outline-primary borderless"><i class="fas fa-chevron-right"></i></a>
|
<a href="javascript:;" class="btn btn-xs icon-btn btn-outline-primary borderless" onclick="moveLink(this, 1)"><i class="fas fa-chevron-right"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</div>`);
|
</div>`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deleteLink(el){
|
||||||
|
let idLink = parseInt($(el).parent().parent().attr('data-id'));
|
||||||
|
if (isNaN(idLink)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$.blockUI();
|
||||||
|
$.ajax({
|
||||||
|
type: "DELETE",
|
||||||
|
beforeSend: function(xhr) {
|
||||||
|
xhr.setRequestHeader("XSRF-TOKEN",
|
||||||
|
$('input:hidden[name="__RequestVerificationToken"]').val());
|
||||||
|
},
|
||||||
|
url: "/BoardsLinks/Index/?handler=Link",
|
||||||
|
data: {
|
||||||
|
idLink
|
||||||
|
},
|
||||||
|
success: function(data) {
|
||||||
|
if (data.successful){
|
||||||
|
$(el).parent().parent().remove();
|
||||||
|
} else {
|
||||||
|
Swal.fire('Napaka', data.error, 'error');
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
|
$.unblockUI();
|
||||||
|
},
|
||||||
|
error: function (xhr, ajaxOptions, thrownError) {
|
||||||
|
console.log({xhr, ajaxOptions, thrownError});
|
||||||
|
alert(xhr.responseText);
|
||||||
|
$.unblockUI();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function moveLink(el, direction){
|
||||||
|
let divStart = $(el).parent().parent();
|
||||||
|
let idLinkStart = parseInt(divStart.attr('data-id'));
|
||||||
|
if (isNaN(idLinkStart)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let divEnd;
|
||||||
|
let idLinkEnd;
|
||||||
|
if (direction == -1){
|
||||||
|
divEnd = divStart.prev();
|
||||||
|
} else {
|
||||||
|
divEnd = divStart.next();
|
||||||
|
}
|
||||||
|
|
||||||
|
idLinkEnd = parseInt(divEnd.attr('data-id'));
|
||||||
|
|
||||||
|
if (isNaN(idLinkEnd)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$.blockUI();
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
beforeSend: function(xhr) {
|
||||||
|
xhr.setRequestHeader("XSRF-TOKEN",
|
||||||
|
$('input:hidden[name="__RequestVerificationToken"]').val());
|
||||||
|
},
|
||||||
|
url: "/BoardsLinks/Index/?handler=SwapLinkOrder",
|
||||||
|
data: {
|
||||||
|
idLinkStart,
|
||||||
|
idLinkEnd
|
||||||
|
},
|
||||||
|
success: function(data) {
|
||||||
|
if (data.successful){
|
||||||
|
if (direction == -1){
|
||||||
|
divStart.insertBefore(divEnd);
|
||||||
|
} else {
|
||||||
|
divStart.insertAfter(divEnd);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Swal.fire('Napaka', data.error, 'error');
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
|
$.unblockUI();
|
||||||
|
},
|
||||||
|
error: function (xhr, ajaxOptions, thrownError) {
|
||||||
|
console.log({xhr, ajaxOptions, thrownError});
|
||||||
|
alert(xhr.responseText);
|
||||||
|
$.unblockUI();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function setDuration(el){
|
||||||
|
let div = $(el).parent().parent();
|
||||||
|
let idLink = parseInt(div.attr('data-id'));
|
||||||
|
if (isNaN(idLink)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let step = 5;
|
||||||
|
let duration = div.attr('data-duration');
|
||||||
|
Swal.fire({
|
||||||
|
title: 'Trajanje [s]',
|
||||||
|
html: `
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
value="${duration}"
|
||||||
|
step="${step}"
|
||||||
|
class="swal2-input"
|
||||||
|
id="range-value">`,
|
||||||
|
input: 'range',
|
||||||
|
inputValue: duration,
|
||||||
|
inputAttributes: {
|
||||||
|
min: '5',
|
||||||
|
max: '3600',
|
||||||
|
step: step.toString(),
|
||||||
|
},
|
||||||
|
confirmButtonText: 'Potrdi',
|
||||||
|
cancelButtonText: 'Prekliči',
|
||||||
|
showCancelButton: true,
|
||||||
|
didOpen: () => {
|
||||||
|
const inputRange = Swal.getInput();
|
||||||
|
const inputNumber = Swal.getPopup().querySelector('#range-value');
|
||||||
|
|
||||||
|
// remove default output
|
||||||
|
Swal.getPopup().querySelector('output').style.display = 'none'
|
||||||
|
inputRange.style.width = '100%'
|
||||||
|
|
||||||
|
// sync input[type=number] with input[type=range]
|
||||||
|
inputRange.addEventListener('input', () => {
|
||||||
|
inputNumber.value = inputRange.value
|
||||||
|
})
|
||||||
|
|
||||||
|
// sync input[type=range] with input[type=number]
|
||||||
|
inputNumber.addEventListener('change', () => {
|
||||||
|
inputRange.value = inputNumber.value
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}).then((result) => {
|
||||||
|
console.log(result);
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
let newDuration = parseInt(result.value);
|
||||||
|
$.blockUI();
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
beforeSend: function(xhr) {
|
||||||
|
xhr.setRequestHeader("XSRF-TOKEN",
|
||||||
|
$('input:hidden[name="__RequestVerificationToken"]').val());
|
||||||
|
},
|
||||||
|
url: "/BoardsLinks/Index/?handler=LinkDuration",
|
||||||
|
data: {
|
||||||
|
idLink,
|
||||||
|
duration: newDuration
|
||||||
|
},
|
||||||
|
success: function(data) {
|
||||||
|
if (data.successful){
|
||||||
|
div.attr('data-duration', data.link.duration);
|
||||||
|
} else {
|
||||||
|
Swal.fire('Napaka', data.error, 'error');
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
|
$.unblockUI();
|
||||||
|
},
|
||||||
|
error: function (xhr, ajaxOptions, thrownError) {
|
||||||
|
console.log({xhr, ajaxOptions, thrownError});
|
||||||
|
alert(xhr.responseText);
|
||||||
|
$.unblockUI();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
18
ZpcBulletinBoard/wwwroot/js/boards/index.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
$(function(){
|
||||||
|
$('#inpSearchBoard').on('keyup', function(){
|
||||||
|
searchBoards();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function searchBoards(){
|
||||||
|
let value = $('#inpSearchBoard').val().toLowerCase();
|
||||||
|
|
||||||
|
$("table > tbody > tr").each(function(i, e) {
|
||||||
|
let boardText = $(e).find('td:first').text().toLowerCase();
|
||||||
|
if (boardText.indexOf(value) < 0){
|
||||||
|
$(e).hide();
|
||||||
|
} else {
|
||||||
|
$(e).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
74
ZpcBulletinBoard/wwwroot/js/boards/view.js
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
let indexLink = 0;
|
||||||
|
let links = [];
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
loadBoard();
|
||||||
|
});
|
||||||
|
|
||||||
|
function loadBoard(){
|
||||||
|
let guid = $('#inpGuidBoard').val();
|
||||||
|
$.blockUI();
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: "/Boards/View/?handler=Pages",
|
||||||
|
data: {
|
||||||
|
guid
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.successful){
|
||||||
|
indexLink = 0;
|
||||||
|
links = data.links;
|
||||||
|
|
||||||
|
if (links == null || links.length <= 0){
|
||||||
|
$('.div-placeholder').css('display', 'none');
|
||||||
|
$('.div-no-pages').css('display', '');
|
||||||
|
setTryAgainTimer();
|
||||||
|
} else {
|
||||||
|
$('.div-placeholder').css('display', '');
|
||||||
|
$('.div-no-pages').css('display', 'none');
|
||||||
|
showPage(false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Swal.fire('Napaka', data.error, 'error');
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
|
$.unblockUI();
|
||||||
|
},
|
||||||
|
error: function (xhr, ajaxOptions, thrownError) {
|
||||||
|
console.log(xhr);
|
||||||
|
alert(xhr.responseText);
|
||||||
|
$.unblockUI();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function setTryAgainTimer(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function showPage(showNext){
|
||||||
|
if (showNext){
|
||||||
|
indexLink += 1;
|
||||||
|
if (indexLink >= links.length){
|
||||||
|
loadBoard();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let link = links[indexLink];
|
||||||
|
$('.div-placeholder').empty();
|
||||||
|
|
||||||
|
let element;
|
||||||
|
if (link.bulletinBoardPage.type == 3){
|
||||||
|
element = ` <iframe src="${link.bulletinBoardPage.externalLink}" title="page iframe" scrolling='no'></iframe> `;
|
||||||
|
} else {
|
||||||
|
let date = new Date();
|
||||||
|
element = `<img class='img-fluid' src="/bulletin-board-images/pages/${link.bulletinBoardPage.image}?${date.getTime()}" onerror="this.src='/img/imgNotExists.jpg'" alt="page image" />`;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.div-placeholder').append(element);
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
showPage(true);
|
||||||
|
}, link.duration * 1000);
|
||||||
|
}
|
||||||
@@ -1,19 +1,83 @@
|
|||||||
$(function(){
|
$(function(){
|
||||||
let openEditorForPage = parseInt($('#inpOpenEditorForPage').val());
|
$('#inpSearchPage').on('keyup', function(){
|
||||||
if (!isNaN(openEditorForPage) && openEditorForPage > 0){
|
searchPages();
|
||||||
$('#inpOpenEditorForPage').val(0);
|
});
|
||||||
openEditor(openEditorForPage);
|
|
||||||
}
|
loadPages();
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function searchPages(){
|
||||||
|
let value = $('#inpSearchPage').val().toLowerCase();
|
||||||
|
|
||||||
|
$(".div-page").each(function(i, e) {
|
||||||
|
let pageText = $(e).find('small').text().toLowerCase();
|
||||||
|
if (pageText.indexOf(value) < 0){
|
||||||
|
$(e).hide();
|
||||||
|
} else {
|
||||||
|
$(e).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadPages(){
|
||||||
|
$.blockUI();
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: "/Pages/Index/?handler=Pages",
|
||||||
|
data: {
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if (data.successful){
|
||||||
|
let pageContent = $('.div-pages');
|
||||||
|
pageContent.empty();
|
||||||
|
|
||||||
|
if (data.pages){
|
||||||
|
data.pages.forEach((page) => {
|
||||||
|
addPageToDiv(page);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Swal.fire('Napaka', data.error, 'error');
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
|
$.unblockUI();
|
||||||
|
},
|
||||||
|
error: function (xhr, ajaxOptions, thrownError) {
|
||||||
|
console.log(xhr);
|
||||||
|
alert(xhr.responseText);
|
||||||
|
$.unblockUI();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function addPageToDiv(page){
|
||||||
|
let date = new Date();
|
||||||
|
let preview;
|
||||||
|
if (page.type == 3){
|
||||||
|
preview = `<div class='img-link'><i class="fas fa-link fa-5x"></i></div>`;
|
||||||
|
} else {
|
||||||
|
preview = `<img class="img-thumbnail rounded" src="/bulletin-board-images/pages/${page.image}?${date.getTime()}" onerror="this.src='/img/imgNotExists.jpg'" alt="page image" />`
|
||||||
|
}
|
||||||
|
let element = $(`<div class="div-page" data-id="${page.idBulletinBoardPage}">
|
||||||
|
${preview}
|
||||||
|
<small>${page.name}</small>
|
||||||
|
<div class="tools">
|
||||||
|
<a href="javascript:;" class="btn btn-xs icon-btn btn-outline-primary borderless" onclick="pageOpenEditor(this);" data-toggle="tooltip" data-placement="top" title="Urejevalnik" data-state="secondary"><i class="far fa-edit"></i></a>
|
||||||
|
<a href="javascript:;" class="btn btn-xs icon-btn btn-outline-secondary borderless" onclick="openModalEditPage(this);" data-toggle="tooltip" data-placement="top" title="Urejanje" data-state="secondary"><i class="fas fa-pencil-alt"></i></a>
|
||||||
|
<a href="javascript:;" class="btn btn-xs icon-btn btn-outline-danger borderless" onclick="deletePage(this)"><i class="fas fa-trash-alt"></i></a>
|
||||||
|
</div>
|
||||||
|
</div>`);
|
||||||
|
$('.div-pages').append(element);
|
||||||
|
|
||||||
|
element.find('[data-toggle="tooltip"]').tooltip();
|
||||||
|
}
|
||||||
|
|
||||||
function openModalAddPage(){
|
function openModalAddPage(){
|
||||||
$('#inpModalAddEditPageIdPage').val(0);
|
$('#inpModalAddEditPageIdPage').val(0);
|
||||||
$('#inpModalAddEditPageName').val('');
|
$('#inpModalAddEditPageName').val('');
|
||||||
$('#divModalAddEditPage').modal('show');
|
$('#divModalAddEditPage').modal('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function openModalEditPage(el){
|
function openModalEditPage(el){
|
||||||
let idBulletinBoardPage = parseInt($(el).parent().parent().attr('data-id'));
|
let idBulletinBoardPage = parseInt($(el).parent().parent().attr('data-id'));
|
||||||
if (isNaN(idBulletinBoardPage)){
|
if (isNaN(idBulletinBoardPage)){
|
||||||
@@ -84,14 +148,12 @@ function saveModalAddEditPage(){
|
|||||||
}},
|
}},
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data.successful){
|
if (data.successful){
|
||||||
$('#divModalAddEditPage').modal('hide');
|
if (idBulletinBoardPage <= 0){
|
||||||
if (idBulletinBoardPage > 0){
|
//Ce je nova dodam in odprem editor
|
||||||
//Ce je edit ne odprem editorja
|
addPageToDiv(data.page);
|
||||||
$('#inpOpenEditorForPage').val(0);
|
openEditor(data.page.idBulletinBoardPage);
|
||||||
} else {
|
|
||||||
$('#inpOpenEditorForPage').val(data.page.idBulletinBoardPage);
|
|
||||||
}
|
}
|
||||||
$('#btnRefresh').trigger('click');
|
$('#divModalAddEditPage').modal('hide');
|
||||||
} else {
|
} else {
|
||||||
Swal.fire('Napaka', data.error, 'error');
|
Swal.fire('Napaka', data.error, 'error');
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -105,7 +167,7 @@ function saveModalAddEditPage(){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function rowOpenEditor(el){
|
function pageOpenEditor(el){
|
||||||
openEditor(parseInt($(el).parent().parent().attr('data-id')));
|
openEditor(parseInt($(el).parent().parent().attr('data-id')));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,8 +225,7 @@ function saveModalPageEditorLink(){
|
|||||||
data: { idPage, link},
|
data: { idPage, link},
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data.successful){
|
if (data.successful){
|
||||||
$('#divModalAddEditPage').modal('hide');
|
$('#divModalPageEditorLink').modal('hide');
|
||||||
$('#btnRefresh').trigger('click');
|
|
||||||
} else {
|
} else {
|
||||||
Swal.fire('Napaka', data.error, 'error');
|
Swal.fire('Napaka', data.error, 'error');
|
||||||
console.log(data);
|
console.log(data);
|
||||||
@@ -200,8 +261,39 @@ function saveModalPageEditorPicture(){
|
|||||||
processData: false,
|
processData: false,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data.successful){
|
if (data.successful){
|
||||||
|
let date = new Date();
|
||||||
|
$('.div-page[data-id="' + idPage + '"] > img').attr('src', '/bulletin-board-images/pages/' + data.page.image + '?' + date.getTime());
|
||||||
$('#divModalPageEditorPicture').modal('hide');
|
$('#divModalPageEditorPicture').modal('hide');
|
||||||
$('#btnRefresh').trigger('click');
|
$.unblockUI();
|
||||||
|
} else {
|
||||||
|
Swal.fire('Napaka', data.error, 'error');
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
|
$.unblockUI();
|
||||||
|
},
|
||||||
|
error: function (xhr, ajaxOptions, thrownError) {
|
||||||
|
alert(xhr.responseText);
|
||||||
|
$.unblockUI();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function deletePage(el){
|
||||||
|
let idPage = parseInt($(el).parent().parent().attr('data-id'));
|
||||||
|
$.blockUI();
|
||||||
|
$.ajax({
|
||||||
|
type: "DELETE",
|
||||||
|
beforeSend: function(xhr) {
|
||||||
|
xhr.setRequestHeader("XSRF-TOKEN",
|
||||||
|
$('input:hidden[name="__RequestVerificationToken"]').val());
|
||||||
|
},
|
||||||
|
url: "/Pages/Index/?handler=BoardPage",
|
||||||
|
data: {
|
||||||
|
idPage
|
||||||
|
},
|
||||||
|
success: function(data) {
|
||||||
|
if (data.successful){
|
||||||
|
$(el).parent().parent().remove();
|
||||||
} else {
|
} else {
|
||||||
Swal.fire('Napaka', data.error, 'error');
|
Swal.fire('Napaka', data.error, 'error');
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<key id="3a63e3da-2ef0-49c2-9e68-30571c991f22" version="1">
|
<key id="dd9d2694-d2a1-4c84-8780-8cc2a8450e4b" version="1">
|
||||||
<creationDate>2024-02-27T04:54:17.6808298Z</creationDate>
|
<creationDate>2024-03-13T04:20:53.7153581Z</creationDate>
|
||||||
<activationDate>2024-02-27T04:54:17.6419309Z</activationDate>
|
<activationDate>2024-03-13T04:20:53.6880609Z</activationDate>
|
||||||
<expirationDate>2024-05-27T04:54:17.6419309Z</expirationDate>
|
<expirationDate>2024-06-11T04:20:53.6880609Z</expirationDate>
|
||||||
<descriptor deserializerType="Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60">
|
<descriptor deserializerType="Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60">
|
||||||
<descriptor>
|
<descriptor>
|
||||||
<encryption algorithm="AES_256_CBC" />
|
<encryption algorithm="AES_256_CBC" />
|
||||||
<validation algorithm="HMACSHA256" />
|
<validation algorithm="HMACSHA256" />
|
||||||
<masterKey p4:requiresEncryption="true" xmlns:p4="http://schemas.asp.net/2015/03/dataProtection">
|
<masterKey p4:requiresEncryption="true" xmlns:p4="http://schemas.asp.net/2015/03/dataProtection">
|
||||||
<!-- Warning: the key below is in an unencrypted form. -->
|
<!-- Warning: the key below is in an unencrypted form. -->
|
||||||
<value>1ujUNFqnvXGLHSTiSV2F9ymK+Sosgl6qdy7m0M/Z9bPXyplHR9bOAgm4cy5otT3C/q5H/Qf6NnQkgUqggldGiw==</value>
|
<value>1XXNVBuC3ok1caM9YT8GT0kQE7/8eRQiPgWe36qOTqXhGZVuy4HAnRi6XaxFTcWdNys7KEpjf8YWHyuwHfxm9g==</value>
|
||||||
</masterKey>
|
</masterKey>
|
||||||
</descriptor>
|
</descriptor>
|
||||||
</descriptor>
|
</descriptor>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<key id="f2b93c6e-8236-49e8-a358-a222619e483d" version="1">
|
||||||
|
<creationDate>2024-10-01T03:27:21.3194487Z</creationDate>
|
||||||
|
<activationDate>2024-10-01T03:27:21.2754418Z</activationDate>
|
||||||
|
<expirationDate>2024-12-30T03:27:21.2754418Z</expirationDate>
|
||||||
|
<descriptor deserializerType="Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60">
|
||||||
|
<descriptor>
|
||||||
|
<encryption algorithm="AES_256_CBC" />
|
||||||
|
<validation algorithm="HMACSHA256" />
|
||||||
|
<masterKey p4:requiresEncryption="true" xmlns:p4="http://schemas.asp.net/2015/03/dataProtection">
|
||||||
|
<!-- Warning: the key below is in an unencrypted form. -->
|
||||||
|
<value>TnWlT92Q/3q/QtY2uWeQRsGVS5NUVXp7bB5lzeXT+84afyp92YQZyfWSPKfOe8WBqqiGkJ/ge6aUQfcmYk3syg==</value>
|
||||||
|
</masterKey>
|
||||||
|
</descriptor>
|
||||||
|
</descriptor>
|
||||||
|
</key>
|
||||||
BIN
ZpcBulletinBoard/wwwroot/pin.ico
Normal file
|
After Width: | Height: | Size: 100 KiB |