Implemente la gestion des activités
* Activities.aspx: implémente la vue Html de la liste éditable des activités * Activity.ascx: implémente la vue Html d'une activité * NpgsqlContentProvider.cs: implemente la gestion des activités côté base de donnée Npgsql * TestAPI.csproj: ... une référence au framework 4.5.1 en moins ... * FrontOfficeController.cs: Le contrôleur du FrontOffice gére les activités * Global.asax.cs: nettoyage du code * activity.sql: Typo corrigée sur le terme "MEACode" * style.css: enlève des images qui n'ont plus rien à faire ici, tant ce fichier concerne maintenant uniquement la disposition ou les éléments de base. * AccountController.cs: implémente le contrôle par l'utilisateur du paramêtre de l'activité principale associé à son profile. * FrontOfficeController.cs: Implemente le contrôle de la page des activités, et simplifie le contrôle de la page des compétences. * HomeController.cs: formattage du code * ModuleController.cs: inutilisé * App.master: Theming explicite en page maître * Profile.aspx: Propose maintenant l'édition de l'activité principalement éxercée * Skills.aspx: supprime une ligne de log * Index.aspx: RAZ en home page * MarkdownDeep.dll: remplace le tag englobant les transformations, il était un "<p>", il est maintenant un "<span>". * BlogManager.cs: refactorisation * Activity.cs: implémente un type de commande à associer à une activité. * LocalizedText.fr.resx: * LocalizedText.Designer.cs: * LocalizedText.fr.Designer.cs: La traduction de "ne pas publier mon activité" * LocalizedText.resx: La traduction de "ne pas publier mon activité", et de "Votre activité" * ManagerHelper.cs: refabrique l'instanciation des fournisseurs du workflow, pour avoir une liste de toutes les activité prises en charges par tous les fournisseurs de contenu. * Profile.cs: Implement le code activité de l'objet `Profile` * ProfileEdition.cs: xmldoc * SkillManager.cs: Formattage du code source * IContentProvider.cs: reformattage du code+ propriété "Name" du fournisseur + definition des methodes relatives à la gestion des activités * WorkFlowManager.cs: Methodes de recupperation des activités fournies auprés des fournisseurs de contenu * YavscModel.csproj: renommage * Web.csproj: reference les nouveaux éléments du projet relatifs au activités * Web.config: references manquante en cas d'utilisation du paramértrage global du thème via la section system.web/pages du fichier de configuration.main
parent
f3bc91289d
commit
2fcaa1ded4
@ -0,0 +1,43 @@
|
||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Activity>>" %>
|
||||
|
||||
<asp:Content ID="headContent" ContentPlaceHolderID="head" runat="server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
|
||||
<div id="activities">
|
||||
<% foreach (var a in Model) { %>
|
||||
<%= Html.Partial("Activity",a) %>
|
||||
<% } %>
|
||||
<aside class="control">
|
||||
<form method="post" action="DeclareActivity">
|
||||
<fieldset>
|
||||
<input type="text" name="meacode" id="meacode" >
|
||||
<input type="text" name="activityname" id="activityname" >
|
||||
<input type="text" name="comment" id="comment" >
|
||||
<input type="button" value="Créer l'activité" id="btncreate" >
|
||||
</fieldset>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$('#btncreate').click( function() {
|
||||
var activity = {
|
||||
Title: $('#activityname').val(),
|
||||
Id: $('#meacode').val(),
|
||||
Comment: $('#comment').val(),
|
||||
};
|
||||
console.log(Yavsc.dumpprops(activity));
|
||||
Yavsc.ajax( 'FrontOffice/RegisterActivity', activity,
|
||||
function() {
|
||||
var na = $('<p></p>').addClass('activity');
|
||||
$.get('FrontOffice/Activity/'+activity.meacode, function(data) {
|
||||
na.replaceWith(data);
|
||||
$('#activityname').val('');
|
||||
$('#meacode').val('');
|
||||
$('#comment').val('');
|
||||
na.appendTo('#activities');
|
||||
});
|
||||
}); } ); });
|
||||
</script>
|
||||
</aside>
|
||||
</div>
|
||||
</asp:Content>
|
||||
@ -0,0 +1,9 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Activity>" %>
|
||||
|
||||
<h1 class="activity">
|
||||
<%=Html.Icon("act"+Model.Id)%>
|
||||
<%=Html.Markdown(Model.Title)%></h1>
|
||||
<i>(<%=Html.Markdown(Model.Id)%>)</i>
|
||||
<p>
|
||||
<%=Html.Markdown(Model.Comment)%>
|
||||
</p>
|
||||
Binary file not shown.
@ -1,68 +0,0 @@
|
||||
//
|
||||
// Manager.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2015 GNU GPL
|
||||
//
|
||||
// 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;
|
||||
using System.Configuration;
|
||||
using System.Reflection;
|
||||
using System.Configuration.Provider;
|
||||
|
||||
namespace Yavsc.Model {
|
||||
/// <summary>
|
||||
/// Manager.
|
||||
/// </summary>
|
||||
public static class ManagerHelper {
|
||||
|
||||
/// <summary>
|
||||
/// Gets the provider.
|
||||
/// </summary>
|
||||
/// <value>The provider.</value>
|
||||
public static TProvider GetDefaultProvider<TProvider> (string configSetion) where TProvider: ProviderBase
|
||||
{
|
||||
DataProviderConfigurationSection config = ConfigurationManager.GetSection (configSetion) as DataProviderConfigurationSection;
|
||||
if (config == null)
|
||||
throw new ConfigurationErrorsException (
|
||||
string.Format(
|
||||
"The providers configuration bloc `{0}` was not found",
|
||||
configSetion));
|
||||
ProviderSettings celt =
|
||||
config.Providers [config.DefaultProvider];
|
||||
if (config == null)
|
||||
throw new ConfigurationErrorsException (
|
||||
string.Format (
|
||||
"The default provider `{0}` was not found ",
|
||||
config.DefaultProvider));
|
||||
Type provtype = Type.GetType (celt.Type);
|
||||
if (provtype == null)
|
||||
throw new ProviderException (
|
||||
string.Format (
|
||||
"Provider type '{0}' was not found",celt.Type));
|
||||
ConstructorInfo ci = provtype.GetConstructor (Type.EmptyTypes);
|
||||
ProviderBase bp = ci.Invoke (Type.EmptyTypes) as ProviderBase;
|
||||
bp.Initialize (celt.Name, celt.Parameters);
|
||||
return bp as TProvider;
|
||||
}
|
||||
|
||||
public static ProviderBase GetDefaultProvider (string configSetion)
|
||||
{
|
||||
return GetDefaultProvider<ProviderBase>(configSetion);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,109 @@
|
||||
//
|
||||
// Manager.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2015 GNU GPL
|
||||
//
|
||||
// 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;
|
||||
using System.Configuration;
|
||||
using System.Reflection;
|
||||
using System.Configuration.Provider;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Model {
|
||||
/// <summary>
|
||||
/// Manager.
|
||||
/// </summary>
|
||||
public static class ManagerHelper {
|
||||
|
||||
/// <summary>
|
||||
/// Gets the provider.
|
||||
/// </summary>
|
||||
/// <value>The provider.</value>
|
||||
public static TProvider CreateDefaultProvider<TProvider> (string configSetion) where TProvider: ProviderBase
|
||||
{
|
||||
var config = GetConfiguration (configSetion);
|
||||
ProviderSettings celt =
|
||||
config.Providers [config.DefaultProvider];
|
||||
return CreateProvider<TProvider> (celt.Type, celt.Name, celt.Parameters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the providers.
|
||||
/// </summary>
|
||||
/// <returns>The providers.</returns>
|
||||
/// <param name="configSetion">Config setion.</param>
|
||||
/// <typeparam name="TProvider">The 1st type parameter.</typeparam>
|
||||
public static TProvider [] CreateProviders<TProvider> (string configSetion) where TProvider: ProviderBase
|
||||
{
|
||||
var config = GetConfiguration (configSetion);
|
||||
List<TProvider> providers = new List<TProvider> ();
|
||||
foreach (ProviderSettings provConfig in config.Providers) {
|
||||
var prov = CreateProvider<TProvider>
|
||||
(provConfig.Type, provConfig.Name, provConfig.Parameters);
|
||||
providers.Add (prov);
|
||||
}
|
||||
return providers.ToArray ();
|
||||
}
|
||||
|
||||
private static DataProviderConfigurationSection GetConfiguration(string configSetion) {
|
||||
DataProviderConfigurationSection config = ConfigurationManager.GetSection (configSetion) as DataProviderConfigurationSection;
|
||||
if (config == null)
|
||||
throw new ConfigurationErrorsException (
|
||||
string.Format(
|
||||
"The providers configuration bloc `{0}` was not found",
|
||||
configSetion));
|
||||
return config;
|
||||
}
|
||||
|
||||
private static TProvider CreateProvider<TProvider>(string type, string name,
|
||||
NameValueCollection config) where TProvider: ProviderBase {
|
||||
Type provtype = Type.GetType (type);
|
||||
if (provtype == null)
|
||||
throw new ProviderException (
|
||||
string.Format (
|
||||
"Provider type '{0}' was not found",type));
|
||||
ConstructorInfo ci = provtype.GetConstructor (Type.EmptyTypes);
|
||||
TProvider bp = ci.Invoke (Type.EmptyTypes) as TProvider;
|
||||
bp.Initialize (name, config);
|
||||
return bp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the default provider.
|
||||
/// </summary>
|
||||
/// <returns>The default provider.</returns>
|
||||
/// <param name="configSetion">Config setion.</param>
|
||||
public static ProviderBase CreateDefaultProvider (string configSetion)
|
||||
{
|
||||
return CreateDefaultProvider<ProviderBase>(configSetion);
|
||||
}
|
||||
/// <summary>
|
||||
/// Creates the providers.
|
||||
/// </summary>
|
||||
/// <returns>The providers.</returns>
|
||||
/// <param name="configSetion">Config setion.</param>
|
||||
public static ProviderBase[] CreateProviders (string configSetion)
|
||||
{
|
||||
return CreateProviders<ProviderBase>(configSetion);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue