[do not push this]
parent
3efcfc2e5f
commit
1eaa0021cb
@ -0,0 +1,77 @@
|
|||||||
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.AspNet.Identity;
|
||||||
|
using Microsoft.AspNet.Mvc;
|
||||||
|
using Microsoft.Extensions.OptionsModel;
|
||||||
|
using Microsoft.Extensions.Localization;
|
||||||
|
|
||||||
|
namespace Yavsc.ApiControllers
|
||||||
|
{
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Security.Claims;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Models;
|
||||||
|
using Services;
|
||||||
|
using Yavsc.Interfaces.Workflow;
|
||||||
|
using Yavsc.Models.Haircut;
|
||||||
|
using Yavsc.Resources;
|
||||||
|
|
||||||
|
[Route("api/haircut")]
|
||||||
|
public class HairCutController : Controller
|
||||||
|
{
|
||||||
|
private ApplicationDbContext _context;
|
||||||
|
private IEmailSender _emailSender;
|
||||||
|
private IGoogleCloudMessageSender _GCMSender;
|
||||||
|
private GoogleAuthSettings _googleSettings;
|
||||||
|
private IStringLocalizer<YavscLocalisation> _localizer;
|
||||||
|
private ILogger _logger;
|
||||||
|
private SiteSettings _siteSettings;
|
||||||
|
private SmtpSettings _smtpSettings;
|
||||||
|
private UserManager<ApplicationUser> _userManager;
|
||||||
|
|
||||||
|
public HairCutController(ApplicationDbContext context,
|
||||||
|
IOptions<GoogleAuthSettings> googleSettings,
|
||||||
|
IGoogleCloudMessageSender GCMSender,
|
||||||
|
UserManager<ApplicationUser> userManager,
|
||||||
|
IStringLocalizer<Yavsc.Resources.YavscLocalisation> localizer,
|
||||||
|
IEmailSender emailSender,
|
||||||
|
IOptions<SmtpSettings> smtpSettings,
|
||||||
|
IOptions<SiteSettings> siteSettings,
|
||||||
|
ILoggerFactory loggerFactory)
|
||||||
|
{
|
||||||
|
_context = context;
|
||||||
|
_GCMSender = GCMSender;
|
||||||
|
_emailSender = emailSender;
|
||||||
|
_googleSettings = googleSettings.Value;
|
||||||
|
_userManager = userManager;
|
||||||
|
_smtpSettings = smtpSettings.Value;
|
||||||
|
_siteSettings = siteSettings.Value;
|
||||||
|
_localizer = localizer;
|
||||||
|
_logger = loggerFactory.CreateLogger<HairCutController>();
|
||||||
|
}
|
||||||
|
public IActionResult Index()
|
||||||
|
{
|
||||||
|
var uid = User.GetUserId();
|
||||||
|
var now = DateTime.Now;
|
||||||
|
var result = _context.HairCutQueries.Where(
|
||||||
|
q=>q.ClientId == uid
|
||||||
|
&& q.EventDate > now
|
||||||
|
&& q.Status == QueryStatus.Inserted
|
||||||
|
);
|
||||||
|
return Ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public IActionResult PostQuery (HairCutQuery query )
|
||||||
|
{
|
||||||
|
var uid = User.GetUserId();
|
||||||
|
if (!ModelState.IsValid) {
|
||||||
|
return new BadRequestObjectResult(ModelState);
|
||||||
|
}
|
||||||
|
_context.HairCutQueries.Add(query);
|
||||||
|
_context.Update(uid);
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
body{background-color:#080225;color:#999}.discussion,h1,h2,h3,h4,h5,h6{color:#fff}.notif{color:#aaf}.pv{color:#ff0;font-style:bold}.price{color:#fff;border:1px solid #fff}.total{color:#fff;background-color:#1f1c58;border-color:#fff}.blog{padding:1em}.blog a{color:#FF8}.blog a:active,.blog a:hover,a:active,a:hover{color:#FAFA09}tr.hiddenpost{background-color:#130414}a.bloglink{text-shadow:0 0 8px #fff}a{color:#FF8}.panel{color:#fff;background-color:#421824}button,input,select,textarea{background-color:#999;color:#333}.jumbotron{background-color:#502020}.carousel-caption-s p{text-shadow:3px 3px 7px rgba(0,0,0,.8);-webkit-text-shadow:inset 0 3px 5px #000;color:#000;background-color:rgba(256,256,256,.4)}.carousel-caption-s{text-shadow:0 4px 8px rgba(0,0,0,.6)}.carousel-inner .item{color:#FF8}@-webkit-keyframes mymove{from,to{text-decoration-color:red}50%{text-decoration-color:#00f}}@keyframes mymove{from,to{text-decoration-color:red}50%{text-decoration-color:#00f}}ul.actiongroup li a:hover{background-color:rgba(128,128,128,.2);color:red}.display-field{color:#FF8;background-color:#502020}.display-label{color:#A0A0A0;background-color:#210912}footer{color:grey}.meta{color:#A0A0A0}
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
.discussion,.notif,.pv{font-family:monospace}.smalltofhol,tr.visiblepost{max-height:3em}.blog a:active,.blog a:hover,a:active,a:hover{outline:0}.smalltofhol{max-width:3em;float:left;margin:.5em}.price,.total{font-weight:700;padding:.2em;margin:.2em}.price{font-size:x-large;border:2px solid #000;border-radius:1em}.total{font-size:xx-large;background-color:#f8f;border:3px solid #000;border-radius:1em}.blog,.panel{padding:1em}.blog a{font-weight:900}.discussion{color:#000}.notif{color:#006}.pv{color:#251;font-style:bold}#targets{display:block}tr.hiddenpost{background-color:#888;font-size:smaller;max-height:2em}a.bloglink{font-weight:700;text-shadow:0 0 8px #000}a{font-weight:900}.panel{float:left;margin:1em;color:#000}button,input,select,textarea{background-color:#bbb;color:#000}.jumbotron{padding:.5em}.carousel-caption-s p{font-family:jubilat;font-weight:600;font-size:large;line-height:1.1;text-decoration:overline;text-decoration-line:overline;text-shadow:3px 3px 7px #000;-webkit-text-shadow:inset 0 3px 5px #000;color:#000;margin:.5em;padding:.5em;animation:mymove 3s infinite;background-color:rgba(256,256,256,.6)}.carousel-caption-s{right:3em;top:1em;left:3em;z-index:10;padding-top:20px;padding-bottom:20px;text-align:center;text-shadow:0 4px 8px rgba(0,0,0,.6);height:16em;overflow:auto}.carousel-inner .item{padding-left:15%;margin-right:15%}.carousel-indicators{position:absolute;z-index:15;padding:0;text-align:center;list-style:none;top:.1em;height:1em}main.container{padding-right:1em;padding-left:1em;margin-left:1em;margin-right:1em}@-webkit-keyframes mymove{from,to{text-decoration-color:red}50%{text-decoration-color:#00f}}@keyframes mymove{from,to{text-decoration-color:red}50%{text-decoration-color:#00f}}ul.actiongroup li{display:inline}ul.actiongroup li a:hover{background-color:rgba(200,200,200,.6);color:#400}.display-field{font-kerning:none;display:inline-flex;color:#008}.display-label{font-family:'Lucida Sans','Lucida Sans Regular','Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,sans-serif;font-stretch:condensed;display:inline-flex;color:#444;background-color:#210912}footer{vertical-align:bottom;padding:1.5em;color:grey;font-weight:bolder;font-size:x-small}.meta{color:#444;font-style:italic;font-size:smaller}.activity{font-family:fantasy}.blogtitle{display:inline-block;font-size:x-large}.blogphoto{float:left;margin:1em}
|
||||||
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
|||||||
.smalltofhol,tr.visiblepost{max-height:3em}body{background-color:#080225;color:#999}h1,h2,h3,h4,h5,h6{color:#fff}.smalltofhol{max-width:3em;float:left;margin:.5em}.price,.total{font-weight:700;color:#fff;padding:.2em;margin:.2em}.price{font-size:x-large;border:1px solid #fff;border-radius:1em}.total{font-size:xx-large;background-color:#1f1c58;border:1px solid #fff;border-radius:1em}.blog,.panel{padding:1em}.blog a{color:#FF8;font-weight:900}.blog a:active,.blog a:hover,a:active,a:hover{outline:0;color:#FAFA09}tr.hiddenpost{background-color:#130414;font-size:smaller;max-height:2em}a.bloglink{font-weight:700;text-shadow:0 0 8px #fff}a{font-weight:900;color:#FF8}.panel{float:left;margin:1em;color:#fff;background-color:#421824}button,input,select,textarea{background-color:#999;color:#333}.jumbotron{background-color:#502020;padding:.5em}.carousel-caption-s p{font-family:jubilat;font-weight:600;font-size:large;line-height:1.1;text-decoration:overline;text-decoration-line:overline;text-shadow:3px 3px 7px rgba(0,0,0,.8);-webkit-text-shadow:inset 0 3px 5px #000;color:#000;margin:.5em;padding:.5em;animation:mymove 3s infinite;background-color:rgba(256,256,256,.4)}.carousel-caption-s{right:3em;top:1em;left:3em;z-index:10;padding-top:20px;padding-bottom:20px;text-align:center;text-shadow:0 4px 8px rgba(0,0,0,.6);height:16em;overflow:auto}.carousel-inner .item{color:#FF8;padding-left:15%;margin-right:15%}.carousel-indicators{position:absolute;z-index:15;padding:0;text-align:center;list-style:none;top:.1em;height:1em}main.container{padding-right:1em;padding-left:1em;margin-left:1em;margin-right:1em}@-webkit-keyframes mymove{from,to{text-decoration-color:red}50%{text-decoration-color:#00f}}@keyframes mymove{from,to{text-decoration-color:red}50%{text-decoration-color:#00f}}ul.actiongroup li{display:inline}ul.actiongroup li a:hover{background-color:rgba(128,128,128,.2);color:red}.display-field{font-kerning:none;display:inline-flex;color:#FF8;background-color:#502020}.display-label{font-family:'Lucida Sans','Lucida Sans Regular','Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,sans-serif;font-stretch:condensed;display:inline-flex;color:#A0A0A0;background-color:#210912}footer{vertical-align:bottom;padding:1.5em;color:grey;font-weight:bolder;font-size:x-small}.meta{color:#A0A0A0;font-style:italic;font-size:smaller}.activity{font-family:fantasy}.blogtitle{display:inline-block;font-size:x-large}.blogphoto{float:left;margin:1em}
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
|||||||
var markdownize=function(r){if(!r)return"";var n=r.split("\n").map($.trim).filter(function(r){return""!=r}).join("\n");return toMarkdown(n)},converter=new showdown.Converter,htmlize=function(r){return converter.makeHtml(r)},updateMD=function(r,n){if(!n)return jQuery("#"+r).val("");var e=markdownize(n);jQuery("#"+r).val()!==e&&jQuery("#"+r).val(e)};
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
|||||||
var allowCircleToBlog=function(o){var c=$(this).prop("checked"),e=$(this).data("circle-id"),n=$(this).data("target-id"),l={CircleId:e,BlogPostId:n},i="/api/blogacl";c||(i+="/"+e),console.log(l),$.ajax({url:i,type:c?"POST":"DELETE",data:JSON.stringify(l),contentType:"application/json;charset=utf-8",success:function(o){console.log("POSTed")},error:function(){console.log("POSTed")}}),o.preventDefault()};$(document).ready(function(){$("input.Blogcirle[type=checkbox]").on("change",allowCircleToBlog)});var notifClick=function(o){$.get("/api/dimiss/click/"+o).done(function(o){console.log("second success"),console.log(o)}).fail(function(){console.log("error")}).always(function(){console.log("finished")})};
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue