Merge from totem

This commit is contained in:
Paul Schneider 2015-10-21 21:23:48 +02:00
commit c466aed242
64 changed files with 3820 additions and 171 deletions

View file

@ -11,6 +11,48 @@
</asp:Content>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<% using(Html.BeginForm("ValidateEdit","Blogs")) { %>
<fieldset>
<legend>Contrôle d'accès au Billet</legend>
<%= Html.LabelFor(model => model.Visible) %> : <%= Html.CheckBox( "Visible" ) %>
<i id="note_visible">Note: Si un ou plusieurs cercles sont séléctionnés ici,
le billet ne sera visible qu'aux membres de ces cercles.</i>
<%= Html.ValidationMessage("Visible", "*") %>
<%= Html.LabelFor(model => model.AllowedCircles) %>
<%= Html.ListBox("AllowedCircles") %>
<%= Html.ValidationMessage("AllowedCircles", "*") %>
</fieldset>
<span id="viewsource">
<i class="fa fa-code menuitem"><%=Html.Translate("View_source")%></i></span>
<span id="hidesource" class="hidden">
<i class="fa fa-code menuitem"><%=Html.Translate("Hide_source")%></i>
</span>
<fieldset id="source" class="hidden">
<%=Html.Hidden("Author")%>
<%=Html.Hidden("Id")%>
<%= Html.LabelFor(model => model.Photo) %>
<%=Html.TextBox("Photo")%>
<%=Html.ValidationMessage("Photo")%><br>
<%= Html.LabelFor(model => model.Title) %>
<%=Html.TextBox("Title")%>
<%=Html.ValidationMessage("Title")%><br>
<%=Html.TextArea("Content")%>
<%=Html.ValidationMessage("Content")%>
</fieldset>
<input type="submit" id="validate" value="Valider" class="fa fa-check menuitem">
<% } %>
<form id="frmajax">
<fieldset>
<legend>Attacher des fichiers</legend>
<input type="file" name="attached" id="postedfile" multiple>
<input type="button" value="attacher les ficher" onclick="submitFile()">
<input type="button" value="importer les documents" onclick="submitImport()">
</fieldset>
</form>
<span class="placard editable" for="Photo">
<img src="<%=Model.Photo%>" alt="photo" id="vphoto" >
</span>
@ -189,44 +231,7 @@ var data = new FormData($('#frmajax').get()[0]);
}
</script>
<form id="frmajax">
<fieldset>
<legend>Attacher des fichiers</legend>
<input type="file" name="attached" id="postedfile" multiple>
<input type="button" value="attacher les ficher" onclick="submitFile()">
<input type="button" value="importer les documents" onclick="submitImport()">
</fieldset>
</form>
<% using(Html.BeginForm("ValidateEdit","Blogs")) { %>
<fieldset>
<legend>Contrôle d'accès au Billet</legend>
<%= Html.LabelFor(model => model.Visible) %> : <%= Html.CheckBox( "Visible" ) %>
<i id="note_visible">Note: Si un ou plusieurs cercles sont séléctionnés ici,
le billet ne sera visible qu'aux membres de ces cercles.</i>
<%= Html.ValidationMessage("Visible", "*") %>
<%= Html.LabelFor(model => model.AllowedCircles) %>
<%= Html.ListBox("AllowedCircles") %>
<%= Html.ValidationMessage("AllowedCircles", "*") %>
</fieldset>
<span id="viewsource">
<i class="fa fa-code menuitem"><%=Html.Translate("View_source")%></i></span>
<span id="hidesource" class="hidden">
<i class="fa fa-code menuitem"><%=Html.Translate("Hide_source")%></i>
</span>
<fieldset id="source" class="hidden">
<%=Html.Hidden("Author")%>
<%=Html.Hidden("Id")%>
<%= Html.LabelFor(model => model.Photo) %>
<%=Html.TextBox("Photo")%>
<%=Html.ValidationMessage("Photo")%><br>
<%= Html.LabelFor(model => model.Title) %>
<%=Html.TextBox("Title")%>
<%=Html.ValidationMessage("Title")%><br>
<%=Html.TextArea("Content")%>
<%=Html.ValidationMessage("Content")%>
</fieldset>
<input type="submit" id="validate" value="Valider" class="fa fa-check menuitem">
<% } %>
<aside>

View file

