From b2fdbc8d2e1da1f5cbd8b4c18dd50349ec379b6c Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 12 Mar 2015 13:56:59 +0100 Subject: [PATCH] * robots.txt: Web robots should not index /Account/Login nor /Google/Login * Makefile: * GDate.cs: * YavscModel.csproj: * Resource.cs: * CalendarApi.cs: * GoogleController.cs: * CalendarListEntry.cs: * CalendarEventList.cs: * CalendarEntryList.cs: refactoring * style.css: another style * Index.aspx: cleanning * Index.aspx: code formatting * Login.aspx: Fixes the Page title * Web.config: Trying to fix the default directory index * Web.csproj: robots.txt creation * TextInput.cs: xml doc --- Makefile | 48 +++++++++++-------- web/Controllers/GoogleController.cs | 2 +- web/Helpers/Google/CalendarApi.cs | 12 ++--- web/Theme/style.css | 37 +++++++++----- web/Views/Account/Index.aspx | 2 +- web/Views/Admin/Index.aspx | 10 ++-- web/Views/Google/Login.aspx | 2 +- web/Web.config | 8 ++++ web/Web.csproj | 1 + web/robots.txt | 5 ++ yavscModel/FrontOffice/Catalog/TextInput.cs | 3 +- yavscModel/Google/CalendarEventList.cs | 36 ++++++++++++++ yavscModel/Google/CalendarListEntry.cs | 26 +++++----- .../Google/{CalendarEntryList.cs => GDate.cs} | 15 +++--- yavscModel/Google/Resource.cs | 36 ++++++++++++++ yavscModel/YavscModel.csproj | 4 +- 16 files changed, 180 insertions(+), 67 deletions(-) create mode 100644 web/robots.txt create mode 100644 yavscModel/Google/CalendarEventList.cs rename yavscModel/Google/{CalendarEntryList.cs => GDate.cs} (87%) create mode 100644 yavscModel/Google/Resource.cs diff --git a/Makefile b/Makefile index 0208ed39..e1ca0257 100644 --- a/Makefile +++ b/Makefile @@ -3,14 +3,25 @@ VERSION=1.1 CONFIG=Debug DESTDIR=build/web/$(CONFIG) COPYUNCHANGED="false" -LOCALHOSTDIR=localhost:/srv/www/lua -TESTHOSTDIR=localhost:/srv/www/yavsc -PREPRODHOSTDIR=lua.localdomain:/srv/www/yavsc -PRODHOSTDIR=lua.localdomain:/srv/www/lua + +HOST_rsync_local=localhost +DESTDIR_rsync_local=/srv/www/yavsc + +HOST_rsync_test=localhost +DESTDIR_rsync_test=/srv/www/lua + +HOST_rsync_preprod=lua.localdomain +DESTDIR_rsync_preprod=/srv/www/yavsc + +HOST_rsync_prod=lua.localdomain +DESTDIR_rsync_prod=/srv/www/lua + DOCASSBS=NpgsqlBlogProvider.dll WorkFlowProvider.dll Yavsc.WebControls.dll ITContentProvider.dll NpgsqlMRPProviders.dll Yavsc.dll SalesCatalog.dll YavscModel.dll +RSYNCCMD=rsync -ravu --chown=www-data:www-data + all: deploy - + ddir: mkdir -p $(DESTDIR) @@ -18,9 +29,18 @@ deploy: ddir build rm -rf $(DESTDIR) xbuild /p:Configuration=$(CONFIG) /p:SkipCopyUnchangedFiles=$(COPYUNCHANGED) /p:DeployDir=../$(DESTDIR) /t:Deploy web/Web.csproj mv $(DESTDIR)/Web.config $(DESTDIR)/Web.config.new - -rsync: rsync-preprod + +rsync_% : HOST = $(HOST_$@) + +rsync_% : DESTDIR = $(DESTDIR_$@) + +rsync_% : + echo "!Deploying to $(HOST)!" + $(RSYNCCMD) build/web/$(CONFIG)/ root@$(HOST):$(DESTDIR) + ssh root@$(HOST) apachectl restart + +rsync: rsync_test build: xbuild /p:Configuration=$(CONFIG) /t:Build Yavsc.sln @@ -29,19 +49,8 @@ clean: xbuild /t:Clean rm -rf $(DESTDIR) -rsync-local: deploy - rsync -ravu build/web/$(CONFIG)/ root@$(LOCALHOSTDIR) - -rsync-test: deploy - rsync -ravu build/web/$(CONFIG)/ root@$(TESTHOSTDIR) - -rsync-preprod: deploy - rsync -ravu build/web/$(CONFIG)/ root@$(PREPRODHOSTDIR) - -rsync-prod: deploy - rsync -ravu build/web/$(CONFIG)/ root@$(PRODHOSTDIR) -rsync-all: rsync-local rsync-test rsync-preprod rsync-prod +rsync-all: rsync_local rsync_test rsync_preprod rsync_prod sourcepkg: git archive --format=tar --prefix=yavsc-$(CONFIG)/ $(CONFIG) | bzip2 > yavsc-$(CONFIG).tar.bz2 @@ -58,4 +67,5 @@ htmldoc: xmldoc docdeploy-prod: htmldoc rsync -ravu web/htmldoc root@$(PRODHOSTDIR) +.PHONY: rsync-local diff --git a/web/Controllers/GoogleController.cs b/web/Controllers/GoogleController.cs index 80870b93..15b6dc1a 100644 --- a/web/Controllers/GoogleController.cs +++ b/web/Controllers/GoogleController.cs @@ -325,7 +325,7 @@ namespace Yavsc.Controllers DateTime maxdate = model.MaxDate; CalendarApi c = new CalendarApi (); - CalendarEntryList res; + CalendarEventList res; try { res = c.GetCalendar (calid, mindate, maxdate, upr); } catch (OtherWebException ex) { diff --git a/web/Helpers/Google/CalendarApi.cs b/web/Helpers/Google/CalendarApi.cs index 7566ae99..a947d68f 100644 --- a/web/Helpers/Google/CalendarApi.cs +++ b/web/Helpers/Google/CalendarApi.cs @@ -87,7 +87,7 @@ namespace Yavsc.Helpers.Google /// Mindate. /// Maxdate. /// Upr. - public CalendarEntryList GetCalendar (string calid, DateTime mindate, DateTime maxdate, ProfileBase upr) + public CalendarEventList GetCalendar (string calid, DateTime mindate, DateTime maxdate, ProfileBase upr) { string uri = string.Format ( getCalEntriesUri, HttpUtility.UrlEncode (calid)) + @@ -100,16 +100,16 @@ namespace Yavsc.Helpers.Google webreq.Headers.Add (HttpRequestHeader.Authorization, cred); webreq.Method = "GET"; webreq.ContentType = "application/http"; - CalendarEntryList res = null; + CalendarEventList res = null; try { using (WebResponse resp = webreq.GetResponse ()) { using (Stream respstream = resp.GetResponseStream ()) { try { - res = (CalendarEntryList) new DataContractJsonSerializer(typeof(CalendarEntryList)).ReadObject (respstream); + res = (CalendarEventList) new DataContractJsonSerializer(typeof(CalendarEventList)).ReadObject (respstream); } catch (Exception ex) { respstream.Close (); resp.Close (); - webreq.Abort (); + webreq.Abort (); throw ex; } } @@ -120,8 +120,8 @@ namespace Yavsc.Helpers.Google throw new OtherWebException (ex); } webreq.Abort (); - return res; + return res; } + } - } diff --git a/web/Theme/style.css b/web/Theme/style.css index 6a1d0a63..abf52041 100644 --- a/web/Theme/style.css +++ b/web/Theme/style.css @@ -5,7 +5,7 @@ body { background-repeat: no-repeat; color: #D0FFD0; font-family: 'Arial', cursive; - margin-bottom:3em; + padding-bottom:2.5em; } textarea { @@ -16,20 +16,20 @@ input, textarea, checkbox { color: #FFFFA0; background: black; } + main { background-color: rgba(17,0,23,0.65); float:left; - margin:.5em; + margin-bottom:3em; } .panel,.bshpanel,aside { background-color: rgba(32,16,16,0.8); - padding: 0.5em; margin: 0.5em; border-radius:5px; border: solid 1px #000060; float: right; } - .bsh { float: right; } +.bsh { float: right; } video,img { @@ -45,12 +45,22 @@ footer { bottom:0; left:0; right:0; - background-color:rgba(0,16,0,0.6); + background-color:rgba(0,16,0,0.8); display: flex; - justify-content: space-around; + justify-content: space-around; z-index:-1; } +#login { + position:fixed; + width:7em; + top:0; + right:0; + background-color:rgba(0,16,0,0.8); + justify-content: space-around; + padding:1em; + } + footer img { max-height: 2em; } a { @@ -195,18 +205,23 @@ padding-left: 20px; .bshd:hover > .bsh { display: none; } - footer { + footer img { max-height: 1em; } - footer a { - font-size: xx-small; + footer { + font-size: small; } + body { margin-bottom:1em; font-size: smaller; } + } @media all and (max-width: 350px) { - footer img { max-height: 0.7em; } - footer { font-size: xx-small; } + footer img { max-height: 0.8em; } + footer { font-size: x-small; } } } + + + diff --git a/web/Views/Account/Index.aspx b/web/Views/Account/Index.aspx index f98c515f..1d76ed12 100644 --- a/web/Views/Account/Index.aspx +++ b/web/Views/Account/Index.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="Comptes utilisateur" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %> +<%@ Page Title="Comptes utilisateur" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %> Pas de contenu :-( diff --git a/web/Views/Admin/Index.aspx b/web/Views/Admin/Index.aspx index 43a7cf40..5a815a2d 100644 --- a/web/Views/Admin/Index.aspx +++ b/web/Views/Admin/Index.aspx @@ -1,10 +1,10 @@ -<%@ Page Title="Admin" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage" %> - +<%@ Page Title="Administration" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %> + +
-
  • -<%= Html.ActionLink("Backups","Backups") %> -
  • +
      +
    • <%= Html.ActionLink("Backups","Backups") %>
    • <%= Html.ActionLink("Restaurations", "Restore") %>
    • <%= Html.ActionLink("Create backup","CreateBackup") %>
    • <%= Html.ActionLink("Remove user", "RemoveUser") %>
    • diff --git a/web/Views/Google/Login.aspx b/web/Views/Google/Login.aspx index 7825a886..107fdfe9 100644 --- a/web/Views/Google/Login.aspx +++ b/web/Views/Google/Login.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="Catalog" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %> +<%@ Page Title="Google Login" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %> diff --git a/web/Web.config b/web/Web.config index 104ebd03..d8adc0d9 100644 --- a/web/Web.config +++ b/web/Web.config @@ -28,6 +28,14 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
      + + + + + + + +