feat(forums): add forums admin list view side-overlay

This commit is contained in:
OldHawk
2017-07-03 18:27:07 +08:00
parent 0085271d71
commit a7eb5eef3f
4 changed files with 40 additions and 4 deletions

View File

@@ -5,18 +5,29 @@
.module('forums')
.controller('ForumsController', ForumsController);
ForumsController.$inject = ['$scope', '$translate', 'Authentication', 'MeanTorrentConfig', 'ForumsAdminService'];
ForumsController.$inject = ['$scope', '$translate', 'Authentication', 'MeanTorrentConfig', 'ForumsAdminService', 'SideOverlay'];
function ForumsController($scope, $translate, Authentication, MeanTorrentConfig, ForumsAdminService) {
function ForumsController($scope, $translate, Authentication, MeanTorrentConfig, ForumsAdminService, SideOverlay) {
var vm = this;
vm.forumsConfig = MeanTorrentConfig.meanTorrentConfig.forumsConfig;
vm.user = Authentication.user;
/**
* init
*/
vm.init = function () {
ForumsAdminService.query({}, function (items) {
vm.forums = items;
console.log(items);
});
};
/**
* openSideOverlay
* @param evt
*/
vm.openSideOverlay = function (evt) {
SideOverlay.open(evt, 'popupSlide');
};
}
}());

View File

@@ -0,0 +1,19 @@
@import (reference) "../../../core/client/less/mt-var.less";
.forum-side-overlay {
top: 50px !important;
@media (min-width: @screen-sm-min) {
width: 450px;
}
@media (max-width: @screen-xs-max) {
min-width: ~"calc(100% - 50px)";
}
}
.forum-popup {
background-color: #fdfdfd;
width: 100%;
height: ~"calc(100% - 150px)";
overflow: auto;
padding: 15px;
}

View File

@@ -1,7 +1,7 @@
<section class="container padding-top-10" ng-controller="ForumsController as vm" ng-init="vm.init();">
<div class="row margin-top-20">
<div class="col-md-10 col-md-offset-1">
<button class="btn btn-success">  {{ 'FORUMS.BTN_ADD_FORUM' | translate }}  </button>
<button class="btn btn-success" ng-click="vm.openSideOverlay($event)">  {{ 'FORUMS.BTN_ADD_FORUM' | translate }}  </button>
</div>
<div class="col-sm-10 col-sm-offset-1">
@@ -23,6 +23,7 @@
<tr ng-repeat="f in vm.forums | filter: { category: cat }">
<td scope="row">
<h4>{{f.name}}</h4>
<p>{{f.desc}}</p>
</td>
<td class="text-center">{{f.order}}</td>
@@ -34,5 +35,10 @@
</div>
</div>
</div>
<div id="popupSlide" side-overlay="right" side-class="forum-side-overlay" side-modal side-close-on-esc side-close-on-outside-click>
<div class="forum-popup">
</div>
</div>
</section>

View File

@@ -90,7 +90,7 @@
width: 450px;
}
@media (max-width: @screen-xs-max) {
min-width: ~"calc(100% - 150px)";
min-width: ~"calc(100% - 50px)";
}
}