Permalink
Browse files

Make assets page more responsive, fix slight indentation issue

Should fix #69.
  • Loading branch information...
bojidar-bg committed Nov 6, 2017
1 parent e7a4bc3 commit 9cd0e06a6365ab4ed487ad2321c74a8a6b119558
Showing with 49 additions and 31 deletions.
  1. +16 −0 style/base.css
  2. +26 −26 templates/asset_edits.phtml
  3. +7 −5 templates/assets.phtml
View
@@ -27,7 +27,23 @@
content: ' *';
color: #d9534f;
}
.media-object {
overflow: hidden;
text-overflow: ellipsis;
}
.nowrap {
white-space: nowrap;
display: inline-block;
}
.label {
line-height: 1.8;
}
@media (min-width: 768px) {
.asset-item {
height: 95px;
}
}
@@ -46,35 +46,35 @@
</form>
<?php foreach($data['result'] as $i => $asset_edit) { ?>
<div class="media">
<div class="media-left">
<a href="<?php echo raw($basepath) . '/asset/edit/' . url($asset_edit['edit_id']) ?>">
<img class="media-object" src="<?php echo esc($asset_edit['icon_url']) ?>" alt="<?php echo esc($asset_edit['title']) ?>'s icon" width=80 height=80>
</a>
</div>
<div class="media-body">
<h4 class="media-heading">
<a href="<?php echo raw($basepath) . '/asset/edit/' . url($asset_edit['edit_id']) ?>"><?php echo ($asset_edit['asset_id'] == -1 ? 'Create ' : 'Edit ') . '"' . esc($asset_edit['title']) . '"' ?></a>
<br>
<span class="label label-<?php echo raw([
'new' => 'info',
'in_review' => 'primary',
'rejected' => 'danger',
'accepted' => 'success'
][$asset_edit['status']]) ?>"><?php echo raw(ucfirst(str_replace('_', ' ', $asset_edit['status']))) ?></span>
<span class="label label-default"><?php echo raw(ucfirst(str_replace('_', ' ', $asset_edit['godot_version']))) ?></span>
<div class="media">
<div class="media-left">
<a href="<?php echo raw($basepath) . '/asset/edit/' . url($asset_edit['edit_id']) ?>">
<img class="media-object" src="<?php echo esc($asset_edit['icon_url']) ?>" alt="<?php echo esc($asset_edit['title']) ?>'s icon" width=80 height=80>
</a>
</div>
<div class="media-body">
<h4 class="media-heading">
<a href="<?php echo raw($basepath) . '/asset/edit/' . url($asset_edit['edit_id']) ?>"><?php echo ($asset_edit['asset_id'] == -1 ? 'Create ' : 'Edit ') . '"' . esc($asset_edit['title']) . '"' ?></a>
<br>
<span class="label label-<?php echo raw([
'new' => 'info',
'in_review' => 'primary',
'rejected' => 'danger',
'accepted' => 'success'
][$asset_edit['status']]) ?>"><?php echo raw(ucfirst(str_replace('_', ' ', $asset_edit['status']))) ?></span>
<span class="label label-default"><?php echo raw(ucfirst(str_replace('_', ' ', $asset_edit['godot_version']))) ?></span>
<span class="label label-<?php echo raw([
'official' => 'danger',
'community' => 'info',
'testing' => 'success',
][$asset_edit['support_level']]) ?>"><?php echo raw(ucfirst($asset_edit['support_level'])) ?></span>
</h4>
<span class="label label-<?php echo raw([
'official' => 'danger',
'community' => 'info',
'testing' => 'success',
][$asset_edit['support_level']]) ?>"><?php echo raw(ucfirst($asset_edit['support_level'])) ?></span>
</h4>
<p>Submitted by user <?php echo esc($asset_edit['author']) ?></p>
<?php if($asset_edit['status'] == 'rejected' && $asset_edit['reason']) echo 'Rejection reason: ' . esc($asset_edit['reason']) ?>
</div>
<p>Submitted by user <?php echo esc($asset_edit['author']) ?></p>
<?php if($asset_edit['status'] == 'rejected' && $asset_edit['reason']) echo 'Rejection reason: ' . esc($asset_edit['reason']) ?>
</div>
</div>
<?php } ?>
<?php include("_pagination.phtml") ?>
<?php include("_footer.phtml") ?>
View
@@ -76,7 +76,7 @@
<br/>
<div class="row">
<?php foreach($data['result'] as $i => $asset) { ?>
<div class="col-md-6" style="height:90px;">
<div class="col-md-6 asset-item">
<div class="media">
<div class="media-left">
<a href="<?php echo raw($basepath) . '/asset/' . url($asset['asset_id']) ?>" class="img-thumbnail">
@@ -87,9 +87,11 @@
<h4 class="media-heading">
<a href="<?php echo raw($basepath) . '/asset/' . url($asset['asset_id']) ?>"><?php echo esc($asset['title']) ?></a>
<small><?php echo esc($asset['version_string']) ?></small>
<?php for ($star=1; $star <= 5; $star++) { ?>
<i class="glyphicon glyphicon-star<?php if($asset['rating'] < $star) echo '-empty'; ?>"></i>
<?php } ?>
<span class="nowrap pull-right">
<?php for ($star=1; $star <= 5; $star++) { ?>
<i class="glyphicon glyphicon-star<?php if($asset['rating'] < $star) echo '-empty'; ?>"></i>
<?php } ?>
</span>
<br>
<span class="label label-primary"><?php echo esc($asset['category']) ?></span>
<span class="label label-danger"><?php echo esc(ucfirst(str_replace('_', ' ', $asset['godot_version']))) ?></span>
@@ -105,7 +107,7 @@
<a href="?<?php echo esc(http_build_query([
'filter' => $asset['cost'] // isset($params['filter']) ? $params['filter'] . ' ' . $asset['cost'] : $asset['cost']
] + $params)) ?>" title="Search assets with filter '<?php echo esc($asset['cost']) ?>'"><?php echo esc($asset['cost']) ?></a>;
<?php echo esc(explode(" ", $asset['modify_date'])[0]) ?>
<span class="nowrap"><?php echo esc(explode(" ", $asset['modify_date'])[0]) ?></span>
</p>
</div>
</div>

0 comments on commit 9cd0e06

Please sign in to comment.