Theme: Single pledge view (#43)

* Theme: Create template part for single pledge

* Plugin: Add functions for handling xprofile data

* Plugin: Add helper function for getting contributor user objects

* Theme: Display aggregated contributor data on single pledge view

* Theme: Add functions, markup, and styles to show team badges

* Theme: Add badge for Test team

* Theme: Add tentative URL for report a pledge link

* Theme: Add support for post thumbnails

* Theme: Add org logo to single pledge view

* Theme: Update `$content_width` to 960

This matches the width of the content in the global header and
the About page.

* Move pledge template to a file used by the template heirarchy

* Clean up some PHPCS errors

* Move pledge structure out to just the list items

* Create file for single pledge styles

* style badge grid into a grid.

* Add a custom image size for the logo

* Update styles

* Un-hide pledges with no confirmed contributors

* Fix content width
This commit is contained in:
Corey McKrill 2019-10-28 10:38:49 -07:00 committed by Kelly Dwan
parent 2ec665bcbb
commit dbdcf26bd9
17 changed files with 683 additions and 53 deletions

View file

@ -23,8 +23,11 @@
@import "archive";
@import "entry-content";
@import "page";
@import "pledge-contributors";
@import "pledge-list";
@import "pledge-single";
@import "site-content";
@import "site-header";
@import "site-title";
@import "team-badges";
@import "wporg-header";

View file

@ -8,8 +8,13 @@
}
h2 {
margin-top: ms(10);
font-size: ms( 2 );
font-weight: 400;
color: $color__text-heading;
}
> :first-child {
margin-top: 0;
}
}

View file

@ -0,0 +1,52 @@
.pledge-contributors {
h3 {
margin-top: 0;
font-size: ms(-1);
color: $color__text-lighter;
}
.pledge-contributor__avatar {
display: inline-block;
background: $color-gray-light-700;
img {
vertical-align: middle;
}
}
&.has-contrib-names {
display: flex;
flex-wrap: wrap;
margin: ms(2) 0;
list-style: none;
justify-content: space-between;
li {
margin: 0 auto 40px;
width: calc( 50% - 20px );
@include breakpoint( $breakpoint-small ) {
width: calc( 33% - 48px );
min-width: 170px;
}
}
li:first-child:last-child {
width: 100%;
a {
max-width: 280px;
}
}
.pledge-contributor__avatar {
margin-bottom: 20px;
}
.pledge-contributor__name {
display: block;
text-align: center;
}
}
}

View file

@ -45,7 +45,7 @@ body.archive.post-type-archive-5ftf_pledge {
}
}
}
.page-header-controls {
font-size: ms(-2);
@ -55,4 +55,32 @@ body.archive.post-type-archive-5ftf_pledge {
font-weight: 700;
}
}
/* Structure */
article {
display: grid;
grid-template-columns: 330px auto;
margin-bottom: ms(12);
.entry-image {
grid-column: 1;
grid-row: 1 / span 2;
margin-right: ms(8);
}
.entry-header {
grid-column: 2;
grid-row: 1;
}
.entry-content {
grid-column: 2;
grid-row: 2;
}
}
.entry-title {
font-size: ms(2);
font-weight: 400;
}
}

View file

@ -0,0 +1,57 @@
body.single.single-5ftf_pledge {
// Expand archive content area to full-width of header.
.site-content .site-main {
padding: 0 10px;
max-width: $size__site-main;
}
.entry-header {
margin: ms(12) 0;
padding-bottom: ms(4);
border-bottom: 1px solid $color-gray-light-500;
@include breakpoint( $breakpoint-mobile ) {
display: flex;
align-items: center;
> div {
flex: auto;
}
.entry-image {
max-width: 330px;
}
}
@include breakpoint( 0, $breakpoint-mobile ) {
text-align: center;
.entry-image {
margin-top: ms(2);
}
}
}
.entry-title {
margin-bottom: 0;
}
.entry-image__logo {
background: transparent;
}
.pledge-company-description {
max-width: $size__content-width;
}
.team-grid {
margin-top: ms(2);
}
.entry-footer {
margin-top: ms(2);
border-top: 1px solid $color-gray-light-500;
padding-top: ms(2);
}
}

View file

