mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-02-27 16:50:59 +01:00
feat(forums): init forum post new topic page view & client controller
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
angular
|
||||
.module('forums')
|
||||
.controller('ForumsPostController', ForumsPostController);
|
||||
|
||||
ForumsPostController.$inject = ['$scope', '$state', '$translate', 'Authentication', 'MeanTorrentConfig', 'ForumsService', 'SideOverlay', '$filter', 'NotifycationService',
|
||||
'marked', 'ModalConfirmService', '$stateParams', 'TopicsService'];
|
||||
|
||||
function ForumsPostController($scope, $state, $translate, Authentication, MeanTorrentConfig, ForumsService, SideOverlay, $filter, NotifycationService,
|
||||
marked, ModalConfirmService, $stateParams, TopicsService) {
|
||||
var vm = this;
|
||||
vm.forumsConfig = MeanTorrentConfig.meanTorrentConfig.forumsConfig;
|
||||
vm.user = Authentication.user;
|
||||
|
||||
/**
|
||||
* init
|
||||
*/
|
||||
vm.init = function () {
|
||||
// get forum info by state params
|
||||
ForumsService.get({
|
||||
forumId: $stateParams.forumId
|
||||
}, function (item) {
|
||||
console.log(item);
|
||||
vm.forum = item;
|
||||
|
||||
vm.forumPath = [
|
||||
{name: vm.forum.name, state: 'forums.view', params: {forumId: vm.forum._id}},
|
||||
{name: 'Post New Topic', state: undefined}
|
||||
];
|
||||
});
|
||||
|
||||
};
|
||||
}
|
||||
}());
|
||||
36
modules/forums/client/views/post.client.view.html
Normal file
36
modules/forums/client/views/post.client.view.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<section ng-controller="ForumsPostController as vm" ng-init="vm.init();">
|
||||
<div class="pagetop">
|
||||
<div class="container">
|
||||
<div class="col-sm-8">
|
||||
<div class="page-header">
|
||||
<h1>meanTorrent Forums</h1>
|
||||
|
||||
<p class="text-muted">Welcome to meanTorrent forums!</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="page-header padding-top-10">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" aria-label="search" placeholder="Search">
|
||||
|
||||
<div class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" aria-label="Search"><span class="glyphicon glyphicon-search"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!--<p class="text-muted margin-top-10">Welcome to meanTorrent forums!</p>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container forum-list">
|
||||
<div class="path margin-top-20">
|
||||
<ol class="breadcrumb">
|
||||
<li><a ui-sref="forums.list"><span class="small glyphicon glyphicon-home"></span> {{'FORUMS.HOME_INDEX' | translate}}</a></li>
|
||||
<li ng-repeat="p in vm.forumPath" ng-class="{'active': !g.state}"><a ui-sref="{{p.state}}( {{p.params}} )" ng-if="p.state!=undefined">{{p.name}}</a><span ng-if="p.state==undefined">{{p.name}}</span></li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user