Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current Version #11

Merged
merged 6 commits into from
May 4, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Archive Location edits.
  • Loading branch information
ChrisChasm committed Apr 21, 2017
commit e8236c4c383e6f72464820f0f3595fec2bea4a4e
37 changes: 37 additions & 0 deletions archive-locations.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php get_header(); ?>

<div id="content">

<div id="inner-content" class="row">

<!-- Breadcrumb Navigation-->
<nav aria-label="You are here:" role="navigation">
<ul class="breadcrumbs">
<li><a href="/">Dashboard</a></li>
<li>
<span class="show-for-sr">Current: </span> Locations
</li>
</ul>
</nav>

<main id="main" class="large-8 medium-8 columns" role="main">

<?php include ('parts/content-locations-tabs.php') ?>

</main> <!-- end #main -->

<aside class="large-4 medium-4 columns ">

<section class="block">

<p>Links</p>

</section>

</aside> <!-- end #aside -->

</div> <!-- end #inner-content -->

</div> <!-- end #content -->

<?php get_footer(); ?>
2 changes: 1 addition & 1 deletion assets/functions/page-profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function dt_theme_page_profile_content ($content) {


if(is_page(get_option('dt_page_profile'))) {
return 'This is filtered content';
return 'This page will be for the management of your personal profile and setting preferences.';
}

return $content;
Expand Down
198 changes: 198 additions & 0 deletions parts/content-locations-tabs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
<ul class="tabs" data-tabs id="my-contact-tabs">
<li class="tabs-title is-active"><a href="#panel1" aria-selected="true">My Locations</a></li>
<li class="tabs-title"><a href="#panel2">Team Locations</a></li>
<li class="tabs-title"><a href="#panel3">Project Locations</a></li>
<li class="float-right"><a href="javascript:void(0)" onclick="jQuery('.search-tools').toggle();" class="maginifying-glass"><i class="fi-magnifying-glass large" ></i></a></li>
</ul>
<div class="tabs-content" data-tabs-content="my-contact-tabs">
<div class="tabs-panel is-active" id="panel1">

<div id="my-groups">
<div class="row search-tools" style="display:none;">
<div class="medium-6 columns">
<input type="text" class="search" />
</div>
<div class="medium-6 columns">
<button class="sort button small" data-sort="name">Sort by name</button> <button class="sort button small" data-sort="team">Sort by team</button>
</div>

</div>

<ul class="list">

<?php
$args = array(
'post_type' => 'locations',
'nopaging' => true,
);
$query2 = new WP_Query( $args );
?>

<?php p2p_type( 'contacts_to_locations' )->each_connected( $query2 ); // collect all the records for the connected contacts to locations ?>

<?php if ( $query2->have_posts() ) : while ( $query2->have_posts() ) : $query2->the_post(); ?>

<!-- To see additional archive styles, visit the /parts directory -->
<li>

<span class="name">
<a href="<?php the_permalink() ?>" rel="link" title="<?php the_title_attribute(); ?>"><?php the_title(); ?> </a>
</span>

<span class="float-right small grey team">
(active:
<?php
// Display connected pages
$i = 0;
foreach ( $post->connected as $post ) : setup_postdata( $post );
$i++;
endforeach;
echo $i;
wp_reset_postdata(); // set $post back to original post
?>
)
</span>

</li>

<?php endwhile; ?>

<?php else : ?>

<?php echo 'No records'; ?>

<?php endif; ?>

</ul>

<ul class="pagination"></ul>
</div> <!-- End my-contacts -->
</div> <!-- End tab panel -->

<div class="tabs-panel" id="panel2">

<div id="team-groups">
<div class="row search-tools" style="display:none;">
<div class="medium-6 columns">
<input type="text" class="search" />
</div>
<div class="medium-6 columns">
<button class="sort button small" data-sort="name">Sort by name</button> <button class="sort button small" data-sort="team">Sort by team</button>
</div>

</div>

<ul class="list">
<?php
$args = array(
'post_type' => 'locations',
'nopaging' => true,
// 'meta_query' => dt_get_team_contacts(get_current_user_id()),
);
$query2 = new WP_Query( $args );
?>
<?php if ( $query2->have_posts() ) : while ( $query2->have_posts() ) : $query2->the_post(); ?>

<!-- To see additional archive styles, visit the /parts directory -->
<li><span class="name"><a href="<?php the_permalink() ?>" rel="link" title="<?php the_title_attribute(); ?>"><?php the_title(); ?> </a></span> <span class="float-right small grey team">(<?php dt_get_assigned_name(get_the_ID() ); ?>)</span> </li>


<?php endwhile; ?>

<?php else : ?>

<?php echo 'No records'; ?>

<?php endif; ?>
</ul>

<ul class="pagination"></ul>
</div> <!-- End my-contacts -->
</div> <!-- End tab panel -->
<div class="tabs-panel" id="panel3">


<div id="location-groups">
<div class="row search-tools" style="display:none;">
<div class="medium-6 columns">
<input type="text" class="search" />
</div>
<div class="medium-6 columns">
<button class="sort button small" data-sort="name">Sort by name</button> <button class="sort button small" data-sort="team">Sort by team</button>
</div>

</div>

<ul class="list">
<?php
$args = array(
'post_type' => 'locations',
'nopaging' => true,
);
$query2 = new WP_Query( $args );
?>

<?php p2p_type( 'contacts_to_locations' )->each_connected( $query2 ); // collect all the records for the connected contacts to locations ?>

<?php if ( $query2->have_posts() ) : while ( $query2->have_posts() ) : $query2->the_post(); ?>

<!-- To see additional archive styles, visit the /parts directory -->
<li>

<span class="name">
<a href="<?php the_permalink() ?>" rel="link" title="<?php the_title_attribute(); ?>"><?php the_title(); ?> </a>
</span>

<span class="float-right small grey team">
(active:
<?php
// Display connected pages
$i = 0;
foreach ( $post->connected as $post ) : setup_postdata( $post );
$i++;
endforeach;
echo $i;
wp_reset_postdata(); // set $post back to original post
?>
)
</span>

</li>

<?php endwhile; ?>

<?php else : ?>

<?php echo 'No records'; ?>

<?php endif; ?>
</ul>

<ul class="pagination"></ul>

</div> <!-- End my-contacts -->


</div>
</div> <!-- End tab panel -->
<script type="text/javascript">
jQuery(document).ready(function() {
var myContacts = new List('my-groups', {
valueNames: ['name', 'team'],
page: 10,
pagination: true
});

var teamContacts = new List('team-groups', {
valueNames: ['name', 'team'],
page: 10,
pagination: true
});

var locationContacts = new List('location-groups', {
valueNames: ['name'],
page: 10,
pagination: true
});
});
</script>