* Presta.csproj: A first class
* AssemblyInfo.cs: initial commit * NpgsqlCircleProvider.cs: circle members are now stored in bd upon their user's name * InputCircle.cs: fixes the new CircleManager interface usage * Yavsc.sln: Adds the `Presta` project * CircleController.cs: * Authorize some Http methods * Lists circles as circles * style.css: Fixes the missing "hidden" css class * AccountController.cs: using the new Circle provider interface * BlogsController.cs: * using the new Circle provider interface * do not test blog entry collections in order to group them by a unique user name or title, it's too bad, instead, keep user's request id as guide to model and view. * YavscHelpers.cs: Adds a Circle Html formatter * Circles.aspx: List of circles is now given as a list of `Circle` objects * instdbws.sql: fixes the db in order to store user names in circle member's records. * BlogEntryCollection.cs: ConcernsAUniqueTitle and ConcernsAUniqueUser are now Obsoletes * UUTBlogEntryCollection.cs: Drops a useless ctor * CircleProvider.cs: The `CircleManager` now delivers the user's circle as a `Circle` object collection.
This commit is contained in:
parent
3fa55acf2e
commit
bdbda2a21f
21 changed files with 322 additions and 82 deletions
|
|
@ -13,12 +13,11 @@
|
|||
</thead>
|
||||
<tbody id="tbcb">
|
||||
<% int lc=0;
|
||||
foreach (SelectListItem ci in (IEnumerable<SelectListItem>) ViewData["Circles"]) { lc++; %>
|
||||
<tr class="<%= (lc%2==0)?"even ":"odd " %>row" id="c_<%=ci.Value%>">
|
||||
<td><%=ci.Text%></td>
|
||||
foreach (var ci in (IEnumerable<Circle>) ViewData["Circles"]) { lc++; %>
|
||||
<tr class="<%= (lc%2==0)?"even ":"odd " %>row" id="c_<%=ci.Id%>">
|
||||
<td><%=Html.FormatCircle(ci)%></td>
|
||||
<td>
|
||||
<input type="button" value="<%=Html.Translate("Remove")%>" class="actionlink rowbtnrm"/>
|
||||
<input type="button" value="<%=Html.Translate("Members")%>" class="actionlink rowbtnvw"/>
|
||||
<input type="button" value="<%=Html.Translate("Remove")%>" class="btnremovecircle actionlink" cid="<%=ci.Id%>"/>
|
||||
</td>
|
||||
</tr>
|
||||
<% } %>
|
||||
|
|
@ -33,13 +32,13 @@ $("#tbc").stupidtable();
|
|||
<asp:Content ID="MASContentContent" ContentPlaceHolderID="MASContent" runat="server">
|
||||
|
||||
<div id="dfnuser" class="hidden panel">
|
||||
<%= Html.Partial("~/Views/Account/Register.ascx",new RegisterClientModel(),new ViewDataDictionary(ViewData)
|
||||
<%= Html.Partial("~/Views/Account/Register.ascx",new RegisterClientModel(),new ViewDataDictionary(ViewData)
|
||||
{
|
||||
TemplateInfo = new System.Web.Mvc.TemplateInfo
|
||||
{
|
||||
TemplateInfo = new System.Web.Mvc.TemplateInfo
|
||||
{
|
||||
HtmlFieldPrefix = ViewData.TemplateInfo.HtmlFieldPrefix==""?"ur":ViewData.TemplateInfo.HtmlFieldPrefix+"_ur"
|
||||
}
|
||||
}) %>
|
||||
HtmlFieldPrefix = ViewData.TemplateInfo.HtmlFieldPrefix==""?"ur":ViewData.TemplateInfo.HtmlFieldPrefix+"_ur"
|
||||
}
|
||||
}) %>
|
||||
</div>
|
||||
<form>
|
||||
<fieldset>
|
||||
|
|
@ -87,9 +86,38 @@ $("#tbc").stupidtable();
|
|||
$("#Err_ur_IsApprouved").text("");
|
||||
}
|
||||
function clearCircleValidation() {}
|
||||
function removeCircle() {
|
||||
message(false);
|
||||
var id = $(this).attr('cid');
|
||||
$.ajax({
|
||||
url: "<%=Url.Content("~/api/Circle/Delete/")%>"+id,
|
||||
type: "GET",
|
||||
success: function (data) {
|
||||
// Drops the detroyed circle row
|
||||
$("c_"+id).remove();
|
||||
},
|
||||
statusCode: {
|
||||
400: function(data) {
|
||||
$.each(data.responseJSON, function (key, value) {
|
||||
var errspanid = "Err_cr_" + value.key.replace("model.","");
|
||||
var errspan = document.getElementById(errspanid);
|
||||
if (errspan==null)
|
||||
alert('enoent '+errspanid);
|
||||
else
|
||||
errspan.innerHTML=value.errors.join("<br/>");
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
if (xhr.status!=400)
|
||||
message(xhr.status+" : "+xhr.responseText);
|
||||
else message(false);
|
||||
}});
|
||||
}
|
||||
|
||||
function addCircle()
|
||||
{
|
||||
message(false);
|
||||
var circle = { title: $("#title").val(), users: $("#users").val() } ;
|
||||
$("#title").text('');
|
||||
$("#users").val('');
|
||||
|
|
@ -98,7 +126,8 @@ $("#tbc").stupidtable();
|
|||
type: "POST",
|
||||
data: circle,
|
||||
success: function (data) {
|
||||
$("#users option:last").after($('<option>'+user.UserName+'</option>'));
|
||||
// Adds a node rendering the new circle
|
||||
$("#tbcb").append("<tr><td>"+circle.title+" <br><i>"+circle.users+"</i></td></tr>");
|
||||
},
|
||||
statusCode: {
|
||||
400: function(data) {
|
||||
|
|
@ -121,6 +150,7 @@ $("#tbc").stupidtable();
|
|||
|
||||
function addUser()
|
||||
{
|
||||
message(false);
|
||||
var user={
|
||||
UserName: $("#ur_UserName").val(),
|
||||
Name: $("#ur_Name").val(),
|
||||
|
|
@ -174,6 +204,7 @@ $("#tbc").stupidtable();
|
|||
$(document).ready(function () {
|
||||
$("#btnnewuser").click(addUser);
|
||||
$("#btnnewcircle").click(addCircle);
|
||||
$(".btnremovecircle").click(removeCircle);
|
||||
});
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue