* 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
This commit is contained in:
Paul Schneider
2015-06-26 13:56:39 +02:00
parent 4ba20187e8
commit ccc3b2ffff
24 changed files with 148 additions and 79 deletions

View File

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

View File

@ -21,28 +21,54 @@
using System;
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
{
/// <summary>
/// Paypal API controller.
/// </summary>
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 =
new OAuthTokenCredential("<CLIENT_ID>", "<CLIENT_SECRET>");
string accessToken = tokenCredential.GetAccessToken();
var parameters = new PayPal.Util.QueryParameters();
parameters.Add ("Count", "10");
PaymentHistory paymentHistory = Payment.Get(apiContext, accessToken, parameters);
base.Initialize (controllerContext);
// Get the config properties from PayPal.Api.ConfigManager
// Create the Classic SDK service instance to use.
service = new PayPalAPIInterfaceServiceService(ConfigManager.Instance.GetProperties());
}
/// <summary>
/// Search the specified str.
/// </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

View File

@ -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>
* instdbws.sql: Creates a new table to store one time usage

View File

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

View File

@ -28,7 +28,11 @@ namespace Yavsc.Helpers
string tr = LocalizedText.ResourceManager.GetString (msg.Replace (" ", "_"));
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)
{
// Just call the other one, to avoid having two copies (we don't use the HtmlHelper).

View File

@ -1,9 +1,31 @@
using System;
using System.Configuration;
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>
/// Thanks helper.
/// </summary>
@ -24,28 +46,13 @@ namespace Yavsc
/// <summary>
/// Html code for each entry
/// </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.To == null) return result.ToArray();
foreach (ThanksConfigurationElement e in ConfigurationSection.To) {
string link = "";
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);
}
foreach (ThanksConfigurationElement e in ConfigurationSection.To)
result.Add( new Link { Url = e.Url, Image=e.Image, Text = e.Name });
return result.ToArray();
}
}

View File

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

View File

@ -62,10 +62,11 @@ ViewState["orgtitle"] = T.GetString(Page.Title);
<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 %>
<% } %>
<%= Html.ActionLink("Contact","Contact","Home",null, new { @class="thanks" }) %>
<% foreach ( Link link in Html.Thanks()) { %>
<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>
</footer>
<script type="text/javascript">

View File

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

View File

@ -19,15 +19,15 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
</sectionGroup>
</sectionGroup>
</sectionGroup>
<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.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.DataProviderConfigurationSection, YavscModel" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
<section name="circleProviders" type="Yavsc.Model.DataProviderConfigurationSection, YavscModel" />
</sectionGroup>
<section name="circleProviders" type="Yavsc.Model.DataProviderConfigurationSection, YavscModel" />
</sectionGroup>
<section name="paypal" type="PayPal.SDKConfigHandler, PayPal" />
</configSections>
<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" />
</to>
</thanks>
<circleProviders defaultProvider="NpgsqlCircleProvider">
<providers>
<add name="NpgsqlCircleProvider" applicationName="/" type="WorkFlowProvider.NpgsqlCircleProvider, NpgsqlContentProvider" connectionStringName="yavsc" />
</providers>
</circleProviders>
<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

@ -93,6 +93,12 @@
<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>
</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>
<Folder Include="Models\" />
@ -159,7 +165,6 @@
<Compile Include="Settings\ThanksConfigurationSection.cs" />
<Compile Include="Settings\ThanksConfigurationCollection.cs" />
<Compile Include="Settings\ThanksConfigurationElement.cs" />
<Compile Include="Settings\ThanksHelper.cs" />
<Compile Include="Settings\ModulesConfigurationSection.cs" />
<Compile Include="Settings\ModuleConfigurationElementCollection.cs" />
<Compile Include="Settings\ModuleConfigurationElement.cs" />
@ -190,6 +195,7 @@
<Compile Include="ApiControllers\FrontOfficeController.cs" />
<Compile Include="ApiControllers\GCMController.cs" />
<Compile Include="ApiControllers\AccountController.cs" />
<Compile Include="Helpers\ThanksHelper.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Web.config" />

View File

@ -10,6 +10,7 @@
<package id="MarkdownHelper" version="1.3" targetFramework="net451" />
<package id="Newtonsoft.Json" version="6.0.8" 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="xunit" version="2.0.0" targetFramework="net451" />
<package id="xunit.abstractions" version="2.0.0" targetFramework="net451" />

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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>
* RegisterClientModel.cs: Implements the Question and answer

View File

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