mirror of
https://onedev.site.tesses.net/tytd2025
synced 2026-02-09 01:55:46 +00:00
Add some api docs
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
func Components.PersonalListDescription(tytd,name,editing)
|
||||
{
|
||||
var description = tytd.GetPersonalListDescription(name);
|
||||
var first=true;
|
||||
var description_with_br = "";
|
||||
each(var txt : description.Split("\n"))
|
||||
{
|
||||
if(!first)
|
||||
{
|
||||
description_with_br += <br>;
|
||||
}
|
||||
description_with_br += Net.Http.HtmlEncode(txt);
|
||||
first=false;
|
||||
}
|
||||
<return>
|
||||
<if(editing)>
|
||||
<true>
|
||||
<form hx-post={$"./edit-personal-description?name={Net.Http.UrlEncode(name)}"} hx-swap="outerHTML">
|
||||
<div class="row">
|
||||
<div class="max">
|
||||
<div class="field textarea label border">
|
||||
<textarea name="description">{description}</textarea>
|
||||
<label>Description</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="min">
|
||||
<button><i>save</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</true>
|
||||
<false>
|
||||
<div class="row" id="description">
|
||||
<div class="max">
|
||||
<p><raw(description_with_br)></p>
|
||||
</div>
|
||||
<div class="min">
|
||||
<button hx-get={$"./edit-personal-description?name={Net.Http.UrlEncode(name)}"} hx-target="#description" hx-swap="outerHTML"><i>edit</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</false>
|
||||
</if>
|
||||
</return>
|
||||
}
|
||||
Reference in New Issue
Block a user