@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Allow users to choo choo choose a room color

Summary: This adds some basic per user / per room theming for Conpherence, which should hopefully let users identify rooms from just the sidebar color.

Test Plan: Lots of threads with different colors.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D17747

+139 -27
+25 -22
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'conpherence.pkg.css' => '3776e82d', 11 - 'conpherence.pkg.js' => '7b6aa581', 10 + 'conpherence.pkg.css' => 'ff161f2d', 11 + 'conpherence.pkg.js' => 'b5b51108', 12 12 'core.pkg.css' => '959330a2', 13 13 'core.pkg.js' => '47a69358', 14 14 'darkconsole.pkg.js' => '1f9a31bc', ··· 50 50 'rsrc/css/application/config/config-template.css' => '8f18fa41', 51 51 'rsrc/css/application/config/setup-issue.css' => 'f794cfc3', 52 52 'rsrc/css/application/config/unhandled-exception.css' => '4c96257a', 53 + 'rsrc/css/application/conpherence/color.css' => 'abb4c358', 53 54 'rsrc/css/application/conpherence/durable-column.css' => '89ea6bef', 54 - 'rsrc/css/application/conpherence/header-pane.css' => 'a1104b93', 55 - 'rsrc/css/application/conpherence/menu.css' => '88100764', 55 + 'rsrc/css/application/conpherence/header-pane.css' => 'cb6f4e19', 56 + 'rsrc/css/application/conpherence/menu.css' => '6953e7ec', 56 57 'rsrc/css/application/conpherence/message-pane.css' => 'b0f55ecc', 57 58 'rsrc/css/application/conpherence/notification.css' => 'cef0a3fc', 58 59 'rsrc/css/application/conpherence/participant-pane.css' => '26a3ce56', ··· 378 379 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '4d863052', 379 380 'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '9bbf3762', 380 381 'rsrc/js/application/conpherence/behavior-durable-column.js' => 'aa3bd034', 381 - 'rsrc/js/application/conpherence/behavior-menu.js' => '31ab6d0f', 382 + 'rsrc/js/application/conpherence/behavior-menu.js' => 'c9b99b77', 382 383 'rsrc/js/application/conpherence/behavior-participant-pane.js' => '8604caa8', 383 384 'rsrc/js/application/conpherence/behavior-pontificate.js' => '55616e04', 384 385 'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3', ··· 559 560 'conduit-api-css' => '7bc725c4', 560 561 'config-options-css' => '0ede4c9b', 561 562 'config-page-css' => 'c1d5121b', 563 + 'conpherence-color-css' => 'abb4c358', 562 564 'conpherence-durable-column-view' => '89ea6bef', 563 - 'conpherence-header-pane-css' => 'a1104b93', 564 - 'conpherence-menu-css' => '88100764', 565 + 'conpherence-header-pane-css' => 'cb6f4e19', 566 + 'conpherence-menu-css' => '6953e7ec', 565 567 'conpherence-message-pane-css' => 'b0f55ecc', 566 568 'conpherence-notification-css' => 'cef0a3fc', 567 569 'conpherence-participant-pane-css' => '26a3ce56', ··· 605 607 'javelin-behavior-choose-control' => '327a00d1', 606 608 'javelin-behavior-comment-actions' => '9a6dd75c', 607 609 'javelin-behavior-config-reorder-fields' => 'b6993408', 608 - 'javelin-behavior-conpherence-menu' => '31ab6d0f', 610 + 'javelin-behavior-conpherence-menu' => 'c9b99b77', 609 611 'javelin-behavior-conpherence-participant-pane' => '8604caa8', 610 612 'javelin-behavior-conpherence-pontificate' => '55616e04', 611 613 'javelin-behavior-conpherence-search' => '9bbf3762', ··· 1126 1128 '31420f77' => array( 1127 1129 'javelin-behavior', 1128 1130 ), 1129 - '31ab6d0f' => array( 1130 - 'javelin-behavior', 1131 - 'javelin-dom', 1132 - 'javelin-util', 1133 - 'javelin-stratcom', 1134 - 'javelin-workflow', 1135 - 'javelin-behavior-device', 1136 - 'javelin-history', 1137 - 'javelin-vector', 1138 - 'javelin-scrollbar', 1139 - 'phabricator-title', 1140 - 'phabricator-shaped-request', 1141 - 'conpherence-thread-manager', 1142 - ), 1143 1131 '320810c8' => array( 1144 1132 'javelin-install', 1145 1133 'javelin-dom', ··· 2003 1991 'javelin-util', 2004 1992 'javelin-stratcom', 2005 1993 ), 1994 + 'c9b99b77' => array( 1995 + 'javelin-behavior', 1996 + 'javelin-dom', 1997 + 'javelin-util', 1998 + 'javelin-stratcom', 1999 + 'javelin-workflow', 2000 + 'javelin-behavior-device', 2001 + 'javelin-history', 2002 + 'javelin-vector', 2003 + 'javelin-scrollbar', 2004 + 'phabricator-title', 2005 + 'phabricator-shaped-request', 2006 + 'conpherence-thread-manager', 2007 + ), 2006 2008 'ca3f91eb' => array( 2007 2009 'javelin-behavior', 2008 2010 'javelin-dom', ··· 2261 2263 'conpherence.pkg.css' => array( 2262 2264 'conpherence-durable-column-view', 2263 2265 'conpherence-menu-css', 2266 + 'conpherence-color-css', 2264 2267 'conpherence-message-pane-css', 2265 2268 'conpherence-notification-css', 2266 2269 'conpherence-transaction-css',
+1
resources/celerity/packages.php
··· 161 161 'conpherence.pkg.css' => array( 162 162 'conpherence-durable-column-view', 163 163 'conpherence-menu-css', 164 + 'conpherence-color-css', 164 165 'conpherence-message-pane-css', 165 166 'conpherence-notification-css', 166 167 'conpherence-transaction-css',
+22
src/applications/conpherence/constants/ConpherenceRoomSettings.php
··· 9 9 const DEFAULT_MENTION_SOUND = 'alert'; 10 10 const DEFAULT_NO_SOUND = 'none'; 11 11 12 + const COLOR_LIGHT = 'light'; 13 + const COLOR_BLUE = 'blue'; 14 + const COLOR_INDIGO = 'indigo'; 15 + const COLOR_PEACH = 'peach'; 16 + const COLOR_GREEN = 'green'; 17 + const COLOR_PINK = 'pink'; 18 + 12 19 public static function getSoundMap() { 13 20 return array( 14 21 'none' => array( ··· 41 48 public static function getDropdownSoundMap() { 42 49 $map = self::getSoundMap(); 43 50 return ipull($map, 'name'); 51 + } 52 + 53 + public static function getThemeMap() { 54 + return array( 55 + self::COLOR_LIGHT => pht('Light'), 56 + self::COLOR_BLUE => pht('Blue'), 57 + self::COLOR_INDIGO => pht('Indigo'), 58 + self::COLOR_PEACH => pht('Peach'), 59 + self::COLOR_GREEN => pht('Green'), 60 + self::COLOR_PINK => pht('Pink'), 61 + ); 62 + } 63 + 64 + public static function getThemeClass($theme) { 65 + return 'conpherence-theme-'.$theme; 44 66 } 45 67 46 68
+10 -1
src/applications/conpherence/controller/ConpherenceRoomPreferencesController.php
··· 41 41 if ($request->isFormPost()) { 42 42 $notifications = $request->getStr('notifications'); 43 43 $sounds = $request->getArr('sounds'); 44 + $theme = $request->getStr('theme'); 44 45 45 46 $participant->setSettings(array( 46 47 'notifications' => $notifications, 47 48 'sounds' => $sounds, 49 + 'theme' => $theme, 48 50 )); 49 51 $participant->save(); 50 52 ··· 60 62 61 63 $settings = $participant->getSettings(); 62 64 $notifications = idx($settings, 'notifications', $notification_default); 65 + $theme = idx($settings, 'theme', ConpherenceRoomSettings::COLOR_LIGHT); 63 66 64 67 $sounds = idx($settings, 'sounds', array()); 65 68 $map = PhabricatorConpherenceSoundSetting::getDefaultSound($sound_default); ··· 92 95 ->setLabel(pht('New Message')) 93 96 ->setName('sounds['.ConpherenceRoomSettings::SOUND_RECEIVE.']') 94 97 ->setOptions(ConpherenceRoomSettings::getDropdownSoundMap()) 95 - ->setValue($receive)); 98 + ->setValue($receive)) 99 + ->appendChild( 100 + id(new AphrontFormSelectControl()) 101 + ->setLabel(pht('Theme')) 102 + ->setName('theme') 103 + ->setOptions(ConpherenceRoomSettings::getThemeMap()) 104 + ->setValue($theme)); 96 105 97 106 return $this->newDialog() 98 107 ->setTitle(pht('Room Preferences'))
+5
src/applications/conpherence/controller/ConpherenceViewController.php
··· 56 56 $this->setConpherence($conpherence); 57 57 58 58 $participant = $conpherence->getParticipantIfExists($user->getPHID()); 59 + $theme = ConpherenceRoomSettings::COLOR_LIGHT; 60 + 59 61 if ($participant) { 62 + $settings = $participant->getSettings(); 63 + $theme = idx($settings, 'theme', ConpherenceRoomSettings::COLOR_LIGHT); 60 64 if (!$participant->isUpToDate($conpherence)) { 61 65 $write_guard = AphrontWriteGuard::beginScopedUnguardedWrites(); 62 66 $participant->markUpToDate($conpherence); ··· 118 122 ->setSearch($search) 119 123 ->setMessages($messages) 120 124 ->setReplyForm($form) 125 + ->setTheme($theme) 121 126 ->setLatestTransactionID($data['latest_transaction_id']) 122 127 ->setRole('thread'); 123 128
+6
src/applications/conpherence/storage/ConpherenceThread.php
··· 204 204 } 205 205 206 206 $user_participation = $this->getParticipantIfExists($viewer->getPHID()); 207 + $theme = ConpherenceRoomSettings::COLOR_LIGHT; 207 208 if ($user_participation) { 208 209 $user_seen_count = $user_participation->getSeenMessageCount(); 210 + $participant = $this->getParticipant($viewer->getPHID()); 211 + $settings = $participant->getSettings(); 212 + $theme = idx($settings, 'theme', $theme); 213 + $theme_class = ConpherenceRoomSettings::getThemeClass($theme); 209 214 } else { 210 215 $user_seen_count = 0; 211 216 } ··· 221 226 'unread_count' => $unread_count, 222 227 'epoch' => $this->getDateModified(), 223 228 'image' => $img_src, 229 + 'theme' => $theme_class, 224 230 ); 225 231 } 226 232
+8
src/applications/conpherence/view/ConpherenceLayoutView.php
··· 10 10 private $search; 11 11 private $messages; 12 12 private $replyForm; 13 + private $theme = ConpherenceRoomSettings::COLOR_LIGHT; 13 14 private $latestTransactionID; 14 15 15 16 public function setMessages($messages) { ··· 56 57 return $this; 57 58 } 58 59 60 + public function setTheme($theme) { 61 + $this->theme = $theme; 62 + return $this; 63 + } 64 + 59 65 public function setLatestTransactionID($id) { 60 66 $this->latestTransactionID = $id; 61 67 return $this; ··· 66 72 $classes[] = 'conpherence-layout'; 67 73 $classes[] = 'hide-widgets'; 68 74 $classes[] = 'conpherence-role-'.$this->role; 75 + $classes[] = ConpherenceRoomSettings::getThemeClass($this->theme); 69 76 70 77 return array( 71 78 'id' => 'conpherence-main-layout', ··· 105 112 'canEditSelectedThread' => $can_edit_selected, 106 113 'latestTransactionID' => $this->latestTransactionID, 107 114 'role' => $this->role, 115 + 'theme' => ConpherenceRoomSettings::getThemeClass($this->theme), 108 116 'hasThreadList' => (bool)$this->threadView, 109 117 'hasThread' => (bool)$this->messages, 110 118 'hasWidgets' => false,
+1
src/applications/conpherence/view/ConpherenceThreadListView.php
··· 75 75 'title' => $data['title'], 76 76 'id' => $dom_id, 77 77 'threadID' => $thread->getID(), 78 + 'theme' => $data['theme'], 78 79 )); 79 80 } 80 81
+48
webroot/rsrc/css/application/conpherence/color.css
··· 1 + /** 2 + * @provides conpherence-color-css 3 + */ 4 + 5 + .conpherence-theme-blue .conpherence-menu-pane { 6 + background-color: {$lightblue}; 7 + } 8 + 9 + .conpherence-theme-blue .phui-basic-nav .phabricator-side-menu 10 + .phui-list-item-selected { 11 + border-left-color: {$blue}; 12 + } 13 + 14 + .conpherence-theme-indigo .conpherence-menu-pane { 15 + background-color: {$lightindigo}; 16 + } 17 + 18 + .conpherence-theme-indigo .phui-basic-nav .phabricator-side-menu 19 + .phui-list-item-selected { 20 + border-left-color: {$indigo}; 21 + } 22 + 23 + .conpherence-theme-peach .conpherence-menu-pane { 24 + background-color: {$lightred}; 25 + } 26 + 27 + .conpherence-theme-peach .phui-basic-nav .phabricator-side-menu 28 + .phui-list-item-selected { 29 + border-left-color: rgba(0,0,0,.25); 30 + } 31 + 32 + .conpherence-theme-green .conpherence-menu-pane { 33 + background-color: {$lightgreen}; 34 + } 35 + 36 + .conpherence-theme-green .phui-basic-nav .phabricator-side-menu 37 + .phui-list-item-selected { 38 + border-left-color: {$green}; 39 + } 40 + 41 + .conpherence-theme-pink .conpherence-menu-pane { 42 + background-color: {$lightpink}; 43 + } 44 + 45 + .conpherence-theme-pink .phui-basic-nav .phabricator-side-menu 46 + .phui-list-item-selected { 47 + border-left-color: {$pink}; 48 + }
-4
webroot/rsrc/css/application/conpherence/header-pane.css
··· 2 2 * @provides conpherence-header-pane-css 3 3 */ 4 4 5 - .conpherence-header-pane { 6 - background-color: {$lightbluebackground}; 7 - } 8 - 9 5 .conpherence-header-pane .phui-header-shell { 10 6 padding: 8px 16px 10px; 11 7 min-height: 38px;
+4
webroot/rsrc/css/application/conpherence/menu.css
··· 21 21 background-color: {$page.sidenav}; 22 22 } 23 23 24 + .conpherence-menu-pane .phui-basic-nav .phabricator-side-menu { 25 + background-color: transparent; 26 + } 27 + 24 28 .conpherence-menu-pane.phabricator-side-menu .room-list-href { 25 29 padding: 10px 0 9px 8px; 26 30 display: inline-block;
+9
webroot/rsrc/js/application/conpherence/behavior-menu.js
··· 25 25 }; 26 26 27 27 var scrollbar = null; 28 + var cur_theme = config.theme; 28 29 29 30 // TODO - move more logic into the ThreadManager 30 31 var threadManager = new JX.ConpherenceThreadManager(); ··· 144 145 145 146 function updatePageData(data) { 146 147 var uri = '/Z' + _thread.selected; 148 + var new_theme = data.theme; 149 + 150 + if (new_theme != cur_theme) { 151 + var root = JX.$('conpherence-main-layout'); 152 + JX.DOM.alterClass(root, cur_theme, false); 153 + JX.DOM.alterClass(root, new_theme, true); 154 + cur_theme = new_theme; 155 + } 147 156 JX.History.replace(uri); 148 157 if (data.title) { 149 158 JX.Title.setTitle(data.title);