Skip to content

Commit b5e98e7

Browse files
committed
add global settings screen in WP backend & style fixes
1 parent 24ac5a2 commit b5e98e7

File tree

8 files changed

+418
-27
lines changed

8 files changed

+418
-27
lines changed

frontend-build/scss/modules.scss

+97-18
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ table.ccgn-profile {
606606
}
607607
.view-content {
608608
display: none;
609+
margin-bottom: 1.5rem;
609610
&.active {
610611
display: block;
611612
}
@@ -683,23 +684,101 @@ table.ccgn-profile {
683684
}
684685
}
685686
}
686-
// &:after {
687-
// content: '';
688-
// position: absolute;
689-
// width: 0;
690-
// height: 0;
691-
// margin-left: -0.5em;
692-
// bottom: -2em;
693-
// left: 45%;
694-
// box-sizing: border-box;
695-
696-
// border: 1em solid black;
697-
// border-color: transparent transparent $white $white;
698-
699-
// transform-origin: 0 0;
700-
// transform: rotate(-45deg);
701-
702-
// box-shadow: -3px 3px 3px 0 rgba(0, 0, 0, 0.4);
703-
// }
687+
688+
}
689+
}
690+
.dataTables_wrapper {
691+
.dataTables_filter {
692+
margin-bottom: 2rem;
693+
label {
694+
display: flex;
695+
align-items: center;
696+
input {
697+
margin-bottom: 0;
698+
}
699+
}
700+
}
701+
.dataTable {
702+
thead {
703+
td {
704+
font-family: $font-alt;
705+
text-transform: uppercase;
706+
font-size: .9rem;
707+
border-bottom: 1px solid $light-gray;
708+
}
709+
}
710+
tbody {
711+
td {
712+
border-bottom: 1px solid lighten($light-gray,6);
713+
.button {
714+
color: $white !important;
715+
}
716+
}
717+
}
718+
&.no-footer {
719+
border-bottom: 1px solid $light-gray;
720+
}
721+
}
722+
.dataTables_info {
723+
margin-top: 1rem;
724+
color: $dark-gray;
725+
font-size: .9rem;
726+
font-style: italic;
727+
}
728+
.dataTables_paginate {
729+
margin-top: 1rem;
730+
font-size: .9rem;
731+
.paginate_button {
732+
&.current {
733+
background: $dark-gray;
734+
color: $white !important;
735+
&:hover {
736+
background: $primary-color;
737+
}
738+
}
739+
}
740+
}
741+
}
742+
.chapter-stats {
743+
.cell {
744+
&:nth-child(1) {
745+
.stat-box {
746+
background-color: $alert-color;
747+
}
748+
}
749+
&:nth-child(2) {
750+
.stat-box {
751+
background-color: $success-color;
752+
}
753+
}
754+
&:nth-child(3) {
755+
.stat-box {
756+
background-color: $warning-color;
757+
}
758+
}
759+
.stat-box {
760+
padding: .5rem 1.5rem;
761+
color: $white;
762+
font-family: $font-alt;
763+
text-align: center;
764+
.stat-number {
765+
display: block;
766+
font-size: rem-calc(80);
767+
line-height: 5.6rem;
768+
font-weight: bold;
769+
}
770+
.subtitle {
771+
text-transform: uppercase;
772+
}
773+
.title {
774+
font-size: rem-calc(42);
775+
text-transform: uppercase;
776+
}
777+
&.with-subtitle {
778+
.title {
779+
line-height: 2.3rem;
780+
}
781+
}
782+
}
704783
}
705784
}

frontend-build/scss/style.scss

