Skip to content

Commit

Permalink
Merge pull request #135 from wikitongues/project_single
Browse files Browse the repository at this point in the history
Project single
  • Loading branch information
bogreudell authored Mar 21, 2021
2 parents 0ecf614 + 4446796 commit 79b0d16
Show file tree
Hide file tree
Showing 9 changed files with 615 additions and 348 deletions.
692 changes: 384 additions & 308 deletions acf-json/group_5af2062235702.json

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion acf-json/group_601dad3f0d9b2.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@
"operator": "==",
"value": "page"
}
],
[
{
"param": "post_type",
"operator": "==",
"value": "projects"
}
]
],
"menu_order": 0,
Expand All @@ -111,5 +118,5 @@
"hide_on_screen": "",
"active": true,
"description": "",
"modified": 1613023394
"modified": 1616283718
}
99 changes: 99 additions & 0 deletions components/jewish-languages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<div class="single-projects__jewish">
<?php
if( have_rows('jewish_languages_layout') ){
while( have_rows('jewish_languages_layout') ){
the_row();

if( get_row_layout() == 'summary' ){
// summary layout variables
$header_text = get_sub_field('header_text');
$copy_text = get_sub_field('copy_text');
$first_action_text = get_sub_field('first_action_text');
$first_action_link = get_sub_field('first_action_link');
$second_action_embed = get_sub_field('second_action_embed');

// summary layout markup
echo '<div class="wt_content-block">'.
'<h1>'.$header_text.'</h1>'.
$copy_text.
'<a class="wt_primary-action" href="'.$first_action_link.'">'.
$first_action_text.
'</a>'.
$second_action_embed.
'<a id="target" class="wt_donate__secondaryaction" href="#target"><i class="fal fa-arrow-to-bottom"></i><span>Or keep reading</span></a>'.
'</div>';

} elseif ( get_row_layout() == 'languages' ){
// languages layout variables
$header_text = get_sub_field('header_text');
$copy_text = get_sub_field('copy_text');

echo '<div class="wt_content-block">'.
'<h1>'.$header_text.'</h1>'.
$copy_text;

if( have_rows('jewish_languages') ){
while( have_rows('jewish_languages') ){
the_row();

$language_name = get_sub_field('language_name');
$language_information = get_sub_field('language_information');

echo '<p>'.
'<strong>'.$language_name.'</strong><br />'.
$language_information.
'</p>';
}
}

echo '</div>';

} elseif ( get_row_layout() == 'featured_videos' ){
// featured videos variables
$header_text = get_sub_field('header_text');
$copy_text = get_sub_field('copy_text');
$videos = get_sub_field('videos');

echo '<div class="wt_content-block">'.
'<h1>'.$header_text.'</h1>'.
$copy_text.
'</div>';

if( $videos ) {
foreach( $videos as $post ){
setup_postdata( $post );

if ( get_field('video_title') ) {
$video_title = get_field('video_title');
} else {
$video_title = get_the_title($post);
}

$video_permalink = get_the_permalink();
$video_thumbnail = get_field('video_thumbnail');
$featured_languages = get_field('featured_languages');
$video_description = get_field('video_description');
$dropbox_link = get_field('dropbox_link');
$youtube_link = get_field('youtube_link');
$wikimedia_commons_link = get_field('wikimedia_commons_link');
$video_license = get_field('video_license');
$license_link = get_field('license_link');
$attribution_statement = get_field('attribution');

include( locate_template('components/video-preview.php') );
}
wp_reset_postdata();
}
}
}
}
// define variables for donate CTA at bottom of layout
$donate_header = get_field('donate_header');
$donate_copy = get_field('donate_copy');
$donate_embed = get_field('donate_embed');
$donate_secondary_action_text = get_field('donate_secondary_action_text');
$donate_secondary_action_link = get_field('donate_secondary_action_link');

// load donate CTA
include( locate_template('components/donate-block.php') ); ?>
</div>
35 changes: 0 additions & 35 deletions components/project-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,4 @@
<div class="wt_single-projects__copy">
<?php the_content(); ?>
</div>
<div class="wt_single-projects__help">
<h1>How you can help</h1>
<?php if ( $how_to_help ): ?>
<p><?php echo $how_to_help; ?></p>
<?php endif; ?>
<?php echo $giveforms_embed_code; ?>
<!-- <p>If you or someone in your community speaks a Jewish language, or you'd like to volunteer your time as a field linguist, <a href="#">sign up</a>.</p> -->
</div>
<?php if ( $featured_videos ): ?>
<div class="wt_single-projects__videos">
<h1><?php echo $videos_header; ?></h1>
<p><?php echo $videos_copy; ?></p>
<?php foreach( $featured_videos as $post ): setup_postdata( $post );

