Skip to content

Commit

Permalink
Merge branch 'IDI-99' into development
Browse files Browse the repository at this point in the history
Conflicts:
	style.css
  • Loading branch information
acheetham committed Mar 14, 2013
2 parents 532ccad + 26572bb commit 964a6f2
Show file tree
Hide file tree
Showing 27 changed files with 627 additions and 168 deletions.
29 changes: 29 additions & 0 deletions equipment-details.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/*
Template Name: Equipment List Details
*/
?>
<?php get_header(); ?>

<?php if ( is_user_logged_in() ): ?>

<?php if(have_posts()) { the_post(); } ?>
<div class="fl-centered fl-col-mixed fl-site-wrapper idi-equipment">
<div class="fl-col-fixed fl-force-left">
<?php get_sidebar('equipment');?>
<?php get_sidebar('equipment-categories');?>
</div>
<div id="content" class="fl-col-flex idi-3cols idi-equipment-details">
<div class="idi-breadcrumbs">
<a href="<?php echo get_home_url(); ?>/booking/equipment">Back to Equipment</a>
</div>
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
</div>
</div>

<?php else: ?>
<p>You must login to view this content.</p>
<?php endif; ?>

<?php get_footer(); ?>
25 changes: 25 additions & 0 deletions equipment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/*
Template Name: Equipment List
*/
?>
<?php get_header(); ?>

<?php if ( is_user_logged_in() ): ?>

<?php if (have_posts()) { the_post(); } ?>
<div class="idi-equipment fl-centered fl-col-mixed fl-site-wrapper">
<div class="fl-col-fixed fl-force-left">
<?php get_sidebar('equipment');?>
</div>
<div id="content" class="fl-col-flex idi-3cols">
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
</div>
</div>

<?php else: ?>
<p>You must login to view this content.</p>
<?php endif; ?>

<?php get_footer(); ?>
125 changes: 73 additions & 52 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,30 @@
* Add IDI-specific JS files to the header
*/
function add_idi_files() {
$baseurl = get_stylesheet_directory_uri();
// The font fix for Chrome and Firefox on windows
// Lato font is too light to read with chrome on windows, use arial/helvetica instead
$userAgent = strtolower($_SERVER['HTTP_USER_AGENT']);
if (strpos($userAgent, "windows") && (strpos($userAgent, "chrome") || strpos($userAgent, "firefox"))) {
echo '<link rel="stylesheet" type="text/css" media="all" href="'. $baseurl. '/style-windows.css" />'. "\n";
}
echo '<script type="text/javascript" src="' . $baseurl . '/lib/parallax-scrolling.js" ></script>' . "\n";
echo '<script type="text/javascript" src="' . $baseurl . '/idi.js" ></script>' . "\n";
echo '<!--[if lt IE 8]>' . "\n";
echo '<script type="text/javascript" src="' . $baseurl . '/idi-ltie8.js" ></script>' . "\n";
echo '<![endif]-->' . "\n";
$baseurl = get_stylesheet_directory_uri();
// The font fix for Chrome and Firefox on windows
// Lato font is too light to read with chrome on windows, use arial/helvetica instead
$userAgent = strtolower($_SERVER['HTTP_USER_AGENT']);
if (strpos($userAgent, "windows") && (strpos($userAgent, "chrome") || strpos($userAgent, "firefox"))) {
echo '<link rel="stylesheet" type="text/css" media="all" href="'. $baseurl. '/style-windows.css" />'. "\n";
}
echo '<script type="text/javascript" src="' . $baseurl . '/lib/parallax-scrolling.js" ></script>' . "\n";
echo '<script type="text/javascript" src="' . $baseurl . '/idi.js" ></script>' . "\n";
echo '<!--[if lt IE 8]>' . "\n";
echo '<script type="text/javascript" src="' . $baseurl . '/idi-ltie8.js" ></script>' . "\n";
echo '<![endif]-->' . "\n";
}
add_action('wp_head', 'add_idi_files');

