diff --git a/.gitignore b/.gitignore index f3abf1c..c235a13 100755 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # Public assets # ################# -public/robots.txt public/.well-known assets/js/modules/npm diff --git a/endpoints/search/GET.php b/endpoints/search/GET.php index 16b12cd..b89e952 100644 --- a/endpoints/search/GET.php +++ b/endpoints/search/GET.php @@ -29,7 +29,7 @@ (new Rules(SearchTable::ID->value)) ->type(Type::STRING) - ->min(10) + ->min(1) ->max(10) ->default(null), diff --git a/endpoints/work/permalinks/GET.php b/endpoints/work/permalinks/GET.php deleted file mode 100644 index 853671d..0000000 --- a/endpoints/work/permalinks/GET.php +++ /dev/null @@ -1,48 +0,0 @@ -ruleset = new Ruleset(strict: true); - - $this->ruleset->GET([ - (new Rules(PermalinksTable::ID->value)) - ->type(Type::STRING) - ->min(1) - ->max(parent::SIZE_VARCHAR), - - (new Rules(PermalinksTable::REF_WORK_ID->value)) - ->type(Type::STRING) - ->min(1) - ->max(parent::SIZE_VARCHAR) - ]); - - $this->ruleset->validate_or_exit(); - - parent::__construct(); - } - - public function main(): Response { - $response = $this->db->for(PermalinksTable::NAME) - ->where($_GET) - ->select([ - PermalinksTable::ID->value, - PermalinksTable::REF_WORK_ID->value, - PermalinksTable::DATE_CREATED->value - ]); - - return $response->num_rows > 0 - ? new Response($response->fetch_all(MYSQLI_ASSOC)) - : new Response([], 404); - } - } \ No newline at end of file diff --git a/endpoints/work/permalinks/POST.php b/endpoints/work/permalinks/POST.php deleted file mode 100644 index d20575f..0000000 --- a/endpoints/work/permalinks/POST.php +++ /dev/null @@ -1,61 +0,0 @@ -ruleset = new Ruleset(strict: true); - - $this->ruleset->POST([ - (new Rules(PermalinksTable::ID->value)) - ->required() - ->type(Type::STRING) - ->min(1) - ->max(parent::SIZE_VARCHAR), - - (new Rules(PermalinksTable::REF_WORK_ID->value)) - ->required() - ->type(Type::STRING) - ->min(1) - ->max(parent::SIZE_VARCHAR), - - (new Rules(PermalinksTable::DATE_CREATED->value)) - ->type(Type::NUMBER) - ->min(1) - ->max(parent::SIZE_UINT8) - ->default(time()) - ]); - - $this->ruleset->validate_or_exit(); - - parent::__construct(); - } - - private static function get_entity(): Response { - return (new Call(Endpoints::WORK->value))->params([ - WorkTable::ID->value => $_POST[TagsTable::REF_WORK_ID->value] - ])->get(); - } - - public function main(): Response { - // Bail out if work entity could not be fetched - $entity = self::get_entity(); - if (!$entity->ok) { - return $entity; - } - - return $this->db->for(PermalinksTable::NAME)->insert($_POST) === true - ? new Response($_POST[PermalinksTable::ID->value], 201) - : new Response("Failed to add permalink to work entity", 500); - } - } \ No newline at end of file diff --git a/public/assets/css/pages/work/timeline.css b/public/assets/css/pages/work/timeline.css index 9556582..3df1e78 100644 --- a/public/assets/css/pages/work/timeline.css +++ b/public/assets/css/pages/work/timeline.css @@ -121,7 +121,10 @@ section.timeline .items .item img { } section.timeline .items .item .actions { + display: flex; + align-items: baseline; margin-top: 7px; + gap: var(--padding); } /* # Size queries */ @@ -166,6 +169,10 @@ section.timeline .items .item .actions { border-top-color: rgba(var(--primer-color-accent), .2); } + section.timeline .items .item .actions { + flex-direction: column; + } + section.timeline .year:first-of-type .month:first-of-type .day:first-of-type .items .item:first-of-type { margin-top: var(--padding); } diff --git a/public/assets/js/modules/npm/Elevent.mjs b/public/assets/js/modules/npm/Elevent.mjs deleted file mode 120000 index 899f42b..0000000 --- a/public/assets/js/modules/npm/Elevent.mjs +++ /dev/null @@ -1 +0,0 @@ -../../../../../node_modules/elevent/src/Elevent.mjs \ No newline at end of file diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..6f27bb6 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: \ No newline at end of file