index.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. use yii\helpers\Url;
  3. \common\modules\theme\backend\assets\ThemeAsset::register($this);
  4. /* @var $theme \frontend\themes\Theme */
  5. $this->title = '主题';
  6. $this->params['breadcrumbs'][] = $this->title;
  7. ?>
  8. <?php $this->beginBlock('content-header'); ?>
  9. <h1>
  10. <?= $this->title?>
  11. <a class="btn btn-success " href="<?= Url::to(['upload']) ?>">上传新主题</a>
  12. </h1>
  13. <?php $this->endBlock(); ?>
  14. <?php foreach ($dataProvider->getModels() as $theme):?>
  15. <div class="col-md-3">
  16. <div class="theme <?= $theme->isActive()?"active":"";?>">
  17. <?php $screenshot = $theme->getScreenshot();if(!empty($screenshot)):?>
  18. <div class="theme-screenshot">
  19. <a href="<?= Url::to(["view","id"=>$theme->getPackage()])?>"> <img
  20. src="<?= $screenshot ?>" alt="" /> <span
  21. class="more-details">主题详情</span>
  22. </a>
  23. </div>
  24. <?php else :?>
  25. <div class="theme-screenshot blank">
  26. <a href="<?= Url::to(["view","id"=>$theme->getPackage()])?>"> <span
  27. class="more-details">主题详情</span>
  28. </a>
  29. </div>
  30. <?php endif;?>
  31. <h3 class="theme-name">
  32. <span><?= $theme->isActive() ? "默认:" : "";?></span><?= $theme->getName()?>
  33. </h3>
  34. <div class="theme-actions">
  35. <?php if( $theme->isActive() == true):?>
  36. <a class="btn bg-maroon btn-flat btn-sm"
  37. href="<?= Url::to(["custom","id"=>$theme->getPackage()])?>"> 自定义 </a>
  38. <?php else:?>
  39. <a class="btn bg-purple btn-flat btn-sm"
  40. href="<?= Url::to(["open","id" => $theme->getPackage(), ['data-method' => 'post']])?>">启用</a>&nbsp;&nbsp;&nbsp;&nbsp;
  41. <a class="btn bg-maroon btn-flat btn-sm"
  42. href="<?= Url::to(["demo","id"=>$theme->getPackage()])?>"
  43. target="_blank"> 预览 </a>
  44. <?php endif;?>
  45. </div>
  46. </div>
  47. </div>
  48. <?php endforeach;?>