@ -1,97 +1,48 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogEntry>" %>
<ul id="tags">
<% if (Model.Tags != null) foreach (string tagname in Model.Tags) { %>
<li><%= tagname %></li>
<% } %>
</ul>
<p id="tags<%=Model.Id%>" data-postid="<%=Model.Id%>" class="fa fa-tag">
<% if (Model.Tags != null) {
foreach ( var tagname in Model.Tags) { %>
<span class="tagname"><%=tagname%></span> <%
%><% } } %>
</p>
<% if (Membership.GetUser()!=null) { %>
<% if (Membership.GetUser().UserName==Model.Author || Roles.IsUserInRole("Admin"))
{ // grant all permissions: to choose a given set of tags, also create some new tags %>
<span id="viewtagger">
<i class="fa fa-tag menuitem" id="viewtaggerbtn"><%=Html.Translate("DoTag")%></i></span>
<span id="hidetagger" class="hidden">
<i class="fa fa-tag menuitem" id="hidetaggerbtn" ><%=Html.Translate("Hide")%></i>
<span id="viewtagger<%=Model.Id%>">
<i class="fa fa-tag menuitem" id="viewtaggerbtn<%=Model.Id%>"><%=Html.Translate("DoTag")%></i></span>
<span id="hidetagger<%=Model.Id%>" class="hidden">
<i class="fa fa-tag menuitem" id="hidetaggerbtn<%=Model.Id%>" ><%=Html.Translate("Tags")%> - <%=Html.Translate("Hide")%></i>
Note: Ils sont utilisé pour classifier le document. Par exemple, le tag <code>Accueil</code> rend le document
éligible à une place en page d'Accueil.
</span>
<form id="tagger" class="hidden">
<form id="tagger<%=Model.Id%>" class="maskable" data-btn-show="viewtagger<%=Model.Id%>" data-btn-hide="hidetagger<%=Model.Id%>" >
<fieldset>
<legend>Associer des tags au billet</legend>
<label for="newtag"><%= Html.Translate("Tag_name")%>: </label>
<span id="Err_tag" class="error"></span>
<input type="text" id="newtag">
<span id="Err_model" class="error"></span>
<input id="sendnewtag" type="submit" class="fa fa-tag" value="<%=Html.Translate("Submit")%>">
<span id="Err_tag<%=Model.Id%>" class="error"></span>
<input type="text" id="newtag<%=Model.Id%>" class="taginput">
<span id="Err_model<%=Model.Id%>" class="error"></span>
<input id="sendnewtag<%=Model.Id%>" type="submit" class="submittag fa fa-tag" value="<%=Html.Translate("Submit")%>">
</fieldset>
</form>
<script>
$(document).ready(function(){
$('#hidetaggerbtn').click(function(){
$('#tagger').addClass('hidden');
$('#viewtagger').removeClass('hidden');
$('#hidetagger').addClass('hidden');
});
$('#viewtaggerbtn').click(function(){
$('#tagger').removeClass('hidden');
$('#viewtagger').addClass('hidden');
$('#hidetagger').removeClass('hidden');
});
$('#newtag').autocomplete({
minLength: 0,
delay: 200,
source: function( request, response ) {
$.ajax({
url: "/api/Blogs/Tags",
type: "POST",
data: {
pattern: request.term
},
success: function( data ) {
response( data );
}
});
},
select: function( event, ui ) {
console.log( ui.item ?
"Selected: " + ui.item.label :
"Nothing selected, input was " + this.value);
},
open: function() {
$( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
},
close: function() {
$( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
}
});
$('#tagger').on('submit', function(e) { e.preventDefault(); });
$('#sendnewtag').click(function(){
var data = {
postid: <%= Model.Id %>,
tag: $('#newtag').val()
}
$.ajax({
url: '/api/Blogs/Tag/',
type: 'POST',
data: data,
success: function() {
$('<li>'+data.tag+'</li>').appendTo('#tags');
$('#newtag').val('');
},
statusCode: {
400: Yavsc.onAjaxBadInput
},
error: Yavsc.onAjaxError
});
$('#sendnewtag<%=Model.Id%>').click(function(e){
Tags.tag(<%=Model.Id%>,$('#newtag<%=Model.Id%>').val(),
function(postid,tagname){
var nTagDisplay = $('<span class="tagname">'+tagname+'</span>');
nTagDisplay.click( function() {
var postid=$(this).parent().data('postid');
var $thistag = $(this);
Tags.untag(postid, $thistag.text(), function () { $thistag.remove(); } );
});
nTagDisplay.appendTo('#tags'+postid);
$('#newtag'+postid).val('');
}
);
e.preventDefault();
});
});
$('#sendnewtag<%=Model.Id%>').on('submit', function(e) { e.preventDefault(); });
</script>
<% } %>
<% } %>

View file

@ -20,7 +20,19 @@
<%= Html.TextArea("body") %>
</p>
</fieldset>
<input type="submit">
<input type="submit" value="<%=Html.Translate("Submit")%>">
<p>
Directeur : Boudjouraf Brahim<br>
Adresse postale : 29 rue des près, 92 71200 LE CREUSOT<br>
Tél. : +33 6.58.91.36.78<br>
Tél. : +33 6.78.65.36.31<br>
Facebook : Brahms Totem Officiel (Totem Prod)<br>
Twitter : Totem Officiel<br>
Skyblog : Totem-Production.skyrock.com<br>
SIREN : 517 942 991<br>
SIRET : 517 942 991 000 12<br>
Activité Principalement Exercée (APE) : 9329Z Autres activités récréatives et de loisirs<br>
</p>
<% } %>
</asp:Content>

View file

@ -1,12 +1,13 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<TagInfo>" %>
<div class="panel">
<i class="fa fa-tag"><%=Html.Encode(Model.Name)%></i>
<h2><%=Html.Encode(Model.Name)%></h2>
<% foreach (var t in Model.Titles) { %>
<a href="<%= Url.RouteUrl("Titles", new { title = t.Title }) %>">
<img src="<%=Url.Encode(t.Photo)%>" alt="placard" class="photo">
<%= Html.Markdown(t.Title,"/bfiles/"+t.Id+"/")%></a>
<div class="postpreview">
<p><%= Html.Markdown(t.Intro,"/bfiles/"+t.Id+"/") %></p>
<a href="<%= Url.RouteUrl("Titles", new { title = t.Title }) %>">
<% if (t.Photo != null ) { %>
<img src="<%=Url.Encode(t.Photo)%>" alt="placard" class="photo"><% } %>
<%= Html.Markdown(t.Title,"/bfiles/"+t.Id+"/")%></a>
<%= Html.Markdown(t.Intro,"/bfiles/"+t.Id+"/") %>
</div>
<% } %>
</div>