Permalink
Browse files

Merge branch 'master' of https://github.com/n0ur/hackits

  • Loading branch information...
2 parents fe79f63 + 75de6bd commit 35210c8f4b3e29565df745525e9c5a6a5f70f02c @koopa committed Jan 28, 2013
Showing 361 changed files with 15,112 additions and 474 deletions.
View
@@ -21,7 +21,7 @@
///////////////////////////////////////////////////////////////////////////////////
?>
-<div id="course">
+<ul class="unstyled tree span3">
<?
$category = isset($_GET['category']) ? $_GET['category'] : null;
$course = isset($_GET['course']) ? $_GET['course'] : null;
@@ -30,56 +30,46 @@
$mincourseid = 0;
$maxcourseid = 100000;
- $selectCourse = "<p class=\"center\"><img alt=\"Y U NO GIVE ID\" src=\"images/yuno.png\" /><br /><br />No active course, select a valid course from the navigation on the left!
- </p>";
-
-
- echo '<div id="coursenavigation">
- <ol class="tree">';
+ $selectCourse = "<p class=\"center\"><img alt=\"Y U NO GIVE ID\" src=\"images/yuno.png\" /><br /><br />No active course, select a valid course from the navigation on the left!</p>";
foreach($categories as $id => $name){
- echo '<li><a href="/course/'.urlencode($name).'"><label for="'.urlencode($name).'">
- '.$name.'</label></a>
- <input type="checkbox" id="'.urlencode($name).'" />';
if(count($tree[$id]) > 0){
- echo '<ol>';
+ echo '<li class="level0"><i class="icon-folder-open"></i>';
+ } else {
+ echo '<li class="level0"><i class="icon-folder-close"></i>';
}
- foreach($tree[$id] as $course){
- echo '<li><a href="/course/'.urlencode($name)
- .'/'.urlencode($course['title']).'"><label for="'.urlencode($course['title']).'">
- '.$course['title'].'</label></a>
- <input type="checkbox" id="'.urlencode($course['title']).'" />
- <ol>';
- $filename = "courses/course".$course['id'].".php";
- if(is_readable($filename)){
- $courseData = include($filename);
- }
- if($courseData['nav']) foreach($courseData['nav'] as $chapterType => $chapters){
- if($chapters) foreach($chapters as $contentId => $chapterName){
- //$chapterType class to style icons
- echo '<li class="file '.$chapterType.'"><a
- data-contentid="'.$contentId.'"
- data-chapterid="'.$chapterName.'_'.$course['id'].'"
- href="/course/'.urlencode($name)
- .'/'.urlencode($course['title'])
- .'/'.urlencode($chapterName).'">'.$chapterName.'
- </a>
- <script type="text/html" id="'.$chapterName.'_'.$course['id'].'">
- '.$courseData['content'][$chapterType][$contentId].'
- </script>
- </li>';
+ echo '<a class="title" href="#/course/'.renameTitle($name).'">'. urlencode($name) .'</a>';
+ if(count($tree[$id]) > 0){
+ echo '<ul class="unstyled">';
+ foreach($tree[$id] as $course){
+ echo '<li class="level1"><i class="icon-folder-open"></i><a class="title" href="#/course/'.renameTitle($name).'/'.renameTitle($course['title']).'">'.$course['title'].'</a>';
+ echo '<ul class="unstyled">';
+
+ $filename = "courses/course".$course['id'].".php";
+ if(is_readable($filename)){
+ $courseData = include($filename);
}
+ if($courseData['nav']) foreach($courseData['nav'] as $chapterType => $chapters){
+ if($chapters) foreach($chapters as $contentId => $chapterName){
+ echo '<li>';
+ switch($chapterType) {
+ case 'default':
+ echo '<i class="icon-file"></i>'; break;
+ case 'exercises':
+ echo '<i class="icon-tasks"></i>'; break;
+ case 'exam':
+ echo '<i class="icon-certificate"></i>'; break;
+ }
+ echo '<a href="#/course/'.renameTitle($name).'/'. renameTitle($course['title']).'/'.renameTitle($chapterName).'">'.$chapterName.'</a></li>';
+ // course content: $courseData['content'][$chapterType][$contentId];
+ }
+ }
+ echo '</ul></li>';
}
- echo '</ol></li>';
- }
- if(count($tree[$id]) > 0){
- echo '</ol>';
+ echo '</ul></li>';
}
- echo '</li>';
}
- echo '</ol><!-- end ol class tree -->
- </div><!-- end div id="coursenavigation" -->';
-
?>
- <div id="coursecontent"><?php echo $selectCourse; ?></div>
-</div>
+</ul><!-- end ul class tree -->
+
+<div class="span8 courseContent"><?php echo $selectCourse; ?></div>
View
@@ -28,22 +28,22 @@
?>
<script type="text/javascript">
// when the examn form is submitted, show the results in a dialog window
- $(document).ready(function(){
- $("#examnform").submit( function () {
- $.post(
- 'examnhandler.php?id=<? echo $courseid; ?>',
- $(this).serialize(),
- function(data){
- $("#examnresult").empty().append(data).dialog("open");
- }
- );
- return false;
- });
- });
- $("#examnresult").dialog({ autoOpen: false, minWidth: 500 });
+ // $(document).ready(function(){
+ // $("#examnform").submit( function () {
+ // $.post(
+ // 'examnhandler.php?id=<? echo $courseid; ?>',
+ // $(this).serialize(),
+ // function(data){
+ // $("#examnresult").empty().append(data).dialog("open");
+ // }
+ // );
+ // return false;
+ // });
+ // });
+ // $("#examnresult").dialog({ autoOpen: false, minWidth: 500 });
- // start with only the default div shown
- $("#default").show().siblings().hide();
+ // // start with only the default div shown
+ // $("#default").show().siblings().hide();
</script>
View
@@ -19,6 +19,6 @@
// //
///////////////////////////////////////////////////////////////////////////////////
?>
-<h1>Help!</h1>
+<h3>Help!</h3>
<p>For a general introduction to this Courses system, please check out the 'Intro to Hackits Courses' course in the General category. Click on the tab 'Course Overview' to head over there.</p>
<p>If you have specific questions about a course or have found a bug, let us know on the <a href="../forum/index.php?topic=13.0">forum</a>.</p>
View
@@ -28,147 +28,125 @@
?><!DOCTYPE html>
<html lang="en">
<head>
- <meta charset="utf-8">
- <title>Hackits.be - Courses</title>
- <link rel="stylesheet" href="css/jquery-ui-1.8.17.custom.css">
- <link rel="stylesheet" href="css/hackits-courses.css">
- <script src="js/jquery-1.8.2.js"></script>
- <script src="js/jquery.ui.core.js"></script>
- <script src="js/jquery.ui.widget.js"></script>
- <script src="js/jquery.ui.button.js"></script>
- <script src="js/jquery.ui.position.js"></script>
- <script src="js/jquery.ui.tabs.js"></script>
- <script src="js/jquery.ui.dialog.js"></script>
- <script src="js/jquery.ui.accordion.js"></script>
- <script src="js/jquery.address.js"></script>
-<!-- <script src="js/jquery.history.js"></script>-->
- <script>
- $(function() {
+ <meta charset="utf-8">
+ <meta name="description" content="Hackits.be" />
+ <title>Hackits.be - Courses</title>
+ <!-- <link rel="stylesheet" href="../frontpage/css/bootstrap.min.css"> -->
+ <link rel="stylesheet" href="../frontpage/css/bootstrap.css">
+ <link rel="stylesheet" href="../frontpage/css/custom.css">
+ <link rel="stylesheet" href="../frontpage/css/bootstrap-responsive.css">
+ <script src="../frontpage/js/jquery-1.8.1.min.js"></script>
+ <script src="../frontpage/js/bootstrap.min.js"></script>
+ <script src="js/jquery.address.js"></script>
+ <script src="js/jquery.scrollTo-1.4.3.1-min.js"></script>
+ <script>
+ $(function() {
var tabStates = { //default states
- overview: '/overview/General',
- course: '/course/General/Intro+to+Hackits+Courses/Hackits+Courses',
+ overview: '/overview',
+ course: '/course',
ranking: '/ranking',
help: '/help'
},
- selectPart = function(part){
- var part = $("#"+part);
- part.show().siblings().hide();
- },
- getPanelIndex = function(str){
- return $('.ui-accordion-header a').filter(function(){
- return (new RegExp(str)).test($(this).text())
- }).parent().index() / 2;
- },
updateState = function(e){
var parts = e.path.split('/')
- , tab = parts[1]
+ , tab = tabStates.hasOwnProperty(parts[1]) ? parts[1] : 'overview'
, category = parts[2] || ''
, course = parts[3] || ''
, chapter = parts[4] || '';
if(tab.length){ //select tab
- $("#tabs").tabs("select", '#'+tab.replace(/^#/,''));
+ $('.tab-pane.active').removeClass('active').addClass('fade');
+ $('#coursesTabs li.active').removeClass('active');
+ $('#'+tab).addClass('active in');
+ $('#coursesTabs li a[href=#'+tab+']').parent().addClass('active');
}
if(category.length){ //select accordion panel
- $("#courses").accordion("activate", getPanelIndex(category));
- $('a[href$="/course/'+category+'"]').siblings('input').attr('checked', true);
+ var h4Cat = $('h4#'+category),
+ aCat = $('a[href="#/course/'+category+'"]');
+ if(h4Cat.length) { // we dont want this to get executed when we're in #/courses/etc
+ $.scrollTo(h4Cat);
+ $.scrollTo('-=20px');
+ }
+ if (aCat.length) {
+ aCat.next('ul').show();
+ }
}
if(course.length){ //select course
- $('a[href$="/course/'+category+'/'+course+'"]').siblings('input').attr('checked', true);
+ var aCourse = $('a[href="#/course/'+category+'/'+course+'"]');
+ if(aCourse.length) {
+ console.log("here")
+ aCourse.next('ul').show();
+ }
}
if(chapter.length){ //select chapter
- $('#coursenavigation li.file a').each(function(){
- $(this).closest('li').toggleClass('selected',
- (new RegExp(e.path.replace(/\+/g, '\\+')+'$', 'i'))
- .test($(this).attr('href')));
- });
- $('#coursecontent').html(
- $('[id="'
- + $('a[href$="/course/'+category+'/'+course+'/'+chapter+'"]:not([rel=overview])').data('chapterid')
- + '"]').html());
+ //TODO: what's another way to load courses?
}
};
-
- $("#tabs").tabs({
- select: function(event, ui){
- var oldSelected = $('#tabs .ui-tabs-selected a').attr('href').replace(/^#/, '')
- , newSelected = ui.tab.hash.replace(/^#/, '');
- if((new RegExp('^/'+newSelected, 'i')).test($.address.path())){ return; }
- tabStates[oldSelected] = $.address.path();
- $.address.path(tabStates[newSelected]);
- }
+ $('ul#coursesTabs li a').click(function(e){
+ var index = $(this).attr('href').replace(/^#/, '');
+ $.address.path(tabStates[index]);
});
- $("#courses").accordion({
- autoHeight: false,
- animated: false
- });
-
+ $('a.title').next('ul').hide();
$.address.init(function(e){
if($.address.path() === '/'){
$.address.path(tabStates.overview); //default to overview
}
- $('#coursenavigation .file a[data-chapterid]').address(function() {
- return $(this).attr('href');
- });
- tabStates[$.address.path().match(/^\/([^\/]+)/)[0].substr(1)] = $.address.path();
+ // what do these do?
+ // $('#coursenavigation .file a[data-chapterid]').address(function() {
+ // return $(this).attr('href');
+ // });
+ // tabStates[$.address.path().match(/^\/([^\/]+)/)[0].substr(1)] = $.address.path();
}).change(updateState)
.internalChange({}, updateState)
.externalChange({}, updateState);
});
- </script>
+ </script>
</head>
+
<body>
-<div id="container">
-<div id="center">
+ <?php include("../frontpage/shared/_header.php"); ?>
- <div id="topbar">
- <div id="memb_time">
- <span><? echo $showdate ?></span>
- </div>
- <div id="user_area">
- <p>[ <a href="https://www.hackits.be/forum">Back to the Hackits.be Forum</a> ] [ Logged in as: <b><? echo $usernametext; ?></b> ] [ All content is licensed under <a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/3.0/">CC BY-NC-SA 3.0</a> ]</p>
- </div>
- </div>
- <div id="header">
- <div id="logo">
- <a href="https://www.hackits.be/index.php"><img src="../forum/Themes/insidiousII2/images/theme/logo.png" alt="Hackits.be" title="Hackits.be" /></a>
- </div>
- </div>
+ <div class="container wrapper">
+ <p class="pbody date"><? echo date('F d, o, h:i:s A'); ?></p>
+ <div class="logo"><img src="../frontpage/img/hackits_logo.png" alt="Hackits.be" title="Hackits.be" /></div>
-<div id="tabs">
+ <div class="row">
+ <div class="span12">
- <ul>
- <li class="tab"><a rel="address:/overview" href="#overview">Course Overview</a></li>
- <li class="tab"><a rel="address:/course" href="#course">Current Course</a></li>
- <li class="tab"><a rel="address:/ranking" href="#ranking">Ranking List</a></li>
- <li class="tab"><a rel="address:/help" href="#help">Help</a></li>
- </ul>
+ <div class="tabbable">
+ <ul id="coursesTabs" class="nav nav-tabs">
+ <li class="active"><a href="#overview" data-toggle="tab">Course Overview</a></li>
+ <li class=""><a href="#course" data-toggle="tab">Current Course</a></li>
+ <li class=""><a href="#ranking" data-toggle="tab">Ranking List</a></li>
+ <li class=""><a href="#help" data-toggle="tab">Help</a></li>
+ </ul>
- <div id="overview">
- <? include("overview.php"); ?>
- </div>
+ <div id="tabContent" class="tab-content">
+ <div class="tab-pane fade active in" id="overview">
+ <? include("overview.php"); ?>
+ </div>
- <div id="course">
- <?
- require_once("courseheader.php");
- include("course.php");
- ?>
- </div>
+ <div class="tab-pane fade" id="course">
+ <?
+ require_once("courseheader.php");
+ include("course.php");
+ ?>
+ </div>
- <div id="ranking">
- <? include("ranking.php"); ?>
- </div>
+ <div class="tab-pane fade" id="ranking">
+ <? include("ranking.php"); ?>
+ </div>
- <div id="help">
- <? include("help.php"); ?>
- </div>
+ <div class="tab-pane fade" id="help">
+ <? include("help.php"); ?>
+ </div>
+ </div>
+ </div>
-</div> <!-- end-of-tabs -->
-</div> <!-- end-of-center -->
-</div> <!-- end-of-container -->
-<script>
- <? echo isset($loadcourse) ? $loadcourse : ''; ?>
-</script>
+ </div>
+ </div>
+ <?php include("../frontpage/shared/_footer.html"); ?>
+ </div>
<?php Utils::queryLog(); ?>
</body>
-</html>
+</html>

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 35210c8

Please sign in to comment.