From 3a086fa8da36e37c6cbfbc446bfe192cbc8cacfa Mon Sep 17 00:00:00 2001 From: janschoenherr Date: Thu, 17 Dec 2015 17:10:37 +0100 Subject: [PATCH 1/7] cleanup --- app/components/post-settings.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/post-settings.vue b/app/components/post-settings.vue index 875282e..1dc5a35 100644 --- a/app/components/post-settings.vue +++ b/app/components/post-settings.vue @@ -11,9 +11,9 @@
- +
- +
From e45e30f75a234a88eb6d8520d721aa0da56a265f Mon Sep 17 00:00:00 2001 From: Malte Date: Mon, 21 Dec 2015 12:07:24 +0100 Subject: [PATCH 2/7] Set comment ordering to DESC at admin panel --- CHANGELOG.md | 6 ++++++ src/Controller/BlogController.php | 1 + src/Controller/CommentApiController.php | 8 +++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bd65b7..f66ef09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## WIP + +### Changed +- Set comment ordering to DESC at admin panel +- Updated Vue resource + ## 0.10.0 (Dezember 15, 2015) ### Changed diff --git a/src/Controller/BlogController.php b/src/Controller/BlogController.php index 29f16ec..e036955 100644 --- a/src/Controller/BlogController.php +++ b/src/Controller/BlogController.php @@ -111,6 +111,7 @@ public function editAction($id = 0) public function commentAction($filter = [], $post = 0, $page = 0) { $post = Post::find($post); + $filter['order'] = 'created DESC'; return [ '$view' => [ diff --git a/src/Controller/CommentApiController.php b/src/Controller/CommentApiController.php index fe30fb3..de9b639 100644 --- a/src/Controller/CommentApiController.php +++ b/src/Controller/CommentApiController.php @@ -69,9 +69,15 @@ public function indexAction($filter = [], $post = 0, $page = 0, $limit = 0) $query->offset($page * $limit)->limit($limit); } + if (preg_match('/^(created)\s(asc|desc)$/i', $order, $match)) { + $order = $match; + } else { + $order = [1 => 'created', 2 => App::module('blog')->config('comments.order')]; + } + $comments = $query->related(['post' => function ($query) { return $query->related('comments'); - }])->related('user')->orderBy('created', App::module('blog')->config('comments.order'))->get(); + }])->related('user')->orderBy($order[1], $order[2])->get(); $posts = []; From ccf3cea9495cbc824f724f388ff5558d612b4665 Mon Sep 17 00:00:00 2001 From: Malte Date: Mon, 4 Jan 2016 15:36:29 +0100 Subject: [PATCH 3/7] update translations --- languages/bg_BG/messages.php | 2 +- languages/de_DE/messages.php | 2 +- languages/hu_HU/messages.php | 2 +- languages/id_ID/messages.php | 20 +++---- languages/th/messages.php | 105 +++++++++++++++++++++++++++++++++++ languages/tr_TR/messages.php | 46 +++++++-------- languages/zh_CN/messages.php | 18 +++--- languages/zh_TW/messages.php | 88 ++++++++++++++--------------- 8 files changed, 194 insertions(+), 89 deletions(-) create mode 100644 languages/th/messages.php diff --git a/languages/bg_BG/messages.php b/languages/bg_BG/messages.php index aa13573..63d17ed 100644 --- a/languages/bg_BG/messages.php +++ b/languages/bg_BG/messages.php @@ -24,7 +24,7 @@ 'Default post settings' => '', '{1} %count% Post selected|]1,Inf[ %count% Posts selected' => '', 'Read more' => '', - 'Image' => '', + 'Image' => 'Изображение', 'Posts' => 'Публикации', 'Pending' => 'Изчакващ', 'Comment' => 'Коментар', diff --git a/languages/de_DE/messages.php b/languages/de_DE/messages.php index 173e834..bad4916 100644 --- a/languages/de_DE/messages.php +++ b/languages/de_DE/messages.php @@ -90,7 +90,7 @@ 'Comments are closed.' => 'Kommentare sind geschlossen.', 'Close comments on articles older than' => 'Kommentare von Artikeln schließen, die älter sind als', 'Cancel' => 'Abbrechen', - 'Written by %name% on %date%' => 'Geschrieben von %Name% am %Date%', + 'Written by %name% on %date%' => 'Geschrieben von %name% am %date%', 'Enable nested comments of' => 'Verschachtelte Kommentare aktivieren für', 'Restrict Access' => 'Zugriff einschränken', 'Comment cannot be blank.' => 'Kommentar darf nicht leer sein.', diff --git a/languages/hu_HU/messages.php b/languages/hu_HU/messages.php index 8f7c0ca..504eec3 100644 --- a/languages/hu_HU/messages.php +++ b/languages/hu_HU/messages.php @@ -73,7 +73,7 @@ 'Day and name' => 'Nap és név', 'Options' => 'Egyéb opciók', 'Field must be a valid email address.' => 'Hibás email cím formátum', - 'levels deep.' => '', + 'levels deep.' => 'szintek mélysége.', 'Comments on %title%' => 'Hozzászólások a %title% tartalmon', 'Insufficient User Rights.' => 'Elégtelen felhasználói jogok', 'Copy' => 'Másolás', diff --git a/languages/id_ID/messages.php b/languages/id_ID/messages.php index c9c06e5..7d6735f 100644 --- a/languages/id_ID/messages.php +++ b/languages/id_ID/messages.php @@ -1,9 +1,9 @@ '', + 'Require e-mail.' => 'E-mail diperlukan', 'General' => 'Umum', 'Show Avatars from Gravatar.' => 'Tampilan Avatar dari Gravatar.', - 'Unable to comment. Please try again later.' => '', - 'Submit' => '', + 'Unable to comment. Please try again later.' => 'Tidak dapat berkomentar. Silakan coba lagi nanti.', + 'Submit' => 'Submit', '{0} No pending|{1} One pending|]1,Inf[ %comments% pending' => '{0} Tidak ada yang tertunda|{1} Satu tertunda|]1,Inf[ %comments% tertunda', 'Enable Comments' => 'Ijinkan Komentar', 'Appearance' => 'Tampilan', @@ -14,23 +14,23 @@ 'Slug' => 'Slug', 'Email invalid.' => 'Email tidak valid', 'Comment not found.' => 'Halaman tidak ditemukan.', - 'Filter by' => '', + 'Filter by' => 'Filter dengan', 'Comments (%count%)' => '(%count%) Komentar', 'Author' => 'Penulis', 'Unapprove' => 'Jangan terima', '{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '{1} %count% komentar yang dipilih|]1,Inf[ %count% Komentar yang dipilih', 'Insufficient user rights.' => 'Hak pengguna tidak cukup .', - 'Posts View' => '', + 'Posts View' => 'Lihat Post', 'Default post settings' => 'Standar pengaturan post', '{1} %count% Post selected|]1,Inf[ %count% Posts selected' => '{1} %count% Posting yang dipilih|]1,Inf[ %count% Posting yang dipilih', - 'Read more' => '', + 'Read more' => 'Baca selengkapnya', 'Image' => 'Gambar', 'Posts' => 'Post', 'Pending' => 'Tertunda', 'Comment' => 'Komentar', 'Approved' => 'Diterima', 'Edit Post' => 'Edit Post', - 'Thank you! Your comment needs approval before showing up.' => '', + 'Thank you! Your comment needs approval before showing up.' => 'Terima kasih! Komentar anda memerlukan persetujuan sebelum ditayangkan.', 'Pending Review' => 'Review tertunda', 'Excerpt' => 'Ringkasan', 'Edit' => 'Edit', @@ -48,7 +48,7 @@ 'Please login to leave a comment.' => 'Silahkan masuk untuk meninggalkan komentar.', 'Posts per page' => 'Post per halaman', 'E-mail' => 'E-mail', - 'latest last' => '', + 'latest last' => 'terbaru terakhir', 'Please wait another %seconds% seconds before commenting again.' => 'Silahkan tunggu %seconds% detik lagi sebelum berkomentar kembali.', 'Delete' => 'Hapus', 'Post not found.' => 'Post tidak ditemukan.', @@ -59,7 +59,7 @@ 'Please provide valid name and email.' => 'Harap berikan nama dan email yang valid.', 'You are not allowed to post comments.' => 'Anda tidak diperbolehkan untuk mengirimkan komentar.', 'Author cannot be blank.' => 'Penulis tidak boleh kosong.', - 'latest first' => '', + 'latest first' => 'terbaru pertama', 'Unpublished' => 'Tidak diterbitkan', 'Mark as spam' => 'Tandai sebagai spam', 'Custom' => 'Kustom', @@ -99,7 +99,7 @@ 'Leave a comment' => 'Tinggalkan komentar', '{0} No comments|{1} %num% Comment|]1,Inf[ %num% Comments' => '{0} Tidak ada komentar|{1} %num% Komentar|]1,Inf[ %num% Komentar', 'Post' => 'Post', - 'View' => '', + 'View' => 'Lihat', 'Numeric' => 'Numerik', 'Name' => 'Nama', ); \ No newline at end of file diff --git a/languages/th/messages.php b/languages/th/messages.php new file mode 100644 index 0000000..11ce916 --- /dev/null +++ b/languages/th/messages.php @@ -0,0 +1,105 @@ + 'จำเป็นต้องใช้อีเมล์', + 'General' => 'ทั่วไป', + 'Show Avatars from Gravatar.' => 'แสดงรูปประจำตัวจาก Gravatar', + 'Unable to comment. Please try again later.' => 'ไม่สามารถแสดงความเห็นได้ โปรดลองอีกครั้งภายหลัง', + 'Submit' => 'ตกลง', + '{0} No pending|{1} One pending|]1,Inf[ %comments% pending' => '{0} ไม่มีการรอดำเนินการ|{1} หนึ่งความเห็นที่รอดำเนินการ|]1,Inf[ %comments% ดำเนินการ', + 'Enable Comments' => 'เปิดใช้งานความคิดเห็น', + 'Appearance' => 'ลักษณะ', + 'Draft' => 'ฉบับร่าง', + 'Approve' => 'อนุมัติ', + 'Title' => 'หัวเรื่อง', + 'Permalink' => 'ลิงก์ถาวร', + 'Slug' => 'Slug', + 'Email invalid.' => 'อีเมลไม่ถูกต้อง', + 'Comment not found.' => 'ไม่พบความเห็น', + 'Filter by' => 'คัดกรองโดย', + 'Comments (%count%)' => 'ความเห็น (%count%)', + 'Author' => 'ผู้เขียน', + 'Unapprove' => 'ไม่อนุมัติ', + '{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '{1} %count% ความเห็นที่เลือก|]1,Inf[ %count% ความเห็นที่เลือก', + 'Insufficient user rights.' => 'สิทธิ์ของผู้ใช้ไม่เพียงพอ', + 'Posts View' => 'เข้าชมเรื่อง', + 'Default post settings' => 'ค่าเริ่มต้นการตั้งค่าเรื่อง', + '{1} %count% Post selected|]1,Inf[ %count% Posts selected' => '{1} %count% เรื่องที่เลือก|]1,Inf[ %count% เรื่องที่เลือก', + 'Read more' => 'อ่านต่อ', + 'Image' => 'รูปภาพ', + 'Posts' => 'เรื่อง', + 'Pending' => 'รอดำเนินการ', + 'Comment' => 'ความคิดเห็น', + 'Approved' => 'ได้รับการอนุมัติ', + 'Edit Post' => 'แก้ไขเรื่อง', + 'Thank you! Your comment needs approval before showing up.' => 'ขอบคุณ! ความเห็นของคุณต้องอนุมัติก่อนขึ้นโชว์', + 'Pending Review' => 'รอคอยการตรวจสอบ', + 'Excerpt' => 'คำตัดทอน', + 'Edit' => 'แก้ไข', + '{0} No pending|{1} One pending|]1,Inf[ %comments_pending% pending' => '{0} ไม่มีการรอดำเนินการ|{1} หนึ่งความเห็นที่รอดำเนินการ|]1,Inf[ %comments_pending% ดำเนินการ', + 'Invalid post id.' => 'ไอดีเรื่องไม่ถูกต้อง', + 'Blog' => 'บล็อก', + 'Enter Title' => 'ระบุหัวเรื่อง', + 'Logged in as %name%' => 'เข้าสู่ระบบในชื่อ %name%', + 'Order comments by' => 'เรียงความเห็นโดย', + 'Title cannot be blank.' => 'หัวเรื่องไม่สามารถเว้นว่างได้', + 'Save' => 'บันทึก', + 'Status' => 'สถานะ', + '{0} No post copied.|{1} Post copied.|]1,Inf[ Posts copied.' => '{0} ไม่มีการคัดลอกเรื่อง|{1} เรื่องถูกคัดลอก|]1,Inf[ เรื่องถูกคัดลอก.', + '{0} %count% Comments|{1} %count% Comment|]1,Inf[ %count% Comments' => '{0} %count% ความเห็น|{1} %count% ความเห็น|]1,Inf[ %count% ความเห็น', + 'Please login to leave a comment.' => 'กรุณาเข้าสู่ระบบก่อนแสดงความคิดเห็น', + 'Posts per page' => 'เรื่องต่อหน้า', + 'E-mail' => 'อีเมล์', + 'latest last' => 'รายการแรกสุดท้าย', + 'Please wait another %seconds% seconds before commenting again.' => 'โปรดรอ %seconds% วินาที จึงจะแสดงความเห็นได้อีกครั้ง', + 'Delete' => 'ลบ', + 'Post not found.' => 'ไม่พบเรื่อง', + 'No comments found.' => 'ไม่พบความคิดเห็น', + 'Publish on' => 'เผยแพร่บน', + 'Name cannot be blank.' => 'ชื่อไม่สามารถเว้นว่างได้', + 'Invalid slug.' => 'slug ไม่ถูกต้อง', + 'Please provide valid name and email.' => 'โปรดระบุชื่อที่ถูกต้องและอีเมล', + 'You are not allowed to post comments.' => 'คุณยังไม่ได้รับอนุญาตให้แสดงความคิดเห็น', + 'Author cannot be blank.' => 'ผู้เขียนไม่สามารถเว้นว่างได้', + 'latest first' => 'รายการแรกล่าสุด', + 'Unpublished' => 'ไม่ได้เผยแพร่แล้ว', + 'Mark as spam' => 'ระบุว่าเป็นสแปม', + 'Custom' => 'ปรับแต่ง', + 'Published' => 'เผยแพร่แล้ว', + '{0} %count% Posts|{1} %count% Post|]1,Inf[ %count% Posts' => '{0} %count% เรื่อง|{1} %count% เรื่อง|]1,Inf[ %count% เรื่อง', + 'Add Post' => 'เพิ่มเรื่อง', + 'Date' => 'วันที่', + 'Reply' => 'ตอบกลับ', + 'Parent not found.' => 'ไม่พบหัวข้อหลัก', + 'URL' => 'URL', + 'Day and name' => 'วันที่และชื่อ', + 'Options' => 'ตัวเลือก', + 'Field must be a valid email address.' => 'ต้องระบุอีเมลที่ถูกต้อง', + 'levels deep.' => 'ระดับความลึก', + 'Comments on %title%' => 'ความเห็น %title%', + 'Insufficient User Rights.' => 'สิทธิ์ของผู้ใช้ไม่เพียงพอ', + 'Copy' => 'คัดลอก', + 'Post not found!' => 'ไม่พบเรื่อง!', + 'Blog Settings' => 'การตั้งค่าบล็อก', + 'days.' => 'วัน', + 'Email' => 'อีเมล', + 'No posts found.' => 'ไม่พบเรื่อง', + 'Enable Markdown' => 'เปิดใช้งาน Markdown', + 'Comments' => 'ความเห็น', + 'Content cannot be blank.' => 'เนื้อหาไม่สามารถเว้นว่างได้', + 'Unknown' => 'ไม่ระบุ', + 'Month and name' => 'เดือนและชื่อ', + 'Comments are closed.' => 'ความคิดเห็นถูกปิด', + 'Close comments on articles older than' => 'ปิดความเห็นบนบทความที่เก่ากว่า', + 'Cancel' => 'ยกเลิก', + 'Written by %name% on %date%' => 'เขียนโดย %name% ใน %date%', + 'Enable nested comments of' => 'เปิดใช้งานความเห็นที่ซ้อนกันของ', + 'Restrict Access' => 'จำกัดการเข้าถึง', + 'Comment cannot be blank.' => 'ความเห็นไม่สามารถเว้นว่างได้', + 'Access denied.' => 'ปฏิเสธการเข้าใช้', + 'Spam' => 'สแปม', + 'Leave a comment' => 'แสดงความคิดเห็น', + '{0} No comments|{1} %num% Comment|]1,Inf[ %num% Comments' => '{0} ไม่มีความเห็น|{1} %num% ความเห็น|]1,Inf[ %num% ความเห็น', + 'Post' => 'เรื่อง', + 'View' => 'เข้าชม', + 'Numeric' => 'ตัวเลข', + 'Name' => 'ชื่อ', +); \ No newline at end of file diff --git a/languages/tr_TR/messages.php b/languages/tr_TR/messages.php index d94e4ba..2158d16 100644 --- a/languages/tr_TR/messages.php +++ b/languages/tr_TR/messages.php @@ -1,9 +1,9 @@ '', + 'Require e-mail.' => 'Zorunlu e-posta.', 'General' => 'Genel', 'Show Avatars from Gravatar.' => 'Avatarlar Gravatar Üzerinden Görüntülensin', - 'Unable to comment. Please try again later.' => '', - 'Submit' => '', + 'Unable to comment. Please try again later.' => 'Yorum yapılamaz. Lütfen daha sonra tekrar deneyiniz.', + 'Submit' => 'Gönder', '{0} No pending|{1} One pending|]1,Inf[ %comments% pending' => '{0} Bekleyen yorum yok|{1} Bir yorum bekliyor|]1,Inf[ %comments% yorum bekliyor', 'Enable Comments' => 'Yorumlar Kullanılsın', 'Appearance' => 'Görünüm', @@ -14,27 +14,27 @@ 'Slug' => 'Kısaltma', 'Email invalid.' => 'E-posta geçersiz.', 'Comment not found.' => 'Yorum bulunamadı.', - 'Filter by' => '', + 'Filter by' => 'Filtrele', 'Comments (%count%)' => 'Yorumlar (%count%)', 'Author' => 'Yazar', 'Unapprove' => 'Onaylama', - '{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '', + '{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '{1} %count% Yorum seçildi|]1,Inf[ %count% Yorum seçildi', 'Insufficient user rights.' => 'Yetersiz kullanıcı yetkisi', - 'Posts View' => '', - 'Default post settings' => '', - '{1} %count% Post selected|]1,Inf[ %count% Posts selected' => '', - 'Read more' => '', + 'Posts View' => 'Yazılar Görünümü', + 'Default post settings' => 'Varsayılan yazı ayarları', + '{1} %count% Post selected|]1,Inf[ %count% Posts selected' => '{1} %count% Yazı seçildi|]1,Inf[ %count% Yazı seçildi', + 'Read more' => 'Devamını oku', 'Image' => 'Görsel', 'Posts' => 'Yazılar', 'Pending' => 'Bekleyen', 'Comment' => 'Yorum', 'Approved' => 'Onaylanmış', 'Edit Post' => 'Yazıyı Düzenle', - 'Thank you! Your comment needs approval before showing up.' => '', + 'Thank you! Your comment needs approval before showing up.' => 'Teşekkürler. Yorumunuz yayınlanmak için onay bekliyor.', 'Pending Review' => 'İncelenmeyi Bekliyor', 'Excerpt' => 'Alıntı', 'Edit' => 'Düzenle', - '{0} No pending|{1} One pending|]1,Inf[ %comments_pending% pending' => '', + '{0} No pending|{1} One pending|]1,Inf[ %comments_pending% pending' => '{0} Bekleyen yok|{1} Bir bekleyen|]1,Inf[ %comments_pending% bekleyen', 'Invalid post id.' => 'Geçersiz yazı kodu.', 'Blog' => 'Blog', 'Enter Title' => 'Başlık Yazın', @@ -44,35 +44,35 @@ 'Save' => 'Kaydet', 'Status' => 'Durum', '{0} No post copied.|{1} Post copied.|]1,Inf[ Posts copied.' => '{0} Hiç bir yazı kopyalanmadı.|{1} yazı kopyalandı.|]1,Inf[ yazı kopyalandı.', - '{0} %count% Comments|{1} %count% Comment|]1,Inf[ %count% Comments' => '', + '{0} %count% Comments|{1} %count% Comment|]1,Inf[ %count% Comments' => '{0} %count% Yorumlar|{1} %count% Yorum|]1,Inf[ %count% Yorumlar', 'Please login to leave a comment.' => 'Yorum yapmak için lütfen oturum açın.', - 'Posts per page' => '', + 'Posts per page' => 'Sayfa da görüntülenecek yazı ', 'E-mail' => 'E-posta', - 'latest last' => '', + 'latest last' => 'yeniden eskiye', 'Please wait another %seconds% seconds before commenting again.' => 'Lütfen yeniden yorum yazabilmek için %seconds% saniye bekleyin.', 'Delete' => 'Sil', - 'Post not found.' => '', + 'Post not found.' => 'Yazı bulunamadı!', 'No comments found.' => 'Henüz bir yorum yok.', 'Publish on' => 'Yayınlanma', - 'Name cannot be blank.' => '', - 'Invalid slug.' => '', + 'Name cannot be blank.' => 'İsim boş bırakılamaz.', + 'Invalid slug.' => 'Geçersiz kısaltma', 'Please provide valid name and email.' => 'Geçerli bir ad ve e-posta yazın.', 'You are not allowed to post comments.' => 'Yorum gönderme izniniz yok.', 'Author cannot be blank.' => 'Yazar boş bırakılamaz.', - 'latest first' => '', + 'latest first' => 'eskiden yeniye', 'Unpublished' => 'Yayınlanmamış', 'Mark as spam' => 'Istenmeyen olarak işaretle', 'Custom' => 'İsteğe göre uyarlanmış', 'Published' => 'Yayınlanmış', - '{0} %count% Posts|{1} %count% Post|]1,Inf[ %count% Posts' => '', + '{0} %count% Posts|{1} %count% Post|]1,Inf[ %count% Posts' => '{0} %count% Yazılar|{1} %count% Yazı]1,Inf[ %count% Yazılar', 'Add Post' => 'Yazı Ekle', 'Date' => 'Tarih', 'Reply' => 'Yanıt', - 'Parent not found.' => '', + 'Parent not found.' => 'Yol bulunamadı.', 'URL' => 'URL', 'Day and name' => 'Gün ve ad', 'Options' => 'Seçenekler', - 'Field must be a valid email address.' => '', + 'Field must be a valid email address.' => 'Alanda geçerli bir e-posta adresi olmalıdır.', 'levels deep.' => 'derinlik düzeyi.', 'Comments on %title%' => '%title% yorumları', 'Insufficient User Rights.' => 'Yetersiz Kullanıcı Yetkisi.', @@ -87,7 +87,7 @@ 'Content cannot be blank.' => 'İçerik boş bırakılamaz', 'Unknown' => 'Bilinmeyen', 'Month and name' => 'Ay ve ad', - 'Comments are closed.' => '', + 'Comments are closed.' => 'Yorumlar kapatıldı.', 'Close comments on articles older than' => 'Şu tarihten önceki yazılar yoruma kapatılsın:', 'Cancel' => 'İptal', 'Written by %name% on %date%' => '%date% tarihinde %name% tarafından yazılmıştır.', @@ -99,7 +99,7 @@ 'Leave a comment' => 'Bir yorum yapın', '{0} No comments|{1} %num% Comment|]1,Inf[ %num% Comments' => '{0} Yorum Yok|{1} %num% Yorum|]1,Inf[ %num% Yorum', 'Post' => 'Yazı', - 'View' => '', + 'View' => 'Görünüm', 'Numeric' => 'Sayısal', 'Name' => 'Ad', ); \ No newline at end of file diff --git a/languages/zh_CN/messages.php b/languages/zh_CN/messages.php index 1cf1bec..24860bb 100644 --- a/languages/zh_CN/messages.php +++ b/languages/zh_CN/messages.php @@ -1,8 +1,8 @@ '', + 'Require e-mail.' => '必填 e-mail', 'General' => '基本', 'Show Avatars from Gravatar.' => '显示来自 Gravatar 的头像', - 'Unable to comment. Please try again later.' => '', + 'Unable to comment. Please try again later.' => '无法评论。请稍后再试。', 'Submit' => '提交', '{0} No pending|{1} One pending|]1,Inf[ %comments% pending' => '{0} 无评论需要审核|{1} 条评论需要审核|]1,Inf[ %comments% 条评论需要审核', 'Enable Comments' => '启用评论', @@ -14,13 +14,13 @@ 'Slug' => '别名', 'Email invalid.' => 'Email 无效.', 'Comment not found.' => '评论未找到.', - 'Filter by' => '', + 'Filter by' => '筛选自', 'Comments (%count%)' => '评论 (%count%)', 'Author' => '作者', 'Unapprove' => '驳回', '{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '{1} %count% 条评论已选择|]1,Inf[ %count% 条评论已选择', 'Insufficient user rights.' => '没有足够的用户权限.', - 'Posts View' => '', + 'Posts View' => '文章视图', 'Default post settings' => '默认文章设置', '{1} %count% Post selected|]1,Inf[ %count% Posts selected' => '{1} %count% 文章被选择|]1,Inf[ %count% 文章被选择', 'Read more' => '查看更多', @@ -30,7 +30,7 @@ 'Comment' => '评论', 'Approved' => '审核通过', 'Edit Post' => '编辑文章', - 'Thank you! Your comment needs approval before showing up.' => '', + 'Thank you! Your comment needs approval before showing up.' => '感谢您!您的评论在显示前需要经过审核。', 'Pending Review' => '等待审核', 'Excerpt' => '文章摘要', 'Edit' => '编辑', @@ -48,7 +48,7 @@ 'Please login to leave a comment.' => '请登录后发表评论。', 'Posts per page' => '篇文章每个页面', 'E-mail' => 'E-mail', - 'latest last' => '', + 'latest last' => '从旧到新', 'Please wait another %seconds% seconds before commenting again.' => '请等待 %seconds% 秒后重新进行评论。', 'Delete' => '删除', 'Post not found.' => '文章未找到.', @@ -59,7 +59,7 @@ 'Please provide valid name and email.' => '请提供正确的用户名及 Email。', 'You are not allowed to post comments.' => '您无权对此篇文章发表评论。', 'Author cannot be blank.' => '作者不能为空.', - 'latest first' => '', + 'latest first' => '从新到旧', 'Unpublished' => '已取消发布', 'Mark as spam' => '标记为垃圾评论', 'Custom' => '基本', @@ -68,7 +68,7 @@ 'Add Post' => '添加文章', 'Date' => '日期', 'Reply' => '回复', - 'Parent not found.' => '', + 'Parent not found.' => '未找到父节点', 'URL' => 'URL', 'Day and name' => '日期文章型', 'Options' => '选项', @@ -99,7 +99,7 @@ 'Leave a comment' => '留个言吧', '{0} No comments|{1} %num% Comment|]1,Inf[ %num% Comments' => '{0} 没有评论|{1} %num% 条评论|]1,Inf[ %num% 条评论', 'Post' => '文章', - 'View' => '', + 'View' => '视图', 'Numeric' => '数字型', 'Name' => '名字', ); \ No newline at end of file diff --git a/languages/zh_TW/messages.php b/languages/zh_TW/messages.php index 2d7ad54..06cfddf 100644 --- a/languages/zh_TW/messages.php +++ b/languages/zh_TW/messages.php @@ -2,63 +2,63 @@ 'Require e-mail.' => '', 'General' => '一般', 'Show Avatars from Gravatar.' => '從 Gravatar 顯示頭像。', - 'Unable to comment. Please try again later.' => '', - 'Submit' => '', + 'Unable to comment. Please try again later.' => '無法發表評論,請稍後再試一次。', + 'Submit' => '送出', '{0} No pending|{1} One pending|]1,Inf[ %comments% pending' => '{0} 無等待中評論|{1} 1則評論等待中|]1,Inf[ %comments% 則評論等待中', 'Enable Comments' => '允許發表評論', 'Appearance' => '外觀', 'Draft' => '草稿', - 'Approve' => '', - 'Title' => '', + 'Approve' => '核可', + 'Title' => '標題', 'Permalink' => '永久連結', - 'Slug' => '', - 'Email invalid.' => '', - 'Comment not found.' => '', - 'Filter by' => '', + 'Slug' => '別名', + 'Email invalid.' => '無效的電子郵件。', + 'Comment not found.' => '找不到評論。', + 'Filter by' => '過濾條件', 'Comments (%count%)' => '評論 (%count%)', 'Author' => '作者', - 'Unapprove' => '', - '{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '', - 'Insufficient user rights.' => '', + 'Unapprove' => '駁回', + '{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '{1} %count% 則評論被選取|]1,Inf[ %count% 則評論被選取', + 'Insufficient user rights.' => '使用者權限不足。', 'Posts View' => '', 'Default post settings' => '', '{1} %count% Post selected|]1,Inf[ %count% Posts selected' => '', - 'Read more' => '', - 'Image' => '', + 'Read more' => '閱讀更多', + 'Image' => '圖片', 'Posts' => '文章', 'Pending' => '等待審核', 'Comment' => '發表評論', 'Approved' => '已審核', 'Edit Post' => '編輯文章', - 'Thank you! Your comment needs approval before showing up.' => '', + 'Thank you! Your comment needs approval before showing up.' => '謝謝!您的評論在顯示之前需要先經過審核。', 'Pending Review' => '等待審核中', 'Excerpt' => '引文', - 'Edit' => '', + 'Edit' => '編輯', '{0} No pending|{1} One pending|]1,Inf[ %comments_pending% pending' => '', 'Invalid post id.' => '無效的文章ID。', 'Blog' => '部落格', 'Enter Title' => '輸入標題', 'Logged in as %name%' => '以 %name% 登入', 'Order comments by' => '排序評論:', - 'Title cannot be blank.' => '', - 'Save' => '', - 'Status' => '', - '{0} No post copied.|{1} Post copied.|]1,Inf[ Posts copied.' => '', - '{0} %count% Comments|{1} %count% Comment|]1,Inf[ %count% Comments' => '', + 'Title cannot be blank.' => '標題不能為空白。', + 'Save' => '儲存', + 'Status' => '狀態', + '{0} No post copied.|{1} Post copied.|]1,Inf[ Posts copied.' => '{0} 沒有文章被複製。|{1} 篇文章已被複製。|]1,Inf[ 篇文章已被複製。', + '{0} %count% Comments|{1} %count% Comment|]1,Inf[ %count% Comments' => '{0} 無評論|{1} %num% 則評論|]1,Inf[ %num% 則評論', 'Please login to leave a comment.' => '請登入來發表評論。', 'Posts per page' => '', 'E-mail' => 'E-mail', 'latest last' => '', 'Please wait another %seconds% seconds before commenting again.' => '再等待 %seconds% 秒才能再次發表評論。', - 'Delete' => '', - 'Post not found.' => '', + 'Delete' => '刪除', + 'Post not found.' => '找不到文章。', 'No comments found.' => '找不到任何意見。', 'Publish on' => '發佈於', - 'Name cannot be blank.' => '', - 'Invalid slug.' => '', + 'Name cannot be blank.' => '名字不能為空白。', + 'Invalid slug.' => '無效的別名。', 'Please provide valid name and email.' => '請輸入有效的姓名和 Email。', 'You are not allowed to post comments.' => '你無法發表評論。', - 'Author cannot be blank.' => '', + 'Author cannot be blank.' => '作者不能空白。', 'latest first' => '', 'Unpublished' => '未發佈', 'Mark as spam' => '標記為垃圾訊息', @@ -69,37 +69,37 @@ 'Date' => '日期', 'Reply' => '回覆', 'Parent not found.' => '', - 'URL' => '', + 'URL' => 'URL', 'Day and name' => '日期和姓名', - 'Options' => '', - 'Field must be a valid email address.' => '', + 'Options' => '選項', + 'Field must be a valid email address.' => '此欄位必須是個合法的 Email 地址。', 'levels deep.' => '層的巢狀評論。', - 'Comments on %title%' => '', - 'Insufficient User Rights.' => '', - 'Copy' => '', - 'Post not found!' => '', - 'Blog Settings' => '', + 'Comments on %title%' => '於 %title% 的評論', + 'Insufficient User Rights.' => '使用者權限不足。', + 'Copy' => '複製', + 'Post not found!' => '找不到文章!', + 'Blog Settings' => '部落格設定', 'days.' => '以前的文章評論。', - 'Email' => '', + 'Email' => 'Email', 'No posts found.' => '找不到文章。', - 'Enable Markdown' => '', + 'Enable Markdown' => '啟用Markdown', 'Comments' => '評論', - 'Content cannot be blank.' => '', - 'Unknown' => '', + 'Content cannot be blank.' => '內容不能空白。', + 'Unknown' => '未知', 'Month and name' => '日期和姓名', - 'Comments are closed.' => '', + 'Comments are closed.' => '評論被關閉。', 'Close comments on articles older than' => '關閉', - 'Cancel' => '', + 'Cancel' => '取消', 'Written by %name% on %date%' => '%name% 寫於 %date%', 'Enable nested comments of' => '允許', - 'Restrict Access' => '', - 'Comment cannot be blank.' => '', - 'Access denied.' => '', + 'Restrict Access' => '限制存取', + 'Comment cannot be blank.' => '評論不能空白。', + 'Access denied.' => '存取被拒絕。', 'Spam' => '垃圾訊息', 'Leave a comment' => '留下評論', '{0} No comments|{1} %num% Comment|]1,Inf[ %num% Comments' => '{0} 無評論|{1} %num% 則評論|]1,Inf[ %num% 則評論', - 'Post' => '', + 'Post' => '文章', 'View' => '', 'Numeric' => '數字', - 'Name' => '', + 'Name' => '名字', ); \ No newline at end of file From cd8a1e0349c8eed37245dd68cabe4e1b1dccac7e Mon Sep 17 00:00:00 2001 From: Malte Date: Mon, 4 Jan 2016 16:07:32 +0100 Subject: [PATCH 4/7] cleanup --- src/Controller/CommentApiController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/CommentApiController.php b/src/Controller/CommentApiController.php index de9b639..6e9c8f8 100644 --- a/src/Controller/CommentApiController.php +++ b/src/Controller/CommentApiController.php @@ -27,7 +27,7 @@ public function __construct() public function indexAction($filter = [], $post = 0, $page = 0, $limit = 0) { $query = Comment::query(); - $filter = array_merge(array_fill_keys(['status', 'search'], ''), $filter); + $filter = array_merge(array_fill_keys(['status', 'search', 'order'], ''), $filter); extract($filter, EXTR_SKIP); From 8e2cbc49185328602f82edc3c61501a023139207 Mon Sep 17 00:00:00 2001 From: Malte Date: Mon, 4 Jan 2016 16:39:38 +0100 Subject: [PATCH 5/7] fix comments permalink --- CHANGELOG.md | 5 ++++- app/views/comments.js | 4 ++-- src/Controller/SiteController.php | 2 +- src/Model/Post.php | 4 +--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f66ef09..923fbb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,10 @@ - Set comment ordering to DESC at admin panel - Updated Vue resource -## 0.10.0 (Dezember 15, 2015) +### Fixed +- Comments permalink + +## 0.10.0 (December 15, 2015) ### Changed - Switched to Vuejs 1.0 diff --git a/app/views/comments.js b/app/views/comments.js index 499c597..61131e7 100644 --- a/app/views/comments.js +++ b/app/views/comments.js @@ -21,7 +21,7 @@ module.exports = { load: function () { - return this.$http.get('api/blog/comment/:id', {post: this.config.post}).then(function (res) { + return this.$http.get('api/blog/comment/:id', {post: this.config.post.id}).then(function (res) { var data = res.data; this.$set('comments', data.comments); @@ -137,7 +137,7 @@ module.exports = { var comment = { parent_id: this.parent, - post_id: this.config.post, + post_id: this.config.post.id, content: this.content }; diff --git a/src/Controller/SiteController.php b/src/Controller/SiteController.php index 1f9851a..30121b2 100644 --- a/src/Controller/SiteController.php +++ b/src/Controller/SiteController.php @@ -137,7 +137,7 @@ public function postAction($id = 0) ], '$comments' => [ 'config' => [ - 'post' => $post->id, + 'post' => ['id' => $post->id, 'url' => App::url('@blog/id', ['id' => $post->id ?: 0], 'base')], 'enabled' => $post->isCommentable(), 'requireinfo' => $this->blog->config('comments.require_email'), 'max_depth' => $this->blog->config('comments.max_depth'), diff --git a/src/Model/Post.php b/src/Model/Post.php index a94f9c4..e272b2a 100755 --- a/src/Model/Post.php +++ b/src/Model/Post.php @@ -122,9 +122,7 @@ public function isAccessible(User $user = null) */ public function jsonSerialize() { - $data = [ - 'url' => App::url('@blog/id', ['id' => $this->id ?: 0], 'base') - ]; + $data = []; if ($this->comments) { $data['comments_pending'] = count(array_filter($this->comments, function ($comment) { From 030cc7fcbddfdcaaaadaebbb08c7ce7892fc5fa7 Mon Sep 17 00:00:00 2001 From: Malte Date: Wed, 6 Jan 2016 14:23:27 +0100 Subject: [PATCH 6/7] link to login page at comment section --- CHANGELOG.md | 3 +++ app/views/comments.js | 10 +++++++--- src/Controller/SiteController.php | 2 +- views/comments.php | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 923fbb4..205e1cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## WIP +### Added +- Link to login page at comment section + ### Changed - Set comment ordering to DESC at admin panel - Updated Vue resource diff --git a/app/views/comments.js b/app/views/comments.js index 61131e7..13bf5ab 100644 --- a/app/views/comments.js +++ b/app/views/comments.js @@ -21,7 +21,7 @@ module.exports = { load: function () { - return this.$http.get('api/blog/comment/:id', {post: this.config.post.id}).then(function (res) { + return this.$http.get('api/blog/comment/:id', {post: this.config.post}).then(function (res) { var data = res.data; this.$set('comments', data.comments); @@ -94,7 +94,7 @@ module.exports = { }, permalink: function () { - return $pagekit.url + this.config.post.url + '#comment-' + this.comment.id; + return '#comment-' + this.comment.id; } }, @@ -127,6 +127,10 @@ module.exports = { user: function () { return this.config.user; + }, + + login: function () { + return this.$url('user/login', {redirect: window.location.href}); } }, @@ -137,7 +141,7 @@ module.exports = { var comment = { parent_id: this.parent, - post_id: this.config.post.id, + post_id: this.config.post, content: this.content }; diff --git a/src/Controller/SiteController.php b/src/Controller/SiteController.php index 30121b2..1f9851a 100644 --- a/src/Controller/SiteController.php +++ b/src/Controller/SiteController.php @@ -137,7 +137,7 @@ public function postAction($id = 0) ], '$comments' => [ 'config' => [ - 'post' => ['id' => $post->id, 'url' => App::url('@blog/id', ['id' => $post->id ?: 0], 'base')], + 'post' => $post->id, 'enabled' => $post->isCommentable(), 'requireinfo' => $this->blog->config('comments.require_email'), 'max_depth' => $this->blog->config('comments.max_depth'), diff --git a/views/comments.php b/views/comments.php index 09aee5c..0a9cebd 100644 --- a/views/comments.php +++ b/views/comments.php @@ -121,7 +121,7 @@ From 622439ffa020c6efc5ee7d2261290b2f631706f2 Mon Sep 17 00:00:00 2001 From: Malte Date: Mon, 11 Jan 2016 14:01:06 +0100 Subject: [PATCH 7/7] update version --- CHANGELOG.md | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 205e1cb..b148956 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## WIP +## 0.10.1 (January 11, 2016) ### Added - Link to login page at comment section diff --git a/composer.json b/composer.json index 62229e0..bf9e01e 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "pagekit/blog", "type": "pagekit-extension", - "version": "0.10.0", + "version": "0.10.1", "title": "Blog", "description": "A blog extensions with a built-in comment system.", "license": "MIT",