9d738c0b by Jeff Balicki

qa

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent 63de5caa
......@@ -75,25 +75,45 @@ if($categoryID == ""){
$documents = get_posts($args);
$posts = array_merge($documents, $attachments);
echo '<ul>';
echo '<table id="relevant-resources"><thead style="display:none;"><tr><th>file</th></tr></thead><tbody>';
foreach($posts as $post ) {
$post_type = get_post_type( $post->ID );
$link = wp_get_attachment_url( $post->ID );
$description = get_post_meta($post->ID, 'description', true );
$terms = wp_get_post_terms( $post->ID, 'document-format');
$imgid =$post->ID;
if($imgid) {
$image = wp_get_attachment_image_src($imgid, 'medium');
$image = $image[0];
$image_alt = get_post_meta($imgid, '_wp_attachment_image_alt', TRUE);
}
$term_list = array();
if ( !empty( $terms ) && !is_wp_error( $terms ) ){
foreach ( $terms as $term ) {
$term_list = $term->name;
}
}
if($post_type == 'documents'){ $link = get_post_meta($post->ID, 'document_link', true );};
echo '<li><a class="'.$term_list.'" href="'.$link.'">'.$post->post_title.'</a><p>'.$description.'</p></li>';
echo '<tr><td><div class="rel">';
if($image):
?>
<div class='photo'>
<img src='#' data-src="<?= $image ?>" class='lazy' alt='<?= $image_alt ?>' />
</div>
<?php endif; ?>
<div class='content'>
<?php echo '<a class="'.$term_list.'" href="'.$link.'">'.$post->post_title.'</a>';
if($description != ""){
echo '<p>'.$description.'</p>';
};
echo '</div></div></td></tr>';
};
echo '</ul>';
echo '</tbody></table>';
?>
</div>
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
......@@ -41,3 +41,4 @@ function wptp_add_tags_to_attachments() {
}
add_action( 'init' , 'wptp_add_tags_to_attachments' );
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
......@@ -23,6 +23,16 @@ if($post_type == 'attachment') {
$target = 'target="_blank"';
}
$term_list = array();
$terms = wp_get_post_terms( $post->ID, 'document-format');
if ( !empty( $terms ) && !is_wp_error( $terms ) ){
foreach ( $terms as $term ) {
$term_list = $term->name;
}
}
?>
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
......@@ -43,6 +53,7 @@ if($post_type == 'attachment') {
$image = $img;
$image_alt = get_field('alt_text', $search_posts[$i]['ID']);
}
?>
<img src='#' data-src="<?= $image ?>" class='lazy' alt='<?= $image_alt ?>' />
</div>
......@@ -51,7 +62,7 @@ if($post_type == 'attachment') {
<header class="entry-header">
<h2 class="entry-title"><?= the_title() ?></h2>
<h2 class="<?php echo $term_list;?>"><?= the_title() ?></h2>
</header><!-- .entry-header -->
......
......@@ -2620,6 +2620,14 @@
"integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==",
"dev": true
},
"@types/jquery": {
"version": "3.5.17",
"resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.17.tgz",
"integrity": "sha512-U40tNEAGSTZ7R1OC6kGkD7f4TKW5DoVx6jd9kTB9mo5truFMi1m9Yohnw9kl1WpTPvDdj7zAw38LfCHSqnk5kA==",
"requires": {
"@types/sizzle": "*"
}
},
"@types/node": {
"version": "20.4.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.2.tgz",
......@@ -2632,6 +2640,11 @@
"integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==",
"dev": true
},
"@types/sizzle": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz",
"integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ=="
},
"abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
......@@ -3410,6 +3423,32 @@
"css-tree": "^1.1.2"
}
},
"datatables.net": {
"version": "1.13.6",
"resolved": "https://registry.npmjs.org/datatables.net/-/datatables.net-1.13.6.tgz",
"integrity": "sha512-rHNcnW+yEP9me82/KmRcid5eKrqPqW3+I/p1TwqCW3c/7GRYYkDyF6aJQOQ9DNS/pw+nyr4BVpjyJ3yoZXiFPg==",
"requires": {
"jquery": ">=1.7"
}
},
"datatables.net-dt": {
"version": "1.13.6",
"resolved": "https://registry.npmjs.org/datatables.net-dt/-/datatables.net-dt-1.13.6.tgz",
"integrity": "sha512-0fBsUi8k5e+x5e+xA/Eb5stFr2PIkHgDnbhZs8ZDLvzzL975lCm6sqBAcsTsXKvF7yuBvaDTVBTF4wOMw7PrYw==",
"requires": {
"datatables.net": ">=1.13.4",
"jquery": ">=1.7"
}
},
"datatables.net-plugins": {
"version": "1.13.6",
"resolved": "https://registry.npmjs.org/datatables.net-plugins/-/datatables.net-plugins-1.13.6.tgz",
"integrity": "sha512-CPLH+09OiEAP3PKbZH7u2qcLajgHhy4fBHCdLzjGWJwKbIkhaPu7tby4jZHQXqoolUznbm3TEpJj4eMI1eqcGw==",
"requires": {
"@types/jquery": "^3.5.16",
"datatables.net": "^1.13.2"
}
},
"debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
......@@ -4323,6 +4362,11 @@
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
"dev": true
},
"jquery": {
"version": "3.7.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz",
"integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg=="
},
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
......
......@@ -42,6 +42,8 @@
},
"homepage": "https://understrap.com",
"dependencies": {
"datatables.net-dt": "^1.13.6",
"datatables.net-plugins": "^1.13.6",
"rollup-plugin-postcss": "^4.0.2",
"swiper": "^8.4.2",
"vanilla-lazyload": "^17.8.4"
......
// Add your custom JS here.
import jquery from 'jquery';
import LazyLoad from "vanilla-lazyload";
import DataTable from 'datatables.net-dt';
import "./_menu_mobile";
import "./_search";
......@@ -10,9 +11,11 @@ import "./_image_captionation";
import "./_carousels";
var myLazyLoad = new LazyLoad();
window.tz_checkVisible = function(elm, evalType , offset, heightBuffer) {
evalType = evalType || "visible";
......@@ -29,4 +32,15 @@ window.tz_checkVisible = function(elm, evalType , offset, heightBuffer) {
if (evalType === "above") return ((y < (vpH + st)));
};
jQuery(document).ready(function() {
console.log('ready');
jQuery('#relevant-resources').dataTable( {
info: false,
ordering: false,
paging: true,
bLengthChange: false,
bFilter: false,
pagingType: "numbers",
pageLength: 10
} );
} );
......
......@@ -302,7 +302,7 @@ blockquote{
table:not(.ui-datepicker-calendar) {
table:not(.ui-datepicker-calendar):not(#relevant-resources) {
margin: 2.5rem 0rem;
border: 0.25rem solid #fff!important;
background-color: #EAEDF1 !important;
......
......@@ -5,27 +5,46 @@
h2{
border-bottom:1px solid #707070;
}
ul{
list-style: none;
margin-left: 0px;
padding-left: 0px;
li{
#relevant-resources{
width: 100%;
td{
border-bottom:1px solid #ccc;
margin-left: 0px;
padding-left: 0px !important;
padding-bottom: 25px;
padding-top: 25px;
.rel{
display: flex;
.photo {
max-width: 160px;
max-height: 92px;
margin-right: 20px;
img {
object-fit: cover;
object-position: center;
height: 100%;
width: 100%;
}
}
.content{
}
}
a{
margin-bottom: 20px;
font-weight: 700;
text-decoration: none;
font-size: 16px;
line-height: 20px;
line-height: 20pxs;
display: block;
}
a:hover{
text-decoration: underline;
}
p{
margin-top: 15px;
padding-bottom: 0px;
}
a.PDF{
&:before {
content:'';
......@@ -71,6 +90,58 @@
margin-right: 0.3125rem;
}
}
a.PPT{
&:before {
content:'';
width: 17px;
height: 20px;
background-repeat: no-repeat;
background-size: contain;
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="17.95" height="20.264" viewBox="0 0 17.95 20.264"><defs><clipPath id="clip-path"><rect id="Rectangle_308" data-name="Rectangle 308" width="17.95" height="20.264" fill="none"/></clipPath></defs><g id="Group_1957" data-name="Group 1957" transform="translate(0 0)"><g id="Group_1956" data-name="Group 1956" transform="translate(0 0)" clip-path="url(%23clip-path)"><path id="Path_1523" data-name="Path 1523" d="M5.437,12.6a.576.576,0,0,0,.176-.433.645.645,0,0,0-.153-.435.734.734,0,0,0-.574-.179H4.456v1.216h.37a.872.872,0,0,0,.611-.169" transform="translate(-0.72 -1.868)" fill="%23040504"/><path id="Path_1524" data-name="Path 1524" d="M10.318,11.555v1.216h.369A.876.876,0,0,0,11.3,12.6a.578.578,0,0,0,.175-.433.644.644,0,0,0-.153-.435.736.736,0,0,0-.574-.179Z" transform="translate(-1.668 -1.868)" fill="%23040504"/><path id="Path_1525" data-name="Path 1525" d="M17.855,7.916a1.113,1.113,0,0,0-1.014-.671c-.138,0-.276,0-.414,0h-.093V4.924a.563.563,0,0,0-.153-.4L12.408.225A1.1,1.1,0,0,0,12.33.136.4.4,0,0,0,12.024,0H2.487a.915.915,0,0,0-.34.049A.8.8,0,0,0,1.638.78v6.46a.317.317,0,0,1-.075.006h-.4A1.135,1.135,0,0,0,.03,8.2a.633.633,0,0,1-.03.1v6.077a.941.941,0,0,1,.032.1,1.135,1.135,0,0,0,1.1.941h.508v4a.846.846,0,0,0,.048.307.788.788,0,0,0,.551.5c.032.008.062.022.094.033h13.3l0,0c.034-.01.068-.023.1-.033a.794.794,0,0,0,.593-.7c.005-.053.005-.107.005-.16v-3.94a.626.626,0,0,1,.08,0h.414a1.132,1.132,0,0,0,1.11-.937,1.482,1.482,0,0,0,.011-.244V8.409a1.1,1.1,0,0,0-.094-.493M2.437.8h9.2v4a.785.785,0,0,0,.005.126.4.4,0,0,0,.385.335h3.5c.021.066.023,1.9,0,1.985H2.437Zm8.835,9.455a1.8,1.8,0,0,1-.444,1.291,1.792,1.792,0,0,1-1.354.464H8.65v2.023H7.139V8.579h2.5a1.6,1.6,0,0,1,1.224.435,1.745,1.745,0,0,1,.407,1.239M2.224,14.031V8.579h2.5a1.6,1.6,0,0,1,1.224.435,1.745,1.745,0,0,1,.407,1.239,1.8,1.8,0,0,1-.443,1.291,1.792,1.792,0,0,1-1.354.464H3.736v2.023Zm13.31,5.21H2.437l-.006-3.815h13.1Zm.759-9.317H14.758v4.106H13.252V9.925H11.718V8.579h4.575Z" transform="translate(0 0)" fill="%23040504"/></g></g></svg>');
display: inline-block;
position: relative;
top: 0.3125rem;
left:-0.2rem;
margin-right: 0.3125rem;
}
}
a.HTML{
&:before {
content:'';
width: 17px;
height: 17px;
background-repeat: no-repeat;
background-size: contain;
background-image: url('data:image/svg+xml,<svg id="Group_1310" data-name="Group 1310" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="17.758" height="17.741" viewBox="0 0 17.758 17.741"><defs><clipPath id="clip-path"><rect id="Rectangle_151" data-name="Rectangle 151" width="17.758" height="17.741"/></clipPath></defs><path id="Path_1277" data-name="Path 1277" d="M0,0V17.741H17.757V8.281H15.586v7.3H2.189V2.135H9.3V0Z" transform="translate(0 0)"/><g id="Group_1023" data-name="Group 1023" transform="translate(0 0)"><g id="Group_1022" data-name="Group 1022" clip-path="url(%23clip-path)"><path id="Path_1278" data-name="Path 1278" d="M17.986,11.548,16.363,9.931l7.791-7.756H21.989V.016h5.864V5.867H25.7V3.8l-7.717,7.748" transform="translate(-10.096 -0.01)"/></g></g></svg>');
display: inline-block;
position: relative;
top: 0.3125rem;
left:-0.2rem;
margin-right: 0.3125rem;
}
}
}
}
}
#relevant-resources_paginate {
margin-top: 30px;
}
.paginate_button{
background-color: transparent;
color: #000;
font-weight: 300;
padding: 5px 10px;
margin: 0px 5px;
cursor: pointer;
text-decoration: none;
&:hover{
text-decoration: underline;
}
&.current{
font-weight: 700;
}
}
\ No newline at end of file
......
......@@ -41,10 +41,10 @@
display: flex;
.photo {
min-width: 18.375rem;
min-height: 12.375rem;
max-width: 18.375rem;
max-height: 12.375rem;
max-width: 160px;
max-height: 92px;
min-width: 160px;
min-height: 92px;
img {
object-fit: cover;
......@@ -64,15 +64,21 @@
@media screen and (max-width: 59.375rem) {
flex-direction: column;
}
h2 {
text-decoration: none;
font-size: 16px;
font-weight: bold;
}
&:hover {
h2.entry-title {
h2 {
text-decoration: underline;
font-size: 16px;
}
}
}
a[href$=".pdf"]{
h2{
h2.PDF{
&:before {
content:'';
width:1.313rem;
......@@ -86,10 +92,8 @@
margin-right: 0.3125rem;
}
}
}
a[href$=".doc"],
a[href$=".docx"]{
h2{
h2.Word{
&:before {
content:'';
width:1.313rem;
......@@ -104,10 +108,9 @@
margin-right: 0.3125rem;
}
}
}
a[href$=".xls"],
a[href$=".xlsx"]{
h2{
h2.Excel{
&:before {
content:'';
width:1.313rem;
......@@ -122,7 +125,36 @@
margin-right: 0.3125rem;
}
}
}
h2.PPT{
&:before {
content:'';
width:1.313rem;
height:1.5rem;
background-repeat: no-repeat;
background-size: contain;
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="17.95" height="20.264" viewBox="0 0 17.95 20.264"><defs><clipPath id="clip-path"><rect id="Rectangle_308" data-name="Rectangle 308" width="17.95" height="20.264" fill="none"/></clipPath></defs><g id="Group_1957" data-name="Group 1957" transform="translate(0 0)"><g id="Group_1956" data-name="Group 1956" transform="translate(0 0)" clip-path="url(%23clip-path)"><path id="Path_1523" data-name="Path 1523" d="M5.437,12.6a.576.576,0,0,0,.176-.433.645.645,0,0,0-.153-.435.734.734,0,0,0-.574-.179H4.456v1.216h.37a.872.872,0,0,0,.611-.169" transform="translate(-0.72 -1.868)" fill="%23040504"/><path id="Path_1524" data-name="Path 1524" d="M10.318,11.555v1.216h.369A.876.876,0,0,0,11.3,12.6a.578.578,0,0,0,.175-.433.644.644,0,0,0-.153-.435.736.736,0,0,0-.574-.179Z" transform="translate(-1.668 -1.868)" fill="%23040504"/><path id="Path_1525" data-name="Path 1525" d="M17.855,7.916a1.113,1.113,0,0,0-1.014-.671c-.138,0-.276,0-.414,0h-.093V4.924a.563.563,0,0,0-.153-.4L12.408.225A1.1,1.1,0,0,0,12.33.136.4.4,0,0,0,12.024,0H2.487a.915.915,0,0,0-.34.049A.8.8,0,0,0,1.638.78v6.46a.317.317,0,0,1-.075.006h-.4A1.135,1.135,0,0,0,.03,8.2a.633.633,0,0,1-.03.1v6.077a.941.941,0,0,1,.032.1,1.135,1.135,0,0,0,1.1.941h.508v4a.846.846,0,0,0,.048.307.788.788,0,0,0,.551.5c.032.008.062.022.094.033h13.3l0,0c.034-.01.068-.023.1-.033a.794.794,0,0,0,.593-.7c.005-.053.005-.107.005-.16v-3.94a.626.626,0,0,1,.08,0h.414a1.132,1.132,0,0,0,1.11-.937,1.482,1.482,0,0,0,.011-.244V8.409a1.1,1.1,0,0,0-.094-.493M2.437.8h9.2v4a.785.785,0,0,0,.005.126.4.4,0,0,0,.385.335h3.5c.021.066.023,1.9,0,1.985H2.437Zm8.835,9.455a1.8,1.8,0,0,1-.444,1.291,1.792,1.792,0,0,1-1.354.464H8.65v2.023H7.139V8.579h2.5a1.6,1.6,0,0,1,1.224.435,1.745,1.745,0,0,1,.407,1.239M2.224,14.031V8.579h2.5a1.6,1.6,0,0,1,1.224.435,1.745,1.745,0,0,1,.407,1.239,1.8,1.8,0,0,1-.443,1.291,1.792,1.792,0,0,1-1.354.464H3.736v2.023Zm13.31,5.21H2.437l-.006-3.815h13.1Zm.759-9.317H14.758v4.106H13.252V9.925H11.718V8.579h4.575Z" transform="translate(0 0)" fill="%23040504"/></g></g></svg>');
display: inline-block;
position: relative;
top: 0.3125rem;
left:-0.2rem;
margin-right: 0.3125rem;
}
}
h2.HTML{
&:before {
content:'';
width: 17px;
height: 17px;
background-repeat: no-repeat;
background-size: contain;
background-image: url('data:image/svg+xml,<svg id="Group_1310" data-name="Group 1310" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="17.758" height="17.741" viewBox="0 0 17.758 17.741"><defs><clipPath id="clip-path"><rect id="Rectangle_151" data-name="Rectangle 151" width="17.758" height="17.741"/></clipPath></defs><path id="Path_1277" data-name="Path 1277" d="M0,0V17.741H17.757V8.281H15.586v7.3H2.189V2.135H9.3V0Z" transform="translate(0 0)"/><g id="Group_1023" data-name="Group 1023" transform="translate(0 0)"><g id="Group_1022" data-name="Group 1022" clip-path="url(%23clip-path)"><path id="Path_1278" data-name="Path 1278" d="M17.986,11.548,16.363,9.931l7.791-7.756H21.989V.016h5.864V5.867H25.7V3.8l-7.717,7.748" transform="translate(-10.096 -0.01)"/></g></g></svg>');
display: inline-block;
position: relative;
top: 0.3125rem;
left:-0.2rem;
margin-right: 0.3125rem;
}
}
.entry-header {
......
......@@ -2,5 +2,5 @@
Theme Name: MSF CA Child
Author: Tenzing Communications
Template: msf-ca
Version: 1.0.428
Version: 1.0.429
*/
......