background: rgba(0, 0, 0, .8);
border: 1px solid #CCC;
}
+
+section {
+ position: absolute;
+ top: 7ex;
+ right: 1em;
+}
+section > ul {
+ margin-top: 1ex;
+}
+section > ul strong, section form {
+ line-height: 2;
+}
</style>
<script>
$row = $db->select(word => '*', $find)->hash
or Abort("Word not found", 404);
}
+else {
+ $row = \%fields;
+}
my $title = $row->{id} ? "entry <small>#$row->{id}</small>" : 'new entry';
:>
<input type="submit" value="New" formaction="/writer?copy=cat" />
</p>
</form>
+
+<:
+$row->{id} or exit;
+:>
+<section>
+<h2>Hierarchy</h2>
+
+<:
+say '<ul>';
+my $parents = $db->select(word => '*', {id => $row->{cat}});
+while (my $ref = $parents->hash) {
+ printf '<li><a href="/writer/%d">%s</a></li>', $ref->{id}, Entity($ref->{form});
+}
+say "<li><strong>$row->{form}</strong></li>";
+my $children = $db->select(word => '*', {cat => $row->{id}});
+while (my $ref = $children->hash) {
+ printf '<li><a href="/writer/%d">%s</a></li>', $ref->{id}, Entity($ref->{form});
+}
+:>
+<li><form action="/writer">
+ <input type="hidden" name="cat" value="<:= $row->{id} :>" />
+ <input type="hidden" name="lang" value="<:= $row->{lang} :>" />
+ <input type="submit" value="Add" />
+</form></li>
+</ul>
+</section>