-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
632 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
|
||
/** | ||
* creator search page | ||
*/ | ||
|
||
$app = Gazelle\App::go(); | ||
|
||
$get = Gazelle\Http::get(); | ||
$manticore = new Gazelle\Manticore("creators"); | ||
|
||
/** search handling */ | ||
|
||
$searchResults = $manticore->search($get); | ||
$pagination = $manticore->paginate($searchResults); | ||
|
||
# build query string | ||
foreach ($get as $key => $value) { | ||
if (empty($value)) { | ||
unset($get[$key]); | ||
} | ||
} | ||
|
||
$queryString = "/creators" . http_build_query($get); | ||
#!d($queryString); | ||
|
||
/** info */ | ||
|
||
$app->debug["time"]->startMeasure("browse", "get creators"); | ||
|
||
$ids = array_column($searchResults, "id"); | ||
$ids = array_slice($ids, $pagination["offset"], $pagination["pageSize"]); | ||
|
||
$creators = []; | ||
foreach ($ids as $id) { | ||
$creators[] = new Gazelle\Creators($id); | ||
} | ||
|
||
$app->debug["time"]->stopMeasure("browse", "get creators"); | ||
|
||
/** twig template */ | ||
|
||
$app->twig->display("creators/browse.twig", [ | ||
"title" => "Browse creators", | ||
|
||
"css" => [], | ||
"js" => ["browse"], | ||
|
||
"manticore" => $manticore, | ||
"creators" => $creators, | ||
|
||
"pagination" => $pagination, | ||
"queryString" => $queryString, | ||
|
||
/** */ | ||
|
||
"categories" => $app->env->categories->pluck("title"), | ||
"officialTags" => Gazelle\Tags::getOfficialTags(), | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
|
||
/** | ||
* publications search page | ||
*/ | ||
|
||
$app = Gazelle\App::go(); | ||
|
||
$get = Gazelle\Http::get(); | ||
$manticore = new Gazelle\Manticore("publications"); | ||
|
||
/** search handling */ | ||
|
||
$searchResults = $manticore->search($get); | ||
$pagination = $manticore->paginate($searchResults); | ||
|
||
# build query string | ||
foreach ($get as $key => $value) { | ||
if (empty($value)) { | ||
unset($get[$key]); | ||
} | ||
} | ||
|
||
$queryString = "/publications" . http_build_query($get); | ||
#!d($queryString); | ||
|
||
/** info */ | ||
|
||
$app->debug["time"]->startMeasure("browse", "get publications"); | ||
|
||
$ids = array_column($searchResults, "id"); | ||
$ids = array_slice($ids, $pagination["offset"], $pagination["pageSize"]); | ||
|
||
$publications = []; | ||
foreach ($ids as $id) { | ||
$publications[] = new Gazelle\Publications($id); | ||
} | ||
|
||
$app->debug["time"]->stopMeasure("browse", "get publications"); | ||
|
||
/** twig template */ | ||
|
||
$app->twig->display("publications/browse.twig", [ | ||
"title" => "Browse publications", | ||
|
||
"css" => [], | ||
"js" => ["browse"], | ||
|
||
"manticore" => $manticore, | ||
"publications" => $publications, | ||
|
||
"pagination" => $pagination, | ||
"queryString" => $queryString, | ||
|
||
/** */ | ||
|
||
"categories" => $app->env->categories->pluck("title"), | ||
"officialTags" => Gazelle\Tags::getOfficialTags(), | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
|
||
/** | ||
* publication details page | ||
*/ | ||
|
||
$app = Gazelle\App::go(); | ||
|
||
try { | ||
$id ??= null; | ||
$publication = new Gazelle\Publications($id); | ||
|
||
if (!$publication->id) { | ||
throw new Exception("not found"); | ||
} | ||
} catch (Throwable $e) { | ||
$app->error(404); | ||
} | ||
|
||
# request variables | ||
$get = Gazelle\Http::request("get"); | ||
$post = Gazelle\Http::request("post"); | ||
|
||
# create a conversation if it doesn't exist | ||
$conversation = Gazelle\Conversations::createIfNotExists($publication->id, "publications"); | ||
|
||
# twig template | ||
$app->twig->display("publication/details.twig", [ | ||
"title" => $publication->attributes->name, | ||
"sidebar" => true, | ||
|
||
"css" => [], | ||
"js" => ["conversations"], | ||
|
||
"breadcrumbs" => [ | ||
"/publications" => "publications", | ||
"/publications/{$publication->id}" => $publication->attributes->name, | ||
], | ||
|
||
"publication" => $publication, | ||
|
||
"enableConversation" => true, | ||
"conversation" => $conversation, | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{% extends "base.twig" %} | ||
|
||
{% block content %} | ||
|
||
<h2>Browse creators</h2> | ||
|
||
{# include the main search form #} | ||
{{ include("creators/search.twig") }} | ||
|
||
{# no results message #} | ||
{% if pagination.resultCount == 0 %} | ||
<div class="alertbar warning halfwide"> | ||
<h3>No search results :(</h3> | ||
<p>Please ensure you didn't make too many typos or apply too many filters.</p> | ||
</div> | ||
{% else %} | ||
{{ include("manticore/pagination.twig") }} | ||
{{ include("tables/creators.twig", {"grouping": "grouping"}) }} | ||
{{ include("manticore/pagination.twig") }} | ||
{% endif %} | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{## | ||
# literature search form | ||
#} | ||
|
||
<form id="torrentSearch" name="torrentSearch" method="get"> | ||
{# simpleSearch #} | ||
<section id="simpleSearch"> | ||
<div id="searchFormHeader"> | ||
<h3>Simple search</h3> | ||
<a id="showComplexSearch" class="button button-orange u-pull-right">show complex search</a> | ||
</div> | ||
|
||
<table class="torrentSearch"> | ||
{{ include("manticore/simpleSearch.twig") }} | ||
</table> | ||
</section> | ||
|
||
|
||
{# complexSearch #} | ||
<section id="complexSearch"> | ||
<div id="searchFormHeader"> | ||
<h3>Complex search</h3> | ||
<a id="showSimpleSearch" class="button button-orange u-pull-right">show simple search</a> | ||
</div> | ||
|
||
<table class="torrentSearch"> | ||
{{ include("manticore/complexSearch.twig") }} | ||
{{ include("manticore/people.twig") }} | ||
{{ include("manticore/places.twig") }} | ||
{{ include("manticore/relationships.twig") }} | ||
</table> | ||
</section> | ||
|
||
|
||
{# sortOptions #} | ||
<section id="sortOptions"> | ||
<h3>Sorting options</h3> | ||
|
||
<table class="torrentSearch"> | ||
{{ include("manticore/organization.twig") }} | ||
{{ include("manticore/ordering.twig") }} | ||
{{ include("manticore/formControls.twig") }} | ||
</table> | ||
</section> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{% extends "base.twig" %} | ||
|
||
{% block content %} | ||
|
||
<h2>Browse publications</h2> | ||
|
||
{# include the main search form #} | ||
{{ include("publications/search.twig") }} | ||
|
||
{# no results message #} | ||
{% if pagination.resultCount == 0 %} | ||
<div class="alertbar warning halfwide"> | ||
<h3>No search results :(</h3> | ||
<p>Please ensure you didn't make too many typos or apply too many filters.</p> | ||
</div> | ||
{% else %} | ||
{{ include("manticore/pagination.twig") }} | ||
{{ include("tables/publications.twig", {"grouping": "grouping"}) }} | ||
{{ include("manticore/pagination.twig") }} | ||
{% endif %} | ||
|
||
{% endblock %} |
Oops, something went wrong.