* Web.csproj:

* ThanksHelper.cs:
* YavscHelpers.cs:
* Period.cs:
* YaEvent.cs:
* OpenDay.cs:
* WeekDay.cs:
* Schedule.cs:
* Position.cs:
* EventPub.cs:
* Periodicity.cs:
* ProvidedEvent.cs:
* CalendarController.cs:
* FrontOfficeController.cs:
* PositionAndKeyphrase.cs:
* ProviderPublicInfo.cs: refactoring

* PaypalApiController.cs: adds a package reference to payPal buttons

* T.cs: xml doc

* App.master: yet another thanks giving

* style.css: Yet another impact on style sheet

* Web.config: adds a circle provider section

* packages.config: Adds PayPal Button manager package reference
main
Paul Schneider 11 years ago
parent 4ba20187e8
commit ccc3b2ffff
24 changed files with 148 additions and 79 deletions

@ -20,13 +20,13 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
using System; using System;
using System.Web.Http; using System.Web.Http;
using Yavsc.ApiControllers.Calendar.Model;
using Yavsc.Model.RolesAndMembers; using Yavsc.Model.RolesAndMembers;
using System.Web.Security; using System.Web.Security;
using Yavsc.Model.Google; using Yavsc.Model.Google;
using Yavsc.Helpers; using Yavsc.Helpers;
using System.Web.Profile; using System.Web.Profile;
using Yavsc.Model.Circles; using Yavsc.Model.Circles;
using Yavsc.Model.Calendar;
namespace Yavsc.ApiControllers namespace Yavsc.ApiControllers

@ -21,28 +21,54 @@
using System; using System;
using System.Web.Http; using System.Web.Http;
#if USEPAYPALAPI
using PayPal.Api; using PayPal;
using System.Collections.Generic;
using PayPal.OpenIdConnect;
using PayPal.Manager;
using PayPal.PayPalAPIInterfaceService;
using PayPal.PayPalAPIInterfaceService.Model;
namespace Yavsc.ApiControllers namespace Yavsc.ApiControllers
{ {
/// <summary>
/// Paypal API controller.
/// </summary>
public class PaypalApiController: ApiController public class PaypalApiController: ApiController
{ {
public void GetPayments() PayPalAPIInterfaceServiceService service = null;
/// <summary>
/// Initialize the specified controllerContext.
/// </summary>
/// <param name="controllerContext">Controller context.</param>
protected override void Initialize (System.Web.Http.Controllers.HttpControllerContext controllerContext)
{ {
OAuthTokenCredential tokenCredential = base.Initialize (controllerContext);
new OAuthTokenCredential("<CLIENT_ID>", "<CLIENT_SECRET>"); // Get the config properties from PayPal.Api.ConfigManager
// Create the Classic SDK service instance to use.
string accessToken = tokenCredential.GetAccessToken(); service = new PayPalAPIInterfaceServiceService(ConfigManager.Instance.GetProperties());
var parameters = new PayPal.Util.QueryParameters(); }
parameters.Add ("Count", "10"); /// <summary>
/// Search the specified str.
PaymentHistory paymentHistory = Payment.Get(apiContext, accessToken, parameters); /// </summary>
/// <param name="str">str.</param>
public BMCreateButtonResponseType Create(string str)
{
BMCreateButtonRequestType btcrerqu = new BMCreateButtonRequestType ();
BMCreateButtonReq btcrerq = new BMCreateButtonReq ();
btcrerq.BMCreateButtonRequest = btcrerqu;
BMCreateButtonResponseType btcrere = service.BMCreateButton (btcrerq);
return btcrere;
}
public BMButtonSearchResponseType Search(string str)
{
BMButtonSearchReq req = new BMButtonSearchReq ();
req.BMButtonSearchRequest = new BMButtonSearchRequestType ();
return service.BMButtonSearch (req);
} }
} }
} }
#endif

@ -1,3 +1,25 @@
2015-06-26 Paul Schneider <paul@pschneider.fr>
* Web.csproj:
* ThanksHelper.cs:
* YavscHelpers.cs:
* CalendarController.cs:
* FrontOfficeController.cs: refactoring
* PaypalApiController.cs: adds a package reference to payPal
buttons
* T.cs: xml doc
* App.master: yet another thanks giving
* style.css: Yet another impact on style sheet
* Web.config: adds a circle provider section
* packages.config: Adds PayPal Button manager package
reference
2015-06-18 Paul Schneider <paul@pschneider.fr> 2015-06-18 Paul Schneider <paul@pschneider.fr>
* instdbws.sql: Creates a new table to store one time usage * instdbws.sql: Creates a new table to store one time usage

