Skip to content

Issues-377: design tweaks #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions class.groups.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
class GroupsPlugin extends Gdn_Plugin {
const GROUPS_ROUTE = '/groups';
const ROUTE_MY_GROUPS = '/groups/mine';
const ROUTE_CHALLENGE_GROUPS = '/groups?filter=challenge'; //'/groups/challenges';
const ROUTE_REGULAR_GROUPS = '/groups?filter=regular'; //'/groups/regulars';
const ROUTE_CHALLENGE_GROUPS = '/groups/mine?filter=challenge'; //'/groups/challenges';
const ROUTE_REGULAR_GROUPS = '/groups/mine?filter=regular'; //'/groups/regulars';
const GROUP_ROUTE = '/group/';
const GROUPS_GROUP_ADD_PERMISSION = 'Groups.Group.Add';
const GROUPS_GROUP_ARCHIVE_PERMISSION = 'Groups.Group.Archive';
Expand All @@ -39,7 +39,7 @@ class GroupsPlugin extends Gdn_Plugin {
'CreateGroupTitle' => 'Create Challenge',
'EditGroupTitle' => 'Edit Challenge',
'TypeName' => 'challenge'],
'regular' => ['BreadcrumbLevel1Title' => 'Groups',
'regular' => ['BreadcrumbLevel1Title' => 'Group Discussions',
'BreadcrumbLevel1Url' => self::ROUTE_REGULAR_GROUPS,
'CreateGroupTitle' => 'Create Group',
'EditGroupTitle' => 'Edit Group',
Expand Down Expand Up @@ -820,7 +820,7 @@ private function addGroupLinkToMenu($sender) {
if(Gdn::session()->isValid()) {

echo '<li class="'.$this->getMenuItemCssClassFromQuery($sender, 'challenge').'">'. anchor('Challenge Discussions', GroupsPlugin::ROUTE_CHALLENGE_GROUPS).'</li>';
// echo '<li class="'.$this->getMenuItemCssClassFromQuery($sender, 'regular').'">'. anchor('Groups', GroupsPlugin::ROUTE_REGULAR_GROUPS).'</li>';
// echo '<li class="'.$this->getMenuItemCssClassFromQuery($sender, 'regular').'">'. anchor('Group Discussions', GroupsPlugin::ROUTE_REGULAR_GROUPS).'</li>';
// echo '<li class="'.$this->getMenuItemCssClassFromRequestMethod($sender, 'mine').'">'. anchor('My Challenges & Groups', GroupsPlugin::ROUTE_MY_GROUPS).'</li>';
}
}
Expand Down
4 changes: 2 additions & 2 deletions controllers/class.groupcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function initialize() {
}

// Add modules
$this->addModule('NewDiscussionModule');
//$this->addModule('NewDiscussionModule');
$this->addModule('DiscussionFilterModule');
//$this->addModule('CategoriesModule');
$this->addModule('BookmarkedModule');
Expand Down Expand Up @@ -566,7 +566,7 @@ public function discussions($GroupID='',$Page = false) {
// $this->View = 'index';
break;
}
Gdn_Theme::section('Group');
//Gdn_Theme::section('Group');

// Remove score sort
DiscussionModel::removeSort('top');
Expand Down
30 changes: 15 additions & 15 deletions controllers/class.groupscontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ public function setFilterPageData($filter) {
if($filter == 'challenge') {
$this->View = 'index';
$this->title('Challenge Discussions');
$this->setData('Title', 'My Challenges');
$this->setData('Title', 'Challenge Discussions');
$this->setData('ShowAddButton', false);
$this->setData('AddButtonTitle', 'Challenge');
$this->setData('AddButtonLink', '/group/add?type=challenge');
$this->setData('AvailableGroupTitle', 'Available Challenges');
$this->setData('MyGroupButtonTitle', 'All My Challenges');
$this->setData('AllGroupButtonTitle', 'All Available Challenges');
$this->setData('MyGroupButtonTitle', 'All Challenge Discussions');
$this->setData('AllGroupButtonTitle', 'All Available Challenge Discussions');
$this->SetData('MyGroupButtonLink', '/groups/mine/?filter=challenge');
$this->setData('AllGroupButtonLink', '/groups/all/?filter=challenge');
$this->setData('NoGroups', 'No challenges were found.');
Expand All @@ -67,9 +67,9 @@ public function setFilterPageData($filter) {
$this->setData('ShowAddButton', true);
$this->setData('AddButtonTitle', 'Group');
$this->setData('AddButtonLink', '/group/add?type=regular');
$this->setData('MyGroupButtonTitle', 'All My Groups');
$this->setData('AllGroupButtonTitle', 'All Available Groups');
$this->setData('AvailableGroupTitle', 'Available Groups');
$this->setData('MyGroupButtonTitle', 'All Group Discussions');
$this->setData('AllGroupButtonTitle', 'All Available Group Discussions');
$this->setData('AvailableGroupTitle', 'Available Group Discussions');
$this->SetData('MyGroupButtonLink', '/groups/mine/?filter=regular');
$this->setData('AllGroupButtonLink', '/groups/all/?filter=regular');
$this->setData('NoGroups','No groups were found.');
Expand All @@ -81,7 +81,7 @@ public function setFilterPageData($filter) {
public function index($Page=false, $filter) {
DashboardNavModule::getDashboardNav()->setHighlightRoute('groups/challenges');
$this->Menu->highlightRoute('groups/challenges');
Gdn_Theme::section('GroupList');
// Gdn_Theme::section('GroupList');

$GroupModel = new GroupModel();
$GroupModel->setFilters(Gdn::request()->get());
Expand All @@ -100,13 +100,13 @@ public function index($Page=false, $filter) {
$defaultSort = $GroupModel::getAllowedSorts()['new']['orderBy'];
$GroupData = $GroupModel->getMyGroups($where, $defaultSort, $Limit, $Offset);
$countOfGroups = $GroupModel->countMyGroups($where);
$AvailableGroupData = $GroupModel->getAvailableGroups($where, $defaultSort, $Limit, $Offset);
//$AvailableGroupData = $GroupModel->getAvailableGroups($where, $defaultSort, $Limit, $Offset);

$this->setData('CurrentUserGroups', $GroupModel->memberOf(Gdn::session()->UserID));
$this->setData('Groups', $GroupData);

$this->setData('CountOfGroups', $countOfGroups);
$this->setData('AvailableGroups', $AvailableGroupData);
//$this->setData('AvailableGroups', $AvailableGroupData);
$this->render();
}

Expand Down Expand Up @@ -190,16 +190,16 @@ private function mygroups($Page = false, $filter = '') {
$this->setData('_Limit', $Limit);

if($filter == 'regular') {
$title = 'My Groups';
$noDataText = 'No groups were found.';
$title = 'Group Discussions';
$noDataText = 'No Group discussions were found.';
$this->setData('Breadcrumbs', [
['Name' => 'Groups', 'Url' => '/groups/'.$queryString],
//['Name' => 'Group Discussions', 'Url' => '/groups/'.$queryString],
['Name' => $title, 'Url' => '/groups/mine/'.$queryString]]);
} else if($filter == 'challenge'){
$title = 'My Challenges';
$noDataText = 'No challenges were found.';
$title = 'Challenge Discussions';
$noDataText = 'No Challenge discussions were found.';
$this->setData('Breadcrumbs', [
['Name' => 'Challenges', 'Url' => '/groups/'.$queryString],
//['Name' => 'Challenge Discussions', 'Url' => '/groups/'.$queryString],
['Name' => $title, 'Url' => '/groups/mine/'.$queryString]]);

}
Expand Down
27 changes: 0 additions & 27 deletions design/groups.css
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,6 @@ li.ui-timepicker-selected .ui-timepicker-duration,
clear: both
}

.Groups .DataList .ItemContent {
padding-left: 48px
}

.Groups .Item .OptionsMenu,
.Groups .Item .ButtonGroup {
display: inline-block;
Expand Down Expand Up @@ -589,19 +585,7 @@ li.ui-timepicker-selected .ui-timepicker-duration,
margin-bottom: 20px
}

.Group-Header:after {
content: "";
display: table;
clear: both
}

.Group-Header .MItem {
display: inline-block
}

.Group-Header .Meta {
font-size: 12px
}

.Group-Header .OptionsMenu {
display: block;
Expand Down Expand Up @@ -679,21 +663,10 @@ li.ui-timepicker-selected .ui-timepicker-duration,
margin-left: 0
}

.Group-Title {
margin-bottom: 10px;
font-size: 36px;
line-height: 1
}

.NoBanner .Group-Title {
padding-top: 5px
}

.Group-Description {
line-height: 1.4;
padding: 5px 0
}

.Group-Banner {
height: 200px;
width: 100%;
Expand Down
4 changes: 2 additions & 2 deletions views/group/discussions.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
<div class="Group-Content">
<div class="Group-Box Group-Discussions Section-DiscussionList">
<?php
echo ' <h1 class="H clearfix">Discussions</h1>';
echo '<div class="PageControls">';
echo ' <h2 class="H media-list-heading">Discussions</h2>';
$PagerOptions = ['Wrapper' => '<span class="PagerNub">&#160;</span><div %1$s>%2$s</div>', 'RecordCount' => $CountDiscussions, 'CurrentRecords' => $Discussions->numRows()];
if ($this->data('_PagerUrl')) {
$PagerOptions['Url'] = $this->data('_PagerUrl');
}
PagerModule::write($PagerOptions);
echo Gdn_Theme::module('NewDiscussionModule', $this->data('_NewDiscussionProperties', ['CssClass' => 'Button Action Primary']));
// echo Gdn_Theme::module('NewDiscussionModule', $this->data('_NewDiscussionProperties', ['CssClass' => 'Button Action Primary']));
// Avoid displaying in a category's list of discussions.
if ($this->data('EnableFollowingFilter')) {
// echo discussionFilters();
Expand Down
2 changes: 1 addition & 1 deletion views/group/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
echo '</div>';

echo '<div class="Buttons">';
echo anchor(t('Cancel'), $CancelUrl, 'Button');
echo $this->Form->button( 'Save', ['class' => 'Button Primary']);
echo anchor(t('Cancel'), $CancelUrl, 'Button');
// echo ' '.anchor(t('Edit'), '#', 'Button WriteButton Hidden')."\n";
echo '</div>';

Expand Down
58 changes: 34 additions & 24 deletions views/group/helper_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,42 +195,52 @@ function writeGroupHeader($group, $showDetails = false, $owner = null, $leaders
$bannerCssClass = $group->Banner ? 'HasBanner':'NoBanner';
?>
<div class="Group-Header <?php echo $bannerCssClass; ?>">
<div class="GroupOptions OptionsMenu ButtonGroup">
<?php echo getGroupOptionsDropdown();?>
</div>
<h1 class="Group-Title"><?php echo $group->Name; ?></h1>
<?php echo writeGroupBanner($group);?>
<?php if($group->Icon) { ?>
<div class="Photo PhotoWrap PhotoWrapLarge Group-Icon-Big-Wrap">
<?php echo writeGroupIcon($group, '', 'Group-Icon Group-Icon-Big');?>
</div>
<?php }?>
<div class="GroupOptions OptionsMenu ButtonGroup">
<?php echo getGroupOptionsDropdown();?>
</div>
<div class="Group-Header-Info">
<h1 class="Group-Title"><?php echo anchor($group->Name, groupUrl($group)); ?></h1>
<?php if($showDetails) { ?>
<div class="Group-Description userContent"><?php echo $group->Description; ?></div>
<div class="Meta Group-Meta Group-Info">
<div class="Group-Info">
<div class="Group-Description"><?php echo $group->Description; ?></div>
<div class="Meta Group-Meta Table">
<?php if($group->ChallengeUrl) { ?>
<span class="MItem ">
<span class="label">Challenge: </span>
<span class="value"><?php echo anchor($group->Name, $group->ChallengeUrl);?></span>
</span>
<div class="MItem TableRow">
<div class="TableCell Cell1">Challenge</div>
<div class="TableCell Cell2"><?php echo anchor($group->Name, $group->ChallengeUrl);?></div>
</div>
<?php } ?>
<span class="MItem ">
<span class="label">Owner: </span>
<span class="value"><?php echo userAnchor($owner, 'Username');?></span>
</span>
<span class="MItem ">
<span class="label">Leaders: </span>
<span class="value">
<div class="MItem TableRow">
<div class="TableCell Cell1">Owner</div>
<div class="TableCell Cell2"><?php echo userAnchor($owner, 'Username');?></div>
</div>
<div class="MItem TableRow">
<div class="TableCell Cell1">Leaders</div>
<div class="TableCell Cell2">
<?php echo writeGroupMembers($leaders, ','); ?>
</span>
</span>
<span class="MItem "><span class="label"><?php echo $totalMembers.' member(s)'; ?></span></span>
<span class="MItem "><span class="label">Created on <?php echo $group->DateInserted; ?></span></span>
<span class="MItem "><span class="label">Privacy: </span><span class="value"><?php echo $group->Privacy; ?></span></span>
</div>
</div>
<div class="MItem TableRow">
<div class="TableCell Cell1">Member(s)</div>
<div class="TableCell Cell2"><?php echo $totalMembers; ?></div>
</div>

<div class="MItem TableRow">
<div class="TableCell Cell1">Created on</div>
<div class="TableCell Cell2"><?php echo $group->DateInserted; ?></div>
</div>
<div class="MItem TableRow Last">
<div class="TableCell Cell1">Privacy</div>
<div class="TableCell Cell2"><?php echo $group->Privacy; ?></div>
</div>
</div>
<?php }?>
</div>
<?php }?>
</div>

<?php
Expand Down
6 changes: 3 additions & 3 deletions views/group/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

<div class="Group-Content">
<div class="Group-Box Group-Announcements Section-DiscussionList">
<h1 class="H">Announcements</h1>
<div class="PageControls">
<h2 class="H">Announcements</h2>
<div class="Button-Controls">
<?php

Expand All @@ -48,8 +48,8 @@
<?php } ?>
</div>
<div class="Group-Box Group-Discussions Section-DiscussionList">
<h1 class="H">Discussions</h1>
<div class="PageControls">
<h2 class="H">Discussions</h2>
<div class="Button-Controls">
<?php
if($groupModel->canAddDiscussion($Group)) {
Expand All @@ -76,7 +76,7 @@
<div class="Group-Info ClearFix clearfix">
<div class="Group-Box Group-MembersPreview">
<div class="PageControls">
<h2 class="Groups H">Members</h2>
<h1 class="Groups H">Members</h1>
</div>
<?php if(count($Members) > 0 ) { ?>
<div class="PhotoGrid PhotoGridSmall">
Expand Down
6 changes: 2 additions & 4 deletions views/group/members.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@

?>
<?php echo writeGroupHeader($Group);?>
<h1 class="H">Leaders</h1>
<div class="media-list-container Group-Box MemberList">
<div class="PageControls">
<h2 class="H media-list-heading">Leaders</h2>
</div>
<?php if(count($Leaders) > 0 ) {?>
<ul class="media-list DataList">
<?php echo writeGroupMembersWithDetails($Leaders, $Group); ?>
Expand All @@ -21,9 +19,9 @@
echo '<div class="EmptyMessage">There are no leaders.</div>';
}?>
</div>
<h1 class="H">Members</h1>
<div class="media-list-container Group-Box MemberList">
<div class="PageControls">
<h2 class="H media-list-heading">Members</h2>
<?php
$PagerOptions = ['Wrapper' => '<span class="PagerNub">&#160;</span><div %1$s>%2$s</div>', 'RecordCount' => $this->data('CountMembers'), 'CurrentRecords' => $Members];
if ($this->data('_PagerUrl')) {
Expand Down
Loading