From 1cb3a692ef7e040d315fac0fbdc24eaaaa550afb Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sat, 19 Dec 2015 15:12:42 +0100 Subject: [PATCH] =?UTF-8?q?message=20de=20retour=20=C3=A0=20l'envoi=20du?= =?UTF-8?q?=20jeton=20Google?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- web/ApiControllers/BackOfficeController.cs | 11 ++++++-- web/App_Code/Global.asax.cs | 1 + web/App_Code/Startup.Auth.cs | 32 ++++++++++++++++++++++ web/App_Themes/clear/style.css | 9 ++++-- web/App_Themes/itclear/style.css | 9 +++++- web/App_Themes/style.css | 1 + web/Web.config | 22 +++++++-------- web/WebApiConfig.cs | 2 ++ web/packages.config | 3 +- 10 files changed, 74 insertions(+), 18 deletions(-) create mode 100644 web/App_Code/Startup.Auth.cs diff --git a/Makefile b/Makefile index 500d7986..11c0bd95 100644 --- a/Makefile +++ b/Makefile @@ -106,7 +106,7 @@ rsync_yavsc: rsync_TotemProd: nuget_restore: - for prj in ITContentProvider NpgsqlBlogProvider NpgsqlContentProvider NpgsqlMRPProviders Presta SalesCatalog TestAPI web WebControls yavscclient yavscModel; do nuget restore "$${prj}/packages.config" -SolutionDirectory . ; done + for prj in ITContentProvider NpgsqlBlogProvider NpgsqlContentProvider NpgsqlMRPProviders Presta SalesCatalog TestAPI web WebControls yavscclient yavscModel; do if [ -f "$${prj}/packages.config" ]; then nuget restore "$${prj}/packages.config" -SolutionDirectory . ; fi; done nuget_update: for prj in ITContentProvider NpgsqlBlogProvider NpgsqlContentProvider NpgsqlMRPProviders Presta SalesCatalog TestAPI web WebControls yavscclient yavscModel; do nuget update "$${prj}/packages.config" ; done diff --git a/web/ApiControllers/BackOfficeController.cs b/web/ApiControllers/BackOfficeController.cs index a535c1b3..f57f60a7 100644 --- a/web/ApiControllers/BackOfficeController.cs +++ b/web/ApiControllers/BackOfficeController.cs @@ -19,6 +19,7 @@ // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see . using System; +using System.Web.Http; using Yavsc.Model.Google; using Yavsc.Model.Calendar; using Yavsc.Helpers; @@ -41,6 +42,7 @@ namespace Yavsc.ApiControllers /// /// Evpub. [Authorize(Roles="BackOffice")] + [AcceptVerbs("POST")] public MessageWithPayloadResponse NotifyEvent(EventPub evpub) { return GoogleHelpers.NotifyEvent(evpub); } @@ -50,10 +52,15 @@ namespace Yavsc.ApiControllers /// /// Registration identifier. [Authorize] - public void SetRegistrationId(string registrationId) + [AcceptVerbs("GET")] + public string SetRegistrationId(string registrationId) { // TODO set registration id - setRegistrationId (User.Identity.Name, registrationId); + if (string.IsNullOrWhiteSpace(registrationId)) + return "Registration id cannot be blank"; + var username = User.Identity.Name; + setRegistrationId (username, registrationId); + return "Saved registration for user:"+username; } private void setRegistrationId(string username, string regid) { diff --git a/web/App_Code/Global.asax.cs b/web/App_Code/Global.asax.cs index 7971d349..6d0d4545 100644 --- a/web/App_Code/Global.asax.cs +++ b/web/App_Code/Global.asax.cs @@ -99,6 +99,7 @@ namespace Yavsc WebApiConfig.Register (GlobalConfiguration.Configuration); RegisterRoutes (RouteTable.Routes); AjaxHelper.GlobalizationScriptPath = "~/Scripts/globalize"; + } /// diff --git a/web/App_Code/Startup.Auth.cs b/web/App_Code/Startup.Auth.cs new file mode 100644 index 00000000..60fab70b --- /dev/null +++ b/web/App_Code/Startup.Auth.cs @@ -0,0 +1,32 @@ +// +// Startup.Auth.cs +// +// Author: +// Paul Schneider +// +// Copyright (c) 2015 GNU GPL +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +using System; + +namespace Yavsc +{ + public class Startup + { + public Startup () + { + } + } +} + diff --git a/web/App_Themes/clear/style.css b/web/App_Themes/clear/style.css index 6ad86a66..708529aa 100644 --- a/web/App_Themes/clear/style.css +++ b/web/App_Themes/clear/style.css @@ -58,12 +58,17 @@ fieldset, .performer { } h1 { - background-color: rgba(256,256,256,.2); + background-color: rgba(0,0,0,.2); padding: 1em; color:white; transition: color 1s; } - + main h1 { + background-color: rgba(256,256,256,.3); + padding: 1em; + color:black; + transition: color 1s; + } .postpreview { background-color: rgba(233,233,233,0.8); animation-name: slideInDown; diff --git a/web/App_Themes/itclear/style.css b/web/App_Themes/itclear/style.css index b7067fbb..77897589 100644 --- a/web/App_Themes/itclear/style.css +++ b/web/App_Themes/itclear/style.css @@ -58,12 +58,19 @@ fieldset, .performer { } h1 { - background-color: rgba(256,256,256,.2); + background-color: rgba(0,0,0,.2); padding: 1em; color:white; transition: color 1s; } + main h1 { + background-color: rgba(256,256,256,.3); + padding: 1em; + color:black; + transition: color 1s; + } + .postpreview { background-color: rgba(233,233,233,0.8); animation-name: slideInDown; diff --git a/web/App_Themes/style.css b/web/App_Themes/style.css index 984ace44..e62055d7 100644 --- a/web/App_Themes/style.css +++ b/web/App_Themes/style.css @@ -45,6 +45,7 @@ main { display: block; text-align: center; } +.post { text-align: left; } main video, main img { max-width:100%; max-height:75%; diff --git a/web/Web.config b/web/Web.config index fa0caf6f..3bf37066 100644 --- a/web/Web.config +++ b/web/Web.config @@ -148,7 +148,7 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx - + @@ -221,7 +221,7 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx - + @@ -246,7 +246,7 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx - + @@ -265,22 +265,22 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx - + - - - + + + - - - + + + - \ No newline at end of file + diff --git a/web/WebApiConfig.cs b/web/WebApiConfig.cs index 1f01b584..e8321f88 100644 --- a/web/WebApiConfig.cs +++ b/web/WebApiConfig.cs @@ -29,6 +29,7 @@ using System.Web.Routing; using Yavsc.Formatters; using Yavsc.Model.FrontOffice; using System.Web.Http; +using System.IdentityModel; namespace Yavsc { @@ -60,6 +61,7 @@ namespace Yavsc routeTemplate: WebApiConfig.UrlPrefix + "/{controller}/{action}/{id}", defaults: new { action="Index", id = RouteParameter.Optional } ); + } } diff --git a/web/packages.config b/web/packages.config index 8ee21bf2..b4381817 100644 --- a/web/packages.config +++ b/web/packages.config @@ -10,6 +10,7 @@ + @@ -22,4 +23,4 @@ - \ No newline at end of file +