* 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
vnext
Paul Schneider 10 years ago
parent e99c03e54a
commit b2fdbc8d2e
16 changed files with 180 additions and 67 deletions

@ -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

@ -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) {

@ -87,7 +87,7 @@ namespace Yavsc.Helpers.Google
/// <param name="mindate">Mindate.</param>
/// <param name="maxdate">Maxdate.</param>
/// <param name="upr">Upr.</param>
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;
}
}
}

@ -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; }
}
}

@ -1,4 +1,4 @@
<%@ Page Title="Comptes utilisateur" Language="C#" Inherits="System.Web.Mvc.ViewPage<DataAccess>" MasterPageFile="~/Models/App.master" %>
<%@ Page Title="Comptes utilisateur" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
Pas de contenu :-(
</asp:Content>

@ -1,10 +1,10 @@
<%@ Page Title="Admin" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
<%@ Page Title="Administration" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<div class="panel">
<ul><li>
<%= Html.ActionLink("Backups","Backups") %>
</li>
<ul>
<li><%= Html.ActionLink("Backups","Backups") %></li>
<li><%= Html.ActionLink("Restaurations", "Restore") %></li>
<li><%= Html.ActionLink("Create backup","CreateBackup") %></li>
<li><%= Html.ActionLink("Remove user", "RemoveUser") %></li>

@ -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" %>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">

@ -28,6 +28,14 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
<section name="workflow" type="Yavsc.Model.WorkFlow.Configuration.WorkflowConfiguration, YavscModel" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
</sectionGroup>
</configSections>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="Index" />
</files>
</defaultDocument>
</system.webServer>
<system.web>
<!--
Set compilation debug="true" to insert debugging

@ -698,6 +698,7 @@
<None Include="packages.config" />
<None Include="Scripts\jquery-2.1.3.min.map" />
<None Include="Scripts\styles.json" />
<None Include="robots.txt" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NpgsqlMRPProviders\NpgsqlMRPProviders.csproj">

@ -0,0 +1,5 @@

User-agent: *
Disallow: /Google/Login
Disallow: /Account/Login
Disallow: /Admin/

@ -81,12 +81,11 @@ namespace Yavsc.Model.FrontOffice
public bool MultiLine { get { return multiline; } set { multiline = value; } }
/// <summary>
/// Tos the html.
/// html representation of this input.
/// </summary>
/// <returns>The html.</returns>
public override string ToHtml ()
{
return MultiLine?
string.Format ("<textarea id=\"{0}\" name=\"{1}\">{2}</textarea>", Id,Name,DefaultValue)
: string.Format ("<input type=\"text\" id=\"{0}\" name=\"{1}\" value=\"{2}\"/>", Id,Name,DefaultValue);

@ -0,0 +1,36 @@
//
// CalendarEventList.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 Paul Schneider
//
// 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 <http://www.gnu.org/licenses/>.
using System;
namespace Yavsc.Model.Google
{
public class CalendarEventList
{
public string nextPageToken;
public string nextSyncToken;
public Resource [] items ;
}
}

@ -101,18 +101,7 @@ namespace Yavsc.Model.Google
/// <summary>
/// Reminder.
/// </summary>
public class Reminder {
/// <summary>
/// Gets or sets the method.
/// </summary>
/// <value>The method.</value>
public string method { get; set; }
/// <summary>
/// Gets or sets the minutes.
/// </summary>
/// <value>The minutes.</value>
public int minutes { get; set; }
}
/// <summary>
/// Gets or sets the default reminders.
/// </summary>
@ -127,4 +116,17 @@ namespace Yavsc.Model.Google
*/
}
public class Reminder {
/// <summary>
/// Gets or sets the method.
/// </summary>
/// <value>The method.</value>
public string method { get; set; }
/// <summary>
/// Gets or sets the minutes.
/// </summary>
/// <value>The minutes.</value>
public int minutes { get; set; }
}
}

@ -1,5 +1,5 @@
//
// CalendarEntry.cs
// GDate.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
@ -18,16 +18,15 @@
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
namespace Yavsc.Model.Google
{
/// <summary>
/// Calendar entry list.
/// </summary>
public class CalendarEntryList
{
public class GDate {
public DateTime date;
public DateTime datetime;
public string timeZone;
}
}

@ -0,0 +1,36 @@
//
// Resource.cs
//
// Author:
// Paul Schneider <paulschneider@free.fr>
//
// Copyright (c) 2015 Paul Schneider
//
// 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 <http://www.gnu.org/licenses/>.
using System;
namespace Yavsc.Model.Google
{
public class Resource {
public string id;
public string location;
public string status;
public GDate start;
public GDate end;
public string recurence;
}
}

@ -132,7 +132,6 @@
<Compile Include="FileSystem\DirNotFoundException.cs" />
<Compile Include="FileSystem\InvalidDirNameException.cs" />
<Compile Include="FileSystem\WebFileInfo.cs" />
<Compile Include="Google\CalendarEntryList.cs" />
<Compile Include="FrontOffice\CommandStatus.cs" />
<Compile Include="FrontOffice\CommandSet.cs" />
<Compile Include="FrontOffice\Catalog\Billing\SetPrice.cs" />
@ -140,6 +139,9 @@
<Compile Include="OtherWebException.cs" />
<Compile Include="WorkFlow\Automate.cs" />
<Compile Include="Google\FreeDate.cs" />
<Compile Include="Google\CalendarEventList.cs" />
<Compile Include="Google\GDate.cs" />
<Compile Include="Google\Resource.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>

Loading…