Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Commit

Permalink
feat(Category): Add Image and class_name support
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip committed Aug 1, 2019
1 parent d411770 commit 6f4f318
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
- **redis_key:** Fix array value cause parser error

### Perf
- **Site:** Move apps/{libraries->components}/Site
- **Site:** try to cache re-hit
- **Tracker:** Use brpoplpush to get announce data from redis
- **captcha:** simple captcha input
Expand Down
9 changes: 8 additions & 1 deletion apps/views/torrents/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@
<tbody>
<?php foreach ($torrents as $torrent): ?>
<tr data-tid="<?= $torrent->getId() ?>">
<td class="text-center" style="margin: 0;padding: 0"><?= ($torrent->getCategory())['name'] ?></td>
<td class="text-center" style="margin: 0;padding: 0">
<?php $cat = $torrent->getCategory(); ?>
<?php if ($cat['image']): // Show Category's Image with classname ?>
<img src="<?= $cat['image'] ?>" class="category <?= $cat['class_name'] ?>" alt="<?= $cat['name'] ?>">
<?php else: // Show Category's Name if image not set ?>
<?= $cat['name'] ?>
<?php endif; ?>
</td>
<td>
<div>
<div class="name-left">
Expand Down

0 comments on commit 6f4f318

Please sign in to comment.