Skip to content

Commit 866a3be

Browse files
authored
Merge pull request #492 from topcoder-platform/issues-477
Issues-477, Issues-478, Issues-481
2 parents 75da445 + 46c24d4 commit 866a3be

File tree

7 files changed

+35
-14
lines changed

7 files changed

+35
-14
lines changed

config/vanilla/bootstrap.before.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,13 +299,14 @@ function_exists('topcoderRoleCssStyles')) {
299299
*/
300300
function dateUpdated($row, $wrap = null) {
301301
$result = '';
302+
$insertUserID = val('InsertUserID', $row);
302303
$dateUpdated = val('DateUpdated', $row);
303304
$updateUserID = val('UpdateUserID', $row);
304305

305306
if ($dateUpdated) {
306307
$updateUser = Gdn::userModel()->getID($updateUserID);
307308
$dateUpdatedFormatted = Gdn::getContainer()->get(DateTimeFormatter::class)->formatDate($dateUpdated, false, DateTimeFormatter::FORCE_FULL_FORMAT);
308-
if ($updateUser) {
309+
if ($updateUser && $insertUserID != $updateUserID) {
309310
$title = sprintf(t('Edited %s by %s.'), $dateUpdatedFormatted, val('Name', $updateUser));
310311
$link = userAnchor($updateUser);
311312
$text = sprintf(t('edited %s by %s'), $dateUpdatedFormatted, $link);

vanilla/applications/vanilla/controllers/class.categoriescontroller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ public function all($Category = '', $displayAs = '') {
539539
if ($Title) {
540540
$this->title($Title, '');
541541
} else {
542-
$this->title(t('Roundtables'));
542+
$this->title(t('Public Forums'));
543543
}
544544
}
545545
Gdn_Theme::section('CategoryList');
@@ -677,7 +677,7 @@ public function discussions($Category = '') {
677677
if ($Title) {
678678
$this->title($Title, '');
679679
} else {
680-
$this->title(t('Roundtables'));
680+
$this->title(t('Public Forums'));
681681
}
682682
}
683683

vanilla/applications/vanilla/controllers/class.vanillacontroller.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
*/
1414
class VanillaController extends Gdn_Controller {
1515

16-
const ROOT_CATEGORY = ['Name' => 'Roundtables', 'Url'=>'/'];
17-
16+
const ROOT_CATEGORY = ['Name' => 'Public Forums', 'Url'=>'/'];
17+
const CHALLENGE_FORUMS_URLCODE = 'challenges-forums';
1818
/**
1919
* Include JS, CSS, and modules used by all methods.
2020
*
@@ -81,15 +81,27 @@ protected function buildBreadcrumbs($CategoryID) {
8181
if($ancestor['GroupID'] > 0) {
8282
$temp[$ancestor['CategoryID']] = $ancestor;
8383
} else {
84-
if($ancestor['UrlCode'] == 'challenges-forums') {
85-
array_push($temp, ['Name' => 'Challenge Discussions', 'Url'=>'/groups/mine?filter=challenge']);
84+
if($ancestor['UrlCode'] == self::CHALLENGE_FORUMS_URLCODE) {
85+
array_push($temp, ['Name' => 'Challenge Forums', 'Url'=>'/groups/mine?filter=challenge']);
8686
}else if($ancestor['UrlCode'] == 'groups') {
87-
array_push($temp, ['Name' => 'Group Discussions', 'Url'=>'/groups/mine?filter=regular']);
87+
array_push($temp, ['Name' => 'Group Forums', 'Url'=>'/groups/mine?filter=regular']);
8888
}
8989
}
9090
}
9191
return $temp;
9292
} else {
93+
$urlCode = val('UrlCode', $Category);
94+
if($urlCode == self::CHALLENGE_FORUMS_URLCODE) {
95+
return $ancestors;
96+
}
97+
98+
// Check if ancestors contains 'challenges-forums'
99+
foreach ($ancestors as $id => $ancestor) {
100+
if($ancestor['UrlCode'] == self::CHALLENGE_FORUMS_URLCODE) {
101+
return $ancestors;
102+
}
103+
}
104+
93105
array_unshift($ancestors, self::ROOT_CATEGORY);
94106
return $ancestors;
95107
}

vanilla/applications/vanilla/views/categories/all.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
$title .= watchButton($this->Category->CategoryID);
77
}
88
echo '<h1 class="H HomepageTitle">'.$title.'</h1>';
9-
// if ($description = $this->description()) {
10-
//echo wrap($description, 'div', ['class' => 'P PageDescription']);
11-
// }
9+
if ($description = $this->description()) {
10+
echo wrap($description, 'div', ['class' => 'P PageDescription']);
11+
}
1212
$this->fireEvent('AfterPageTitle');
1313
echo '<div class="PageControls Top">';
1414
if ($this->data('EnableFollowingFilter')) {

vanilla/applications/vanilla/views/categories/helper_functions.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ function mostRecentString($row) {
147147
* @throws Exception
148148
*/
149149
function writeListItem($category, $depth) {
150+
$urlcode = $category['UrlCode'];
151+
// FIX: https://github.com/topcoder-platform/forums/issues/477: Don't show 'Challenge Forums'
152+
if($urlcode == VanillaController::CHALLENGE_FORUMS_URLCODE) {
153+
return;
154+
}
150155
$children = $category['Children'];
151156
$categoryID = val('CategoryID', $category);
152157
$cssClass = cssClass($category, true);
@@ -183,6 +188,9 @@ function writeListItem($category, $depth) {
183188
Gdn::controller()->fireEvent('AfterCategoryTitle');
184189
?>
185190
</div>
191+
<div class="CategoryDescription">
192+
<?php echo val('Description', $category) ?>
193+
</div>
186194
<div class="Challenge">
187195
<?php
188196
Gdn::controller()->fireEvent('AfterChallenge', ['Category' =>$category]);

vanilla/applications/vanilla/views/discussions/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
watchButton($this->data('Category.CategoryID')).
1111
'</h1>';
1212

13-
// $Description = $this->data('Category.Description', $this->description());
14-
// echo wrapIf(Gdn_Format::htmlFilter($Description), 'div', ['class' => 'P PageDescription']);
13+
$Description = $this->data('Category.Description', $this->description());
14+
echo wrapIf(Gdn_Format::htmlFilter($Description), 'div', ['class' => 'P PageDescription']);
1515

1616
$this->fireEvent('AfterPageTitle');
1717

vanilla/applications/vanilla/views/modules/discussionfilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
|| strpos(strtolower($Controller->Request->path()) , 'categories') === 0) {
4343
$CssClass .= ' Active';
4444
}
45-
echo '<li class="'.$CssClass.'">'.anchor('Roundtables', '/categories').'</li> ';
45+
echo '<li class="'.$CssClass.'">'.anchor('Public Forums', '/categories').'</li> ';
4646
}
4747
/*
4848
<li id="RecentDiscussions" class="Discussions<?php echo strtolower($Controller->ControllerName) == 'discussionscontroller' && strtolower($Controller->RequestMethod) == 'index' && strpos(strtolower($Controller->Request->path()) , 'discussions') === 0? ' Active' : ''; ?>">

0 commit comments

Comments
 (0)