refactoring

This commit is contained in:
Paul Schneider 2015-06-12 00:52:58 +02:00
commit 7fc21f1056
25 changed files with 179 additions and 335 deletions

View file

@ -17,7 +17,7 @@ namespace Yavsc.ApiControllers
/// <summary>
/// Work flow controller.
/// </summary>
public class WorkFlowApiController : ApiController
public class WorkFlowController : ApiController
{
string adminRoleName="Admin";
/// <summary>

View file

@ -1,3 +1,16 @@
2015-06-12 Paul Schneider <paul@pschneider.fr>
* Web.csproj:
* Web.config:
* instdbws.sql:
* style.css:
* App.master:
* NoLogin.master:
* Login.aspx:
* Circles.aspx:
* AccountController.cs:
* WorkFlowController.cs:
2015-06-11 Paul Schneider <paul@pschneider.fr>
* App.master: g+1 feels better at right ...

View file

@ -11,6 +11,7 @@ using Yavsc;
using Yavsc.Model.RolesAndMembers;
using Yavsc.Helpers;
using System.Web.Mvc;
using Yavsc.Model.Circles;
namespace Yavsc.Controllers
{
@ -290,7 +291,14 @@ namespace Yavsc.Controllers
}
return View (model);
}
/// <summary>
/// Circles this instance.
/// </summary>
[Authorize]
public ActionResult Circles ()
{
return View (CircleManager.DefaultProvider.List (Membership.GetUser().UserName));
}
/// <summary>
/// Logout the specified returnUrl.
/// </summary>

View file

@ -59,7 +59,6 @@ ViewState["orgtitle"] = T.GetString(Page.Title);
</aside>
<div style="float:right; height:5em; z-index:-1;"></div>
<footer>
<!-- Placez cette balise dans l'en-tête ou juste avant la balise de fermeture du corps de texte. -->
<script src="https://apis.google.com/js/platform.js" async defer>
{lang: 'fr'}
</script>

View file

@ -37,12 +37,15 @@ ViewState["orgtitle"] = T.GetString(Page.Title);
<asp:ContentPlaceHolder ID="MASContent" runat="server">
</asp:ContentPlaceHolder>
<div style="float:right; height:5em; z-index:-1;"></div>
<footer>
<footer>
<script src="https://apis.google.com/js/platform.js" async defer>
{lang: 'fr'}
</script>
<%= Html.ActionLink("Contact","Contact","Home",null, new { @class="footerlink" }) %> <br/>
<% foreach ( string link in Yavsc.ThanksHelper.Links()) { %>
<%= link %>
<% } %>
<div class="g-plusone" data-annotation="inline" data-width="230"></div>
</footer>
<script type="text/javascript">
var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>';

View file

