Skip to content

Commit 3f2f715

Browse files
committed
fix chapter section style && permissions to sub admin role
1 parent 2a3010c commit 3f2f715

File tree

6 files changed

+55
-14
lines changed

6 files changed

+55
-14
lines changed

frontend-build/scss/modules.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,8 @@ table.ccgn-profile {
625625
}
626626
.view-switch {
627627
.grid-x {
628-
padding: 1rem 0;
629-
margin-bottom: 1.5rem;;
628+
padding: .5rem 0;
629+
margin-bottom: 3rem;
630630
border-top: 1px solid $light-gray;
631631
border-bottom: 1px solid $light-gray;
632632
.title {

frontend-build/scss/style.scss

+13-1
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,23 @@ body:not(.page-template-page-faqs) {
9696
.button-list {
9797
margin: 2.5rem 0 1.5rem 0;
9898
.button {
99+
margin-right: 1.3rem;
99100
color: $white;
100101
font-style: normal;
101102
font-family: $font-alt;
102-
font-size: .9rem;
103+
font-size: 1.1rem;
103104
text-transform: uppercase;
105+
.subtitle {
106+
display: block;
107+
font-size: .8rem;
108+
text-align: left;
109+
line-height: 1.4rem;
110+
text-transform: none;
111+
font-weight: initial;
112+
}
113+
&:last-child {
114+
margin-right: 0;
115+
}
104116
}
105117
}
106118
}

plugins/cc-global-network/includes/buddypress-integration.php

+23-5
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,7 @@ function add_sub_admin_role() {
168168
array()
169169
);
170170
if (null !== $result ) {
171-
$sub_admin = get_role(CCGN_USER_ROLE_SUB_ADMIN);
172-
$sub_admin->add_cap('ccgn_view_applications');
173-
$sub_admin->add_cap('ccgn_list_applications');
174-
$sub_admin->add_cap('ccgn_sub_admin_view');
175-
$sub_admin->add_cap('ccgn_list_applications_legal');
171+
ccgn_ensure_sub_admin_capabilities();
176172
}
177173
$council = get_role(CCGN_USER_ROLE_MEMBERSHIP_COUNCIL);
178174
$approver = get_role(CCGN_USER_ROLE_FINAL_APPROVER);
@@ -182,6 +178,28 @@ function add_sub_admin_role() {
182178
$approver->add_cap('ccgn_sub_admin_view');
183179
$legal->add_cap('ccgn_sub_admin_view');
184180
}
181+
function ccgn_ensure_sub_admin_capabilities() {
182+
$sub_admin = get_role(CCGN_USER_ROLE_SUB_ADMIN);
183+
$sub_admin->add_cap('ccgn_view_applications');
184+
$sub_admin->add_cap('ccgn_list_applications');
185+
$sub_admin->add_cap('ccgn_sub_admin_view');
186+
$sub_admin->add_cap('ccgn_list_applications_legal');
187+
//admin chapters
188+
$sub_admin->add_cap('edit_cc_chapters');
189+
$sub_admin->add_cap('read_cc_chapters');
190+
$sub_admin->add_cap('delete_cc_chapters');
191+
$sub_admin->add_cap('edit_others_cc_chapters');
192+
$sub_admin->add_cap('publish_cc_chapters');
193+
$sub_admin->add_cap('read_private_cc_chapters');
194+
$sub_admin->add_cap('delete_private_cc_chapters');
195+
$sub_admin->add_cap('edit_cc_chapters');
196+
$sub_admin->add_cap('delete_published_cc_chapters');
197+
$sub_admin->add_cap('delete_others_cc_chapters');
198+
$sub_admin->add_cap('edit_private_cc_chapters');
199+
$sub_admin->add_cap('edit_published_cc_chapters');
200+
201+
$sub_admin->add_cap( 'edit_theme_options' );
202+
}
185203
function ccgn_user_is_new ( $user_id ) {
186204
$new = true;
187205
$user = get_user_by( 'ID', $user_id );

themes/cc-commoners/archive-cc_chapters.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<div class="view-switch show-for-large">
2626
<div class="grid-x align-justify">
2727
<div class="cell large-3 title">
28-
Switch view
28+
&nbsp;
2929
</div>
3030
<div class="cell large-2 buttons">
3131
<a href="#view-map" class="button gray active"><span class="dashicons dashicons-location-alt"></span> Map</a>
@@ -60,7 +60,7 @@
6060
</thead>
6161
<tbody>
6262
<?php
63-
$chapters = Commoners::get_chapters();
63+
$chapters = Commoners::get_chapters();
6464
if (!empty($chapters)) {
6565
foreach ($chapters as $chapter) {
6666
$chapter_url = (!empty($chapter->cc_chapters_url)) ? '<a href="'. filter_var($chapter->cc_chapters_url, FILTER_VALIDATE_URL) .'" target="_blank" class="button secondary tiny">View</a>' : 'No url';

themes/cc-commoners/assets/css/style.css

+13-3
Original file line numberDiff line numberDiff line change
@@ -3911,11 +3911,21 @@ body:not(.page-template-page-faqs) .item-content {
39113911
.page-body .entry-content .post-content .button-list {
39123912
margin: 2.5rem 0 1.5rem 0; }
39133913
.page-body .entry-content .post-content .button-list .button {
3914+
margin-right: 1.3rem;
39143915
color: #fefefe;
39153916
font-style: normal;
39163917
font-family: "Roboto Condensed", sans-serif;
3917-
font-size: .9rem;
3918+
font-size: 1.1rem;
39183919
text-transform: uppercase; }
3920+
.page-body .entry-content .post-content .button-list .button .subtitle {
3921+
display: block;
3922+
font-size: .8rem;
3923+
text-align: left;
3924+
line-height: 1.4rem;
3925+
text-transform: none;
3926+
font-weight: initial; }
3927+
.page-body .entry-content .post-content .button-list .button:last-child {
3928+
margin-right: 0; }
39193929

39203930
.page-body .entry-content .std-text {
39213931
margin-bottom: 1rem;
@@ -4793,8 +4803,8 @@ table.ccgn-profile {
47934803
display: block; } }
47944804

47954805
.view-switch .grid-x {
4796-
padding: 1rem 0;
4797-
margin-bottom: 1.5rem;
4806+
padding: .5rem 0;
4807+
margin-bottom: 3rem;
47984808
border-top: 1px solid #e6e6e6;
47994809
border-bottom: 1px solid #e6e6e6; }
48004810
.view-switch .grid-x .title {

themes/cc-commoners/inc/site.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php
22

33
class Commoners {
4-
public static function get_chapters_by_status($status='active') {
4+
public static function get_chapters_by_status() {
5+
$status='active';
56
$params = array(
67
'post_type' => 'cc_chapters',
78
'post_status' => 'publish',

0 commit comments

Comments
 (0)