feat(forums): init post new topic view

This commit is contained in:
OldHawk
2017-07-07 16:08:45 +08:00
parent 011e2212ed
commit 936c6d6170
7 changed files with 54 additions and 24 deletions

View File

@@ -619,6 +619,8 @@
//forum
FORUMS: {
FORUM_TITLE: 'meanTorrent Forums',
FORUM_SUB_TITLE: 'Welcome to meanTorrent forums!',
HOME_INDEX: 'Forums Home',
BTN_ADD_FORUM: 'Add New Forum',
BTN_EDIT_FORUM: 'Edit Forum',
@@ -626,6 +628,8 @@
BTN_EDIT: '  Edit   ',
LINK_EDIT: 'Edit',
BTN_DELETE: ' Delete  ',
BTN_SUBMIT: 'Submit New Topic',
BTN_POST_NEW: 'Post New Topic',
ADD_SUCCESSFULLY: 'Forum added successfully',
ADD_FAILED: 'Forum added failed',
EDIT_SUCCESSFULLY: 'Forum edited successfully',

View File

@@ -619,6 +619,8 @@
//forum
FORUMS: {
FORUM_TITLE: 'meanTorrent 官方论坛',
FORUM_SUB_TITLE: '欢迎您进入 meanTorrent 官方论坛,请文明发言,谢谢!',
HOME_INDEX: '论坛首页',
BTN_ADD_FORUM: '添加版块',
BTN_EDIT_FORUM: '编辑版块',
@@ -626,6 +628,8 @@
BTN_EDIT: '  编辑  ',
LINK_EDIT: '编辑',
BTN_DELETE: ' 删除  ',
BTN_SUBMIT: ' 提交新话题 ',
BTN_POST_NEW: ' 发起新话题 ',
ADD_SUCCESSFULLY: '版块添加成功',
ADD_FAILED: '版块添加失败',
EDIT_SUCCESSFULLY: '版块编辑成功',

View File

@@ -6,10 +6,10 @@
.controller('ForumsPostController', ForumsPostController);
ForumsPostController.$inject = ['$scope', '$state', '$translate', 'Authentication', 'MeanTorrentConfig', 'ForumsService', 'SideOverlay', '$filter', 'NotifycationService',
'marked', 'ModalConfirmService', '$stateParams', 'TopicsService'];
'marked', 'ModalConfirmService', '$stateParams', 'TopicsService', 'localStorageService'];
function ForumsPostController($scope, $state, $translate, Authentication, MeanTorrentConfig, ForumsService, SideOverlay, $filter, NotifycationService,
marked, ModalConfirmService, $stateParams, TopicsService) {
marked, ModalConfirmService, $stateParams, TopicsService, localStorageService) {
var vm = this;
vm.forumsConfig = MeanTorrentConfig.meanTorrentConfig.forumsConfig;
vm.user = Authentication.user;
@@ -22,7 +22,9 @@
autofocus:false,
savable:false,
iconlibrary: 'fa',
resize: 'vertical'
resize: 'vertical',
language: localStorageService.get('storage_user_lang'),
fullscreen: { enable: false}
});
// get forum info by state params

View File

@@ -140,4 +140,5 @@
}
.post-view {
margin-bottom: 100px;
}

View File

@@ -3,9 +3,9 @@
<div class="container">
<div class="col-sm-8">
<div class="page-header">
<h1>meanTorrent Forums</h1>
<h2 translate="FORUMS.FORUM_TITLE"></h2>
<p class="text-muted">Welcome to meanTorrent forums!</p>
<p class="text-muted" translate="FORUMS.FORUM_SUB_TITLE"></p>
</div>
</div>
<div class="col-sm-4">

View File

@@ -3,9 +3,9 @@
<div class="container">
<div class="col-sm-8">
<div class="page-header">
<h1>meanTorrent Forums</h1>
<h2 translate="FORUMS.FORUM_TITLE"></h2>
<p class="text-muted">Welcome to meanTorrent forums!</p>
<p class="text-muted" translate="FORUMS.FORUM_SUB_TITLE"></p>
</div>
</div>
<div class="col-sm-4">
@@ -28,18 +28,34 @@
<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>
<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>
<div class="container post-view">
<div class="row">
<div class="col-md-8">
<input class="form-control margin-bottom-10" name="title" type="text" placeholder="{{'FORUMS.FIELDS.TITLE' | translate}}"/>
<textarea id="postContent" name="content"></textarea>
<div class="post-view">
<div class="row">
<div class="col-md-8">
<input class="form-control margin-bottom-10" name="title" type="text" placeholder="{{'FORUMS.FIELDS.TITLE' | translate}}"/>
<textarea id="postContent" name="content"></textarea>
<div class="margin-top-5" style="display: table;">
<a class="message-extra" href="https://guides.github.com/features/mastering-markdown/" target="_blank"
data-ga-click="Markdown Toolbar, click, help">
<svg aria-hidden="true" height="16" version="1.1"
viewBox="0 0 16 16" width="16">
<path fill-rule="evenodd"
d="M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z"/>
</svg>
{{ 'MARKDOWN_LINK' | translate }}
</a>
</div>
<button class="btn btn-success pull-right">{{'FORUMS.BTN_SUBMIT' | translate}}</button>
</div>
</div>
</div>
</div>

View File

@@ -3,9 +3,9 @@
<div class="container">
<div class="col-sm-8">
<div class="page-header">
<h1>meanTorrent Forums</h1>
<h2 translate="FORUMS.FORUM_TITLE"></h2>
<p class="text-muted">Welcome to meanTorrent forums!</p>
<p class="text-muted" translate="FORUMS.FORUM_SUB_TITLE"></p>
</div>
</div>
<div class="col-sm-4">
@@ -28,7 +28,9 @@
<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>
<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>
@@ -43,7 +45,8 @@
</ul>
</div>
<div class="col-sm-12 col-md-3">
<a class="btn btn-success margin-top-10 margin-bottom-10 pull-right" ui-sref="forums.post({forumId: vm.forum._id})">Post New Topic</a>
<a class="btn btn-success margin-top-10 margin-bottom-10 pull-right"
ui-sref="forums.post({forumId: vm.forum._id})">{{'FORUMS.BTN_POST_NEW' | translate}}</a>
</div>
</div>
</div>
@@ -59,10 +62,10 @@
</tr>
</thead>
<tbody>
<td></td>
<td class="text-center xs-hide"></td>
<td class="text-center xs-hide"></td>
<td class="text-center xs-hide sm-hide"></td>
<td></td>
<td class="text-center xs-hide"></td>
<td class="text-center xs-hide"></td>
<td class="text-center xs-hide sm-hide"></td>
</tr>
</tbody>
</table>