From 4375a7b6783de6a5b39f463cb85cdc34b6aca7c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E7=91=9E=E6=9D=B0?= <490472721@qq.com> Date: Thu, 15 Jun 2017 13:32:45 +0800 Subject: [PATCH 1/3] fix topic create feature --- resources/views/topic/create.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/topic/create.blade.php b/resources/views/topic/create.blade.php index 93e6145..03ec301 100644 --- a/resources/views/topic/create.blade.php +++ b/resources/views/topic/create.blade.php @@ -28,8 +28,8 @@
- @include('common.userAvatarCard', ['user' => auth()->user()]) - @include('common.userInfoCard', ['user' => auth()->user()]) + @include('common.userAvatarCard', ['user' => Auth::user()->user()]) + @include('common.userInfoCard', ['user' => Auth::user()->user()])
From 8f058a2c5a243d8b81e048a3950c971615bcb6b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E7=91=9E=E6=9D=B0?= <490472721@qq.com> Date: Thu, 15 Jun 2017 13:41:36 +0800 Subject: [PATCH 2/3] fix paginator feature --- resources/views/topic/index.blade.php | 6 ++++-- resources/views/ucenter/timeline.blade.php | 5 ++++- resources/views/ucenter/topic.blade.php | 6 ++++-- resources/views/user/timeline.blade.php | 6 +++++- resources/views/user/topic.blade.php | 7 +++++-- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/resources/views/topic/index.blade.php b/resources/views/topic/index.blade.php index a1c3950..05f9b8e 100644 --- a/resources/views/topic/index.blade.php +++ b/resources/views/topic/index.blade.php @@ -66,12 +66,14 @@ @foreach ($topics as $topic) @include('common.topic') @endforeach - - {!! $topics->render() !!} @else @include('common.nodata') @endif +
+
+ @include('common.pagination', ['paginator' => $topics]) +
diff --git a/resources/views/ucenter/timeline.blade.php b/resources/views/ucenter/timeline.blade.php index acaaf16..9fede69 100644 --- a/resources/views/ucenter/timeline.blade.php +++ b/resources/views/ucenter/timeline.blade.php @@ -19,12 +19,15 @@ @foreach ($timelines as $timeline) @include('common.timeline') @endforeach - {!! $timelines->render() !!} @else @include('common.nodata') @endif +
+
+ @include('common.pagination', ['paginator' => $timelines]) +
diff --git a/resources/views/ucenter/topic.blade.php b/resources/views/ucenter/topic.blade.php index 12e3119..d2ac3ad 100644 --- a/resources/views/ucenter/topic.blade.php +++ b/resources/views/ucenter/topic.blade.php @@ -19,13 +19,15 @@ @foreach ($topics as $topic) @include('common.topic') @endforeach - - {!! $topics->render() !!} @else @include('common.nodata') @endif +
+
+ @include('common.pagination', ['paginator' => $topics]) +
diff --git a/resources/views/user/timeline.blade.php b/resources/views/user/timeline.blade.php index afe77d3..7ff2514 100644 --- a/resources/views/user/timeline.blade.php +++ b/resources/views/user/timeline.blade.php @@ -19,11 +19,15 @@ @foreach ($timelines as $timeline) @include('common.timeline') @endforeach - {!! $timelines->render() !!} @else @include('common.nodata') @endif + +
+
+ @include('common.pagination', ['paginator' => $timelines]) +
diff --git a/resources/views/user/topic.blade.php b/resources/views/user/topic.blade.php index 8cf026b..d13baf9 100644 --- a/resources/views/user/topic.blade.php +++ b/resources/views/user/topic.blade.php @@ -19,12 +19,15 @@ @foreach ($topics as $topic) @include('common.topic') @endforeach - - {!! $topics->render() !!} @else @include('common.nodata') @endif + +
+
+ @include('common.pagination', ['paginator' => $topics]) +
From 83537832dc65913d3f981d6ab68fc389b52c9e6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E7=91=9E=E6=9D=B0?= <490472721@qq.com> Date: Thu, 15 Jun 2017 15:09:03 +0800 Subject: [PATCH 3/3] rich editor feature --- bower.json | 3 +- resources/lang/en/hc.php | 1 + resources/lang/zh-CN/hc.php | 1 + resources/views/common/editor.blade.php | 26 ++++++++++++++++ resources/views/common/topic.blade.php | 2 +- resources/views/topic/_form.blade.php | 4 ++- resources/views/topic/show.blade.php | 41 +++++++++++-------------- 7 files changed, 52 insertions(+), 26 deletions(-) create mode 100644 resources/views/common/editor.blade.php diff --git a/bower.json b/bower.json index ae35874..31b3d9d 100644 --- a/bower.json +++ b/bower.json @@ -21,6 +21,7 @@ "font-awesome": "fontawesome#^4.6.3", "jquery": "~2.1.4", "bootswatch-ustclugFonts": "~3.3.76", - "chart.js": "npm:chart.js#^2.2.2" + "chart.js": "npm:chart.js#^2.2.2", + "simditor": "^2.3.6" } } diff --git a/resources/lang/en/hc.php b/resources/lang/en/hc.php index 2416dc7..a29f5ac 100644 --- a/resources/lang/en/hc.php +++ b/resources/lang/en/hc.php @@ -87,6 +87,7 @@ 'no data' => 'There is no data here', 'show more comments' => 'Click to show more comments', 'no bio' => 'No bio yet', + 'reply' => 'Reply', diff --git a/resources/lang/zh-CN/hc.php b/resources/lang/zh-CN/hc.php index d21eedd..ae3451c 100644 --- a/resources/lang/zh-CN/hc.php +++ b/resources/lang/zh-CN/hc.php @@ -87,6 +87,7 @@ 'no data' => '暂时没有数据', 'show more comments' => '点击加载更多评论', 'no bio' => '暂无介绍', + 'reply' => '回复', diff --git a/resources/views/common/editor.blade.php b/resources/views/common/editor.blade.php new file mode 100644 index 0000000..41262dd --- /dev/null +++ b/resources/views/common/editor.blade.php @@ -0,0 +1,26 @@ +{{-- simditor --}} + + + + + + +{{-- markdown --}} +{{----}} +{{----}} +{{----}} +{{----}} +{{-- init simditor --}} + \ No newline at end of file diff --git a/resources/views/common/topic.blade.php b/resources/views/common/topic.blade.php index 4847c24..420909f 100644 --- a/resources/views/common/topic.blade.php +++ b/resources/views/common/topic.blade.php @@ -12,7 +12,7 @@
- {{ mb_substr($topic->content, 0, 200) }} + {!! str_limit($topic->content, 200) !!}
\ No newline at end of file diff --git a/resources/views/topic/_form.blade.php b/resources/views/topic/_form.blade.php index cae76be..5a63252 100644 --- a/resources/views/topic/_form.blade.php +++ b/resources/views/topic/_form.blade.php @@ -10,9 +10,11 @@
{!! Form::label('content', '正文') !!} - {!! Form::textarea('content', null, ['class' => 'form-control']) !!} + {!! Form::textarea('content', null, ['class' => 'form-control', 'id' => 'editor']) !!}
+@include('common.editor') +
{!! Form::submit('确定', ['class' => ' btn btn-primary form-control']) !!}
\ No newline at end of file diff --git a/resources/views/topic/show.blade.php b/resources/views/topic/show.blade.php index 432bb76..54f5292 100644 --- a/resources/views/topic/show.blade.php +++ b/resources/views/topic/show.blade.php @@ -11,7 +11,7 @@ class="pull-left fa fa-chevron-left" style="line-height:1.25"> 返回
+ href="javascript:$('.simditor-body').focus();"> 回复 @@ -86,25 +86,28 @@ class="pull-left fa fa-chevron-left" style="line-height:1.25"> 返回 @endif -

{!! $topic->content !!}

+
{!! $topic->content !!}
+ +
- {!! Form::open(array('url' => '/topic/store-comment', 'method' => 'POST')) !!} + {!! Form::open(array('url' => '/topic/store-comment', 'method' => 'POST', 'class' => 'form form-horizontal')) !!} {{ csrf_field() }} {!! Form::hidden('topic_id', $topic->id) !!} {!! Form::hidden('topic_comment_id', 0, ['id' => 'parent-id']) !!} -
- -
- -
+
+ +
+
{!! Form::close() !!}
+ @include('common.editor') +
@if ($comments) @@ -132,20 +135,12 @@ class="pull-left fa fa-chevron-left" style="line-height:1.25"> 返回 @endsection