From 9748c9d7e4242726c6901cd349df794481badeb2 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 24 Aug 2015 05:51:17 +0200 Subject: [PATCH] * Adds client resourses for Markdown.js * Implements a part of the client UI at editing Circle collections --- .gitignore | 13 ++ NpgsqlContentProvider/NpgsqlCircleProvider.cs | 39 ++-- web/ApiControllers/AuthorizationDenied.cs | 2 +- web/ApiControllers/CircleController.cs | 38 ++-- web/App_Themes/style.css | 3 + web/Controllers/AccountController.cs | 19 +- web/Scripts/MarkdownDeep License.txt | 16 ++ web/Scripts/MarkdownDeep Quick Reference.txt | 60 +++++ web/Scripts/mdd_ajax_loader.gif | Bin 0 -> 2608 bytes web/Scripts/mdd_gripper.png | Bin 0 -> 150 bytes web/Scripts/mdd_help.htm | 166 ++++++++++++++ web/Scripts/mdd_modal_background.png | Bin 0 -> 173 bytes web/Scripts/mdd_styles.css | 211 ++++++++++++++++++ web/Scripts/mdd_toolbar.png | Bin 0 -> 7051 bytes web/Views/Account/Circles.aspx | 17 +- web/instdbws.sql | 3 +- yavscModel/Circles/CircleProvider.cs | 35 +-- yavscModel/ListItem.cs | 48 ---- yavscModel/YavscModel.csproj | 1 - 19 files changed, 552 insertions(+), 119 deletions(-) create mode 100644 .gitignore create mode 100644 web/Scripts/MarkdownDeep License.txt create mode 100644 web/Scripts/MarkdownDeep Quick Reference.txt create mode 100644 web/Scripts/mdd_ajax_loader.gif create mode 100644 web/Scripts/mdd_gripper.png create mode 100644 web/Scripts/mdd_help.htm create mode 100644 web/Scripts/mdd_modal_background.png create mode 100644 web/Scripts/mdd_styles.css create mode 100644 web/Scripts/mdd_toolbar.png delete mode 100644 yavscModel/ListItem.cs diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e98c498d --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +*/bin +*/obj +plugins/*/bin +plugins/*/obj +*.userprefs +packages +web/avatars +web/users +web/Web References +build +.nuget +.gitignore + diff --git a/NpgsqlContentProvider/NpgsqlCircleProvider.cs b/NpgsqlContentProvider/NpgsqlCircleProvider.cs index 75cbe039..3d6fc23b 100644 --- a/NpgsqlContentProvider/NpgsqlCircleProvider.cs +++ b/NpgsqlContentProvider/NpgsqlCircleProvider.cs @@ -36,6 +36,28 @@ namespace WorkFlowProvider /// public class NpgsqlCircleProvider : CircleProvider { + #region implemented abstract members of CircleProvider + + public override void RemoveMembership (long circle_id, string member) + { + using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) + using (NpgsqlCommand cmd = cnx.CreateCommand ()) { + cmd.CommandText = "delete from circle_members where circle_id = :cid and username = :uname"; + cmd.Parameters.AddWithValue("cid",circle_id); + cmd.Parameters.AddWithValue("uname",member); + cnx.Open (); + cmd.ExecuteNonQuery (); + cnx.Close (); + } + } + + public override void RemoveMember (string member) + { + throw new NotImplementedException (); + } + + #endregion + /// /// Initializes a new instance of the class. /// @@ -88,23 +110,6 @@ namespace WorkFlowProvider } } - /// - /// Remove the specified user. - /// - /// circle Identifier. - /// User name. - public override void Remove (long id, string username) - { - using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString)) - using (NpgsqlCommand cmd = cnx.CreateCommand ()) { - cmd.CommandText = "delete from circle_members where circle_id = :cid and username = :uname"; - cmd.Parameters.AddWithValue("cid",id); - cmd.Parameters.AddWithValue("uname",username); - cnx.Open (); - cmd.ExecuteNonQuery (); - cnx.Close (); - } - } /// /// Get the specified id. diff --git a/web/ApiControllers/AuthorizationDenied.cs b/web/ApiControllers/AuthorizationDenied.cs index 1b90bc37..2193e6aa 100644 --- a/web/ApiControllers/AuthorizationDenied.cs +++ b/web/ApiControllers/AuthorizationDenied.cs @@ -44,7 +44,7 @@ namespace Yavsc.ApiControllers public class AuthorizationDenied : HttpRequestException { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the Yavsc.ApiControllers.AuthorizationDenied class. /// /// Message. public AuthorizationDenied(string msg) : base(msg) diff --git a/web/ApiControllers/CircleController.cs b/web/ApiControllers/CircleController.cs index a2e30521..18490ad8 100644 --- a/web/ApiControllers/CircleController.cs +++ b/web/ApiControllers/CircleController.cs @@ -29,26 +29,6 @@ using Yavsc.Model; namespace Yavsc.ApiControllers { - /// - /// New circle. - /// - public class NewCircle { - /// - /// Gets or sets the title. - /// - /// The title. - public string title { get ; set; } - /// - /// Gets or sets the users. - /// - /// The users. - public string [] users { get ; set; } - /// - /// Gets or sets a value indicating whether this is private. - /// - /// true if is private; otherwise, false. - public bool isPrivate { get; set; } - } /// /// Circle controller. @@ -62,10 +42,10 @@ namespace Yavsc.ApiControllers /// Model. [Authorize, AcceptVerbs ("POST")] - public long Create(NewCircle model) + public long Create(Circle model) { string user = Membership.GetUser ().UserName; - return CircleManager.DefaultProvider.Create (user, model.title, model.users); + return CircleManager.DefaultProvider.Create (user, model.Title, model.Members); } /// @@ -94,6 +74,20 @@ namespace Yavsc.ApiControllers CircleManager.DefaultProvider.Delete (id); } + + /// + /// Removes the user from circle. + /// + /// Identifier. + /// Username. + [Authorize, + AcceptVerbs ("GET")] + public void RemoveUserFromCircle(long id, string username) + { + checkIsOwner (CircleManager.DefaultProvider.Get(id)); + CircleManager.DefaultProvider.RemoveMembership (id,username); + } + private void checkIsOwner(Circle c) { string user = Membership.GetUser ().UserName; diff --git a/web/App_Themes/style.css b/web/App_Themes/style.css index 763b5118..0aaba7b5 100644 --- a/web/App_Themes/style.css +++ b/web/App_Themes/style.css @@ -121,6 +121,9 @@ label { font-size: large; background-color: rgba(0,64,0,0.1); } +.dirty { + background-color: rgba(128,128,0,0.3); +} .error { color: #f88; font-size: large; diff --git a/web/Controllers/AccountController.cs b/web/Controllers/AccountController.cs index afd4c1e7..e2876f3d 100644 --- a/web/Controllers/AccountController.cs +++ b/web/Controllers/AccountController.cs @@ -214,12 +214,13 @@ namespace Yavsc.Controllers return View (model); } - /// - /// Profile the specified user. - /// - /// User name. + [Authorize] [HttpGet] + /// + /// Profile the specified id. + /// + /// Identifier. public ActionResult Profile (string id) { if (id == null) @@ -230,14 +231,16 @@ namespace Yavsc.Controllers return View (model); } + + + [Authorize] + [HttpPost] /// - /// Profile the specified user, model and AvatarFile. + /// Profile the specified id, model and AvatarFile. /// - /// User. + /// Identifier. /// Model. /// Avatar file. - [Authorize] - [HttpPost] public ActionResult Profile (string id, Profile model, HttpPostedFileBase AvatarFile) { // ASSERT("Membership.GetUser ().UserName is made of simple characters, no slash nor backslash" diff --git a/web/Scripts/MarkdownDeep License.txt b/web/Scripts/MarkdownDeep License.txt new file mode 100644 index 00000000..3787ba80 --- /dev/null +++ b/web/Scripts/MarkdownDeep License.txt @@ -0,0 +1,16 @@ +MarkdownDeep License +==================== + +MarkdownDeep - +Copyright (C) 2010-2011 Topten Software + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this product except in +compliance with the License. You may obtain a copy of the License at + + + +Unless required by applicable law or agreed to in writing, software distributed under the License is +distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and limitations under the License. + + diff --git a/web/Scripts/MarkdownDeep Quick Reference.txt b/web/Scripts/MarkdownDeep Quick Reference.txt new file mode 100644 index 00000000..f8a2ff58 --- /dev/null +++ b/web/Scripts/MarkdownDeep Quick Reference.txt @@ -0,0 +1,60 @@ +MarkdownDeep Quick Reference +============================ + +Setting up the Client Side Editor +--------------------------------- + +The following assumes you've installed the full edition MarkdownDeep using NuGet and explains how to setup +a client side editor with toolbar, resize bar, real-time preview and syntax reference help. + +1. In either your master view page, or in the view containing the editor ensure the following references are in place: + + + + + +2. Insert the following markup at the location you want the editor to appear: + +
+ <%=Html.TextArea("content", new { @class="mdd_editor" }) %> +
+
+ + Note, the mdd_toolbar, mdd_resizer and mdd_preview divs are all optional. If ommitted, the jQuery plugin will + create them however this may cause the page to appear to "jump" as it loads. By using the above divs and the + associated mdd_styles.css stylesheet, the correct sizing can be in-place immediately, eliminating these jumps. + +3. Use the jQuery plugin to convert the textarea into a Markdown editor. For more options, see below. + + $(function () { + $("textarea.mdd_editor").MarkdownDeep({ + help_location:"/Scripts/mdd_help.htm", + ExtraMode: true + }); + }) + +See for more information on configuring the editor. + +Server Side Translation +----------------------- + +The above steps allow you to create forms where the user can enter and preview Markdown content. This section +explains how to perform the equivalent translation of the entered content server side. + +1. When you installed MarkdownDeep to your project with NuGet, a reference to MarkdownDeep.dll would already have + been created. + +2. To translate Markdown, instantiate an instance of the MarkdownDeep class and call it's Translate method to + do the translation: + + // Instantiate + var md=new MarkdownDeep.Markdown(); + + // Set options + md.ExtraMode=true; + + // Translate + var html=md.Transform(plaintext); + + +See for other methods and properties. diff --git a/web/Scripts/mdd_ajax_loader.gif b/web/Scripts/mdd_ajax_loader.gif new file mode 100644 index 0000000000000000000000000000000000000000..02932f1a426ba3fa25f8fdaa4ae11439efb72941 GIT binary patch literal 2608 zcmdVcdr(tX9tZGC9yiG~=H_*Q-0%n(lu>!CRf^T^KrYX$KoDxfM!SSdLcpStMg`ff zJQM-3WqA~ZmQfxppk;wt1(iYy22fN25rae`NRYKCsOSi_%SOAMo&96Gvoq} zbLKO@^ZlOS&>-K9a%aF9cm@DVOH0WWJ&&I)OwP<3Cuax7X8LYFcrf>Tc;Zp_t?AjP zFQ#XoUBB~P@5tZv=7-}Co-QoD>^FTk^>BV}{>9Oz!L0flm`;X7)%$-A1m6t}o zfB8dQ*PW7c!(-Er7r%e`$@$^DMm_MWEtjQb;epXnn7<@&ou@a^#(I#;KTs@1A=fD4 z1^W{QHr&0br`dx37Ulvq=Gx2hGs%XVQMdjW3AZ=3WJn&~DJG2|$bV zY{B@T+hj&VqTHt){q`gMsy{^uCzCYfo6NwNE1UDrhH0}8@HndcCr7GQ`^TVy@+?Yi zsBea`bx&TAR_ue5+Rx+;gd?!87prqoNy=k?KzcMnBmBHkr$j&}{bU3@&-dN(1@x`$ zX~$L6{8_cuJK+vZCt9xRqA{S!XxaN$-Mt1kIgdd{3Sk542z`nQ`?LQGmVTjkJ8=Cgef*D=8#io;a+bomE z>7JHU$IzCVKF(YI))D);A^LxT_I?oXpFRqDBKDKc5h*D;votAD`5y4245v~?wZc?1 zVr*p)&S;JNt1K9YI|5)l1h3IScqm?=6ESh|&=9CMo<+vSxa6xQJM)-rne?)eH-*>} z+l_qm5$$XIdqv2-1ht8WZj=>jj;!DFgw*Mf17lFTwn!CO9jt9h zC62p@o&9i$7}DN7>gc<=c_y+8TTdY@M`}QG#DkSML?}6|IbzCfWREh>i_g zeXh&Gx=p>Z@OG0{8gXvu0xoHgp6O`9zXB-LjZPWwN^Dx^gNDkMgKtFx+@z3GZ%Wx7 zReN2sb0B-W_fBzZVZTrw7RQ~x%y0l)v7D1#Q}N;gfqg4<4^)WhOMiKXhrh9c0#lq@ zdHz+0vdDB=e*G`~&VI!)`d>zwPK}@AR-=+y5rxSAMzg4KGZc!*YeEc#;{W45 zBOp(J5zrOWf5Gpkc64QUC2$y>u<7>k%d_2Z;Lt3m)}1Z_(66>`&Gz3q)0vp3_!#whW4t#l zHLsS>TCZz(QF0inUJ_w`{Ir)*Uj-6 z*7h%NjwOobS}%=Ky%y7A64GhF^1T5NeLJ8)d3KUl?WRhg@5D%Dh$G0Cvss5#B#e>{ zIPC*=rpE%*6c*=85vN9FP4IN~d5oP-Af_<10iURdpQ_+KEa-D`O1U0NA%iJQy@;6t zn)N2tn0Z{aWq5K#6_zq!9!k`ydd*jNM0Du8Qcm`ZqSi<~H(mm2itaVsT(hwm@Wo36 z1n-A5t_qucd literal 0 HcmV?d00001 diff --git a/web/Scripts/mdd_gripper.png b/web/Scripts/mdd_gripper.png new file mode 100644 index 0000000000000000000000000000000000000000..b581f2ef631d537d0232d33cf0d1088624c48700 GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^(m>40!3HF^a7^C^q!^2X+?^QKos)S9lMarkdown Formatting +