@ -12,7 +12,7 @@ using System.Web.Security;
using System.Threading; using System.Threading;
using Yavsc.Model.FrontOffice; using Yavsc.Model.FrontOffice;
using Yavsc.Model.FileSystem; using Yavsc.Model.FileSystem;
using Yavsc.ApiControllers.Calendar.Model; using Yavsc.Model.Calendar;
namespace Yavsc.Controllers namespace Yavsc.Controllers
{ {

@ -28,7 +28,11 @@ namespace Yavsc.Helpers
string tr = LocalizedText.ResourceManager.GetString (msg.Replace (" ", "_")); string tr = LocalizedText.ResourceManager.GetString (msg.Replace (" ", "_"));
return tr==null?msg:tr; return tr==null?msg:tr;
} }
/// <summary>
/// Translate the specified helper and text.
/// </summary>
/// <param name="helper">Helper.</param>
/// <param name="text">Text.</param>
public static string Translate(this HtmlHelper helper, string text) public static string Translate(this HtmlHelper helper, string text)
{ {
// Just call the other one, to avoid having two copies (we don't use the HtmlHelper). // Just call the other one, to avoid having two copies (we don't use the HtmlHelper).

@ -1,9 +1,31 @@
using System; using System;
using System.Configuration; using System.Configuration;
using System.Collections.Generic; using System.Collections.Generic;
using System.Web.Mvc;
namespace Yavsc namespace Yavsc.Helpers
{ {
/// <summary>
/// Link.
/// </summary>
public class Link {
/// <summary>
/// Gets or sets the text.
/// </summary>
/// <value>The text.</value>
public string Text { get; set; }
/// <summary>
/// Gets or sets the URL.
/// </summary>
/// <value>The URL.</value>
public string Url { get; set; }
/// <summary>
/// Gets or sets the image.
/// </summary>
/// <value>The image.</value>
public string Image { get; set; }
}
/// <summary> /// <summary>
/// Thanks helper. /// Thanks helper.
/// </summary> /// </summary>
@ -24,28 +46,13 @@ namespace Yavsc
/// <summary> /// <summary>
/// Html code for each entry /// Html code for each entry
/// </summary> /// </summary>
public static string[] Links () public static Link[] Thanks (this HtmlHelper helper)
{ {
List<string> result = new List<string>() ; List<Link> result = new List<Link>() ;
if (ConfigurationSection == null) return result.ToArray(); if (ConfigurationSection == null) return result.ToArray();
if (ConfigurationSection.To == null) return result.ToArray(); if (ConfigurationSection.To == null) return result.ToArray();
foreach (ThanksConfigurationElement e in ConfigurationSection.To) { foreach (ThanksConfigurationElement e in ConfigurationSection.To)
string link = ""; result.Add( new Link { Url = e.Url, Image=e.Image, Text = e.Name });
if (!string.IsNullOrEmpty(e.Url))
link = string.Format("<a href=\"{0}\">",e.Url);
string dsp = (string.IsNullOrEmpty(e.Display))?e.Name:e.Display;
if (!string.IsNullOrEmpty(e.Image)) {
string ttl = (string.IsNullOrEmpty(ConfigurationSection.TitleFormat))?"Go and see the website ({0})":ConfigurationSection.TitleFormat;
ttl = string.Format(ttl,dsp);
link += string.Format(
"<img src=\"{1}\" alt=\"{0}\" title=\"{2}\"/>",
dsp,e.Image,ttl);
}
else link += dsp;
if (e.Url!=null)
link += "</a> ";
result.Add (link);
}
return result.ToArray(); return result.ToArray();
} }
} }

@ -96,8 +96,8 @@ namespace Yavsc.Helpers
/// <summary> /// <summary>
/// Resets the password. /// Resets the password.
/// </summary> /// </summary>
/// <param name="modelState">Model state.</param>
/// <param name="model">Model.</param> /// <param name="model">Model.</param>
/// <param name="errors">Errors.</param>
public static void ResetPassword(LostPasswordModel model, out StringDictionary errors) public static void ResetPassword(LostPasswordModel model, out StringDictionary errors)
{ {
MembershipUserCollection users = null; MembershipUserCollection users = null;

@ -62,10 +62,11 @@ ViewState["orgtitle"] = T.GetString(Page.Title);
<script src="https://apis.google.com/js/platform.js" async defer> <script src="https://apis.google.com/js/platform.js" async defer>
{lang: 'fr'} {lang: 'fr'}
</script> </script>
<%= Html.ActionLink("Contact","Contact","Home",null, new { @class="footerlink" }) %> <br/> <%= Html.ActionLink("Contact","Contact","Home",null, new { @class="thanks" }) %>
<% foreach ( string link in Yavsc.ThanksHelper.Links()) { %> <% foreach ( Link link in Html.Thanks()) { %>
<%= link %> <a class="thanks" href="<%=link.Url%>"><% if (link.Image !=null) {
<% } %> %><img src="<%= link.Image %>" alt="<%= link.Text %>"/></a><%
} else { %><a class="thanks" href="<%=link.Url%>"><%= link.Text %></a><% }} %>
<div class="g-plusone" data-annotation="inline" data-width="230"></div> <div class="g-plusone" data-annotation="inline" data-width="230"></div>
</footer> </footer>
<script type="text/javascript"> <script type="text/javascript">

@ -44,18 +44,16 @@ footer {
background-color:rgba(16,0,0,0.8); background-color:rgba(16,0,0,0.8);
display: flex; display: flex;
z-index:-1; z-index:-1;
font-size: small; font-size: smaller;
} }
footer a { .thanks {
max-height: 2em; max-width: 12%;
padding:.1em; width: 100%;
text-align: center;
font-size:smaller;
} }
footer img {
max-height: 2em;
padding:.1em;
}
#logo { #logo {
float: left; float: left;
@ -241,10 +239,6 @@ a.actionlink:hover + .hidcom {
.bshd:hover > .bsh { .bshd:hover > .bsh {
display: none; display: none;
} }
footer img {
max-height: 0.8em;
max-width: 2.0em;
}
footer { footer {
font-size: x-small; font-size: x-small;
} }
@ -253,9 +247,6 @@ a.actionlink:hover + .hidcom {
} }
@media all and (max-width: 350px) { @media all and (max-width: 350px) {
footer img {
max-height: 0.6em;
max-width: 1.4em; }
footer { font-size: xx-small; } footer { font-size: xx-small; }
} }

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

@ -93,6 +93,12 @@
<Reference Include="xunit.assert"> <Reference Include="xunit.assert">
<HintPath>..\packages\xunit.assert.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll</HintPath> <HintPath>..\packages\xunit.assert.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll</HintPath>
</Reference> </Reference>
<Reference Include="PayPalCoreSDK">
<HintPath>..\packages\PayPalCoreSDK.1.6.2\lib\net451\PayPalCoreSDK.dll</HintPath>
</Reference>
<Reference Include="PayPalButtonManagerSDK">
<HintPath>..\packages\PayPalButtonManagerSDK.2.9.109\lib\net20\PayPalButtonManagerSDK.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Models\" /> <Folder Include="Models\" />
@ -159,7 +165,6 @@
<Compile Include="Settings\ThanksConfigurationSection.cs" /> <Compile Include="Settings\ThanksConfigurationSection.cs" />
<Compile Include="Settings\ThanksConfigurationCollection.cs" /> <Compile Include="Settings\ThanksConfigurationCollection.cs" />
<Compile Include="Settings\ThanksConfigurationElement.cs" /> <Compile Include="Settings\ThanksConfigurationElement.cs" />
<Compile Include="Settings\ThanksHelper.cs" />
<Compile Include="Settings\ModulesConfigurationSection.cs" /> <Compile Include="Settings\ModulesConfigurationSection.cs" />
<Compile Include="Settings\ModuleConfigurationElementCollection.cs" /> <Compile Include="Settings\ModuleConfigurationElementCollection.cs" />
<Compile Include="Settings\ModuleConfigurationElement.cs" /> <Compile Include="Settings\ModuleConfigurationElement.cs" />
@ -190,6 +195,7 @@
<Compile Include="ApiControllers\FrontOfficeController.cs" /> <Compile Include="ApiControllers\FrontOfficeController.cs" />
<Compile Include="ApiControllers\GCMController.cs" /> <Compile Include="ApiControllers\GCMController.cs" />
<Compile Include="ApiControllers\AccountController.cs" /> <Compile Include="ApiControllers\AccountController.cs" />
<Compile Include="Helpers\ThanksHelper.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Views\Web.config" /> <Content Include="Views\Web.config" />

@ -10,6 +10,7 @@
<package id="MarkdownHelper" version="1.3" targetFramework="net451" /> <package id="MarkdownHelper" version="1.3" targetFramework="net451" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net451" /> <package id="Newtonsoft.Json" version="6.0.8" targetFramework="net451" />
<package id="Npgsql" version="2.2.5" targetFramework="net451" /> <package id="Npgsql" version="2.2.5" targetFramework="net451" />
<package id="PayPalButtonManagerSDK" version="2.9.109" targetFramework="net451" />
<package id="PayPalCoreSDK" version="1.6.2" targetFramework="net451" /> <package id="PayPalCoreSDK" version="1.6.2" targetFramework="net451" />
<package id="xunit" version="2.0.0" targetFramework="net451" /> <package id="xunit" version="2.0.0" targetFramework="net451" />
<package id="xunit.abstractions" version="2.0.0" targetFramework="net451" /> <package id="xunit.abstractions" version="2.0.0" targetFramework="net451" />

@ -21,12 +21,11 @@
using System; using System;
using System.Web.Http; using System.Web.Http;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Yavsc.ApiControllers.Calendar.Model;
using Yavsc.Model; using Yavsc.Model;
using Yavsc.Model.RolesAndMembers; using Yavsc.Model.RolesAndMembers;
using Yavsc.Model.Circles; using Yavsc.Model.Circles;
namespace Yavsc.ApiControllers.Calendar.Model namespace Yavsc.Model.Calendar
{ {
/// <summary> /// <summary>
/// Event pub. /// Event pub.

@ -23,7 +23,7 @@ using System;
using System.Web.Http; using System.Web.Http;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model namespace Yavsc.Model.Calendar
{ {
/// <summary> /// <summary>

@ -23,7 +23,7 @@ using System;
using System.Web.Http; using System.Web.Http;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model namespace Yavsc.Model.Calendar
{ {
/// <summary> /// <summary>
/// Hollydays. /// Hollydays.

@ -23,7 +23,7 @@ using System;
using System.Web.Http; using System.Web.Http;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model namespace Yavsc.Model.Calendar
{ {
/// <summary> /// <summary>
/// Periodicity. /// Periodicity.

@ -23,7 +23,7 @@ using System;
using System.Web.Http; using System.Web.Http;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model namespace Yavsc.Model.Calendar
{ {
/// <summary> /// <summary>
/// Position. /// Position.

@ -23,7 +23,7 @@ using System;
using System.Web.Http; using System.Web.Http;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model namespace Yavsc.Model.Calendar
{ {
/// <summary> /// <summary>
/// Position and keyphrase. /// Position and keyphrase.

@ -24,7 +24,7 @@ using System.Web.Http;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Yavsc.Model.RolesAndMembers; using Yavsc.Model.RolesAndMembers;
namespace Yavsc.ApiControllers.Calendar.Model namespace Yavsc.Model.Calendar
{ {
/// <summary> /// <summary>

@ -23,7 +23,7 @@ using System;
using System.Web.Http; using System.Web.Http;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model namespace Yavsc.Model.Calendar
{ {
/// <summary> /// <summary>
/// Schedule. /// Schedule.

@ -23,7 +23,7 @@ using System;
using System.Web.Http; using System.Web.Http;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace Yavsc.ApiControllers.Calendar.Model namespace Yavsc.Model.Calendar
{ {
/// <summary> /// <summary>
/// Week day. /// Week day.

@ -24,7 +24,7 @@ using System.Web.Http;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Yavsc.Model; using Yavsc.Model;
namespace Yavsc.ApiControllers.Calendar.Model namespace Yavsc.Model.Calendar
{ {
/// <summary> /// <summary>

@ -1,3 +1,17 @@
2015-06-26 Paul Schneider <paul@pschneider.fr>
* Period.cs:
* WeekDay.cs:
* OpenDay.cs:
* YaEvent.cs:
* Schedule.cs:
* EventPub.cs:
* Position.cs:
* Periodicity.cs:
* ProvidedEvent.cs:
* PositionAndKeyphrase.cs:
* ProviderPublicInfo.cs: refactoring
2015-06-18 Paul Schneider <paul@pschneider.fr> 2015-06-18 Paul Schneider <paul@pschneider.fr>
* RegisterClientModel.cs: Implements the Question and answer * RegisterClientModel.cs: Implements the Question and answer

@ -22,7 +22,7 @@
using System; using System;
using System.Web.Http; using System.Web.Http;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Yavsc.ApiControllers.Calendar.Model; using Yavsc.Model.Calendar;
namespace Yavsc.Model.RolesAndMembers namespace Yavsc.Model.RolesAndMembers
{ {

Loading…