Guest User

Untitled

a guest
Nov 15th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.93 KB | None | 0 0
  1. <?php
  2.  
  3. /* @var $this \yii\web\View */
  4. /* @var $keyword string */
  5. /* @var $spaces humhub\modules\space\models\Space[] */
  6. /* @var $pagination yii\data\Pagination */
  7.  
  8. use humhub\libs\Helpers;
  9. use humhub\libs\Html;
  10. use humhub\modules\directory\widgets\SpaceTagList;
  11. use humhub\modules\space\widgets\MembershipButton;
  12. use humhub\modules\space\widgets\FollowButton;
  13. use humhub\modules\space\widgets\Image;
  14. use humhub\widgets\LinkPager;
  15. use yii\helpers\Url;
  16. ?>
  17. <div class="panel panel-default">
  18.  
  19. <div class="panel-heading">
  20. <?= Yii::t('DirectoryModule.base', '<strong>Space</strong> directory'); ?>
  21. </div>
  22.  
  23. <div class="panel-body">
  24. <?= Html::beginForm(Url::to(['/directory/directory/spaces']), 'get', ['class' => 'form-search']); ?>
  25. <div class="row">
  26. <div class="col-md-3"></div>
  27. <div class="col-md-6">
  28. <div class="form-group form-group-search">
  29. <?= Html::textInput('keyword', $keyword, ['class' => 'form-control form-search', 'placeholder' => Yii::t('DirectoryModule.base', 'search for spaces')]); ?>
  30. <?= Html::submitButton(Yii::t('DirectoryModule.base', 'Search'), ['class' => 'btn btn-default btn-sm form-button-search']); ?>
  31. </div>
  32. </div>
  33. <div class="col-md-3"></div>
  34. </div>
  35. <?= Html::endForm(); ?>
  36.  
  37. <?php if (count($spaces) == 0): ?>
  38. <p><?= Yii::t('DirectoryModule.base', 'No spaces found!'); ?></p>
  39. <?php endif; ?>
  40. </div>
  41.  
  42. <hr>
  43. <ul class="media-list">
  44. <?php foreach ($spaces as $space) : ?>
  45. <li>
  46. <div class="media">
  47. <div class="pull-right">
  48. <?=
  49. FollowButton::widget([
  50. 'space' => $space,
  51. 'followOptions' => ['class' => 'btn btn-primary btn-sm'],
  52. 'unfollowOptions' => ['class' => 'btn btn-info btn-sm']
  53. ]);
  54. ?>
  55. </div>
  56.  
  57. <div class="media">
  58. <div class="pull-right">
  59. <?=
  60. MembershipButton::widget([
  61. 'space' => $space,
  62. ]);
  63. ?>
  64. </div>
  65.  
  66. <?= Image::widget([
  67. 'space' => $space, 'width' => 50,
  68. 'htmlOptions' => [
  69. 'class' => 'media-object',
  70. 'data-contentcontainer-id' => $space->contentcontainer_id
  71. ],
  72. 'linkOptions' => ['class' => 'pull-left'],
  73. 'link' => true,
  74. ]); ?>
  75.  
  76. <?php if ($space->isMember()): ?>
  77. <i class="fa fa-user space-member-sign tt" data-toggle="tooltip" data-placement="top" title=""
  78. data-original-title="<?= Yii::t('DirectoryModule.base', 'You are a member of this space'); ?>"></i>
  79. <?php endif; ?>
  80.  
  81. <div class="media-body">
  82. <h4 class="media-heading">
  83. <?= Html::containerLink($space); ?>
  84. <?php if ($space->isArchived()) : ?>
  85. <span
  86. class="label label-warning"><?= Yii::t('ContentModule.widgets_views_label', 'Archived'); ?></span>
  87. <?php endif; ?>
  88. </h4>
  89.  
  90. <h5><?= Html::encode(Helpers::truncateText($space->description, 100)); ?></h5>
  91. <?= SpaceTagList::widget(['space' => $space]); ?>
  92. </div>
  93. </div>
  94. </li>
  95. <?php endforeach; ?>
  96. </ul>
  97. </div>
  98.  
  99. <div class="pagination-container">
  100. <?= LinkPager::widget(['pagination' => $pagination]); ?>
  101. </div>
Add Comment
Please, Sign In to add comment