From 233c2bb13bfa4048eb618d1958252effb5ac9319 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Thu, 6 Jul 2017 18:03:35 +0800 Subject: [PATCH] feat(forums): init forum post new topic page view & client controller --- .../forums-post.client.controller.js | 36 +++++++++++++++++++ .../forums/client/views/post.client.view.html | 36 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 modules/forums/client/controllers/forums-post.client.controller.js create mode 100644 modules/forums/client/views/post.client.view.html diff --git a/modules/forums/client/controllers/forums-post.client.controller.js b/modules/forums/client/controllers/forums-post.client.controller.js new file mode 100644 index 00000000..c7669ba8 --- /dev/null +++ b/modules/forums/client/controllers/forums-post.client.controller.js @@ -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} + ]; + }); + + }; + } +}()); diff --git a/modules/forums/client/views/post.client.view.html b/modules/forums/client/views/post.client.view.html new file mode 100644 index 00000000..9875aa8c --- /dev/null +++ b/modules/forums/client/views/post.client.view.html @@ -0,0 +1,36 @@ +
+
+
+
+ +
+
+ +
+
+
+ + +
\ No newline at end of file