Skip to content

Commit 73f0a99

Browse files
author
Shawn McCool
committed
Merge branch 'master' of github.com:LaravelIO/laravel-io
2 parents 02c29bb + de96e42 commit 73f0a99

File tree

16 files changed

+252
-51
lines changed

16 files changed

+252
-51
lines changed

app/controllers/ForumController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function __construct(CommentRepository $comments, TagRepository $tags)
1717

1818
public function getIndex()
1919
{
20-
$tags = $this->tags->getAllTagsBySlug(Input::get('tags'));
20+
$tags = $this->tags->getAllTagsBySlug(Input::get('tags'));
2121

2222
$threads = $this->comments->getForumThreadsByTagsPaginated($tags, 20);
2323
$threads->appends(['tags' => Input::get('tags')]);
@@ -28,7 +28,7 @@ public function getIndex()
2828
public function getThread()
2929
{
3030
$thread = App::make('slugModel');
31-
$comments = $this->comments->getThreadCommentsPaginated($thread);
31+
$comments = $this->comments->getThreadCommentsPaginated($thread, 5);
3232

3333
$this->view('forum.thread', compact('thread', 'comments'));
3434
}

app/domain/Lio/Comments/CommentPresenter.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
use McCool\LaravelAutoPresenter\BasePresenter;
44
use App;
55

6+
use Str;
7+
68
class CommentPresenter extends BasePresenter
79
{
810
public function forumThreadUrl()
@@ -44,4 +46,10 @@ public function body()
4446
{
4547
return App::make('markdown')->transform($this->resource->body);
4648
}
49+
50+
public function bodySummary()
51+
{
52+
$body = MarkdownExtra::defaultTransform($this->resource->body);
53+
return Str::words($body, 50);
54+
}
4755
}

app/views/auth/signup.blade.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
Hi, you'll need an account in order to do whatever you just tried to do. No problem, just authenticate through GitHub and you're done.
1+
@extends('layouts._one_column')
22

3-
<a href="{{ action('AuthController@getLogin') }}">Login with GitHub</a>
3+
@section('content')
4+
<section class="auth woops">
5+
<h1>Woops!</h1>
6+
<p>You'll need an account in order to do whatever you just tried to do. No problem, just authenticate through GitHub and you're done.</p>
7+
<a class="button full" href="{{ action('AuthController@getLogin') }}">Login with GitHub</a>
8+
</section>
9+
@stop
Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
We're going to create an account with this information.
1+
@extends('layouts._one_column')
22

3-
<img src="{{ $githubUser['avatar_url'] }}"/>
3+
@section('content')
4+
<section class="auth">
5+
<h1>We're going to create an account with this information.</h1>
46

5-
<a href="{{ $githubUser['html_url'] }}">{{ $githubUser['name'] }} {{ $githubUser['email'] }}</a>
7+
<div class="user">
8+
<img src="{{ $githubUser['avatar_url'] }}"/>
9+
<div class="bio">
10+
<h2>{{ $githubUser['name'] }}</h2>
11+
<h3>{{ $githubUser['email'] }}</h3>
12+
<a class="button" href="{{ action('AuthController@getLogin') }}">Create My Laravel.IO Account</a>
13+
</div>
14+
</div>
615

7-
<a href="{{ action('AuthController@getLogin') }}">Create My Laravel.IO Account</a>
16+
17+
</section>
18+
@stop

app/views/dashboard/index.blade.php

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,5 @@
55
@stop
66

77
@section('content')
8-
<section class="user-content">
98

10-
11-
<h1>{{ Auth::user()->name }}'s Latest Threads</h1>
12-
<div class="comments">
13-
@foreach($user->forumThreads as $comment)
14-
<div class="comment">
15-
<div class="content">
16-
<h2>{{ $comment->title }}</h2>
17-
<p>{{ $comment->body }}</p>
18-
<ul class="meta">
19-
<li><i class="icon-time"></i> {{ $comment->created_ago }}</li>
20-
<li><a href="{{ $comment->forumThreadUrl }}"><i class="icon-eye"></i> View Thread</a></li>
21-
</ul>
22-
</div>
23-
</div>
24-
@endforeach
25-
</div>
26-
27-
<h1>{{ Auth::user()->name }}'s Latest Replies</h1>
28-
<div class="comments">
29-
@foreach($user->forumReplies as $comment)
30-
<div class="comment">
31-
<div class="content">
32-
<h2>RE: {{ $comment->parent->title }}</h2>
33-
<p>{{ $comment->body }}</p>
34-
<ul class="meta">
35-
<li><i class="icon-time"></i> {{ $comment->created_ago }}</li>
36-
<li><a href="{{ $comment->commentUrl }}"><i class="icon-eye"></i> View Comment</a></li>
37-
</ul>
38-
</div>
39-
</div>
40-
@endforeach
41-
</div>
42-
</section>
439
@stop

app/views/layouts/_flash.blade.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
1-
<section>
1+
<section class="alert">
22
@if (Session::has('success'))
33
<div data-alert class="alert-box success">
44
{{ implode('<br />', (array) Session::get('success')) }}
5-
<a href="#" class="close">&times;</a>
65
</div>
76
@endif
87

98
@if (Session::has('error'))
109
<div data-alert class="alert-box alert">
1110
{{ implode('<br />', (array) Session::get('error')) }}
12-
<a href="#" class="close">&times;</a>
1311
</div>
1412
@endif
1513

1614
{{-- Laravel Form Errors --}}
1715
@if ($errors->count() > 0)
1816
<div data-alert class="alert-box alert">
1917
Please review the form below and fix errors before submitting again.
20-
<a href="#" class="close">&times;</a>
2118
</div>
2219
@endif
2320
</section>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<section class="content center">
2+
@section('content')
3+
@show
4+
</section>

app/views/users/profile.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<div class="comment">
1717
<div class="content">
1818
<h2>{{ $thread->title }}</h2>
19-
<p>{{ $thread->body }}</p>
19+
{{ $thread->bodySummary }}
2020
<ul class="meta">
2121
<li><i class="icon-time"></i> {{ $thread->created_ago }}</li>
2222
<li><a href="{{ $thread->forumThreadUrl }}"><i class="icon-eye"></i> View Thread</a></li>
@@ -36,7 +36,7 @@
3636
<div class="comment">
3737
<div class="content">
3838
<h2>RE: {{ $comment->parent->title }}</h2>
39-
<p>{{ $comment->body }}</p>
39+
{{ $comment->bodySummary }}
4040
<ul class="meta">
4141
<li><i class="icon-time"></i> {{ $comment->created_ago }}</li>
4242
<li><a href="{{ $comment->commentUrl }}"><i class="icon-eye"></i> View Comment</a></li>

public/scss/app.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,7 @@
3333
@import "modules/form";
3434
@import "modules/comments";
3535
@import "modules/dashboard";
36-
37-
36+
@import "modules/code";
37+
@import "modules/alert";
38+
@import "modules/auth";
39+
@import "modules/pagination";

public/scss/modules/_alert.scss

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/* ==========================================================================
2+
MOBILE FIRST MODULE SKELETON
3+
========================================================================== */
4+
5+
// MOBILE STYLES ////////////////////////////////////////////////////////////
6+
7+
.alert-box {
8+
padding: 10px;
9+
background: $lioRed;
10+
color:white;
11+
font-size:15px;
12+
}
13+
14+
15+
// BREAKPOINT 1 (480) ////////////////////////////////////////////////////////////
16+
17+
@media only screen and (min-width: 480px) {
18+
19+
.module {}
20+
21+
}
22+
23+
24+
// BREAKPOINT 2 (768) ////////////////////////////////////////////////////////////
25+
26+
@media only screen and (min-width: 768px) {
27+
28+
.module {}
29+
}
30+
31+
32+
// BREAKPOINT 3 (1024) ////////////////////////////////////////////////////////////
33+
34+
@media only screen and (min-width: 1024px) {
35+
36+
.module {}
37+
}
38+
39+
40+
// BREAKPOINT 4 (1440) ////////////////////////////////////////////////////////////
41+
42+
@media only screen and (min-width: 1440px) {
43+
44+
.module {}
45+
}

0 commit comments

Comments
 (0)