Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit 3dab4fd

Browse files
Merge branch 'release/1.0.1'
2 parents 5eca3aa + 7f160dc commit 3dab4fd

Some content is hidden

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

73 files changed

+1474
-884
lines changed

CHANGELOG.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 1.0.1 (May 12, 2016)
4+
5+
### Changed
6+
- Smooth scroll for comment anchor links
7+
8+
### Fixed
9+
- Fixed duplicated request occasionally caused by pagination
10+
311
## 1.0.0 (April 13, 2016)
412

513
### Fixed
@@ -15,7 +23,7 @@
1523
## 0.11.1 (April 1, 2016)
1624

1725
### Changed
18-
- Use truncated post content as Open Graph description if not explicitly provided
26+
- Use truncated post content as Open Graph description if not explicitly provided
1927

2028
### Fixed
2129
- Fixed comments links

app/views/admin/comment-index.js

+9-15
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,21 @@ module.exports = {
2323
ready: function () {
2424

2525
this.Comments = this.$resource('api/blog/comment{/id}');
26-
this.load();
26+
this.$watch('config.page', this.load, {immediate: true});
2727

2828
UIkit.init(this.$el);
2929
},
3030

3131
watch: {
3232

33-
'config.page': function (page, old) {
34-
if (page == old) {
35-
return;
36-
}
37-
38-
this.load();
39-
},
40-
4133
'config.filter': {
4234
handler: function (filter) {
43-
this.load();
35+
if (this.config.page) {
36+
this.config.page = 0;
37+
} else {
38+
this.load();
39+
}
40+
4441
this.$session.set('comments.filter', filter);
4542
},
4643
deep: true
@@ -101,21 +98,18 @@ module.exports = {
10198
});
10299
},
103100

104-
load: function (page) {
105-
106-
page = page !== undefined ? page : this.$get('config.page');
101+
load: function () {
107102

108103
this.cancel();
109104

110-
this.Comments.query({filter: this.config.filter, post: this.config.post && this.config.post.id || 0, page: page, limit: this.config.limit}).then(function (res) {
105+
this.Comments.query({filter: this.config.filter, post: this.config.post && this.config.post.id || 0, page: this.config.page, limit: this.config.limit}).then(function (res) {
111106

112107
var data = res.data;
113108

114109
this.$set('posts', data.posts);
115110
this.$set('comments', data.comments);
116111
this.$set('pages', data.pages);
117112
this.$set('count', data.count);
118-
this.$set('config.page', page);
119113
this.$set('selected', []);
120114
});
121115
},

app/views/admin/post-index.js

+9-11
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,20 @@ module.exports = {
1818
},
1919

2020
ready: function () {
21-
2221
this.resource = this.$resource('api/blog/post{/id}');
23-
this.load();
22+
this.$watch('config.page', this.load, {immediate: true});
2423
},
2524

2625
watch: {
2726

28-
'config.page': 'load',
29-
3027
'config.filter': {
3128
handler: function (filter) {
32-
this.load(0);
29+
if (this.config.page) {
30+
this.config.page = 0;
31+
} else {
32+
this.load();
33+
}
34+
3335
this.$session.set('posts.filter', filter);
3436
},
3537
deep: true
@@ -110,18 +112,14 @@ module.exports = {
110112
});
111113
},
112114

113-
load: function (page) {
114-
115-
page = page !== undefined ? page : this.config.page;
116-
117-
this.resource.query({ filter: this.config.filter, page: page }).then(function (res) {
115+
load: function () {
116+
this.resource.query({ filter: this.config.filter, page: this.config.page }).then(function (res) {
118117

119118
var data = res.data;
120119

121120
this.$set('posts', data.posts);
122121
this.$set('pages', data.pages);
123122
this.$set('count', data.count);
124-
this.$set('config.page', page);
125123
this.$set('selected', []);
126124
});
127125
},

app/views/comments.js

+8
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ module.exports = {
2929
this.$set('post', data.posts[0]);
3030
this.$set('count', data.count);
3131

32+
this.$nextTick(function () {
33+
var anchor = jQuery(window.location.hash);
34+
35+
if (anchor && anchor.length) {
36+
UIkit.Utils.scrollToElement(anchor);
37+
}
38+
});
39+
3240
this.reply();
3341
});
3442
},

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "pagekit/blog",
33
"type": "pagekit-extension",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"title": "Blog",
66
"description": "A blog extensions with a built-in comment system.",
77
"license": "MIT",

languages/ar_EG/messages.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,23 @@
22
'Require e-mail.' => '',
33
'General' => '',
44
'Show Avatars from Gravatar.' => '',
5-
'Unable to comment. Please try again later.' => '',
5+
'Unable to comment. Please try again later.' => 'غير مسموح لك بالتعليق . الرجاء معاودة المحاولة في وقت لاحق.',
66
'Submit' => '',
77
'Comment' => '',
8-
'Comments are closed.' => '',
8+
'Enable Comments' => '',
99
'Appearance' => '',
1010
'Draft' => '',
1111
'Author' => '',
1212
'Permalink' => '',
1313
'Slug' => '',
1414
'Email invalid.' => '',
1515
'Comment not found.' => '',
16-
'Filter by' => '',
17-
'{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '',
16+
'Filter by' => 'تصفية حسب',
1817
'Comments (%count%)' => '',
1918
'Title' => 'عنوان',
20-
'Thank you! Your comment needs approval before showing up.' => '',
19+
'{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '',
2120
'Insufficient user rights.' => '',
22-
'Posts View' => '',
21+
'Posts View' => 'مشاهدة المشاركات',
2322
'Default post settings' => '',
2423
'{1} %count% Post selected|]1,Inf[ %count% Posts selected' => '',
2524
'Comments' => '',
@@ -29,14 +28,14 @@
2928
'Disabled' => '',
3029
'Approved' => '',
3130
'Edit Post' => '',
32-
'Enable Comments' => '',
31+
'Thank you! Your comment needs approval before showing up.' => 'شكرا لتعليقك سيتم نشره عند موافقة المشرف عليه',
3332
'Pending Review' => '',
34-
'Excerpt' => '',
33+
'Excerpt' => 'مقتطفات',
3534
'Invalid post id.' => '',
3635
'Blog' => '',
3736
'Logged in as %name%' => '',
3837
'Order comments by' => '',
39-
'Title cannot be blank.' => '',
38+
'Title cannot be blank.' => 'لايمكن ترك حقل العنوان فارغ',
4039
'Save' => 'حفظ',
4140
'Status' => '',
4241
'{0} %count% Comments|{1} %count% Comment|]1,Inf[ %count% Comments' => '',
@@ -80,6 +79,7 @@
8079
'Content cannot be blank.' => '',
8180
'Unknown' => '',
8281
'Month and name' => '',
82+
'Comments are closed.' => '',
8383
'Close comments on articles older than' => '',
8484
'Cancel' => 'إالغاء',
8585
'Written by %name% on %date%' => '',
@@ -91,7 +91,7 @@
9191
'Leave a comment' => '',
9292
'{0} No comments|{1} %num% Comment|]1,Inf[ %num% Comments' => '',
9393
'Post' => '',
94-
'View' => '',
94+
'View' => 'مشاهدة',
9595
'Numeric' => '',
9696
'Name' => 'الاسم',
9797
);

languages/ar_SA/messages.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'Unable to comment. Please try again later.' => 'لا يمكنك التعليق الرجاء المحاولة لاحقا',
66
'Submit' => 'تقديم',
77
'Comment' => 'تعليق',
8-
'Comments are closed.' => 'التعليقات مغلقة',
8+
'Enable Comments' => 'تمكين التعليقات',
99
'Appearance' => 'المظهر',
1010
'Draft' => 'مسودة',
1111
'Author' => 'الكاتب',
@@ -14,10 +14,9 @@
1414
'Email invalid.' => 'البريد الإلكتروني غير صالح',
1515
'Comment not found.' => 'يتعدر إيجاد المشاركة',
1616
'Filter by' => 'تصنيف حسب',
17-
'{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '',
1817
'Comments (%count%)' => 'تعليقات (%count%)',
1918
'Title' => 'العنوان',
20-
'Thank you! Your comment needs approval before showing up.' => 'شكرا ! ستتم مراجعة التعليق قبل نشره',
19+
'{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '',
2120
'Insufficient user rights.' => 'أنت غير مسجل',
2221
'Posts View' => 'عرض المشاركات',
2322
'Default post settings' => 'الإعدادات الإفتراضية للمنشور',
@@ -29,7 +28,7 @@
2928
'Disabled' => 'معطل',
3029
'Approved' => 'تمت الموافقة عليه',
3130
'Edit Post' => 'تحرير المشاركة.',
32-
'Enable Comments' => 'تمكين التعليقات',
31+
'Thank you! Your comment needs approval before showing up.' => 'شكرا ! ستتم مراجعة التعليق قبل نشره',
3332
'Pending Review' => 'مراجعة قيد الانتظار',
3433
'Excerpt' => 'ملخص',
3534
'Invalid post id.' => 'معرف المشاركة خاطئ.',
@@ -49,7 +48,7 @@
4948
'No comments found.' => 'لا توجد تعليقات',
5049
'Publish on' => 'نشر في',
5150
'Name cannot be blank.' => 'الرجاء إدخال الإسم',
52-
'Invalid slug.' => '',
51+
'Invalid slug.' => 'مسار غير صالح',
5352
'Please provide valid name and email.' => 'فضلا أدخل اسما وبريدا الكترونيا صحيحين.',
5453
'You are not allowed to post comments.' => 'غير مسموح لك بكتابة التعليقات.',
5554
'Author cannot be blank.' => 'الرجاء إدخال اسم الكاتب',
@@ -80,6 +79,7 @@
8079
'Content cannot be blank.' => 'المحتوى لا يمكن أن يكون فارغا',
8180
'Unknown' => 'غير معروف',
8281
'Month and name' => 'شهر واسم',
82+
'Comments are closed.' => 'التعليقات مغلقة',
8383
'Close comments on articles older than' => 'أغلق التعليقات في المواضيع الأقدم من',
8484
'Cancel' => 'إلغاء',
8585
'Written by %name% on %date%' => 'كتبت من قبل %name% في %date%',

languages/az@latin/messages.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'Unable to comment. Please try again later.' => '',
66
'Submit' => '',
77
'Comment' => '',
8-
'Comments are closed.' => '',
8+
'Enable Comments' => '',
99
'Appearance' => '',
1010
'Draft' => '',
1111
'Author' => '',
@@ -14,10 +14,9 @@
1414
'Email invalid.' => '',
1515
'Comment not found.' => '',
1616
'Filter by' => '',
17-
'{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '',
1817
'Comments (%count%)' => '',
1918
'Title' => '',
20-
'Thank you! Your comment needs approval before showing up.' => '',
19+
'{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '',
2120
'Insufficient user rights.' => '',
2221
'Posts View' => '',
2322
'Default post settings' => '',
@@ -29,7 +28,7 @@
2928
'Disabled' => '',
3029
'Approved' => '',
3130
'Edit Post' => '',
32-
'Enable Comments' => '',
31+
'Thank you! Your comment needs approval before showing up.' => '',
3332
'Pending Review' => '',
3433
'Excerpt' => '',
3534
'Invalid post id.' => '',
@@ -80,6 +79,7 @@
8079
'Content cannot be blank.' => '',
8180
'Unknown' => '',
8281
'Month and name' => '',
82+
'Comments are closed.' => '',
8383
'Close comments on articles older than' => '',
8484
'Cancel' => '',
8585
'Written by %name% on %date%' => '',

languages/az_AZ/messages.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'Unable to comment. Please try again later.' => '',
66
'Submit' => '',
77
'Comment' => '',
8-
'Comments are closed.' => '',
8+
'Enable Comments' => '',
99
'Appearance' => '',
1010
'Draft' => '',
1111
'Author' => '',
@@ -14,10 +14,9 @@
1414
'Email invalid.' => '',
1515
'Comment not found.' => '',
1616
'Filter by' => '',
17-
'{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '',
1817
'Comments (%count%)' => '',
1918
'Title' => '',
20-
'Thank you! Your comment needs approval before showing up.' => '',
19+
'{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '',
2120
'Insufficient user rights.' => '',
2221
'Posts View' => '',
2322
'Default post settings' => '',
@@ -29,7 +28,7 @@
2928
'Disabled' => '',
3029
'Approved' => '',
3130
'Edit Post' => '',
32-
'Enable Comments' => '',
31+
'Thank you! Your comment needs approval before showing up.' => '',
3332
'Pending Review' => '',
3433
'Excerpt' => '',
3534
'Invalid post id.' => '',
@@ -80,6 +79,7 @@
8079
'Content cannot be blank.' => '',
8180
'Unknown' => '',
8281
'Month and name' => '',
82+
'Comments are closed.' => '',
8383
'Close comments on articles older than' => '',
8484
'Cancel' => '',
8585
'Written by %name% on %date%' => '',

languages/bg_BG/messages.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'Unable to comment. Please try again later.' => '',
66
'Submit' => '',
77
'Comment' => 'Коментар',
8-
'Comments are closed.' => '',
8+
'Enable Comments' => 'Разреши коментарите',
99
'Appearance' => 'Външност',
1010
'Draft' => 'Чернова',
1111
'Author' => 'Автор',
@@ -14,10 +14,9 @@
1414
'Email invalid.' => '',
1515
'Comment not found.' => '',
1616
'Filter by' => '',
17-
'{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '',
1817
'Comments (%count%)' => 'Коментари (%count%)',
1918
'Title' => '',
20-
'Thank you! Your comment needs approval before showing up.' => '',
19+
'{1} %count% Comment selected|]1,Inf[ %count% Comments selected' => '',
2120
'Insufficient user rights.' => '',
2221
'Posts View' => '',
2322
'Default post settings' => '',
@@ -29,7 +28,7 @@
2928
'Disabled' => '',
3029
'Approved' => 'Одобрен',
3130
'Edit Post' => 'Редактирай публикация',
32-
'Enable Comments' => 'Разреши коментарите',
31+
'Thank you! Your comment needs approval before showing up.' => '',
3332
'Pending Review' => 'Чака ревю',
3433
'Excerpt' => 'Откъс',
3534
'Invalid post id.' => 'Невалиден идентификатор на публикация.',
@@ -80,6 +79,7 @@
8079
'Content cannot be blank.' => '',
8180
'Unknown' => '',
8281
'Month and name' => 'Месец и име',
82+
'Comments are closed.' => '',
8383
'Close comments on articles older than' => 'Затвори коментарите към статиите по-стари от',
8484
'Cancel' => '',
8585
'Written by %name% on %date%' => 'Написан от %name% на %date%',

0 commit comments

Comments
 (0)