Show lists

FossilOrigin-Name: 10cb2fd50d3c08e5bf30109b35df1d3af4948f86d9b2099f716da30949f5b734
This commit is contained in:
nekobit 2022-08-15 04:23:19 +00:00
parent 71b636d77f
commit 9923154112
5 changed files with 40 additions and 10 deletions

6
dist/treebird.css vendored
View file

@ -828,12 +828,6 @@ input[type=checkbox].hidden:not(:checked) + .reply-form
display: inline;
}
/* .notification-text-group-with-icon, */
/* .notification-text-group */
/* { */
/* vertical-align: middle; */
/* } */
.status.status-notification:not(.status-notification-mention) .status-content
{
color: #808080;

View file

@ -11,7 +11,9 @@ sub content_lists
{
my ($ssn, $data, $lists) = @_;
my %vars = ();
my %vars = (
lists => $lists
);
to_template(\%vars, \$data->{'content_lists.tt'});
}

View file

@ -119,7 +119,7 @@ void list_edit(PATH_ARGS)
mastodont_storage_cleanup(&storage);
}
HV* perlify_list(struct mstdnt_list* list)
HV* perlify_list(const struct mstdnt_list* list)
{
if (!list) return NULL;

View file

@ -28,7 +28,7 @@ void content_lists(PATH_ARGS);
void list_edit(PATH_ARGS);
/** Converts list to perl hash */
HV* perlify_list(struct mstdnt_list* list);
HV* perlify_list(const struct mstdnt_list* list);
/** Converts lists to perl array */
AV* perlify_lists(const struct mstdnt_list* lists, size_t len);

View file

@ -1 +1,35 @@
<h1>Lists</h1>
<div class="lists-view">
<h1 class="lists-view-header">Lists</h1>
<div class="lists-view-container">
<ul class="large-list center">
[% FOREACH list IN lists %]
<li>
<a href="/lists/for/[% list.id %]" class="btn split list-item">[% list.title %]</a><label for="list-edit-[% list.id %]"><span class="btn edit-list-btn">Edit</span></label>
<input type="checkbox" id="list-edit-[% list.id %]" class="list-radio-show hidden" name="list-radio" class="hidden">
<div class="list-edit-content">
<form action="/lists/edit/[% list.id %]" method="post">
<input type="text" name="title">
<select name="replies_policy">
<option value="0">None</option>
<option value="1">List</option>
<option value="2">Followed</option>
</select>
</form>
</div>
</li>
[% END %]
</ul>
<ul class="large-list center create-list">
<form action="/lists" method="post">
<li>
<input type="text" name="title" class="create-list-form"><input type="submit" value="Create list" class="create-list-btn btn">
</li>
</form>
</ul>
</div>
</div>