From d5f4d288e92499b64e96aeafe673ed05708cc8da Mon Sep 17 00:00:00 2001 From: PayBas Date: Wed, 28 May 2014 21:33:17 +0200 Subject: [PATCH 1/9] [ticket/12608] Improve notifications drop-down menu styling in header PHPBB3-12608 --- phpBB/language/en/common.php | 37 +++++++++--------- phpBB/phpbb/notification/type/base.php | 36 ++++++++++++++++++ .../notification/type/disapprove_post.php | 26 ++++++++++++- .../notification/type/disapprove_topic.php | 26 ++++++++++++- phpBB/phpbb/notification/type/pm.php | 15 +++++++- phpBB/phpbb/notification/type/post.php | 14 ++++++- phpBB/phpbb/notification/type/report_pm.php | 38 ++++++++++++++----- .../notification/type/report_pm_closed.php | 14 ++++++- phpBB/phpbb/notification/type/report_post.php | 38 ++++++++++++++----- .../notification/type/report_post_closed.php | 14 ++++++- phpBB/phpbb/notification/type/topic.php | 28 +++++++++++++- .../notification/type/type_interface.php | 14 +++++++ .../template/notification_dropdown.html | 9 +++-- .../prosilver/template/ucp_notifications.html | 6 ++- phpBB/styles/prosilver/theme/common.css | 30 ++++++++++++++- phpBB/styles/prosilver/theme/links.css | 3 ++ 16 files changed, 296 insertions(+), 52 deletions(-) diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 9a44337294..09bac9e997 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -440,29 +440,32 @@ $lang = array_merge($lang, array( // A, B, C and 2 others replied... // A, B, C and others replied... 'NOTIFICATION_BOOKMARK' => array( - 1 => '%1$s replied to the topic “%2$s” you have bookmarked.', + 1 => 'Reply from %1$s in bookmarked topic:', ), - 'NOTIFICATION_GROUP_REQUEST' => '%1$s is requesting to join the group %2$s.', - 'NOTIFICATION_GROUP_REQUEST_APPROVED' => 'Your request to join the group %1$s has been approved.', - 'NOTIFICATION_PM' => '%1$s sent you a Private Message "%2$s".', + 'NOTIFICATION_FORUM' => 'Forum: "%1$s"', + 'NOTIFICATION_GROUP_REQUEST' => 'Group request from %1$s to join the group %2$s.', + 'NOTIFICATION_GROUP_REQUEST_APPROVED' => 'Group request approved to join the group %1$s.', + 'NOTIFICATION_PM' => 'Private Message from %1$s:', 'NOTIFICATION_POST' => array( - 1 => '%1$s replied to the topic “%2$s”.', + 1 => 'Reply from %1$s in topic:', ), - 'NOTIFICATION_POST_APPROVED' => 'Your post was approved "%2$s".', - 'NOTIFICATION_POST_DISAPPROVED' => 'Your post "%1$s" was disapproved for reason: "%2$s".', - 'NOTIFICATION_POST_IN_QUEUE' => 'A new post titled "%2$s" was posted by %1$s and needs approval.', + 'NOTIFICATION_POST_APPROVED' => 'Post approved:', + 'NOTIFICATION_POST_DISAPPROVED' => 'Post disapproved:', + 'NOTIFICATION_POST_IN_QUEUE' => 'Post approval request by %1$s:', 'NOTIFICATION_QUOTE' => array( - 1 => '%1$s quoted you in the post “%2$s”.', + 1 => 'Quoted by %1$s in:', ), - 'NOTIFICATION_REPORT_PM' => '%1$s reported a Private Message "%2$s" for reason: "%3$s".', - 'NOTIFICATION_REPORT_POST' => '%1$s reported a post "%2$s" for reason: "%3$s".', - 'NOTIFICATION_REPORT_CLOSED' => '%1$s closed the report you made for "%2$s".', - 'NOTIFICATION_TOPIC' => '%1$s posted a new topic "%2$s" in the forum "%3$s".', - 'NOTIFICATION_TOPIC_APPROVED' => 'Your topic "%2$s" in the forum "%3$s" was approved.', - 'NOTIFICATION_TOPIC_DISAPPROVED' => 'Your topic "%1$s" was disapproved for reason: "%2$s".', - 'NOTIFICATION_TOPIC_IN_QUEUE' => 'A new topic titled "%2$s" was posted by %1$s and needs approval.', + 'NOTIFICATION_REFERENCE' => '"%1$s"', + 'NOTIFICATION_REASON' => 'Reason: "%1$s".', + 'NOTIFICATION_REPORT_PM' => 'Private Message reported by %1$s:', + 'NOTIFICATION_REPORT_POST' => 'Post reported by %1$s:', + 'NOTIFICATION_REPORT_CLOSED' => 'Report closed by %1$s for:', + 'NOTIFICATION_TOPIC' => 'New topic by %1$s:', + 'NOTIFICATION_TOPIC_APPROVED' => 'Topic approved:', + 'NOTIFICATION_TOPIC_DISAPPROVED' => 'Topic disapproved:', + 'NOTIFICATION_TOPIC_IN_QUEUE' => 'Topic approval request by %1$s:', 'NOTIFICATION_TYPE_NOT_EXIST' => 'The notification type "%s" is missing from the file system.', - 'NOTIFICATION_ADMIN_ACTIVATE_USER' => 'The user “%1$s” is newly registered and requires activation.', + 'NOTIFICATION_ADMIN_ACTIVATE_USER' => 'Activation required for newly registered user: “%1$s”', // Used in conjuction with NOTIFICATION_BOOKMARK and NOTIFICATION_POST. 'NOTIFICATION_MANY_OTHERS' => 'others', 'NOTIFICATION_X_OTHERS' => array( diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php index c1d4d0e257..7e881d0c55 100644 --- a/phpBB/phpbb/notification/type/base.php +++ b/phpBB/phpbb/notification/type/base.php @@ -312,6 +312,12 @@ abstract class base implements \phpbb\notification\type\type_interface 'AVATAR' => $this->get_avatar(), 'FORMATTED_TITLE' => $this->get_title(), + + 'REFERENCE' => $this->get_reference(), + + 'FORUM' => $this->get_forum(), + + 'REASON' => $this->get_reason(), 'URL' => $this->get_url(), 'TIME' => $this->user->format_date($this->notification_time), @@ -346,6 +352,36 @@ abstract class base implements \phpbb\notification\type\type_interface return ''; } + /** + * Get the reference of the notifcation (fall back) + * + * @return string + */ + public function get_reference() + { + return ''; + } + + /** + * Get the forum of the notification reference (fall back) + * + * @return string + */ + public function get_forum() + { + return ''; + } + + /** + * Get the reason for the notifcation (fall back) + * + * @return string + */ + public function get_reason() + { + return ''; + } + /** * Get the special items to load (fall back) * diff --git a/phpBB/phpbb/notification/type/disapprove_post.php b/phpBB/phpbb/notification/type/disapprove_post.php index b5f94f404f..c3dbe4e91d 100644 --- a/phpBB/phpbb/notification/type/disapprove_post.php +++ b/phpBB/phpbb/notification/type/disapprove_post.php @@ -62,10 +62,32 @@ class disapprove_post extends \phpbb\notification\type\approve_post * @return string */ public function get_title() + { + return $this->user->lang($this->language_key); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() { return $this->user->lang( - $this->language_key, - censor_text($this->get_data('topic_title')), + 'NOTIFICATION_REFERENCE', + censor_text($this->get_data('topic_title')) + ); + } + + /** + * Get the reason for the disapproval notification + * + * @return string + */ + public function get_reason() + { + return $this->user->lang( + 'NOTIFICATION_REASON', $this->get_data('disapprove_reason') ); } diff --git a/phpBB/phpbb/notification/type/disapprove_topic.php b/phpBB/phpbb/notification/type/disapprove_topic.php index 8883c53294..2f29bb271e 100644 --- a/phpBB/phpbb/notification/type/disapprove_topic.php +++ b/phpBB/phpbb/notification/type/disapprove_topic.php @@ -62,10 +62,32 @@ class disapprove_topic extends \phpbb\notification\type\approve_topic * @return string */ public function get_title() + { + return $this->user->lang($this->language_key); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() { return $this->user->lang( - $this->language_key, - censor_text($this->get_data('topic_title')), + 'NOTIFICATION_REFERENCE', + censor_text($this->get_data('topic_title')) + ); + } + + /** + * Get the reason for the disapproval notification + * + * @return string + */ + public function get_reason() + { + return $this->user->lang( + 'NOTIFICATION_REASON', $this->get_data('disapprove_reason') ); } diff --git a/phpBB/phpbb/notification/type/pm.php b/phpBB/phpbb/notification/type/pm.php index 955d121cc6..4f54e93e06 100644 --- a/phpBB/phpbb/notification/type/pm.php +++ b/phpBB/phpbb/notification/type/pm.php @@ -111,7 +111,20 @@ class pm extends \phpbb\notification\type\base { $username = $this->user_loader->get_username($this->get_data('from_user_id'), 'no_profile'); - return $this->user->lang('NOTIFICATION_PM', $username, $this->get_data('message_subject')); + return $this->user->lang('NOTIFICATION_PM', $username); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() + { + return $this->user->lang( + 'NOTIFICATION_REFERENCE', + $this->get_data('message_subject') + ); } /** diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index c8760f904e..ee3a253e0f 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -225,11 +225,23 @@ class post extends \phpbb\notification\type\base return $this->user->lang( $this->language_key, phpbb_generate_string_list($usernames, $this->user), - censor_text($this->get_data('topic_title')), $responders_cnt ); } + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() + { + return $this->user->lang( + 'NOTIFICATION_REFERENCE', + censor_text($this->get_data('topic_title')) + ); + } + /** * Get email template * diff --git a/phpBB/phpbb/notification/type/report_pm.php b/phpBB/phpbb/notification/type/report_pm.php index 03e89dd28e..2bf13d4aa6 100644 --- a/phpBB/phpbb/notification/type/report_pm.php +++ b/phpBB/phpbb/notification/type/report_pm.php @@ -159,12 +159,36 @@ class report_pm extends \phpbb\notification\type\pm $username = $this->user_loader->get_username($this->get_data('reporter_id'), 'no_profile'); + return $this->user->lang( + $this->language_key, + $username + ); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() + { + return $this->user->lang( + 'NOTIFICATION_REFERENCE', + censor_text($this->get_data('message_subject')) + ); + } + + /** + * Get the reason for the notification + * + * @return string + */ + public function get_reason() + { if ($this->get_data('report_text')) { return $this->user->lang( - $this->language_key, - $username, - censor_text($this->get_data('message_subject')), + 'NOTIFICATION_REASON', $this->get_data('report_text') ); } @@ -172,17 +196,13 @@ class report_pm extends \phpbb\notification\type\pm if (isset($this->user->lang[$this->get_data('reason_title')])) { return $this->user->lang( - $this->language_key, - $username, - censor_text($this->get_data('message_subject')), + 'NOTIFICATION_REASON', $this->user->lang[$this->get_data('reason_title')] ); } return $this->user->lang( - $this->language_key, - $username, - censor_text($this->get_data('message_subject')), + 'NOTIFICATION_REASON', $this->get_data('reason_description') ); } diff --git a/phpBB/phpbb/notification/type/report_pm_closed.php b/phpBB/phpbb/notification/type/report_pm_closed.php index a646996f75..ed40df67f3 100644 --- a/phpBB/phpbb/notification/type/report_pm_closed.php +++ b/phpBB/phpbb/notification/type/report_pm_closed.php @@ -107,7 +107,19 @@ class report_pm_closed extends \phpbb\notification\type\pm return $this->user->lang( $this->language_key, - $username, + $username + ); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() + { + return $this->user->lang( + 'NOTIFICATION_REFERENCE', censor_text($this->get_data('message_subject')) ); } diff --git a/phpBB/phpbb/notification/type/report_post.php b/phpBB/phpbb/notification/type/report_post.php index d5589a6756..1a4682eb62 100644 --- a/phpBB/phpbb/notification/type/report_post.php +++ b/phpBB/phpbb/notification/type/report_post.php @@ -132,12 +132,36 @@ class report_post extends \phpbb\notification\type\post_in_queue $username = $this->user_loader->get_username($this->get_data('reporter_id'), 'no_profile'); + return $this->user->lang( + $this->language_key, + $username + ); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() + { + return $this->user->lang( + 'NOTIFICATION_REFERENCE', + censor_text($this->get_data('post_subject')) + ); + } + + /** + * Get the reason for the notification + * + * @return string + */ + public function get_reason() + { if ($this->get_data('report_text')) { return $this->user->lang( - $this->language_key, - $username, - censor_text($this->get_data('post_subject')), + 'NOTIFICATION_REASON', $this->get_data('report_text') ); } @@ -145,17 +169,13 @@ class report_post extends \phpbb\notification\type\post_in_queue if (isset($this->user->lang[$this->get_data('reason_title')])) { return $this->user->lang( - $this->language_key, - $username, - censor_text($this->get_data('post_subject')), + 'NOTIFICATION_REASON', $this->user->lang[$this->get_data('reason_title')] ); } return $this->user->lang( - $this->language_key, - $username, - censor_text($this->get_data('post_subject')), + 'NOTIFICATION_REASON', $this->get_data('reason_description') ); } diff --git a/phpBB/phpbb/notification/type/report_post_closed.php b/phpBB/phpbb/notification/type/report_post_closed.php index e76fa57036..a979af1fb0 100644 --- a/phpBB/phpbb/notification/type/report_post_closed.php +++ b/phpBB/phpbb/notification/type/report_post_closed.php @@ -114,7 +114,19 @@ class report_post_closed extends \phpbb\notification\type\post return $this->user->lang( $this->language_key, - $username, + $username + ); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() + { + return $this->user->lang( + 'NOTIFICATION_REFERENCE', censor_text($this->get_data('post_subject')) ); } diff --git a/phpBB/phpbb/notification/type/topic.php b/phpBB/phpbb/notification/type/topic.php index 144c4e58a0..a512a12f20 100644 --- a/phpBB/phpbb/notification/type/topic.php +++ b/phpBB/phpbb/notification/type/topic.php @@ -151,8 +151,32 @@ class topic extends \phpbb\notification\type\base return $this->user->lang( $this->language_key, - $username, - censor_text($this->get_data('topic_title')), + $username + ); + } + + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference() + { + return $this->user->lang( + 'NOTIFICATION_REFERENCE', + censor_text($this->get_data('topic_title')) + ); + } + + /** + * Get the forum of the notification reference + * + * @return string + */ + public function get_forum() + { + return $this->user->lang( + 'NOTIFICATION_FORUM', $this->get_data('forum_name') ); } diff --git a/phpBB/phpbb/notification/type/type_interface.php b/phpBB/phpbb/notification/type/type_interface.php index c91c7078ad..5e139b797e 100644 --- a/phpBB/phpbb/notification/type/type_interface.php +++ b/phpBB/phpbb/notification/type/type_interface.php @@ -94,6 +94,20 @@ interface type_interface */ public function get_title(); + /** + * Get the HTML formatted reference of the notification + * + * @return string + */ + public function get_reference(); + + /** + * Get the forum of the notification reference + * + * @return string + */ + public function get_forum(); + /** * Get the url to this item * diff --git a/phpBB/styles/prosilver/template/notification_dropdown.html b/phpBB/styles/prosilver/template/notification_dropdown.html index db4d5bade7..fbe0e1efd4 100644 --- a/phpBB/styles/prosilver/template/notification_dropdown.html +++ b/phpBB/styles/prosilver/template/notification_dropdown.html @@ -20,12 +20,15 @@
  • - + {notifications.AVATAR}
    -

    {notifications.FORMATTED_TITLE}

    -

    » {notifications.TIME}

    +

    {notifications.FORMATTED_TITLE}

    +

    {notifications.REFERENCE}

    +

    {notifications.FORUM}

    +

    {notifications.REASON}

    +

    {notifications.TIME}

    diff --git a/phpBB/styles/prosilver/template/ucp_notifications.html b/phpBB/styles/prosilver/template/ucp_notifications.html index 8910769cce..61df0c9cf5 100644 --- a/phpBB/styles/prosilver/template/ucp_notifications.html +++ b/phpBB/styles/prosilver/template/ucp_notifications.html @@ -72,8 +72,10 @@ {notification_list.AVATAR}
    -

    {notification_list.FORMATTED_TITLE}

    -
    +

    {notification_list.FORMATTED_TITLE} {notification_list.REFERENCE}

    + +

    {notification_list.FORUM}

    +

    {notification_list.REASON}

    {notification_list.TIME}

    {L_MARK_READ}

    diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index aa28cd6962..50e89928d0 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -1101,7 +1101,7 @@ form > p.post-notice strong { display: none; position: absolute; left: 0; - width: 330px; + width: 340px; z-index: 1; top: 22px; } @@ -1173,19 +1173,38 @@ form > p.post-notice strong { text-decoration: none; } +.notification_list a.notification-block { + padding: 8px; +} + .notification_list ul li img { float: left; max-height: 50px; + max-width: 50px; width: auto !important; height: auto !important; margin-right: 5px; } .notification_list ul li p { - margin: 0; + margin-bottom: 4px; font-size: 1em; } +.notification_list p.notification-reference, +.notification_list p.notification-location, +.notification_list a.notification-block p.notification-reason { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.notification_list ul li p.notification-time { + font-size: 0.9em; + margin: 0; + text-align: right; +} + .notification_list div.notifications { padding: 5px; } @@ -1193,6 +1212,9 @@ form > p.post-notice strong { .notification_list p.notifications_title { font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-size: 13px !important; +} + +.notification_list p.notifications_title strong { font-weight: bold; } @@ -1200,6 +1222,10 @@ form > p.post-notice strong { font-size: 11px !important; } +.notification_text { + margin-left: 58px; +} + .notification_text:after { content: ''; clear: both; diff --git a/phpBB/styles/prosilver/theme/links.css b/phpBB/styles/prosilver/theme/links.css index 86cdf9c10e..89639dde02 100644 --- a/phpBB/styles/prosilver/theme/links.css +++ b/phpBB/styles/prosilver/theme/links.css @@ -62,6 +62,9 @@ ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a { top: 50%; width: 30px; height: 40px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } .dropdown-extended li:hover a.mark_read { From 72d29e76ced756a7b4501113a91275d8ca693af2 Mon Sep 17 00:00:00 2001 From: PayBas Date: Wed, 28 May 2014 21:53:05 +0200 Subject: [PATCH 2/9] [ticket/12608] Updated tests PHPBB3-12608 --- tests/notification/user_list_trim_test.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/notification/user_list_trim_test.php b/tests/notification/user_list_trim_test.php index 7e0add2bb5..85d8961e82 100644 --- a/tests/notification/user_list_trim_test.php +++ b/tests/notification/user_list_trim_test.php @@ -75,7 +75,7 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case 'post_username' => 'A', 'responders' => null, ), - 'A replied to the topic “Test”.', + 'Reply from A in topic:', ), array( array( @@ -86,7 +86,7 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case array('username' => '', 'poster_id' => 3), ), ), - 'A and B replied to the topic “Test”.', + 'Reply from A and B in topic:', ), array( array( @@ -98,7 +98,7 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case array('username' => '', 'poster_id' => 4), ), ), - 'A, B, and C replied to the topic “Test”.', + 'Reply from A, B, and C in topic:', ), array( array( @@ -111,7 +111,7 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case array('username' => '', 'poster_id' => 5), ), ), - 'A, B, C, and D replied to the topic “Test”.', + 'Reply from A, B, C, and D in topic:', ), array( array( @@ -125,7 +125,7 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case array('username' => '', 'poster_id' => 6), ), ), - 'A, B, C, and 2 others replied to the topic “Test”.', + 'Reply from A, B, C, and 2 others in topic:', ), ); } From 693cbd247cc1d3768d56795da4a580780e6b899c Mon Sep 17 00:00:00 2001 From: PayBas Date: Wed, 28 May 2014 22:49:16 +0200 Subject: [PATCH 3/9] [ticket/12608] Add styling (CSS class) options to notifications This will allow different notifications to have different styles PHPBB3-12608 --- phpBB/language/en/common.php | 4 ++-- phpBB/phpbb/notification/type/base.php | 12 ++++++++++++ phpBB/phpbb/notification/type/report_pm.php | 10 ++++++++++ phpBB/phpbb/notification/type/report_post.php | 10 ++++++++++ phpBB/phpbb/notification/type/type_interface.php | 7 +++++++ .../prosilver/template/notification_dropdown.html | 4 ++-- .../styles/prosilver/template/ucp_notifications.html | 2 +- phpBB/styles/prosilver/theme/colours.css | 9 +++++++++ phpBB/styles/prosilver/theme/common.css | 2 +- 9 files changed, 54 insertions(+), 6 deletions(-) diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 09bac9e997..e8169fc41a 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -442,7 +442,7 @@ $lang = array_merge($lang, array( 'NOTIFICATION_BOOKMARK' => array( 1 => 'Reply from %1$s in bookmarked topic:', ), - 'NOTIFICATION_FORUM' => 'Forum: "%1$s"', + 'NOTIFICATION_FORUM' => 'Forum: %1$s', 'NOTIFICATION_GROUP_REQUEST' => 'Group request from %1$s to join the group %2$s.', 'NOTIFICATION_GROUP_REQUEST_APPROVED' => 'Group request approved to join the group %1$s.', 'NOTIFICATION_PM' => 'Private Message from %1$s:', @@ -456,7 +456,7 @@ $lang = array_merge($lang, array( 1 => 'Quoted by %1$s in:', ), 'NOTIFICATION_REFERENCE' => '"%1$s"', - 'NOTIFICATION_REASON' => 'Reason: "%1$s".', + 'NOTIFICATION_REASON' => 'Reason: %1$s.', 'NOTIFICATION_REPORT_PM' => 'Private Message reported by %1$s:', 'NOTIFICATION_REPORT_POST' => 'Post reported by %1$s:', 'NOTIFICATION_REPORT_CLOSED' => 'Report closed by %1$s for:', diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php index 7e881d0c55..f5a4a9cc45 100644 --- a/phpBB/phpbb/notification/type/base.php +++ b/phpBB/phpbb/notification/type/base.php @@ -309,6 +309,8 @@ abstract class base implements \phpbb\notification\type\type_interface return array( 'NOTIFICATION_ID' => $this->notification_id, + 'STYLING' => $this->get_styling(), + 'AVATAR' => $this->get_avatar(), 'FORMATTED_TITLE' => $this->get_title(), @@ -342,6 +344,16 @@ abstract class base implements \phpbb\notification\type\type_interface return false; } + /** + * Get the styling of the notification (fall back) + * + * @return string + */ + public function get_styling() + { + return ''; + } + /** * Get the user's avatar (fall back) * diff --git a/phpBB/phpbb/notification/type/report_pm.php b/phpBB/phpbb/notification/type/report_pm.php index 2bf13d4aa6..55bc52927f 100644 --- a/phpBB/phpbb/notification/type/report_pm.php +++ b/phpBB/phpbb/notification/type/report_pm.php @@ -30,6 +30,16 @@ class report_pm extends \phpbb\notification\type\pm return 'report_pm'; } + /** + * Get the styling of the notification + * + * @return string + */ + public function get_styling() + { + return 'reported'; + } + /** * Language key used to output the text * diff --git a/phpBB/phpbb/notification/type/report_post.php b/phpBB/phpbb/notification/type/report_post.php index 1a4682eb62..c982042cb3 100644 --- a/phpBB/phpbb/notification/type/report_post.php +++ b/phpBB/phpbb/notification/type/report_post.php @@ -29,6 +29,16 @@ class report_post extends \phpbb\notification\type\post_in_queue return 'report_post'; } + /** + * Get the styling of the notification + * + * @return string + */ + public function get_styling() + { + return 'reported'; + } + /** * Language key used to output the text * diff --git a/phpBB/phpbb/notification/type/type_interface.php b/phpBB/phpbb/notification/type/type_interface.php index 5e139b797e..b1e54d9b6b 100644 --- a/phpBB/phpbb/notification/type/type_interface.php +++ b/phpBB/phpbb/notification/type/type_interface.php @@ -87,6 +87,13 @@ interface type_interface */ public function load_special($data, $notifications); + /** + * Get the styling of the notification + * + * @return string + */ + public function get_styling(); + /** * Get the HTML formatted title of this notification * diff --git a/phpBB/styles/prosilver/template/notification_dropdown.html b/phpBB/styles/prosilver/template/notification_dropdown.html index fbe0e1efd4..4aebeb16a8 100644 --- a/phpBB/styles/prosilver/template/notification_dropdown.html +++ b/phpBB/styles/prosilver/template/notification_dropdown.html @@ -18,13 +18,13 @@
  • -
  • +
  • {notifications.AVATAR}
    -

    {notifications.FORMATTED_TITLE}

    +

    {notifications.FORMATTED_TITLE}

    {notifications.REFERENCE}

    {notifications.FORUM}

    {notifications.REASON}

    diff --git a/phpBB/styles/prosilver/template/ucp_notifications.html b/phpBB/styles/prosilver/template/ucp_notifications.html index 61df0c9cf5..a7cf2f43aa 100644 --- a/phpBB/styles/prosilver/template/ucp_notifications.html +++ b/phpBB/styles/prosilver/template/ucp_notifications.html @@ -65,7 +65,7 @@
    diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css index f3902b363d..2e563a1edf 100644 --- a/phpBB/styles/prosilver/theme/bidi.css +++ b/phpBB/styles/prosilver/theme/bidi.css @@ -112,6 +112,32 @@ padding-right: 10px; } +.rtl .dropdown-extended .header .header_settings { + float: left; +} + +/* Notifications +----------------------------------------*/ +.rtl .notification_list ul li img { + float: right; + margin-left: 5px; + margin-right: 0; +} + +.rtl .notification_list div.notifications { + margin-left: 0; + margin-right: 50px; +} + +.rtl .notification_text { + margin-left: 0; + margin-right: 58px; +} + +.rtl .notification_list p.notification-time { + text-align: left; +} + /* Responsive breadcrumbs ----------------------------------------*/ .rtl .breadcrumbs .crumb { diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index 75ae7ae59d..05eeee8849 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -1115,7 +1115,7 @@ form > p.post-notice strong { .dropdown-extended ul li { padding: 0; - margin: 0; + margin: 0 !important; float: none; border-bottom: 1px solid; list-style-type: none; @@ -1160,8 +1160,8 @@ form > p.post-notice strong { font-size: 1.1em; } -.dropdown-extended ul li a{ - padding: 10px; +.dropdown-extended ul li a, .dropdown-extended ul li.no-url { + padding: 8px; } .dropdown-extended .footer > a { @@ -1173,10 +1173,6 @@ form > p.post-notice strong { text-decoration: none; } -.notification_list a.notification-block { - padding: 8px; -} - .notification_list ul li img { float: left; max-height: 50px; @@ -1193,22 +1189,27 @@ form > p.post-notice strong { .notification_list p.notification-reference, .notification_list p.notification-location, -.notification_list a.notification-block p.notification-reason { +.notification_list li a p.notification-reason { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .notification_list p.notification-time { - font-size: 0.9em; + font-size: 10px; margin: 0; text-align: right; } .notification_list div.notifications { + margin-left: 50px; padding: 5px; } +.notification_list div.notifications a { + display: block; +} + .notification_list p.notifications_title { font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-size: 13px !important; @@ -1219,7 +1220,7 @@ form > p.post-notice strong { } .notification_list p.notifications_time { - font-size: 11px !important; + font-size: 10px !important; } .notification_text { From a9e6caa7756102e61ee50739ee562b0cf09965fd Mon Sep 17 00:00:00 2001 From: PayBas Date: Sun, 1 Jun 2014 11:12:20 +0200 Subject: [PATCH 6/9] [ticket/12608] Remove somewhat redundant reported color style PHPBB3-12608 --- phpBB/styles/prosilver/theme/colours.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css index a022c361c3..dc22b54914 100644 --- a/phpBB/styles/prosilver/theme/colours.css +++ b/phpBB/styles/prosilver/theme/colours.css @@ -239,8 +239,7 @@ p.post-notice.reported:before, p.post-notice.error:before { color: #4C5D77; } -.notification_list .reported p.notifications_title strong, -.notification_list .reported p.notification-title strong { +.notification_list .reported strong { color: #D31141; } From 8e06d76aaa5179096923971893c26a7f8bfe2fbe Mon Sep 17 00:00:00 2001 From: PayBas Date: Fri, 13 Jun 2014 09:42:57 +0200 Subject: [PATCH 7/9] [ticket/12608] Changed get_styling() to get_style_class() PHPBB3-12608 --- phpBB/phpbb/notification/type/base.php | 15 +++------------ phpBB/phpbb/notification/type/disapprove_post.php | 4 ++-- .../phpbb/notification/type/disapprove_topic.php | 4 ++-- phpBB/phpbb/notification/type/report_pm.php | 4 ++-- phpBB/phpbb/notification/type/report_post.php | 4 ++-- phpBB/phpbb/notification/type/type_interface.php | 4 ++-- 6 files changed, 13 insertions(+), 22 deletions(-) diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php index db0446f510..910f51b3a6 100644 --- a/phpBB/phpbb/notification/type/base.php +++ b/phpBB/phpbb/notification/type/base.php @@ -308,24 +308,15 @@ abstract class base implements \phpbb\notification\type\type_interface return array( 'NOTIFICATION_ID' => $this->notification_id, - - 'STYLING' => $this->get_styling(), - + 'STYLING' => $this->get_style_class(), 'AVATAR' => $this->get_avatar(), - 'FORMATTED_TITLE' => $this->get_title(), - 'REFERENCE' => $this->get_reference(), - 'FORUM' => $this->get_forum(), - 'REASON' => $this->get_reason(), - 'URL' => $this->get_url(), 'TIME' => $this->user->format_date($this->notification_time), - 'UNREAD' => !$this->notification_read, - 'U_MARK_READ' => (!$this->notification_read) ? $u_mark_read : '', ); } @@ -345,11 +336,11 @@ abstract class base implements \phpbb\notification\type\type_interface } /** - * Get the styling of the notification (fall back) + * Get the CSS style class of the notification (fall back) * * @return string */ - public function get_styling() + public function get_style_class() { return ''; } diff --git a/phpBB/phpbb/notification/type/disapprove_post.php b/phpBB/phpbb/notification/type/disapprove_post.php index 004c484409..044658c016 100644 --- a/phpBB/phpbb/notification/type/disapprove_post.php +++ b/phpBB/phpbb/notification/type/disapprove_post.php @@ -31,11 +31,11 @@ class disapprove_post extends \phpbb\notification\type\approve_post } /** - * Get the styling of the notification + * Get the CSS style class of the notification * * @return string */ - public function get_styling() + public function get_style_class() { return 'reported'; } diff --git a/phpBB/phpbb/notification/type/disapprove_topic.php b/phpBB/phpbb/notification/type/disapprove_topic.php index 42ca693f7a..812045b352 100644 --- a/phpBB/phpbb/notification/type/disapprove_topic.php +++ b/phpBB/phpbb/notification/type/disapprove_topic.php @@ -31,11 +31,11 @@ class disapprove_topic extends \phpbb\notification\type\approve_topic } /** - * Get the styling of the notification + * Get the CSS style class of the notification * * @return string */ - public function get_styling() + public function get_style_class() { return 'reported'; } diff --git a/phpBB/phpbb/notification/type/report_pm.php b/phpBB/phpbb/notification/type/report_pm.php index 55bc52927f..d3d91dcd54 100644 --- a/phpBB/phpbb/notification/type/report_pm.php +++ b/phpBB/phpbb/notification/type/report_pm.php @@ -31,11 +31,11 @@ class report_pm extends \phpbb\notification\type\pm } /** - * Get the styling of the notification + * Get the CSS style class of the notification * * @return string */ - public function get_styling() + public function get_style_class() { return 'reported'; } diff --git a/phpBB/phpbb/notification/type/report_post.php b/phpBB/phpbb/notification/type/report_post.php index c982042cb3..5a8febe927 100644 --- a/phpBB/phpbb/notification/type/report_post.php +++ b/phpBB/phpbb/notification/type/report_post.php @@ -30,11 +30,11 @@ class report_post extends \phpbb\notification\type\post_in_queue } /** - * Get the styling of the notification + * Get the CSS style class of the notification * * @return string */ - public function get_styling() + public function get_style_class() { return 'reported'; } diff --git a/phpBB/phpbb/notification/type/type_interface.php b/phpBB/phpbb/notification/type/type_interface.php index b1e54d9b6b..5c5a110836 100644 --- a/phpBB/phpbb/notification/type/type_interface.php +++ b/phpBB/phpbb/notification/type/type_interface.php @@ -88,11 +88,11 @@ interface type_interface public function load_special($data, $notifications); /** - * Get the styling of the notification + * Get the CSS style class of the notification * * @return string */ - public function get_styling(); + public function get_style_class(); /** * Get the HTML formatted title of this notification From c805e53da3fd7578205133b0749e5fd989ad7095 Mon Sep 17 00:00:00 2001 From: PayBas Date: Fri, 13 Jun 2014 10:28:04 +0200 Subject: [PATCH 8/9] [ticket/12608] Add subSilver PHPBB3-12608 --- .../prosilver/template/ucp_notifications.html | 2 +- .../subsilver2/template/overall_header.html | 8 +++++-- .../template/ucp_notifications.html | 6 +++-- phpBB/styles/subsilver2/theme/stylesheet.css | 23 ++++++++++++++++--- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/phpBB/styles/prosilver/template/ucp_notifications.html b/phpBB/styles/prosilver/template/ucp_notifications.html index 5d2af425e8..500bae0c47 100644 --- a/phpBB/styles/prosilver/template/ucp_notifications.html +++ b/phpBB/styles/prosilver/template/ucp_notifications.html @@ -72,7 +72,7 @@ {notification_list.AVATAR}
    -

    {notification_list.FORMATTED_TITLE} {notification_list.REFERENCE}

    +

    {notification_list.FORMATTED_TITLE} {notification_list.REFERENCE}

    {notification_list.FORUM}

    {notification_list.REASON}

    diff --git a/phpBB/styles/subsilver2/template/overall_header.html b/phpBB/styles/subsilver2/template/overall_header.html index 314e284155..42f29b2445 100644 --- a/phpBB/styles/subsilver2/template/overall_header.html +++ b/phpBB/styles/subsilver2/template/overall_header.html @@ -166,7 +166,7 @@ function marklist(id, name, state)
    - +
    @@ -177,7 +177,11 @@ function marklist(id, name, state) {notifications.FORMATTED_TITLE} -
    » {notifications.TIME} + +
    {notifications.REFERENCE} +
    {notifications.FORUM} +
    {notifications.REASON} +
    {notifications.TIME}
    {L_MARK_READ} diff --git a/phpBB/styles/subsilver2/template/ucp_notifications.html b/phpBB/styles/subsilver2/template/ucp_notifications.html index 64e21ec4a6..b0d2925b68 100644 --- a/phpBB/styles/subsilver2/template/ucp_notifications.html +++ b/phpBB/styles/subsilver2/template/ucp_notifications.html @@ -92,9 +92,11 @@
    - {notification_list.FORMATTED_TITLE} + {notification_list.FORMATTED_TITLE} {notification_list.REFERENCE}
    - {notification_list.TIME} + {notification_list.FORUM}
    + {notification_list.REASON}
    + {notification_list.TIME}
    diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css index e69eec4f14..596ebdc29f 100644 --- a/phpBB/styles/subsilver2/theme/stylesheet.css +++ b/phpBB/styles/subsilver2/theme/stylesheet.css @@ -1189,12 +1189,21 @@ a.imageset { overflow-x: hidden; } +#notification_list table { + width: 100%; +} + #notification_list .notification_title { - padding: 5px; + padding: 3px; +} + +#notification_list .notification_title:after { + clear: both; + content: ''; + display: block; } #notification_list .header { - width: 298px; padding: 5px; font-weight: bold; border: 1px solid #A9B8C2; @@ -1208,7 +1217,6 @@ a.imageset { } #notification_list .footer { - width: 300px; text-align: center; font-size: 1.2em; border: 1px solid #A9B8C2; @@ -1223,3 +1231,12 @@ a.imageset { #notification_list .footer > a { display: block; } + +#notification_list .notification-time { + font-size: 0.9em; + float: right; +} + +.notification_list .notifications_time { + font-size: 0.8em; +} From 1a3c1d5b9ad6def9da4186d79a32f583b892a7cd Mon Sep 17 00:00:00 2001 From: PayBas Date: Sun, 22 Jun 2014 22:40:07 +0200 Subject: [PATCH 9/9] [ticket/12608] Change CSS classes to prevent styling conflicts PHPBB3-12608 --- .../notification/type/disapprove_post.php | 2 +- .../notification/type/disapprove_topic.php | 2 +- phpBB/phpbb/notification/type/report_pm.php | 2 +- phpBB/phpbb/notification/type/report_post.php | 2 +- phpBB/styles/prosilver/theme/colours.css | 19 +++++++++++-------- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/phpBB/phpbb/notification/type/disapprove_post.php b/phpBB/phpbb/notification/type/disapprove_post.php index 044658c016..7b18ed70ea 100644 --- a/phpBB/phpbb/notification/type/disapprove_post.php +++ b/phpBB/phpbb/notification/type/disapprove_post.php @@ -37,7 +37,7 @@ class disapprove_post extends \phpbb\notification\type\approve_post */ public function get_style_class() { - return 'reported'; + return 'notification-disapproved'; } /** diff --git a/phpBB/phpbb/notification/type/disapprove_topic.php b/phpBB/phpbb/notification/type/disapprove_topic.php index 812045b352..3f87741807 100644 --- a/phpBB/phpbb/notification/type/disapprove_topic.php +++ b/phpBB/phpbb/notification/type/disapprove_topic.php @@ -37,7 +37,7 @@ class disapprove_topic extends \phpbb\notification\type\approve_topic */ public function get_style_class() { - return 'reported'; + return 'notification-disapproved'; } /** diff --git a/phpBB/phpbb/notification/type/report_pm.php b/phpBB/phpbb/notification/type/report_pm.php index d3d91dcd54..2eb802eb4b 100644 --- a/phpBB/phpbb/notification/type/report_pm.php +++ b/phpBB/phpbb/notification/type/report_pm.php @@ -37,7 +37,7 @@ class report_pm extends \phpbb\notification\type\pm */ public function get_style_class() { - return 'reported'; + return 'notification-reported'; } /** diff --git a/phpBB/phpbb/notification/type/report_post.php b/phpBB/phpbb/notification/type/report_post.php index 5a8febe927..024c8d9d42 100644 --- a/phpBB/phpbb/notification/type/report_post.php +++ b/phpBB/phpbb/notification/type/report_post.php @@ -36,7 +36,7 @@ class report_post extends \phpbb\notification\type\post_in_queue */ public function get_style_class() { - return 'reported'; + return 'notification-reported'; } /** diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css index dc22b54914..9565eb9967 100644 --- a/phpBB/styles/prosilver/theme/colours.css +++ b/phpBB/styles/prosilver/theme/colours.css @@ -235,14 +235,6 @@ p.post-notice.reported:before, p.post-notice.error:before { background-image: url("./images/icon_topic_reported.gif"); } -.notification_list p.notification-time { - color: #4C5D77; -} - -.notification_list .reported strong { - color: #D31141; -} - /* -------------------------------------------------------------- Colours and backgrounds for links.css @@ -1181,3 +1173,14 @@ ul.linklist li.responsive-menu a.responsive-menu-link:hover:before, ul.linklist #minitabs .dropdown-contents { background-color: #F1F8FF; } + +/* Notifications +---------------------------------------- */ + +.notification_list p.notification-time { + color: #4C5D77; +} + +li.notification-reported strong, li.notification-disapproved strong { + color: #D31141; +}