@ -41,24 +41,24 @@ footer {
bottom:0;
left:0;
right:0;
height:2.5em;
background-color:rgba(16,0,0,0.8);
display: flex;
justify-content: space-around;
z-index:-1;
font-size: small;
}
footer a {
border: dashed #888 3px;
max-height: 2em;
padding:.1em;
}
footer img {
max-height: 1em;
max-width: 2.5em;
max-height: 2em;
padding:.1em;
}
#logo {
float: left;
}
.panel,.bshpanel,aside {
@ -217,7 +217,7 @@ a.actionlink:hover + .hidcom {
@media print {
body {background-color:white;color:black;}
header,footer,.postcomment,.actionlink,.metablog{ display:none;}
header,footer,.postcomment,.actionlink,.metablog,#login{ display:none;}
}
@media all and (min-width: 641px) {
.bshpanel { display:block; }
@ -238,7 +238,7 @@ a.actionlink:hover + .hidcom {
max-width: 2.0em;
}
footer {
font-size: small;
font-size: x-small;
}
body { font-size: smaller; }
@ -248,7 +248,7 @@ a.actionlink:hover + .hidcom {
footer img {
max-height: 0.6em;
max-width: 1.4em; }
footer { font-size: x-small; }
footer { font-size: xx-small; }
}
}

View file

@ -0,0 +1,14 @@
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<Yavsc.Model.Circles.CircleInfoCollection>" %>
<asp:Content ID="initContent" ContentPlaceHolderID="init" runat="server">
</asp:Content>
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
<% foreach (CircleInfo ci in model) { %>
<%= ci.Title %>
<%= ci.Id %>
<br/>
<% } %>
</asp:Content>
<asp:Content ID="MASContentContent" ContentPlaceHolderID="MASContent" runat="server">
</asp:Content>

View file

@ -1,4 +1,4 @@
<%@ Page Title="Login" Language="C#" Inherits="System.Web.Mvc.ViewPage<LoginModel>" MasterPageFile="~/Models/App.master" %>
<%@ Page Title="Login" Language="C#" Inherits="System.Web.Mvc.ViewPage<LoginModel>" MasterPageFile="~/Models/NoLogin.master" %>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<%= Html.ValidationSummary("Ouverture de session") %>
<% using(Html.BeginForm("Login", "Account")) %>
@ -20,4 +20,10 @@
<% } %>
<%= Html.ActionLink("S'enregistrer","Register",new {returnUrl=ViewData["returnUrl"]}, new { @class="actionlink" }) %>
</asp:Content>
<a href="<%=Request.Url.Scheme + "://" + Request.Url.Authority + "/Google/Login"%>?returnUrl=<%=ViewData["returnUrl"]==null?Request.Url.PathAndQuery:(string)ViewData["returnUrl"]%>" class="actionlink">
Identification avec un compte Google
<img src="/images/sign-in-with-google.png" style="max-height:1.5em; max-width:6em;" alt="Google sign in">
</a>
</asp:Content>

View file

@ -22,11 +22,12 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
<section name="paypal" type="PayPal.SDKConfigHandler, PayPal" />
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
<sectionGroup name="system.web">
<section name="blog" type="Yavsc.Model.Blogs.Configuration.BlogProvidersConfigurationSection, YavscModel" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="blog" type="Yavsc.Model.DataProviderConfigurationSection, YavscModel" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="thanks" type="Yavsc.ThanksConfigurationSection, Yavsc" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="catalog" type="Yavsc.Model.FrontOffice.Configuration.CatalogProvidersConfigurationSection, YavscModel" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="workflow" type="Yavsc.Model.WorkFlow.Configuration.WorkflowConfiguration, YavscModel" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
</sectionGroup>
<section name="workflow" type="Yavsc.Model.DataProviderConfigurationSection, YavscModel" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="circleProviders" type="Yavsc.Model.DataProviderConfigurationSection, YavscModel" />
</sectionGroup>
</configSections>
<system.web>
<!--
@ -150,6 +151,13 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
<add name="Postgresql" url="http://www.postgresql.org" image="/images/pgsql.png" />
</to>
</thanks>
<circleProviders defaultProvider="NpgsqlCircleProvider">
<providers>
<add name="NpgsqlCircleProvider" applicationName="/" type="WorkFlowProvider.NpgsqlCircleProvider, NpgsqlContentProvider" connectionStringName="yavsc" />
</providers>
</circleProviders>
<!-- <machineKey validationKey="13CA2E37A5A99AD8CE4A6B895BAF0ED3A022AA584B8D922256BA072189CEB085EEB4E573CA833D9B34FBF68687F6A6B3E008FB4EB67585A4D90551B9D36D42A1" decryptionKey="DA89CC83F6FB2EB12D5929DABC89299AC3928E0751705D33D02DB4162ED56536" validation="SHA1" decryption="AES" /> -->
<!--- <sessionState cookieless="true" regenerateExpiredSessionId="true" timeout="120"/> -->
<trust level="High" />

View file

@ -188,7 +188,7 @@
<Compile Include="ApiControllers\CircleApiController.cs" />
<Compile Include="ApiControllers\BasketApiController.cs" />
<Compile Include="ApiControllers\CalendarApiController.cs" />
<Compile Include="ApiControllers\WorkFlowApiController.cs" />
<Compile Include="ApiControllers\WorkFlowController.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Web.config" />
@ -340,6 +340,7 @@
<Content Include="Theme\md\mdd_gripper.png" />
<Content Include="Theme\md\mdd_modal_background.png" />
<Content Include="Theme\mdd_styles.css" />
<Content Include="Views\Account\Circles.aspx" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

View file

@ -658,6 +658,7 @@ CREATE TABLE circle
_id serial NOT NULL, -- Circle identifier
owner character varying(255), -- creator of this circle
applicationname character varying(255), -- Application name
title character varying(512),
CONSTRAINT circle_pkey PRIMARY KEY (_id),
CONSTRAINT circle_owner_fkey FOREIGN KEY (owner, applicationname)
REFERENCES users (username, applicationname) MATCH SIMPLE
@ -666,11 +667,11 @@ CREATE TABLE circle
WITH (
OIDS=FALSE
);
ALTER TABLE circle
OWNER TO yavscdev;
COMMENT ON COLUMN circle._id IS 'Circle identifier';
COMMENT ON COLUMN circle.owner IS 'creator of this circle';
COMMENT ON COLUMN circle.applicationname IS 'Application name';
-- Table: circle_members
-- DROP TABLE circle_members;
@ -688,4 +689,4 @@ WITH (
OIDS=FALSE
);