Merge pull request #938 from pixelfed/frontend-ui-refactor

Frontend ui refactor
This commit is contained in:
daniel 2019-03-02 21:49:15 -07:00 committed by GitHub
commit 510de1950a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 253 additions and 7 deletions

View file

@ -28,16 +28,12 @@ class DiscoverController extends Controller
public function showTags(Request $request, $hashtag)
{
$this->validate($request, [
'page' => 'nullable|integer|min:1|max:20',
]);
$tag = Hashtag::whereSlug($hashtag)
->firstOrFail();
$page = $request->input('page') ?? 1;
$page = 1;
$key = 'discover:tag-'.$tag->id.':page-'.$page;
$keyMinutes = $page == 1 ? 15 : 5;
$keyMinutes = 15;
$posts = Cache::remember($key, now()->addMinutes($keyMinutes), function() use ($tag, $request) {
return $tag->posts()
@ -48,7 +44,8 @@ class DiscoverController extends Controller
->whereIsNsfw(false)
->whereVisibility('public')
->orderBy('id', 'desc')
->simplePaginate(24);
->take(24)
->get();
});
if($posts->count() == 0) {

View file

@ -0,0 +1,19 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used during authentication for various
| messages that we need to display to the user. You are free to modify
| these language lines according to your application's requirements.
|
*/
'failed' => '這些憑證與我們的紀錄不相符。',
'throttle' => '嘗試太多次登入。請在 :seconds 秒後再試一次。',
];

View file

@ -0,0 +1,18 @@
<?php
return [
'search' => '搜尋',
'home' => '首頁',
'local' => '本地',
'discover' => '探索',
'viewMyProfile' => '檢視我的個人檔案',
'myTimeline' => '我的時間軸',
'publicTimeline' => '公開時間軸',
'remoteFollow' => '遠端追蹤',
'settings' => '設定',
'admin' => '管理',
'logout' => '登出',
'directMessages' => '直接傳訊',
];

View file

@ -0,0 +1,11 @@
<?php
return [
'likedPhoto' => '喜歡您的照片。',
'startedFollowingYou' => '開始追蹤您。',
'commented' => '在您的貼文上留言。',
'mentionedYou' => '提到您。',
'shared' => '分享了您的貼文。',
];

View file

@ -0,0 +1,19 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Pagination Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used by the paginator library to build
| the simple pagination links. You are free to change them to anything
| you want to customize your views to better match your application.
|
*/
'previous' => '« 上一個',
'next' => '下一個 »',
];

View file

@ -0,0 +1,22 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Password Reset Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are the default lines which match reasons
| that are given by the password broker for a password update attempt
| has failed, such as for an invalid token or invalid new password.
|
*/
'password' => '密碼必須至少六個字元且與確認密碼符合。',
'reset' => '您的密碼已重設!',
'sent' => '如果您的電子郵件地址已在我們的資料庫裡,您將會在數分鐘內於您的電子郵件地址收到密碼復原連結。如果您沒有收到這封電子郵件的話,請檢查您的垃圾郵件匣。',
'token' => '這個密碼重設憑證無效。',
'user' => '如果您的電子郵件地址已在我們的資料庫裡,您將會在數分鐘內於您的電子郵件地址收到密碼復原連結。如果您沒有收到這封電子郵件的話,請檢查您的垃圾郵件匣。',
];

View file

@ -0,0 +1,15 @@
<?php
return [
'emptyTimeline' => '這個使用者還沒有貼文!',
'emptyFollowers' => '這個使用者還沒有追蹤者!',
'emptyFollowing' => '這個使用者還沒有追蹤任何人!',
'emptySaved' => '您還沒有儲存任何貼文!',
'savedWarning' => '您可以看到的只有您已儲存的貼文',
'privateProfileWarning' => '這個帳號是私密帳號',
'alreadyFollow' => '已經追蹤 :username?',
'loginToSeeProfile' => '來檢視他們的照片與影片。',
'status.disabled.header' => '個人檔案不可用',
'status.disabled.body' => '抱歉,此個人檔案暫時不可用。請稍後再試。',
];

View file

@ -0,0 +1,16 @@
<?php
return [
'about' => '關於',
'help' => '說明',
'language' => '語言',
'fediverse' => 'Fediverse',
'opensource' => '開放原始碼',
'terms' => '條款',
'privacy' => '隱私',
'l10nWip' => '我們仍在努力改善在地化的支援',
'currentLocale' => '目前的語系',
'selectLocale' => '選取一個支援的語言',
];

View file

@ -0,0 +1,7 @@
<?php
return [
'emptyPersonalTimeline' => '您的時間軸還是空的。',
];

View file