Markdown turns plain text formatting into fancy HTML formatting.

+

Phrase Emphasis

+
*italic*   **bold**
+_italic_   __bold__
+
+ +

Links

+

Inline:

+
An [example](http://url.com/ "Title")
+
+ +

Reference-style labels (titles are optional):

+
An [example][id]. Then, anywhere
+else in the doc, define the link:
+
+  [id]: http://example.com/  "Title"
+
+ +

Images

+

Inline (titles are optional):

+
![alt text](/path/img.jpg "Title")
+
+ +

Reference-style:

+
![alt text][id]
+
+[id]: /url/to/img.jpg "Title"
+
+ +

Headers

+

Setext-style:

+
Header 1
+========
+
+Header 2
+--------
+
+ +

atx-style (closing #'s are optional):

+
# Header 1 #
+
+## Header 2 ##
+
+###### Header 6
+
+ +

Lists

+

Ordered, without paragraphs:

+
1.  Foo
+2.  Bar
+
+ +

Unordered, with paragraphs:

+
*   A list item.
+
+    With multiple paragraphs.
+
+*   Bar
+
+ +

You can nest them:

+
*   Abacus
+    * answer
+*   Bubbles
+    1.  bunk
+    2.  bupkis
+        * BELITTLER
+    3. burper
+*   Cunning
+
+ +

Blockquotes

+
> Email-style angle brackets
+> are used for blockquotes.
+
+> > And, they can be nested.
+
+> #### Headers in blockquotes
+> 
+> * You can quote a list.
+> * Etc.
+
+ +

Code Spans

+
`<code>` spans are delimited
+by backticks.
+
+You can include literal backticks
+like `` `this` ``.
+
+ +

Preformatted Code Blocks

+

Indent every line of a code block by at least 4 spaces or 1 tab.

+
This is a normal paragraph.
+
+    This is a preformatted
+    code block.
+
+ +

Horizontal Rules

+

Three or more dashes or asterisks:

+
---
+
+* * *
+
+- - - - 
+
+ +

Manual Line Breaks

+

End a line with two or more spaces:

+
Roses are red,   
+Violets are blue.
+
+ +

Extra Mode

+ +These formatting features are only available when Extra Mode is enabled. + +

Markdown In Html

+

Enable markdown in HTML block level elements:

+
<div markdown="1">
+Markdown **still** works.
+</div>
+
+ +

Fenced Code Blocks

+

Code blocks delimited by 3 or more tildas:

+
~~~
+This is a preformatted
+code block
+~~~
+
+ +

Header IDs

+

Set the id of headings with {#<id>} at end of heading line:

+
## My Heading {#myheading}
+
+ +

Tables

+ +
Fruit    |Color
+---------|----------
+Apples   |Red
+Pears	 |Green
+Bananas  |Yellow
+

Definition Lists

+
Term 1
+: Definition 1
+
+Term 2
+: Definition 2
+ +

Footnotes

+
Body text with a footnote [^1]
+
+[^1]: Footnote text here
+
+ +

Abbreviations

+
MDD <- will have title
+
+*[MDD]: MarkdownDeep
+
+

 

+ diff --git a/web/Scripts/mdd_modal_background.png b/web/Scripts/mdd_modal_background.png new file mode 100644 index 0000000000000000000000000000000000000000..9f8cc70b8a140519476419b6b926a08839931985 GIT binary patch literal 173 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Y)RhkE)4%c zaKYZ?lYt_f1s;*b3=G`DAk4@xYmNj^kiEpy*OmPiCzH58_=vB^HoIy1Tnmx>HI@Kw4UA0a3bSX&(RY z`+RuMdC#1gx$f)B%sF$%T<4BdQ<1~NroaXO08c?)Mgss)ApbD?^Jo9oCfvore;bOc zhMW{oJ4yBDpYhCGQBDSU`fn6;mnZ*Yu$<-fT>$_G^xs4QvU14(k(h1@%CeX%*hDyV z>(LaU5%yk%$Dw{3n2oC6XzGyj!R%1)7Jqr&?%&~5I*~ODGz&BdST|#xN)xL?|y%# z7PX%xz2i5hS&NTXgBM$2YaW1SfELOLU-?J zJJOA^*xNnl*)hMpU)`|48s3Iv^ zoU?0fd)v9caR3LXMnAo;^j~io17(P4&b^|ko@si!>O=uJpxgAxQ#P3DG$QE`gM9vI zr573sGH*51n9#gsVuHj>X%>zQ;;%y{zg6GA%-jhnS)k1#j~ z3Vo%3nuiWt451de*a>0!u?pb4D#qu{%T1*J7bGGAfQR;jd-^} z*Df8l^xS+Cyln|mb^V@_i8XMJNh?n@IPyj^;y6w*^XA1XFIRb*Q3#)HJJj5LEF}1# z{BhHa5{R}81AcquQ>y}R-hFlIB~F`=-C+M8$+|m{igj;o0v9Wyf>!-+O~2(rdS*9XSa|i--%Gmr z+=gZG3YilDejter~9yPGz1$UL#utV=s>MX-PVACvhPDo3i2b1@@J z#g?Ca$;F;2Npp=UuUQy5>raA%(dN>R3IsstaOAGNL z^SB7WC`eg4Z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I;M55n$)O!?}4!20Lj*oTyb zscN6e&vl%L>DTRqwF<-ftb4%X(Z2_CMlrQ6CrC(X0dPc&Dt&t39}Zc2|MD8eHE|4q z)xQp#ErboUUo{``ALUF;Mvosr+~TS)Y0K%MJlUNQz`#ZNi@~Frc>Y!>`=Oa~>THzW1Yx}-inU-zD_`bvd;Qo5Tkd}i#((Vs)5fh-eJ4E&H_7t`% zr5er-u0mOGM`K39H7=a(WlF0#LD-rcTicOiQ<>S@g%NSX-tEPK!iarQst5Z{B`E(J^u4%Jy3e9G z7MI|NsFSc2d}5~AS@`ji@%Knthc_oIm+2Y3n6vvl|Nhgi@c+tL(ep$1bgY*{yA57X zL7xTD#=VVPwx3Duoq=~fAd6N4MpQPWwfRB+E=h**W9o@cmAjg1{_w^s6_v;Mo-1jE zN~%4rm71EYT@ujwowoJdN2FS#;QnHXAb7FWYOk>qYkY zX~yte+7;0!xj-P~UV?8}@nQ{G5X|k5B6_aS35wr>QIP>ZzvDPRq=-FZRDSn1ZZ|Os$k@(Ek7v(0Q-` literal 0 HcmV?d00001 diff --git a/web/Views/Account/Circles.aspx b/web/Views/Account/Circles.aspx index eb76e0b6..984fda86 100644 --- a/web/Views/Account/Circles.aspx +++ b/web/Views/Account/Circles.aspx @@ -43,7 +43,7 @@ $("#tbc").stupidtable(); - + @@ -91,19 +91,24 @@ function(json) { $("#title").val( json.Title); $("#users").val( json.Members ) ; function editNewCircle() { if ($('#fncirc').hasClass('hidden')) $('#fncirc').removeClass('hidden') $('#lgdnvcirc').html("Creation d'un cercle"); + $('#btnnewcircle').val("Créer"); + $('#fncirc').removeClass("dirty"); } function selectCircle() { if ($('#fncirc').hasClass('hidden')) $('#fncirc').removeClass('hidden') var id = $(this).attr('cid'); $('#lgdnvcirc').html("Edition du cercle"); + $('#btnnewcircle').val("Modifier"); // get it from the server getCircle(id); + $('#fncirc').removeClass("dirty"); } function onmembersChange(newval) - { - } + {$('#fncirc').addClass("dirty");} + function onTitleChanged() + { $('#fncirc').addClass("dirty"); } function removeCircle() { message(false); @@ -137,7 +142,7 @@ function selectCircle() { function addCircle() { message(false); - var circle = { title: $("#title").val(), users: $("#users").val() } ; + var circle = { title: $("#title").val(), members: $("#users").val() } ; $("#title").text(''); $("#users").val(''); $.ajax({ @@ -149,8 +154,8 @@ function selectCircle() { $('').addClass('selected row') .appendTo('#tbcb'); - $('') .appendTo('#c_'+id); diff --git a/web/instdbws.sql b/web/instdbws.sql index 84385232..f9250137 100644 --- a/web/instdbws.sql +++ b/web/instdbws.sql @@ -658,7 +658,7 @@ CREATE TABLE circle owner character varying(255) NOT NULL, -- creator of this circle applicationname character varying(255) NOT NULL, -- Application name title character varying(512) NOT NULL, - public boolean, -- true when this circle is a public circle, from which the title would be available from an anonymous access to the owner's profile + public boolean default FALSE, -- true when this circle is a public circle, from which the title would be available from an anonymous access to the owner's profile CONSTRAINT circle_pkey PRIMARY KEY (_id), CONSTRAINT circle_owner_fkey FOREIGN KEY (owner, applicationname) REFERENCES users (username, applicationname) MATCH SIMPLE @@ -673,7 +673,6 @@ COMMENT ON COLUMN circle.owner IS 'creator of this circle'; COMMENT ON COLUMN circle.applicationname IS 'Application name'; COMMENT ON COLUMN circle.public IS 'true when this circle is a public circle, from which the title would be available from an anonymous access to the owner''s profile'; - -- Table: circle_members -- DROP TABLE circle_members; diff --git a/yavscModel/Circles/CircleProvider.cs b/yavscModel/Circles/CircleProvider.cs index b3ae6ff5..c68c7aff 100644 --- a/yavscModel/Circles/CircleProvider.cs +++ b/yavscModel/Circles/CircleProvider.cs @@ -44,23 +44,16 @@ namespace Yavsc.Model.Circles public abstract long Create(string owner, string title, string [] users); /// - /// Add the specified user. + /// Add the specified user to the specified circle. /// /// circle Identifier. /// User name. public abstract void Add(long id, string username); /// - /// Remove the specified user. + /// Delete the specified circle by its id. /// - /// circle Identifier. - /// User name. - public abstract void Remove(long id, string username); - - /// - /// Delete the specified id. - /// - /// Identifier. + /// Circle Identifier. public abstract void Delete(long id) ; /// @@ -70,17 +63,31 @@ namespace Yavsc.Model.Circles public abstract Circle Get(long id); /// - /// List this instance. + /// List circle's user. /// public abstract IEnumerable List(string user); /// - /// Covers the specified username. + /// True when the specified user is listed in one of + /// the specified circles /// - /// circle's owner. - /// Username in his circle. + /// circles to look at + /// Username to look for in the circles public abstract bool Matches(long [] circle_ids, string member); + /// + /// Removes the membership. + /// + /// Circle identifier. + /// Member. + public abstract void RemoveMembership(long circle_id, string member); + + /// + /// Removes the member from all current user circles. + /// + /// Member. + public abstract void RemoveMember(string member); + } } diff --git a/yavscModel/ListItem.cs b/yavscModel/ListItem.cs deleted file mode 100644 index 75612e3e..00000000 --- a/yavscModel/ListItem.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -// ListItem.cs -// -// Author: -// Paul Schneider -// -// 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 . -using System; - -namespace Yavsc.Model -{ - /// - /// List item. - /// - [Obsolete("Use MVC SelectItem")] - public class ListItem - { - /// - /// Gets or sets the value. - /// - /// The value. - public string Value { get; set; } - /// - /// Gets or sets the text. - /// - /// The text. - public string Text { get; set; } - /// - /// Gets or sets the icon. - /// - /// The icon. - public string Icon { get; set; } - } -} - diff --git a/yavscModel/YavscModel.csproj b/yavscModel/YavscModel.csproj index 9fdbfdb4..b0f87748 100644 --- a/yavscModel/YavscModel.csproj +++ b/yavscModel/YavscModel.csproj @@ -153,7 +153,6 @@ -
'+circle.title+'
'+ - circle.users+ + $('
'+circle.title+'
'+ + circle.members+ '