if ( get_field('video_title') ) {
$video_title = get_field('video_title');
} else {
$video_title = get_the_title($post);
}

$video_permalink = get_the_permalink();
$video_thumbnail = get_field('video_thumbnail');
$featured_languages = get_field('featured_languages');
$video_description = get_field('video_description');
$youtube_link = get_field('youtube_link');
$wikimedia_commons_link = get_field('wikimedia_commons_link');
$video_license = get_field('video_license');
$license_link = get_field('license_link');
$attribution_statement = get_field('attribution');

include( locate_template('components/video-preview.php') );

endforeach; wp_reset_postdata(); ?>
</div>
<?php endif; ?>
</div>
6 changes: 5 additions & 1 deletion single-projects.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@

if ( $title == 'Language Revitalization' ) {
include( 'components/language-revitalization.php' );

} elseif ( $title == 'Jewish Languages' ) {
include( 'components/jewish-languages.php' );

} else {
// we will eventually have a default project template and unique templates for each of these big projects
include( 'components/project-content.php' );

}
}
}
Expand Down
59 changes: 58 additions & 1 deletion stylus/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ body.single-projects .wt_single-projects__copy,
body.single-projects .wt_single-projects__help {
width: 90%;
max-width: 600px;
margin: 5% auto 0;
margin: 5% auto 10%;
}
body.single-projects .wt_single-projects__videos {
margin: 5% auto 10%;
Expand Down Expand Up @@ -2602,3 +2602,60 @@ body.post-type-archive-projects .wt_section:last-of-type {
margin: auto !important;
}
}
.single-projects__jewish .wt_content-block {
width: 90%;
max-width: 600px;
margin: 90px auto 0;
}
.single-projects__jewish .wt_content-block p {
line-height: 3.6rem;
}
.single-projects__jewish .wt_content-block:first-of-type {
margin-top: 180px;
}
.single-projects__jewish .wt_content-block .wt_primary-action {
display: inline-block;
width: 48%;
max-width: 500px;
margin: 30px 4% 30px 0;
background: #20597a;
border: 5px solid #20597a;
padding: 25px;
box-sizing: border-box;
border-radius: 60px;
text-align: center;
font-size: 1.5rem;
color: #fff;
font-family: objektiv-mk1, sans-serif;
font-weight: 500;
text-transform: uppercase;
font-size: 2.8rem;
}
.single-projects__jewish .wt_content-block .giveforms-donation-button {
display: inline-block;
width: 48%;
max-width: 500px;
border: 5px solid #20597a;
padding: 25px;
box-sizing: border-box;
border-radius: 60px;
text-align: center;
font-size: 1.5rem;
color: #20597a;
font-family: objektiv-mk1, sans-serif;
font-weight: 500;
text-transform: uppercase;
font-size: 2.8rem;
}
.single-projects__jewish .wt_donate {
padding: 90px 0;
}
@media all and (max-width: 979px) {
.single-projects__jewish .wt_content-block h1 br {
display: none;
}
.single-projects__jewish .wt_content-block .wt_primary-action,
.single-projects__jewish .wt_content-block .giveforms-donation-button {
font-size: 1.4rem;
}
}
3 changes: 2 additions & 1 deletion stylus/require/components/all.styl
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
@require "seedbank-donors"
@require "donate-module"
@require "feature"
@require "language-revitalization"
@require "language-revitalization"
@require "jewish-languages"
58 changes: 58 additions & 0 deletions stylus/require/components/jewish-languages.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.single-projects__jewish
.wt_content-block
width 90%
max-width 600px
margin $margin3 auto 0

p
line-height 3.6rem

&:first-of-type
margin-top $margin5

.wt_primary-action
display inline-block
width 48%
max-width 500px
margin $margin1 4% $margin1 0
background $interactive
border 5px solid $interactive
padding 25px
box-sizing border-box
border-radius 60px
text-align center
font-size 1.5rem
color $white
font-family objektiv-mk1, sans-serif
font-weight 500
text-transform uppercase
font-size 2.8rem

.giveforms-donation-button
display inline-block
width 48%
max-width 500px
border 5px solid $interactive
padding 25px
box-sizing border-box
border-radius 60px
text-align center
font-size 1.5rem
color $interactive
font-family objektiv-mk1, sans-serif
font-weight 500
text-transform uppercase
font-size 2.8rem

.wt_donate
padding $margin3 0

@media all and ( max-width: $mobile )
.single-projects__jewish
.wt_content-block
h1 br
display none

.wt_primary-action,
.giveforms-donation-button
font-size 1.4rem
2 changes: 1 addition & 1 deletion stylus/require/single-projects.styl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ body
&__help
width 90%
max-width 600px
margin 5% auto 0
margin 5% auto 10%

&__videos
margin 5% auto 10%
Expand Down

0 comments on commit 79b0d16

Please sign in to comment.