+10
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ body:not(.page-template-page-faqs) {
9393
}
9494
}
9595
}
96+
.button-list {
97+
margin: 2.5rem 0 1.5rem 0;
98+
.button {
99+
color: $white;
100+
font-style: normal;
101+
font-family: $font-alt;
102+
font-size: .9rem;
103+
text-transform: uppercase;
104+
}
105+
}
96106
}
97107
.std-text {
98108
margin-bottom: 1rem;

plugins/queulat-cc-chapters-cpt-plugin/class-cc-chapters-metabox.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public function get_fields() : array
240240
'label' => 'Meeting URL',
241241
'attributes' => [
242242
'class' => 'widefat',
243-
'placeholder' => 'Chapter URL',
243+
'placeholder' => 'Chapter first meeting URL',
244244
'type' => 'url'
245245
],
246246
'properties' => [

themes/cc-commoners/archive-cc_chapters.php

+55-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
<?php
22
get_header();
33
get_post();
4+
global $_set;
5+
$settings = $_set->settings;
6+
$section_title = (!empty($settings['chapters_title'])) ? $settings['chapters_title'] : 'Chapters';
47
?>
58
<section class="main-content space-top">
69
<div class="grid-container">
7-
<div class="grid-x grid-padding-x">
10+
<div class="grid-x grid-padding-x align-center">
811
<div class="cell large-12">
9-
<div class="entry-header">
10-
<h1 class="entry-title">Chapters</h1>
12+
<div class="grid-x align-center">
13+
<div class="large-10 cell">
14+
<div class="entry-header">
15+
<h1 class="entry-title"><?php echo $section_title ?></h1>
16+
</div>
17+
<section class="entry-content">
18+
<div class="post-content">
19+
<?php echo apply_filters('the_content', $settings['chapters_content']); ?>
20+
</div>
21+
</section>
22+
</div>
1123
</div>
24+
1225
<div class="view-switch">
1326
<div class="grid-x align-justify">
1427
<div class="cell large-3 title">
@@ -23,9 +36,9 @@
2336
<div class="world-map view-content active" id="view-map">
2437
<?php get_template_part('template-parts/maps/world','map'); ?>
2538
<div id="world-map-info">
26-
<h2 class="chapter-title">CC titirilquen</h2>
27-
<p class="chapter-line">Founded on <span class="chapter-date">29 May, 2018</span> </p>
28-
<p class="chapter-lead">Chapter Lead: <span class="chapter-lead-name">Juan Carlos bodoque</span></p>
39+
<h2 class="chapter-title"></h2>
40+
<p class="chapter-line">Founded on <span class="chapter-date"></span> </p>
41+
<p class="chapter-lead">Chapter Lead: <span class="chapter-lead-name"></span></p>
2942
<p class="chapter-buttons">
3043
<a href="#" class="button warning contact">Contact</a>
3144
<a href="#" class="button warning url">Web</a>
@@ -50,13 +63,14 @@
5063
$chapters = Commoners::get_chapters();
5164
if (!empty($chapters)) {
5265
foreach ($chapters as $chapter) {
66+
$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';
5367
echo '<tr>';
5468
echo '<td>'.$chapter->post_title.'</td>';
5569
echo '<td>' . $chapter->cc_chapters_date . '</td>';
5670
echo '<td>' . $chapter->cc_chapters_email . '</td>';
5771
echo '<td>' . get_user_by('id', $chapter->cc_chapters_chapter_lead)->display_name . '</td>';
5872
echo '<td>' . get_user_by('id', $chapter->cc_chapters_member_gnc)->display_name . '</td>';
59-
echo '<td>' . $chapter->cc_chapters_url . '</td>';
73+
echo '<td>' . $chapter_url. '</td>';
6074
echo '</tr>';
6175
}
6276
}
@@ -66,6 +80,40 @@
6680
</div>
6781
</div>
6882
</div>
83+
<div class="grid-x grid-padding-x align-center">
84+
<div class="cell large-10">
85+
<div class="chapter-stats">
86+
<?php $global_stats = Commoners::stats(); ?>
87+
<div class="grid-x grid-margin-x large-up-3 medium-up-3 small-up-3">
88+
<?php if (!empty($global_stats['total_members'])) : ?>
89+
<div class="cell">
90+
<article class="stat-box">
91+
<span class="stat-number"><?php echo $global_stats['total_members']; ?></span>
92+
<span class="title">Users</span>
93+
</article>
94+
</div>
95+
<?php endif; ?>
96+
<?php if (!empty($global_stats['active_chapters'])) : ?>
97+
<div class="cell">
98+
<article class="stat-box">
99+
<span class="stat-number"><?php echo $global_stats['active_chapters']; ?></span>
100+
<span class="title">Chapters</span>
101+
</article>
102+
</div>
103+
<?php endif; ?>
104+
<?php if (!empty($global_stats['in-progress_chapters'])) : ?>
105+
<div class="cell">
106+
<article class="stat-box with-subtitle">
107+
<span class="stat-number"><?php echo $global_stats['in-progress_chapters']; ?></span>
108+
<span class="subtitle">In-progress</span>
109+
<span class="title">Chapters</span>
110+
</article>
111+
</div>
112+
<?php endif; ?>
113+
</div>
114+
</div>
115+
</div>
116+
</div>
69117
</div>
70118
</section>
71119
<?php get_footer(); ?>

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

+78-1
Original file line numberDiff line numberDiff line change
@@ -3908,6 +3908,14 @@ body:not(.page-template-page-faqs) .item-content {
39083908
top: -.1rem; }
39093909
.page-body .entry-content .post-content .search-result .link-more .more-link:hover {
39103910
color: #8a8a8a; }
3911+
.page-body .entry-content .post-content .button-list {
3912+
margin: 2.5rem 0 1.5rem 0; }
3913+
.page-body .entry-content .post-content .button-list .button {
3914+
color: #fefefe;
3915+
font-style: normal;
3916+
font-family: "Roboto Condensed", sans-serif;
3917+
font-size: .9rem;
3918+
text-transform: uppercase; }
39113919

39123920
.page-body .entry-content .std-text {
39133921
margin-bottom: 1rem;
@@ -4764,7 +4772,8 @@ table.ccgn-profile {
47644772
min-height: 20rem; }
47654773

47664774
.view-content {
4767-
display: none; }
4775+
display: none;
4776+
margin-bottom: 1.5rem; }
47684777
.view-content.active {
47694778
display: block; }
47704779
.view-content #chapters-table {
@@ -4828,6 +4837,74 @@ table.ccgn-profile {
48284837
.world-map #world-map-info .chapter-buttons .button:hover {
48294838
background: #ffbe33; }
48304839

4840+
.dataTables_wrapper .dataTables_filter {
4841+
margin-bottom: 2rem; }
4842+
.dataTables_wrapper .dataTables_filter label {
4843+
display: -webkit-box;
4844+
display: -ms-flexbox;
4845+
display: flex;
4846+
-webkit-box-align: center;
4847+
-ms-flex-align: center;
4848+
align-items: center; }
4849+
.dataTables_wrapper .dataTables_filter label input {
4850+
margin-bottom: 0; }
4851+
4852+
.dataTables_wrapper .dataTable thead td {
4853+
font-family: "Roboto Condensed", sans-serif;
4854+
text-transform: uppercase;
4855+
font-size: .9rem;
4856+
border-bottom: 1px solid #e6e6e6; }
4857+
4858+
.dataTables_wrapper .dataTable tbody td {
4859+
border-bottom: 1px solid whitesmoke; }
4860+
.dataTables_wrapper .dataTable tbody td .button {
4861+
color: #fefefe !important; }
4862+
4863+
.dataTables_wrapper .dataTable.no-footer {
4864+
border-bottom: 1px solid #e6e6e6; }
4865+
4866+
.dataTables_wrapper .dataTables_info {
4867+
margin-top: 1rem;
4868+
color: #8a8a8a;
4869+
font-size: .9rem;
4870+
font-style: italic; }
4871+
4872+
.dataTables_wrapper .dataTables_paginate {
4873+
margin-top: 1rem;
4874+
font-size: .9rem; }
4875+
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
4876+
background: #8a8a8a;
4877+
color: #fefefe !important; }
4878+
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
4879+
background: #efbe01; }
4880+
4881+
.chapter-stats .cell:nth-child(1) .stat-box {
4882+
background-color: #f46b2c; }
4883+
4884+
.chapter-stats .cell:nth-child(2) .stat-box {
4885+
background-color: #27a635; }
4886+
4887+
.chapter-stats .cell:nth-child(3) .stat-box {
4888+
background-color: #ffae00; }
4889+
4890+
.chapter-stats .cell .stat-box {
4891+
padding: .5rem 1.5rem;
4892+
color: #fefefe;
4893+
font-family: "Roboto Condensed", sans-serif;
4894+
text-align: center; }
4895+
.chapter-stats .cell .stat-box .stat-number {
4896+
display: block;
4897+
font-size: 5rem;
4898+
line-height: 5.6rem;
4899+
font-weight: bold; }
4900+
.chapter-stats .cell .stat-box .subtitle {
4901+
text-transform: uppercase; }
4902+
.chapter-stats .cell .stat-box .title {
4903+
font-size: 2.625rem;
4904+
text-transform: uppercase; }
4905+
.chapter-stats .cell .stat-box.with-subtitle .title {
4906+
line-height: 2.3rem; }
4907+
48314908
@media screen and (max-width: 39.99875em) {
48324909
.home .page-body {
48334910
padding-top: 2.9rem; }

themes/cc-commoners/functions.php

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Require related files
1010
*/
1111
include STYLESHEETPATH.'/inc/site.php';
12+
include STYLESHEETPATH . '/inc/settings.php';
1213

1314
function cc_commoners_theme_setup () {
1415
register_nav_menus(
@@ -84,6 +85,12 @@ function cc_commoners_theme_scripts () {
8485
array(),
8586
wp_get_theme()->get('Version')
8687
);
88+
wp_enqueue_style(
89+
'cc-datatables-styles-foundation',
90+
get_stylesheet_directory_uri() . '/assets/css/datatables.css',
91+
array('cc-datatables-styles'),
92+
wp_get_theme()->get('Version')
93+
);
8794
}
8895
wp_enqueue_style('dashicons');
8996
$parent_style = 'twentyseventeen-style';

0 commit comments

Comments
 (0)