From 3dd19abbf78e89f1ebd45f23be6437b79de749b5 Mon Sep 17 00:00:00 2001 From: isaosano Date: Fri, 29 Aug 2014 15:39:34 +0900 Subject: [PATCH 1/3] Implementation of the comment reply button (refs #3693) --- .../modules/diaryComment/templates/_list.php | 11 +++++++++++ i18n/messages.ja.xml | 4 ++++ web/css/diary.css | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/apps/pc_frontend/modules/diaryComment/templates/_list.php b/apps/pc_frontend/modules/diaryComment/templates/_list.php index dc648ca..519a89a 100644 --- a/apps/pc_frontend/modules/diaryComment/templates/_list.php +++ b/apps/pc_frontend/modules/diaryComment/templates/_list.php @@ -1,3 +1,13 @@ + + getNbResults()): ?> @@ -40,6 +50,7 @@ member_id === $sf_user->getMemberId() || $comment->member_id === $sf_user->getMemberId()): ?> +

diff --git a/i18n/messages.ja.xml b/i18n/messages.ja.xml index 859a78a..b46a470 100644 --- a/i18n/messages.ja.xml +++ b/i18n/messages.ja.xml @@ -310,6 +310,10 @@ over %years% years ago %years%年以上前 + + Reply + 返信する + diff --git a/web/css/diary.css b/web/css/diary.css index 4e983f2..d7abd41 100644 --- a/web/css/diary.css +++ b/web/css/diary.css @@ -119,3 +119,7 @@ #diarySearchFormLine p.form { text-align: right; } + +.title .heading .reply { + float: right; +} From 1745d17469f30f50fa3c6b18fb48abcfa8225f77 Mon Sep 17 00:00:00 2001 From: isaosano Date: Thu, 2 Oct 2014 16:27:29 +0900 Subject: [PATCH 2/3] add a set of comment reply to pc_backend (refs #3693) --- apps/pc_backend/i18n/messages.ja.xml | 12 ++++++++++++ .../modules/diaryComment/templates/_list.php | 4 ++-- lib/form/opDiaryPluginConfigurationForm.class.php | 7 ++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/apps/pc_backend/i18n/messages.ja.xml b/apps/pc_backend/i18n/messages.ja.xml index b33cf4f..d65b891 100644 --- a/apps/pc_backend/i18n/messages.ja.xml +++ b/apps/pc_backend/i18n/messages.ja.xml @@ -78,6 +78,18 @@ Please input the number of limit that reflects to the diary comment api. 日記コメントAPIの取得件数を入力してください。 + + Please input the number of limit that reflects to the diary comment api. + 日記コメントAPIの取得件数を入力してください。 + + + Diary comment reply + 日記コメント返信機能設定 + + + If this is used, you can reply to the diary comment. + 使用するに設定した場合、クリックした日記コメントに返信することができます。 + diff --git a/apps/pc_frontend/modules/diaryComment/templates/_list.php b/apps/pc_frontend/modules/diaryComment/templates/_list.php index 519a89a..5f0fab6 100644 --- a/apps/pc_frontend/modules/diaryComment/templates/_list.php +++ b/apps/pc_frontend/modules/diaryComment/templates/_list.php @@ -2,7 +2,7 @@ $(document).ready(function() { $('.reply').click(function() { var element = $('#diary_comment_body'); - element.val(element.val() + '@' + $(this).attr('value') + "\n"); + element.val(element.val() + '>>' + $(this).attr('number') + ' ' + $(this).attr('name') + "\n"); element.focus(); }) }) @@ -50,7 +50,7 @@ member_id === $sf_user->getMemberId() || $comment->member_id === $sf_user->getMemberId()): ?> - +get('op_diary_plugin_diary_comment_reply')): ?>

diff --git a/lib/form/opDiaryPluginConfigurationForm.class.php b/lib/form/opDiaryPluginConfigurationForm.class.php index ce938b3..ae89c77 100644 --- a/lib/form/opDiaryPluginConfigurationForm.class.php +++ b/lib/form/opDiaryPluginConfigurationForm.class.php @@ -61,12 +61,17 @@ public function configure() $this->setDefault('diary_comment_api_limit', Doctrine::getTable('SnsConfig')->get('op_diary_plugin_diary_comment_api_limit', '15')); $this->widgetSchema->setHelp('diary_comment_api_limit', 'Please input the number of limit that reflects to the diary comment api.'); + $this->setWidget('diary_comment_reply', new sfWidgetFormSelectRadio(array('choices' => $choices))); + $this->setValidator('diary_comment_reply', new sfValidatorChoice(array('choices' => array_keys($choices)))); + $this->setDefault('diary_comment_reply', Doctrine::getTable('SnsConfig')->get('op_diary_plugin_diary_comment_reply', '0')); + $this->widgetSchema->setHelp('diary_comment_reply', 'If this is used, you can reply to the diary comment.'); + $this->widgetSchema->setNameFormat('op_diary_plugin[%s]'); } public function save() { - $names = array('use_open_diary', 'use_email_post', 'update_activity', 'search_enable', 'search_period_enable', 'search_period', 'diary_api_limit', 'diary_comment_api_limit'); + $names = array('use_open_diary', 'use_email_post', 'update_activity', 'search_enable', 'search_period_enable', 'search_period', 'diary_api_limit', 'diary_comment_api_limit', 'diary_comment_reply'); foreach ($names as $name) { From 4579861c63ae9e4f0891caf162eb4b434c02bdb6 Mon Sep 17 00:00:00 2001 From: isaosano Date: Thu, 2 Oct 2014 17:02:21 +0900 Subject: [PATCH 3/3] remove duplicate lines from messages.ja.xml (refs #3693) --- apps/pc_backend/i18n/messages.ja.xml | 4 ---- apps/pc_frontend/modules/diaryComment/templates/_list.php | 4 +++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/pc_backend/i18n/messages.ja.xml b/apps/pc_backend/i18n/messages.ja.xml index d65b891..f22b176 100644 --- a/apps/pc_backend/i18n/messages.ja.xml +++ b/apps/pc_backend/i18n/messages.ja.xml @@ -78,10 +78,6 @@ Please input the number of limit that reflects to the diary comment api. 日記コメントAPIの取得件数を入力してください。 - - Please input the number of limit that reflects to the diary comment api. - 日記コメントAPIの取得件数を入力してください。 - Diary comment reply 日記コメント返信機能設定 diff --git a/apps/pc_frontend/modules/diaryComment/templates/_list.php b/apps/pc_frontend/modules/diaryComment/templates/_list.php index 5f0fab6..7fb7921 100644 --- a/apps/pc_frontend/modules/diaryComment/templates/_list.php +++ b/apps/pc_frontend/modules/diaryComment/templates/_list.php @@ -50,7 +50,9 @@ member_id === $sf_user->getMemberId() || $comment->member_id === $sf_user->getMemberId()): ?> -get('op_diary_plugin_diary_comment_reply')): ?> +get('op_diary_plugin_diary_comment_reply')): ?> + +