@ -0,0 +1,122 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by
| the validator class. Some of these rules have multiple versions such
| as the size rules. Feel free to tweak each of these messages here.
|
*/
'accepted' => ':attribute 必須接受。',
'active_url' => ':attribute 不是有效的 URL。',
'after' => ':attribute 必須是在 :date 之後的日期。',
'after_or_equal' => ':attribute 必須是在 :date 當天或之後的日期。',
'alpha' => ':attribute 僅能包含字母。',
'alpha_dash' => ':attribute 僅能包含字母、數字與破折號。',
'alpha_num' => ':attribute 僅能包含字母與數字。',
'array' => ':attribute 必須為陣列。',
'before' => ':attribute 必須是在 :date 之前的日期。',
'before_or_equal' => ':attribute 必須是在 :date 當天或之前的日期。',
'between' => [
'numeric' => ':attribute 必須在 :min 到 :max 之間。',
'file' => ':attribute 必須在 :min 到 :max KB 之間。',
'string' => ':attribute 必須在 :min 到 :max 個字母之間。',
'array' => ':attribute 必須在 :min 到 :max 個項目之間。',
],
'boolean' => ':attribute 欄位必須為真或假。',
'confirmed' => ':attribute 確認不符合。',
'date' => ':attribute 不是有效的日期。',
'date_format' => ':attribute 不符合格式 :format。',
'different' => ':attribute 與 :other 必須不同。',
'digits' => ':attribute 必須有 :digits 位。',
'digits_between' => ':attribute 必須在 :min 到 :max 位之間。',
'dimensions' => ':attribute 圖片尺寸無效。',
'distinct' => ':attribute 欄位有重複的值。',
'email' => ':attribute 必須為有效的電子郵件地址。',
'exists' => '選定的 :attribute 無效。',
'file' => ':attribute 必須為檔案。',
'filled' => ':attribute 欄位必須要有值。',
'image' => ':attribute 必須為圖片。',
'in' => '選定的 :attribute 無效。',
'in_array' => ':attribute 欄位在 :other 中不存在。',
'integer' => ':attribute 必須為整數。',
'ip' => ':attribute 必須為有效的 IP 位置。',
'ipv4' => ':attribute 必須為有效的 IPv4 位置。',
'ipv6' => ':attribute 必須為有效的 IPv6 位置。',
'json' => ':attribute 必須為有效的 JSON 字串。',
'max' => [
'numeric' => ':attribute 不能大於 :max。',
'file' => ':attribute 不能大於 :max KB。',
'string' => ':attribute 不能多於 :max 個字元。',
'array' => ':attribute 不能多於 :max 個項目。',
],
'mimes' => ':attribute 必須為這些類型的檔案: :values。',
'mimetypes' => ':attribute 必須為這些類型的檔案: :values。',
'min' => [
'numeric' => ':attribute 必須至少 :min。',
'file' => ':attribute 必須至少 :min KB。',
'string' => ':attribute 必須至少 :min 個字元。',
'array' => ':attribute 必須至少 :min 個項目。',
],
'not_in' => '選定的 :attribute 無效。',
'not_regex' => ':attribute 格式無效。',
'numeric' => ':attribute 必須為數字。',
'present' => ':attribute 欄位必須存在。',
'regex' => ':attribute 格式無效。',
'required' => ':attribute 欄位必填。',
'required_if' => ':attribute 在 :other 為 :value 時必填。',
'required_unless' => ':attribute 欄位為必填,除非 :other 為 :values。',
'required_with' => '在 :values 存在時,:attribute 為必填。',
'required_with_all' => '在 :values 存在時,:attribute 為必填。',
'required_without' => '在 :values 不存在時,:attribute 為必填。',
'required_without_all' => '在沒有 :values 存在時,:attribute 為必填。',
'same' => ':attribute 與 :other 必須符合。',
'size' => [
'numeric' => ':attribute 必須為 :size。',
'file' => ':attribute 必須為 :size KB。',
'string' => ':attribute 必須有 :size 個字元。',
'array' => ':attribute 必須包含 :size 個項目。',
],
'string' => ':attribute 必須為字串。',
'timezone' => ':attribute 必須為有效的區域。',
'unique' => ':attribute 已被取用。',
'uploaded' => ':attribute 上傳失敗。',
'url' => ':attribute 格式無效。',
/*
|--------------------------------------------------------------------------
| Custom Validation Language Lines
|--------------------------------------------------------------------------
|
| Here you may specify custom validation messages for attributes using the
| convention "attribute.rule" to name the lines. This makes it quick to
| specify a specific custom language line for a given attribute rule.
|
*/
'custom' => [
'attribute-name' => [
'rule-name' => '自訂訊息',
],
],
/*
|--------------------------------------------------------------------------
| Custom Validation Attributes
|--------------------------------------------------------------------------
|
| The following language lines are used to swap attribute place-holders
| with something more reader friendly such as E-Mail Address instead
| of "email". This simply helps us make messages a little cleaner.
|
*/
'attributes' => [],
];