Merge branch 'master' of git://factorcode.org/git/factor
commit
bab0e23a30
|
@ -14,10 +14,11 @@
|
||||||
<tr><th class="field-label">Date: </th><td><t:label t:name="date" /></td></tr>
|
<tr><th class="field-label">Date: </th><td><t:label t:name="date" /></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<pre class="description"><t:code t:name="contents" t:mode="mode" /></pre>
|
<t:a t:href="$pastebin/paste.txt" t:query="id">Plain Text</t:a> |
|
||||||
|
|
||||||
<t:button t:action="$pastebin/delete-paste" t:for="id" class="link-button link">Delete Paste</t:button>
|
<t:button t:action="$pastebin/delete-paste" t:for="id" class="link-button link">Delete Paste</t:button>
|
||||||
|
|
||||||
|
<pre class="description"><t:code t:name="contents" t:mode="mode" /></pre>
|
||||||
|
|
||||||
<t:bind-each t:name="annotations">
|
<t:bind-each t:name="annotations">
|
||||||
|
|
||||||
<h2><a name="@id">Annotation: <t:label t:name="summary" /></a></h2>
|
<h2><a name="@id">Annotation: <t:label t:name="summary" /></a></h2>
|
||||||
|
@ -28,10 +29,11 @@
|
||||||
<tr><th class="field-label">Date: </th><td><t:label t:name="date" /></td></tr>
|
<tr><th class="field-label">Date: </th><td><t:label t:name="date" /></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<pre class="description"><t:code t:name="contents" t:mode="mode"/></pre>
|
<t:a t:href="$pastebin/annotation.txt" t:query="id">Plain Text</t:a> |
|
||||||
|
|
||||||
<t:button t:action="$pastebin/delete-annotation" t:for="id" class="link-button link">Delete Annotation</t:button>
|
<t:button t:action="$pastebin/delete-annotation" t:for="id" class="link-button link">Delete Annotation</t:button>
|
||||||
|
|
||||||
|
<pre class="description"><t:code t:name="contents" t:mode="mode"/></pre>
|
||||||
|
|
||||||
</t:bind-each>
|
</t:bind-each>
|
||||||
|
|
||||||
<t:bind t:name="new-annotation">
|
<t:bind t:name="new-annotation">
|
||||||
|
|
|
@ -10,6 +10,7 @@ html.templates.chloe
|
||||||
http.server
|
http.server
|
||||||
http.server.dispatchers
|
http.server.dispatchers
|
||||||
http.server.redirection
|
http.server.redirection
|
||||||
|
http.server.responses
|
||||||
furnace
|
furnace
|
||||||
furnace.actions
|
furnace.actions
|
||||||
furnace.redirection
|
furnace.redirection
|
||||||
|
@ -64,16 +65,19 @@ TUPLE: paste < entity annotations ;
|
||||||
|
|
||||||
TUPLE: annotation < entity parent ;
|
TUPLE: annotation < entity parent ;
|
||||||
|
|
||||||
annotation "ANNOTATIONS"
|
\ annotation "ANNOTATIONS"
|
||||||
{
|
{
|
||||||
{ "parent" "PARENT" INTEGER +not-null+ }
|
{ "parent" "PARENT" INTEGER +not-null+ }
|
||||||
} define-persistent
|
} define-persistent
|
||||||
|
|
||||||
: <annotation> ( parent id -- annotation )
|
: <annotation> ( parent id -- annotation )
|
||||||
annotation new
|
\ annotation new
|
||||||
swap >>id
|
swap >>id
|
||||||
swap >>parent ;
|
swap >>parent ;
|
||||||
|
|
||||||
|
: annotation ( id -- annotation )
|
||||||
|
[ f ] dip <annotation> select-tuple ;
|
||||||
|
|
||||||
: paste ( id -- paste )
|
: paste ( id -- paste )
|
||||||
[ <paste> select-tuple ]
|
[ <paste> select-tuple ]
|
||||||
[ f <annotation> select-tuples ]
|
[ f <annotation> select-tuples ]
|
||||||
|
@ -134,6 +138,11 @@ M: annotation entity-url
|
||||||
|
|
||||||
{ pastebin "paste" } >>template ;
|
{ pastebin "paste" } >>template ;
|
||||||
|
|
||||||
|
: <raw-paste-action> ( -- action )
|
||||||
|
<action>
|
||||||
|
[ validate-integer-id "id" value paste from-object ] >>init
|
||||||
|
[ "contents" value "text/plain" <content> ] >>display ;
|
||||||
|
|
||||||
: <paste-feed-action> ( -- action )
|
: <paste-feed-action> ( -- action )
|
||||||
<feed-action>
|
<feed-action>
|
||||||
[ validate-integer-id ] >>init
|
[ validate-integer-id ] >>init
|
||||||
|
@ -213,13 +222,18 @@ M: annotation entity-url
|
||||||
tri
|
tri
|
||||||
] >>submit ;
|
] >>submit ;
|
||||||
|
|
||||||
|
: <raw-annotation-action> ( -- action )
|
||||||
|
<action>
|
||||||
|
[ validate-integer-id "id" value annotation from-object ] >>init
|
||||||
|
[ "contents" value "text/plain" <content> ] >>display ;
|
||||||
|
|
||||||
: <delete-annotation-action> ( -- action )
|
: <delete-annotation-action> ( -- action )
|
||||||
<action>
|
<action>
|
||||||
|
|
||||||
[ { { "id" [ v-number ] } } validate-params ] >>validate
|
[ { { "id" [ v-number ] } } validate-params ] >>validate
|
||||||
|
|
||||||
[
|
[
|
||||||
f "id" value <annotation> select-tuple
|
f "id" value annotation
|
||||||
[ delete-tuples ]
|
[ delete-tuples ]
|
||||||
[ parent>> paste-url <redirect> ]
|
[ parent>> paste-url <redirect> ]
|
||||||
bi
|
bi
|
||||||
|
@ -234,10 +248,12 @@ M: annotation entity-url
|
||||||
<pastebin-action> "" add-responder
|
<pastebin-action> "" add-responder
|
||||||
<pastebin-feed-action> "list.atom" add-responder
|
<pastebin-feed-action> "list.atom" add-responder
|
||||||
<paste-action> "paste" add-responder
|
<paste-action> "paste" add-responder
|
||||||
|
<raw-paste-action> "paste.txt" add-responder
|
||||||
<paste-feed-action> "paste.atom" add-responder
|
<paste-feed-action> "paste.atom" add-responder
|
||||||
<new-paste-action> "new-paste" add-responder
|
<new-paste-action> "new-paste" add-responder
|
||||||
<delete-paste-action> "delete-paste" add-responder
|
<delete-paste-action> "delete-paste" add-responder
|
||||||
<new-annotation-action> "new-annotation" add-responder
|
<new-annotation-action> "new-annotation" add-responder
|
||||||
|
<raw-annotation-action> "annotation.txt" add-responder
|
||||||
<delete-annotation-action> "delete-annotation" add-responder
|
<delete-annotation-action> "delete-annotation" add-responder
|
||||||
<boilerplate>
|
<boilerplate>
|
||||||
{ pastebin "pastebin-common" } >>template ;
|
{ pastebin "pastebin-common" } >>template ;
|
||||||
|
|
Loading…
Reference in New Issue