/**
* Customize the 'more' link at the end of a post excerpt
*/
function idi_excerpt_more($more) {
global $post;
return '<p><a class="idi-more idi-no-tab-focus" title="'. $post->post_title .'" alt="'. $post->post_title .'" href="'. get_permalink($post->ID) . '">read article</a></p>';
global $post;
return '<p><a class="idi-more idi-no-tab-focus" title="'. $post->post_title .'" alt="'. $post->post_title .'" href="'. get_permalink($post->ID) . '">read article</a></p>';

}
add_filter('excerpt_more', 'idi_excerpt_more');
Expand All @@ -45,18 +45,18 @@ function idi_excerpt_more($more) {
* Brand the login page with IDI-specific styling
*/
function brand_login_page() {
echo '<link rel="stylesheet" type="text/css" media="all" href="'. get_stylesheet_directory_uri() .'/login-page.css" />';
echo '<script type="text/javascript" src="' . get_template_directory_uri() .'/infusion/MyInfusion.js"></script>';
echo '<script type="text/javascript">
function loginalt() {
var logoLink = $("#login a");
logoLink.attr({
href: "' . site_url() . '",
title: "' . get_bloginfo('name') . '"
});
}
window.onload=loginalt;
</script>';
echo '<link rel="stylesheet" type="text/css" media="all" href="'. get_stylesheet_directory_uri() .'/login-page.css" />';
echo '<script type="text/javascript" src="' . get_template_directory_uri() .'/infusion/MyInfusion.js"></script>';
echo '<script type="text/javascript">
function loginalt() {
var logoLink = $("#login a");
logoLink.attr({
href: "' . site_url() . '",
title: "' . get_bloginfo('name') . '"
});
}
window.onload=loginalt;
</script>';
}
add_action('login_head', 'brand_login_page');

Expand All @@ -65,33 +65,33 @@ function loginalt() {
* Determines if the current page or post is a descendent of the given page
*/
function is_tree($pid) { // $pid = The ID of the page we're looking for pages underneath
global $post; // load details about this page
$anc = get_post_ancestors( $post->ID );
foreach($anc as $ancestor) {
if(is_page() && $ancestor == $pid) {
return true;
}
}
if(is_page()&&(is_page($pid)))
global $post; // load details about this page
$anc = get_post_ancestors( $post->ID );
foreach($anc as $ancestor) {
if(is_page() && $ancestor == $pid) {
return true;
}
}
if(is_page()&&(is_page($pid)))
return true; // we're at the page or at a sub page
else
else
return false; // we're elsewhere
};

function idi_generate_top_nav() {
$pages = get_pages( array ('parent' => '0', 'sort_column' => 'menu_order'));
$out = "<ul>";
foreach ( $pages as $pagg ) {
$out .= '<li><a class="idi-nav-' . $pagg->post_name;
if (is_tree($pagg->ID)) {
$out .= ' current_page_item';
}
$out .= '" href="' . get_page_link($pagg->ID) . '">';
$pages = get_pages( array ('parent' => '0', 'sort_column' => 'menu_order'));
$out = "<ul>";
foreach ( $pages as $pagg ) {
$out .= '<li><a class="idi-nav-' . $pagg->post_name;
if (is_tree($pagg->ID)) {
$out .= ' current_page_item';
}
$out .= '" href="' . get_page_link($pagg->ID) . '">';
$out .= $pagg->post_name . '</a></li>';
}
$out .= "</ul>";
}
$out .= "</ul>";

echo $out;
echo $out;
}

/**
Expand All @@ -100,11 +100,32 @@ function idi_generate_top_nav() {
* section.
*/
function remove_parent_contentID() {
echo '<script type="text/javascript">' . "\n";
echo '<script type="text/javascript">' . "\n";
echo '$(document).ready(function () {' . "\n";
echo ' $(".fl-site-main-body[id=\'content\']").removeAttr("id");' . "\n";
echo ' $(".fl-site-main-body[id=\'content\']").removeAttr("id");' . "\n";
echo '});' . "\n";
echo '</script>' . "\n";
echo '</script>' . "\n";
}


/**
* Stay on login panel when login errors occur, instead of redirecting to login screen
*/
add_action( 'wp_login_failed', 'panel_login_fail' ); // hook failed login

function panel_login_fail( $username ) {
$referrer = $_SERVER['HTTP_REFERER'];

// if there's a valid referrer, and it's not the default log-in screen
if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) {
$referrer = explode('?', $referrer);
parse_str($referrer[1], $referrer_args);
unset($referrer_args['idilogout']); //unset old idilogout arg if set
$referrer_args['idilogin'] = "failed"; //let theme know there are errors

wp_redirect( $referrer[0]."?".http_build_query($referrer_args) );
exit;
}
}

?>
Binary file added idi-booking-form.pdf
Binary file not shown.
33 changes: 11 additions & 22 deletions idi.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
var idi = idi || {};

(function ($) {
idi.setUpBookingFaq = function () {
var faqShowHide = $('.idi-booking-faq-show-hide');
faqShowHide.click(function () {
$('.idi-booking-faq').toggleClass("idi-booking-faq-hidden").toggleClass("idi-booking-faq-shown");
faqShowHide.toggleClass("idi-booking-faq-show").toggleClass("idi-booking-faq-hide");
});
};

idi.makeTopNavSticky = function () {
var theWindow = $(window);

Expand Down Expand Up @@ -49,6 +57,7 @@ var idi = idi || {};
loginToggleBtn: ".idi-slidingPanel-toggleButton",
UIOToggleButton: '.flc-slidingPanel-toggleButton',
loginForm: ".idi-login-form",
logoutText: ".idi-logout-text",
mailingList: {
form: ".idi-mailing-list-signup",
loading: ".idi-loading",
Expand All @@ -61,27 +70,6 @@ var idi = idi || {};
}
};

idi.setUpLoginOutPanel = function () {
fluid.slidingPanel(idi.selectors.loginContainer, {
selectors: {
panel: idi.selectors.loginPanel,
toggleButton: idi.selectors.loginToggleBtn
},
strings: {
showText: "Login",
hideText: "Login"
},
listeners: {
onPanelShow: function () {
// close UIO panel if it was open
idi.closeOpenedPanel($(idi.selectors.UIOiFrame), $(idi.selectors.UIOToggleButton));
}
}
});
$(idi.selectors.loginPanel).hide();
$(idi.selectors.loginForm).show();
};

idi.mailingListSignup = function () {
var form = $(idi.selectors.mailingList.form);
var loading = $(idi.selectors.mailingList.loading);
Expand Down Expand Up @@ -128,7 +116,8 @@ var idi = idi || {};
$(document).ready(function () {
idi.setUpLoginOutPanel();
idi.makeTopNavSticky();
idi.keyboardA11y();
idi.setUpBookingFaq();
idi.keyboardA11y();
});

fluid.demands("fluid.slidingPanel", ["fluid.uiOptions", "fluid.uiEnhancer"], {
Expand Down
Binary file added images/arrows/arrow-down-black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/arrows/arrow-down-hover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/arrows/arrow-down-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/arrows/arrow-down-yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/arrows/arrow-down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/arrows/arrow-up-black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/arrows/arrow-up-hover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/arrows/arrow-up-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/arrows/arrow-up-yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/arrows/arrow-up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/bookingsteps/bookingsteps-black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/bookingsteps/bookingsteps-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/bookingsteps/bookingsteps-yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/bookingsteps/bookingsteps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 78 additions & 7 deletions infrastructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@
<?php get_header(); ?>

<div class="fl-centered fl-col-mixed fl-site-wrapper idi-infra">
<div class="fl-container-flex fl-col-flex4">
<div class="fl-col"></div>
<div class="fl-col idi-3cols">
<h1>Equipment and space booking, calendaring, and more coming soon.</h1>
</div>
</div>



<!--
<div class="fl-container-flex fl-col-flex4 idi-infra-row">
Expand All @@ -27,7 +23,82 @@
</div>
</div>
-->

<div class="fl-container-flex fl-col-flex4 idi-infra-row">
<section>
<div class="fl-col">
<h2 class="idi-summary-title idi-booking-title">Book Equipment</h2>
</div>
<div class="fl-col-flex">
<?php if ( is_user_logged_in() ): ?>

<div class="fl-col-flex3">
<div class="fl-col idi-booking-step">
<div class="idi-booking-step-icon idi-booking-step-1"></div>
<h3>Get form:</h3>
<a class="idi-booking-download" href="../wp-content/themes/idi-theme/idi-booking-form.pdf">download <span class="fl-hidden-accessible">the equipment booking form</span></a>
</div>
<div class="fl-col idi-booking-step">
<div class="idi-booking-step-icon idi-booking-step-2"></div>
<h3>Complete</h3>
fill-out fields &amp; sign
</div>
<div class="fl-col idi-booking-step">
<div class="idi-booking-step-icon idi-booking-step-3"></div>
<h3>Return to:</h3>
<a class="idi-booking-email" href="mailto:[email protected]" title="Equipment loan request"><span class="fl-hidden-accessible">return the form to</span> [email protected]</a>
</div>
</div>
<section>
<div class="fl-push idi-booking-summary">
<p>Partner institutions can borrow a range of hardware and software from the Inclusive Design Institute.
To request equipment, download the Equipment Booking form (an editable PDF), fill it out (either by hand or using the computer) and return it to the IDI (by mail, email, fax, or in person).</p>
<h3><a href="#" class="idi-booking-faq-show-hide idi-booking-faq-show">Frequently Asked Questions</a></h3>
<section>
<div class="idi-booking-faq idi-booking-faq-hidden">
<div class="idi-booking-faq-item">
<div class="idi-booking-faq-question"><h4>What can I borrow?</h4></div>
<div class="idi-booking-faq-answer">See the <a href="<?php echo get_home_url(); ?>/booking/equipment">IDI Equipment list</a> for information.</div>
</div>
<div class="idi-booking-faq-item">
<div class="idi-booking-faq-question"><h4>How long can I borrow it for?</h4></div>
<div class="idi-booking-faq-answer">Equipment and software can be borrowed for up to three months.</div>
</div>
<div class="idi-booking-faq-item">
<div class="idi-booking-faq-question"><h4>How far in advance do I have to ask for it?</h4></div>
<div class="idi-booking-faq-answer">We require a minimum of two days notice, to ensure availability. In exceptional circumstances, it is possible that even with two days notice, some items might not be available.</div>
</div>
<div class="idi-booking-faq-item">
<div class="idi-booking-faq-question"><h4>How will I get it?</h4></div>
<div class="idi-booking-faq-answer">Equipment will be shipped via courier, billed to the borrower's account.</div>
</div>
<div class="idi-booking-faq-item">
<div class="idi-booking-faq-question"><h4>Where would I pick it up from?</h4></div>
<div class="idi-booking-faq-answer">If you wish, you can arrange to pick the equipment up in person from 205 Richmond St. W. (2nd floor), Toronto.</div>
</div>
<div class="idi-booking-faq-item">
<div class="idi-booking-faq-question"><h4>How should I return it?</h4></div>
<div class="idi-booking-faq-answer">You must ship the material using the same method it was delivered to you, or you can return it in person. If you will be returning it in person, please contact the IDI to arrange a time.</div>
</div>
<div class="idi-booking-faq-item">
<div class="idi-booking-faq-question"><h4>Can I make a copy of software?</h4></div>
<div class="idi-booking-faq-answer">No. You must agree not to duplicate software, and to uninstall it from your computer once you return the original discs.</div>
</div>
<div class="idi-booking-faq-item">
<div class="idi-booking-faq-question"><h4>How should I uninstall software when I'm finished?</h4></div>
<div class="idi-booking-faq-answer">Some software requires a particular process to uninstall. You will receive instructions with the software.</div>
</div>
</div>
</section>
</div>
</section>
</div>
<?php else: ?>
<p>Partner institutions can borrow a range of hardware and software from the Inclusive Design Institute.</p>
<p>If you belong to a partner institution, please login via the "login" tab at the top of the page to view booking information. If you need an account set up, please <a href="mailto:[email protected]">contact us</a>.</p>
<?php endif; ?>
</section>
</div>

<div class="fl-container-flex fl-col-flex4 idi-infra-row">
<section>
<div class="fl-col">
Expand Down
Loading

0 comments on commit 964a6f2

Please sign in to comment.