Merge pull request #7811 from tobiasd/20191103-clickoncat

categories of postings linked
This commit is contained in:
Hypolite Petovan 2019-11-03 10:58:33 -05:00 committed by GitHub
commit 17061b22d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 6 deletions

View File

@ -42,10 +42,16 @@ final class Item
$folders = []; $folders = [];
$first = true; $first = true;
if (!empty($item['author-link'])) {
$url = $item['author-link'] . "?category=" . rawurlencode($savedFolderName);
} else {
$url = '#';
}
foreach (FileTag::fileToArray($item['file'] ?? '', 'category') as $savedFolderName) { foreach (FileTag::fileToArray($item['file'] ?? '', 'category') as $savedFolderName) {
$categories[] = [ $categories[] = [
'name' => $savedFolderName, 'name' => $savedFolderName,
'url' => "#", 'url' => $url,
'removeurl' => ((local_user() == $item['uid']) ? 'filerm/' . $item['id'] . '?f=&cat=' . rawurlencode($savedFolderName) : ""), 'removeurl' => ((local_user() == $item['uid']) ? 'filerm/' . $item['id'] . '?f=&cat=' . rawurlencode($savedFolderName) : ""),
'first' => $first, 'first' => $first,
'last' => false 'last' => false

View File

@ -64,7 +64,7 @@
{{/if}} {{/if}}
</div> </div>
{{if $item.has_cats}} {{if $item.has_cats}}
<div class="categorytags"><span>{{$item.txt_cats}} {{foreach $item.categories as $cat}}<span class="p-category">{{$cat.name}}</span>{{if $cat.removeurl}} <a href="{{$cat.removeurl}}" title="{{$remove}}">[{{$remove}}]</a>{{/if}} {{if $cat.last}}{{else}}, {{/if}}{{/foreach}} <div class="categorytags"><span>{{$item.txt_cats}} {{foreach $item.categories as $cat}}<span class="p-category"><a href="{{$cat.url}}">{{$cat.name}}</a></span>{{if $cat.removeurl}} <a href="{{$cat.removeurl}}" title="{{$remove}}">[{{$remove}}]</a>{{/if}} {{if $cat.last}}{{else}}, {{/if}}{{/foreach}}
</div> </div>
{{/if}} {{/if}}

View File

@ -313,7 +313,7 @@ as the value of $top_child_total (this is done at the end of this file)
{{/foreach}} {{/foreach}}
{{foreach $item.categories as $cat}} {{foreach $item.categories as $cat}}
<span class="category label btn-success sm p-category">{{$cat.name}}{{if $cat.removeurl}} (<a href="{{$cat.removeurl}}" title="{{$remove}}">x</a>) {{/if}} </span> <span class="category label btn-success sm p-category"><a href="{{$cat.url}}">{{$cat.name}}</a>{{if $cat.removeurl}} (<a href="{{$cat.removeurl}}" title="{{$remove}}">x</a>) {{/if}} </span>
{{/foreach}} {{/foreach}}
</div> </div>
{{if $item.edited}}<div class="itemedited text-muted">{{$item.edited['label']}} (<span title="{{$item.edited['date']}}">{{$item.edited['relative']}}</span>)</div>{{/if}} {{if $item.edited}}<div class="itemedited text-muted">{{$item.edited['label']}} (<span title="{{$item.edited['date']}}">{{$item.edited['relative']}}</span>)</div>{{/if}}

View File

@ -72,7 +72,7 @@
<span class="folder p-category">{{$cat.name}}</a>{{if $cat.removeurl}} (<a href="{{$cat.removeurl}}" title="{{$remove}}">x</a>) {{/if}} </span> <span class="folder p-category">{{$cat.name}}</a>{{if $cat.removeurl}} (<a href="{{$cat.removeurl}}" title="{{$remove}}">x</a>) {{/if}} </span>
{{/foreach}} {{/foreach}}
{{foreach $item.categories as $cat}} {{foreach $item.categories as $cat}}
<span class="category p-category">{{$cat.name}}</a>{{if $cat.removeurl}} (<a href="{{$cat.removeurl}}" title="{{$remove}}">x</a>) {{/if}} </span> <span class="category p-category"><a href="{{$cat.url}}">{{$cat.name}}</a>{{if $cat.removeurl}} (<a href="{{$cat.removeurl}}" title="{{$remove}}">x</a>) {{/if}} </span>
{{/foreach}} {{/foreach}}
{{/if}} {{/if}}
</div> </div>

View File

@ -72,7 +72,7 @@
</div> </div>
{{if $item.has_cats}} {{if $item.has_cats}}
<div class="categorytags"><span>{{$item.txt_cats}} {{foreach $item.categories as $cat}}<span class="p-category">{{$cat.name}}</span> <div class="categorytags"><span>{{$item.txt_cats}} {{foreach $item.categories as $cat}}<span class="p-category"><a href="{{$cat.url}}">{{$cat.name}}</a></span>
<a href="{{$cat.removeurl}}" title="{{$remove}}">[{{$remove}}]</a> <a href="{{$cat.removeurl}}" title="{{$remove}}">[{{$remove}}]</a>
{{if $cat.last}}{{else}}, {{/if}}{{/foreach}} {{if $cat.last}}{{else}}, {{/if}}{{/foreach}}
</div> </div>

View File

@ -89,7 +89,7 @@
<span class="folder p-category">{{$cat.name}}{{if $cat.removeurl}} (<a href="{{$cat.removeurl}}" title="{{$remove}}">x</a>) {{/if}} </span> <span class="folder p-category">{{$cat.name}}{{if $cat.removeurl}} (<a href="{{$cat.removeurl}}" title="{{$remove}}">x</a>) {{/if}} </span>
{{/foreach}} {{/foreach}}
{{foreach $item.categories as $cat}} {{foreach $item.categories as $cat}}
<span class="category p-category">{{$cat.name}}{{if $cat.removeurl}} (<a href="{{$cat.removeurl}}" title="{{$remove}}">x</a>) {{/if}} </span> <span class="category p-category"><a href="{{$cat.url}}">{{$cat.name}}</a>{{if $cat.removeurl}} (<a href="{{$cat.removeurl}}" title="{{$remove}}">x</a>) {{/if}} </span>
{{/foreach}} {{/foreach}}
</div> </div>
</div> </div>