Skip to content

Commit 1dae0d8

Browse files
authored
Merge pull request #130 from topcoder-platform/issues-77
Issues-93, Issues-112, Issues-121
2 parents 311129c + e4c4620 commit 1dae0d8

File tree

5 files changed

+795
-3
lines changed

5 files changed

+795
-3
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ RUN cp -r debugbar /vanillapp/plugins
3535
RUN composer install --working-dir /vanillapp/plugins/Topcoder
3636
# Install Filestack dependencies
3737
RUN composer install --working-dir /vanillapp/plugins/Filestack
38+
# Install Groups dependencies
39+
RUN composer install --working-dir /vanillapp/plugins/Groups
3840
# Copy Vanilla configuration files
3941
COPY ./config/vanilla/. /vanillapp/conf/.
4042
# Copy Topcoder Vanilla files

config/vanilla/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
// Feature
4545
$Configuration['Feature']['NewFlyouts']['Enabled'] = true;
46-
$Configuration['Vanilla']['EnableCategorygiFollowing'] = true;
46+
$Configuration['Vanilla']['EnableCategoryFollowing'] = true;
4747

4848
// Garden
4949
$Configuration['Garden']['Title'] = 'Vanilla';

vanilla/applications/vanilla/controllers/api/CategoriesApiController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,13 +490,14 @@ public function post(array $body) {
490490
public function put_follow($id, array $body) {
491491
$this->permission('Garden.SignIn.Allow');
492492

493-
$schema = ['followed:b' => 'The category-follow status for the current user.'];
493+
$schema = ['followed:b' => 'The category-follow status for the current user.',
494+
'userID:i?' => 'User ID.'];
494495
$in = $this->schema($schema, 'in');
495496
$out = $this->schema($schema, 'out');
496497

497498
$category = $this->category($id);
498499
$body = $in->validate($body);
499-
$userID = $this->getSession()->UserID;
500+
$userID = $body['userID'] > 0? $body['userID'] : $this->getSession()->UserID;
500501
$followed = $this->categoryModel->getFollowed($userID);
501502

502503
// Is this a new follow?
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?php
2+
/**
3+
* @copyright 2009-2019 Vanilla Forums Inc.
4+
* @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
5+
*/
6+
7+
if (!defined('APPLICATION')) {
8+
exit();
9+
}
10+
$UserPhotoFirst = c('Vanilla.Comment.UserPhotoFirst', true);
11+
12+
$Discussion = $this->data('Discussion');
13+
$Author = Gdn::userModel()->getID($Discussion->InsertUserID); // userBuilder($Discussion, 'Insert');
14+
15+
// Prep event args.
16+
$CssClass = cssClass($Discussion, false);
17+
$this->EventArguments['Discussion'] = &$Discussion;
18+
$this->EventArguments['Author'] = &$Author;
19+
$this->EventArguments['CssClass'] = &$CssClass;
20+
21+
// DEPRECATED ARGUMENTS (as of 2.1)
22+
$this->EventArguments['Object'] = &$Discussion;
23+
$this->EventArguments['Type'] = 'Discussion';
24+
25+
// Discussion template event
26+
$this->fireEvent('BeforeDiscussionDisplay');
27+
?>
28+
<div id="<?php echo 'Discussion_'.$Discussion->DiscussionID; ?>" class="<?php echo $CssClass; ?>">
29+
<div class="Discussion">
30+
<div class="Item-Header DiscussionHeader">
31+
<div class="AuthorWrap">
32+
<span class="Author">
33+
<?php
34+
if ($UserPhotoFirst) {
35+
echo userPhoto($Author);
36+
echo userAnchor($Author, 'Username');
37+
} else {
38+
echo userAnchor($Author, 'Username');
39+
echo userPhoto($Author);
40+
}
41+
echo formatMeAction($Discussion);
42+
?>
43+
</span>
44+
<span class="AuthorInfo">
45+
<?php
46+
echo wrapIf(htmlspecialchars(val('Title', $Author)), 'span', ['class' => 'MItem AuthorTitle']);
47+
echo wrapIf(htmlspecialchars(val('Location', $Author)), 'span', ['class' => 'MItem AuthorLocation']);
48+
$this->fireEvent('AuthorInfo');
49+
?>
50+
</span>
51+
</div>
52+
<div class="Meta DiscussionMeta">
53+
<span class="MItem DateCreated">
54+
<?php
55+
echo anchor(Gdn_Format::date($Discussion->DateInserted, 'html'), $Discussion->Url, 'Permalink', ['rel' => 'nofollow']);
56+
?>
57+
</span>
58+
<?php
59+
echo dateUpdated($Discussion, ['<span class="MItem">', '</span>']);
60+
?>
61+
<?php
62+
// Include source if one was set
63+
if ($Source = val('Source', $Discussion)) {
64+
echo ' '.wrap(sprintf(t('via %s'), t($Source.' Source', $Source)), 'span', ['class' => 'MItem MItem-Source']).' ';
65+
}
66+
// Category
67+
if (c('Vanilla.Categories.Use')) {
68+
echo ' <span class="MItem Category">';
69+
echo ' '.t('in').' ';
70+
echo anchor(htmlspecialchars($this->data('Discussion.Category')), categoryUrl($this->data('Discussion.CategoryUrlCode')));
71+
echo '</span> ';
72+
}
73+
74+
$this->fireEvent('DiscussionInfo');
75+
$this->fireEvent('AfterDiscussionMeta'); // DEPRECATED
76+
?>
77+
</div>
78+
</div>
79+
<?php $this->fireEvent('BeforeDiscussionBody'); ?>
80+
<div class="Item-BodyWrap">
81+
<div class="Item-Body">
82+
<div class="Message userContent">
83+
<?php
84+
echo formatBody($Discussion);
85+
?>
86+
</div>
87+
<?php
88+
$this->fireEvent('AfterDiscussionBody');
89+
writeReactions($Discussion);
90+
if (val('Attachments', $Discussion)) {
91+
writeAttachments($Discussion->Attachments);
92+
}
93+
?>
94+
</div>
95+
</div>
96+
</div>
97+
</div>

0 commit comments

Comments
 (0)