@ -6,7 +6,7 @@
padding: 0;
.site-main {
margin: 0 auto;
margin: 0 auto ms(8);
padding: 0 ms( 2 );
max-width: calc( #{ $size__content-width } + #{ ms( 2 ) * 2 } );
}

View file

@ -0,0 +1,196 @@
/**
* Copied from the profiles.wordpress.org theme stylesheet.
*/
.team-grid {
display: flex;
flex-wrap: wrap;
margin: 0;
list-style: none;
li {
display: flex;
align-items: center;
margin: 0 0 1em;
width: 25%;
min-width: 10em;
}
div.dashicons {
margin-right: 0.5em;
&:before {
position: relative;
top: 2px;
font-size: 24px;
}
}
@include breakpoint( 0, $breakpoint-small ) {
li {
width: 100%;
}
}
}
.badge {
margin: 4px;
width: 32px;
height: 32px;
border: 2px solid white;
border-radius: 50%;
box-sizing: border-box;
position: relative;
}
.badge-themes-reviewer {
background: rgba(78, 50, 136, 0.25);
box-shadow: 0 0 0 4px rgb(78, 50, 136);
}
.badge-themes-reviewer:before {
color: rgb(78, 50, 136);
}
.badge-plugins-reviewer {
background: rgba(240, 103, 35, 0.25);
box-shadow: 0 0 0 4px rgb(240, 103, 35);
}
.badge-plugins-reviewer:before {
color: rgb(240, 103, 35);
}
.badge-community {
background: rgba(17, 121, 157, 0.25);
box-shadow: 0 0 0 4px rgb(17, 121, 157);
}
.badge-community:before {
color: rgb(17, 121, 157);
}
.badge-meta {
background: rgba(174, 173, 173, 0.25);
box-shadow: 0 0 0 4px rgb(174, 173, 173);
}
.badge-meta:before {
color: rgb(174, 173, 173);
}
.badge-code-committer {
background: rgba(205, 0, 0, 0.25);
box-shadow: 0 0 0 4px rgb(205, 0, 0);
}
.badge-code-committer:before {
color: rgb(205, 0, 0);
}
.badge-support {
background: rgba(51, 180, 206, 0.25);
box-shadow: 0 0 0 4px rgb(51, 180, 206);
}
.badge-support:before {
color: rgb(51, 180, 206);
}
.badge-wordpress-tv {
background: rgba(115, 173, 48, 0.25);
box-shadow: 0 0 0 4px rgb(115, 173, 48);
}
.badge-wordpress-tv:before {
color: rgb(115, 173, 48);
}
.badge-accessibility {
background: rgba(17, 121, 157, 0.25);
box-shadow: 0 0 0 4px rgb(17, 121, 157);
}
.badge-accessibility:before {
color: rgb(17, 121, 157);
}
.badge-documentation {
background: rgba(59, 114, 54, 0.25);
box-shadow: 0 0 0 4px rgb(59, 114, 54);
}
.badge-documentation:before {
color: rgb(59, 114, 54);
}
.badge-mobile {
background: rgba(251, 161, 108, 0.25);
box-shadow: 0 0 0 4px rgb(251, 161, 108);
}
.badge-mobile:before {
color: rgb(251, 161, 108);
}
.badge-training{
background: rgba(233, 192, 45, 0.25);
box-shadow: 0 0 0 4px rgb(233, 192, 45);
}
.badge-training:before {
color: rgb(233, 192, 45);
}
.badge-translation-editor {
background: rgba(195, 34, 131, 0.25);
box-shadow: 0 0 0 4px rgb(195, 34, 131);
}
.badge-translation-editor:before {
color: rgb(195, 34, 131);
}
.badge-design {
background: rgba(238, 194, 106, 0.25);
box-shadow: 0 0 0 4px rgb(238, 194, 106);
}
.badge-design:before {
color: rgb(238, 194, 106);
}
.badge-marketing {
background: rgba(71, 190, 167, 0.25);
box-shadow: 0 0 0 4px rgb(71, 190, 167);
}
.badge-marketing:before {
color: rgb(71, 190, 167);
}
.badge-wp-cli {
background: rgba(66, 66, 66, 0.25);
box-shadow: 0 0 0 4px rgb(66, 66, 66);
}
.badge-wp-cli:before {
color: rgb(66, 66, 66);
}
.badge-hosting {
background: rgba(83, 88, 166, 0.25);
box-shadow: 0 0 0 4px rgb(83, 88, 166);
}
.badge-hosting:before {
color: rgb(83, 88, 166);
}
.badge-tide {
background: rgb(197, 201, 255);
box-shadow: 0 0 0 4px rgb(21, 38, 255);
}
.badge-tide:before {
color: rgb(21, 38, 255);
}
.badge-security-team {
background: rgba(0, 204, 58, 0.25);
box-shadow: 0 0 0 4px rgb(0, 204, 58);
}
.badge-security-team:before {
color: rgb(0, 204, 58);
}
.badge-test-team {
background: rgba(136, 79, 174, 0.25);
box-shadow: 0 0 0 4px rgb(136, 79, 174);
}
.badge-test-team:before {
color: rgb(136, 79, 174);
}