Skip to content

Commit ac768ad

Browse files
author
SimuraEpona
authored
Merge pull request #1 from dev4living/dev-website
Dev website
2 parents 3dd4ef0 + 0d9b083 commit ac768ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+629
-113
lines changed

app/Helpers/FileSystem.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ class FileSystem
66
{
77
public static function getFullUrl($url)
88
{
9-
if ($url && substr($url, 0, 4) !== 'http') {
9+
if ($url && substr($url, 0, 4) !== 'http' && substr($url, 0, 8) !== '/assets/') {
1010
if (env('FILESYSTEM_DEFAULT') === 'qiniu' && env('QINIU_DOMAINS_CUSTOM')) {
11-
return env('QINIU_DOMAINS_CUSTOM') . '/' . $url;
11+
return env('QINIU_DOMAINS_CUSTOM') . $url;
1212
} else {
1313
if (isset($_SERVER['REQUEST_SCHEME'])) {
14-
return $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . '/' . $url;
14+
return $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . $url;
1515
} else {
16-
return 'http://' . $_SERVER['HTTP_HOST'] . '/' . $url;
16+
return 'http://' . $_SERVER['HTTP_HOST'] . $url;
1717
}
1818
}
1919
} else {

app/Http/Controllers/Api/TimelineController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public function postStoreImg(Request $request)
253253

254254
$ret = [];
255255
foreach($files as $k => $file) {
256-
$uploadPath = 'uploads/timeline/';
256+
$uploadPath = '/uploads/timeline/';
257257
$fileName = date('Ymd-His_') . str_random(6) . '_' . $file->getClientOriginalName();
258258
$imgPath = $uploadPath . $fileName;
259259

app/Http/Controllers/Api/UserController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ public function postSignUp(Request $request)
137137
) {
138138
$User = new User;
139139
$User->nickname = $request->nickname;
140-
$User->avatar = 'assets/images/userAvatar-default.png';
141140
$User->phone = $request->phone;
142141
$User->password = Hash::make($request->password);
143142

@@ -200,7 +199,7 @@ public function postUpdateAvatar(Request $request)
200199
$files = $request->file('uploads');
201200
$file = $files[0];
202201

203-
$uploadPath = 'uploads/avatars/';
202+
$uploadPath = '/uploads/avatars/';
204203
$fileName = date('Ymd-His_') . str_random(6) . '_' . $file->getClientOriginalName();
205204
$imgPath = $uploadPath . $fileName;
206205

app/Http/Controllers/AuthController.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ public function getLogin()
2828
return view('auth.login');
2929
}
3030

31+
/**
32+
*
33+
*/
34+
public function getSignup()
35+
{
36+
return view('auth.signup');
37+
}
38+
3139
/**
3240
*
3341
*/

app/Http/Controllers/TimelineController.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TimelineController extends Controller
1919
*/
2020
public function __construct()
2121
{
22-
$this->middleware('auth', ['only' => ['postStore']]);
22+
$this->middleware('auth', ['only' => ['postStore', 'postStoreComment']]);
2323
}
2424

2525
/**
@@ -97,9 +97,12 @@ public function postStoreComment(Request $request)
9797
* @param int $id
9898
* @return \Illuminate\Http\Response
9999
*/
100-
public function show($id)
100+
public function getShow($id)
101101
{
102-
//
102+
$timeline = Timeline::findOrFail($id);
103+
$users = User::limit(5)->orderByRaw('RAND()')->get();
104+
105+
return view('timeline.show', compact('timeline', 'users'));
103106
}
104107

105108
/**
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
7+
use App\Http\Requests;
8+
use App\Http\Controllers\Controller;
9+
10+
class UserCenterController extends Controller
11+
{
12+
/**
13+
* Display a listing of the resource.
14+
*
15+
* @return \Illuminate\Http\Response
16+
*/
17+
public function getIndex()
18+
{
19+
return redirect()->to('/ucenter/notice');
20+
}
21+
22+
/**
23+
* Notice page
24+
*/
25+
public function getNotice()
26+
{
27+
return view('ucenter.notice');
28+
}
29+
30+
/**
31+
* Timeline page
32+
*/
33+
public function getTimeline()
34+
{
35+
return view('ucenter.timeline');
36+
}
37+
38+
/**
39+
* Topic page
40+
*/
41+
public function getTopic()
42+
{
43+
return view('ucenter.topic');
44+
}
45+
46+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
7+
use App\Http\Requests;
8+
use App\Http\Controllers\Controller;
9+
10+
use Auth;
11+
use App\User;
12+
13+
class UserController extends Controller
14+
{
15+
/**
16+
* Profile page
17+
*/
18+
public function getProfile($id)
19+
{
20+
$user = User::findOrFail($id);
21+
return view('user.profile', compact('user'));
22+
}
23+
}

app/Http/routes.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,5 @@
5959
Route::controller('topic', 'TopicController');
6060
Route::controller('activity', 'ActivityController');
6161
Route::controller('timeline', 'TimelineController');
62+
Route::controller('user', 'UserController');
63+
Route::controller('ucenter', 'UserCenterController');

app/TimelineImg.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,6 @@ public static function getImgs($imgs)
2626
}
2727
}
2828

29-
/**
30-
*
31-
*/
32-
public static function getImgUrl($url)
33-
{
34-
$pattern = '/^http[s]?:\/\/.*/';
35-
if (preg_match($pattern, $url)) {
36-
return $url;
37-
} else {
38-
// $domain = '//public.hey-community.cn/';
39-
$domain = '';
40-
return $domain . $url;
41-
}
42-
}
43-
4429
/**
4530
*
4631
*/

app/User.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,7 @@ public function timelineComments()
6464
return $this->hasMany('App\TimelineComment', 'user_id')->orderBy('created_at', 'desc')->with('author');
6565
}
6666

67-
/**
68-
*
69-
*/
70-
public static function getAvatarUrl($url)
71-
{
72-
return TimelineImg::getImgUrl($url);
73-
}
74-
75-
76-
/**
67+
/*
7768
*
7869
*/
7970
public static function getGenderName($v)

database/migrations/2014_10_12_000000_create_users_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function up()
1717
$table->increments('id');
1818
$table->string('wx_open_id', 191)->nullable();
1919
$table->string('nickname', 191);
20-
$table->string('avatar', 191);
20+
$table->string('avatar', 191)->default('/assets/images/userAvatar-default.png');
2121
$table->string('bio', 191);
2222
$table->integer('gender');
2323
$table->string('email', 191)->nullable();

database/seeds/TimelineImgTableSeeder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function run()
2424

2525
if (env('FAKER_IMAGE_SAVE')) {
2626
$imgUrl = $faker->image(storage_path('app/uploads/timeline'));
27-
$imgUrl = strstr($imgUrl, 'uploads/timeline');
27+
$imgUrl = strstr($imgUrl, '/uploads/timeline');
2828
} else {
2929
$imgUrl = $faker->imageUrl();
3030
}

database/seeds/UserTableSeeder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ public function run()
1515

1616
\App\User::create([
1717
'nickname' => 'Rod',
18-
'avatar' => 'assets/images/userAvatar-default.png',
18+
'avatar' => '/assets/images/userAvatar-default.png',
1919
'email' => 'supgeek.rod@gmail.com',
2020
'phone' => '17090402884',
2121
'password' => bcrypt('123123'),
2222
]);
2323
\App\User::create([
2424
'nickname' => 'Test User',
25-
'avatar' => 'assets/images/userAvatar-default.png',
25+
'avatar' => '/assets/images/userAvatar-default.png',
2626
'email' => 'test@hey-community.cn',
2727
'phone' => '12312341234',
2828
'password' => Hash::make('123123'),
@@ -32,7 +32,7 @@ public function run()
3232

3333
if (env('FAKER_IMAGE_SAVE')) {
3434
$imgUrl = $faker->image(storage_path('app/uploads/avatars'), 300, 300, 'people');
35-
$imgUrl = strstr($imgUrl, 'uploads/avatars');
35+
$imgUrl = strstr($imgUrl, '/uploads/avatars');
3636
} else {
3737
$imgUrl = $faker->imageUrl(300, 300, 'people');
3838
}

public/assets/img/avatar-dhg.png

57.7 KB

public/assets/img/avatar-fat.jpg

11.2 KB

public/assets/img/avatar-mdo.png

91 KB

public/assets/img/brand-white.png

2.67 KB

public/assets/img/brand.png

1.69 KB

public/assets/img/iceland.jpg

780 KB

public/assets/img/instagram_1.jpg

117 KB

public/assets/img/instagram_10.jpg

53.7 KB

public/assets/img/instagram_11.jpg

41.2 KB

public/assets/img/instagram_12.jpg

172 KB

public/assets/img/instagram_13.jpg

83.9 KB

public/assets/img/instagram_14.jpg

83.1 KB

public/assets/img/instagram_15.jpg

110 KB

public/assets/img/instagram_16.jpg

99.8 KB

public/assets/img/instagram_17.jpg

133 KB

public/assets/img/instagram_18.jpg

52.4 KB

public/assets/img/instagram_2.jpg

82.7 KB

public/assets/img/instagram_3.jpg

97.7 KB

public/assets/img/instagram_4.jpg

91.9 KB

public/assets/img/instagram_5.jpg

84.1 KB

public/assets/img/instagram_6.jpg

71.6 KB

public/assets/img/instagram_7.jpg

56.1 KB

public/assets/img/instagram_8.jpg

143 KB

public/assets/img/instagram_9.jpg

169 KB

public/assets/img/unsplash_1.jpg

251 KB

public/assets/img/unsplash_2.jpg

579 KB

public/bootstrap-assets/css/website.css

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/bootstrap-assets/css/website.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/assets/sass/website/_topic.scss

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,40 @@
2323

2424
//
2525
.list-topic {
26-
.avatar {
27-
position: absolute;
28-
width: 40px;
29-
height: 40px;
30-
border-radius: 50%;
31-
}
32-
.body {
33-
margin-left: 52px;
34-
overflow: hidden;
35-
.title {
36-
font-size: 16px;
37-
font-weight: 500;
38-
line-height: 20px;
39-
white-space: nowrap;
40-
text-overflow: ellipsis;
26+
@extend %list-topic;
27+
}
28+
}
29+
}
4130

42-
.info {
43-
position: absolute;
44-
right: 18px;
45-
padding-left: 1em;
46-
background-color: #fff;
47-
font-size: 14px;
48-
font-weight: normal;
49-
color: #777;
50-
}
51-
}
31+
.list-topic {
32+
@extend %list-topic;
33+
}
34+
35+
%list-topic {
36+
.avatar {
37+
position: absolute;
38+
width: 40px;
39+
height: 40px;
40+
border-radius: 50%;
41+
}
42+
.body {
43+
margin-left: 52px;
44+
overflow: hidden;
45+
.title {
46+
font-size: 16px;
47+
font-weight: 500;
48+
line-height: 20px;
49+
white-space: nowrap;
50+
text-overflow: ellipsis;
51+
52+
.info {
53+
position: absolute;
54+
right: 18px;
55+
padding-left: 1em;
56+
background-color: #fff;
57+
font-size: 14px;
58+
font-weight: normal;
59+
color: #777;
5260
}
5361
}
5462
}

resources/lang/en/hc.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
return [
44
// Navigation
55
'home' => 'Home',
6+
'timeline' => 'Timeline',
67
'topic' => 'Topic',
78
'activity' => 'Activity',
89
'logout' => 'Logout',
@@ -68,6 +69,10 @@
6869
'advertise' => 'Advertise',
6970

7071

72+
// common
73+
'detail' => 'Detail',
74+
75+
7176

7277
//
7378
// topic

resources/lang/zh-CN/hc.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
return [
44
// Navigation
55
'home' => '首页',
6+
'timeline' => '动态',
67
'topic' => '话题',
78
'activity' => '活动',
89
'logout' => '退出',
@@ -68,6 +69,10 @@
6869
'advertise' => '广告',
6970

7071

72+
// common
73+
'detail' => '详情',
74+
75+
7176

7277
//
7378
// topic

0 commit comments

Comments
 (0)