mk200789 10 年之前
父節點
當前提交
626e2aebc8

+ 35 - 0
angular/addons/footer.html

@@ -0,0 +1,35 @@
+<!-- Main jumbotron for a primary marketing message or call to action -->
+<div class="jumbotron">
+  <div class="container">
+    <h1>Hello, world!</h1>
+    <p>This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
+    <p><a class="btn btn-primary btn-lg">Learn more &raquo;</a></p>
+  </div>
+</div>
+
+<div class="container">
+  <!-- Example row of columns -->
+  <div class="row">
+    <div class="col-lg-4">
+      <h2>Heading</h2>
+      <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
+      <p><a class="btn btn-default" href="#">View details &raquo;</a></p>
+    </div>
+    <div class="col-lg-4">
+      <h2>Heading</h2>
+      <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
+      <p><a class="btn btn-default" href="#">View details &raquo;</a></p>
+   </div>
+    <div class="col-lg-4">
+      <h2>Heading</h2>
+      <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
+      <p><a class="btn btn-default" href="#">View details &raquo;</a></p>
+    </div>
+  </div>
+
+  <hr>
+
+  <footer>
+    <p>&copy; Company 2013</p>
+  </footer>
+</div> <!-- /container -->

+ 18 - 0
angular/addons/nav.html

@@ -0,0 +1,18 @@
+<nav>
+    <ul class="list-unstyled main-menu">
+      <li><a href="#/snippets">Snippets <span class="icon"></span></a></li>
+      <li><a href="#/steamSales">Steam Sales <span class="icon"></span></a></li>
+      <li><a href="#/githubUser">Github User <span class="icon"></span></a></li>
+      <li><a href="#/githubTopContributions">Github Resume <span class="icon"></span></a></li>
+      <li><a href="#">Dropdown</a>
+        <ul class="list-unstyled">
+            <li class="sub-nav"><a href="#">Sub Menu One <span class="icon"></span></a></li>
+            <li class="sub-nav"><a href="#">Sub Menu Two <span class="icon"></span></a></li>
+            <li class="sub-nav"><a href="#">Sub Menu Three <span class="icon"></span></a></li>
+            <li class="sub-nav"><a href="#">Sub Menu Four <span class="icon"></span></a></li>
+            <li class="sub-nav"><a href="#">Sub Menu Five <span class="icon"></span></a></li>
+        </ul>
+      </li>
+    </ul>
+</nav>
+

+ 176 - 0
angular/css/main.css

@@ -0,0 +1,176 @@
+
+
+/* ==========================================================================
+   Author's custom styles
+   ========================================================================== */
+
+a.nav-expander {
+  background: none repeat scroll 0 0 #000000;
+  color: #FFFFFF;
+  display: block;
+  font-size: 15px;
+  font-weight: 400;
+  height: 50px;
+  margin-right: 0;
+  padding: 1em 1.6em 2em;
+  position: absolute;
+  right: 0;
+  text-decoration: none;
+  text-transform: uppercase;
+  top: 0;
+  transition: right 0.3s ease-in-out 0s;
+  width: 130px;
+  z-index: 12;
+
+  transition: right 0.3s ease-in-out 0s;
+  -webkit-transition: right 0.3s ease-in-out 0s;
+  -moz-transition: right 0.3s ease-in-out 0s;
+  -o-transition: right 0.3s ease-in-out 0s;
+
+}
+
+a.nav-expander:hover {
+  cursor: pointer;
+}
+
+a.nav-expander.fixed {
+  position: fixed;
+}
+
+.nav-expanded a.nav-expander.fixed {
+    right: 20em;
+}
+
+nav {
+  background: #2d2f33;
+  display: block;
+  height: 100%;
+  overflow: auto;
+  position: fixed;
+  right: -20em;
+  font-size: 15px;
+  top: 0;
+  width: 20em;
+  z-index: 2000;
+  
+  transition: right 0.3s ease-in-out 0s;
+  -webkit-transition: right 0.3s ease-in-out 0s;
+  -moz-transition: right 0.3s ease-in-out 0s;
+  -o-transition: right 0.3s ease-in-out 0s;
+
+}
+.nav-expanded nav {
+  right: 0;
+}
+
+body.nav-expanded {
+  margin-left: 0em;
+  transition: right 0.4s ease-in-out 0s;
+  -webkit-transition: right 0.4s ease-in-out 0s;
+  -moz-transition: right 0.4s ease-in-out 0s;
+  -o-transition: right 0.4s ease-in-out 0s;
+}
+
+#nav-close {
+  font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
+  font-weight: 300;
+  font-size: 24px;
+  padding-right: 10px;
+}
+
+.main-menu {
+  padding-top: 12px;
+}
+
+.main-menu li {
+  border-bottom: 1px solid #323949;
+  margin-left: 20px;
+  font-size: 18px;
+  padding: 12px;
+}
+
+.main-menu li a {
+  color: #6F7D8C;
+  text-decoration: none;
+}
+
+.main-menu li a:hover {
+  color: #FFFFFF;
+  text-decoration: none;
+}
+
+.main-menu li .sub-nav {
+  border-bottom: 0px;
+  padding: 4px;
+}
+
+.main-menu a .caret {
+	width: 0;
+	height: 0;
+	display: inline-block;
+	vertical-align: top;
+	border-top: 4px solid #4f5963;
+	border-right: 4px solid transparent;
+	border-left: 4px solid transparent;
+	content: "";
+    margin-top: 8px;
+}
+
+.main-menu a:hover .caret {
+	border-top-color: #4f5963;
+}
+
+.main-menu li.open > a > .caret {
+	border-top: none;
+	border-bottom: 4px solid #4f5963;
+	border-right: 4px solid transparent;
+	border-left: 4px solid transparent;
+}
+
+.main-menu li.open > a:hover > .caret {
+	border-bottom-color: #4f5963;
+}
+
+.icon:before {
+  font-family: 'FontAwesome';
+  font-style: normal;
+  font-variant: normal;
+  font-weight: normal;
+  line-height: 1;
+  text-transform: none;
+  content: '\f105';
+}
+
+.main-menu li > a > span.icon {
+  float: right;
+  margin: 0.1em 1.7em -0.1em 0;
+  opacity: 0;
+  -webkit-transition: all 0.2s ease-in-out;
+  -moz-transition: all 0.2s ease-in-out;
+  -o-transition: all 0.2s ease-in-out;
+  transition: all 0.2s ease-in-out;
+
+}
+
+.main-menu li > a:hover > span.icon {
+  float: right;
+  margin: 0.1em 0.8em -0.1em 0;
+  opacity: 1;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 54 - 0
angular/index.html

@@ -12,12 +12,53 @@
         <!-- Bootstrap Core CSS -->
         <link href="vendor/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
 
+        <!-- Styles -->
+        <link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css">
+        <link rel="stylesheet" href="css/main.css">
+
         <!-- jQuery -->
         <script src="vendor/jquery/dist/jquery.min.js"></script>
 
         <!-- Bootstrap Core JavaScript -->
         <script src="vendor/bootstrap/dist/js/bootstrap.min.js"></script>
 
+        <!-- Front-end JavaScript -->
+        <script src="jquery.navgoco.js"></script>
+        <script>
+        $(document).ready(function(){                       
+           
+           //Navigation Menu Slider
+            $('#nav-expander').on('click',function(e){
+              e.preventDefault();
+              $('body').toggleClass('nav-expanded');
+            });
+            $('#nav-close').on('click',function(e){
+              e.preventDefault();
+              $('body').removeClass('nav-expanded');
+            });
+            
+            
+            // Initialize navgoco with default options
+            $(".main-menu").navgoco({
+                caret: '<span class="caret"></span>',
+                accordion: false,
+                openClass: 'open',
+                save: true,
+                cookie: {
+                    name: 'navgoco',
+                    expires: false,
+                    path: '/'
+                },
+                slide: {
+                    duration: 300,
+                    easing: 'swing'
+                }
+            });
+      
+              
+          });
+          </script>
+
         <!-- Main application file -->
         <script src="scripts/app.js"></script>
 
@@ -40,5 +81,18 @@
 
     <body>
         <div data-ui-view></div>
+
+        <div ng-include="'addons/nav.html'"></div>
+        
+        <div class="navbar navbar-inverse navbar-fixed-top">      
+            <!--Include your brand here-->
+            <a class="navbar-brand" href="#">Django-AngularJS</a>
+            <div class="navbar-header pull-right">
+              <a id="nav-expander" class="nav-expander fixed">
+                Apps &nbsp;<i class="fa fa-bars fa-lg white"></i>
+              </a>
+            </div>
+        </div>
+        
     </body>
 </html>

+ 301 - 0
angular/js/jquery.navgoco.js

@@ -0,0 +1,301 @@
+/*
+ * jQuery Navgoco Menus Plugin v0.1.5 (2013-09-07)
+ * https://github.com/tefra/navgoco
+ *
+ * Copyright (c) 2013 Chris T (@tefra)
+ * BSD - https://github.com/tefra/navgoco/blob/master/LICENSE-BSD
+ */
+(function($) {
+
+	"use strict";
+
+	/**
+	 * Plugin Constructor. Every menu must have a unique id which will either
+	 * be the actual id attribute or its index in the page.
+	 *
+	 * @param {Element} el
+	 * @param {Object} options
+	 * @param {Integer} idx
+	 * @returns {Object} Plugin Instance
+	 */
+	var Plugin = function(el, options, idx) {
+		this.el = el;
+		this.$el = $(el);
+		this.options = options;
+		this.uuid = this.$el.attr('id') ? this.$el.attr('id') : idx;
+		this.state = {};
+		this.init();
+		return this;
+	};
+
+	/**
+	 * Plugin methods
+	 */
+	Plugin.prototype = {
+		/**
+		 * Load cookie, assign a unique data-index attribute to
+		 * all sub-menus and show|hide them according to cookie
+		 * or based on the parent open class. Find all parent li > a
+		 * links add the carent if it's on and attach the event click
+		 * to them.
+		 */
+		init: function() {
+			var self = this;
+			self._load();
+			self.$el.find('ul').each(function(idx) {
+				var sub = $(this);
+				sub.attr('data-index', idx);
+				if (self.options.save && self.state.hasOwnProperty(idx)) {
+					sub.parent().addClass(self.options.openClass);
+					sub.show();
+				} else if (sub.parent().hasClass(self.options.openClass)) {
+					sub.show();
+					self.state[idx] = 1;
+				} else {
+					sub.hide();
+				}
+			});
+
+			if (self.options.caret) {
+				self.$el.find("li:has(ul) > a").append(self.options.caret);
+			}
+
+			var links = self.$el.find("li > a");
+			links.on('click', function(event) {
+				event.stopPropagation();
+				var sub = $(this).next();
+				sub = sub.length > 0 ? sub : false;
+				self.options.onClickBefore.call(this, event, sub);
+				if (sub) {
+					event.preventDefault();
+					self._toggle(sub, sub.is(":hidden"));
+					self._save();
+				} else {
+					if (self.options.accordion) {
+						var allowed = self.state = self._parents($(this));
+						self.$el.find('ul').filter(':visible').each(function() {
+							var sub = $(this),
+								idx = sub.attr('data-index');
+
+							if (!allowed.hasOwnProperty(idx)) {
+								self._toggle(sub, false);
+							}
+						});
+						self._save();
+					}
+				}
+				self.options.onClickAfter.call(this, event, sub);
+			});
+		},
+		/**
+		 * Accepts a JQuery Element and a boolean flag. If flag is false it removes the `open` css
+		 * class from the parent li and slides up the sub-menu. If flag is open it adds the `open`
+		 * css class to the parent li and slides down the menu. If accordion mode is on all
+		 * sub-menus except the direct parent tree will close. Internally an object with the menus
+		 * states is maintained for later save duty.
+		 *
+		 * @param {Element} sub
+		 * @param {Boolean} open
+		 */
+		_toggle: function(sub, open) {
+			var self = this,
+				idx = sub.attr('data-index'),
+				parent = sub.parent();
+
+			self.options.onToggleBefore.call(this, sub, open);
+			if (open) {
+				parent.addClass(self.options.openClass);
+				sub.slideDown(self.options.slide);
+				self.state[idx] = 1;
+
+				if (self.options.accordion) {
+					var allowed = self.state = self._parents(sub);
+					allowed[idx] = self.state[idx] = 1;
+
+					self.$el.find('ul').filter(':visible').each(function() {
+						var sub = $(this),
+							idx = sub.attr('data-index');
+
+						if (!allowed.hasOwnProperty(idx)) {
+							self._toggle(sub, false);
+						}
+					});
+				}
+			} else {
+				parent.removeClass(self.options.openClass);
+				sub.slideUp(self.options.slide);
+				self.state[idx] = 0;
+			}
+			self.options.onToggleAfter.call(this, sub, open);
+		},
+		/**
+		 * Returns all parents of a sub-menu. When obj is true It returns an object with indexes for
+		 * keys and the elements as values, if obj is false the object is filled with the value `1`.
+		 *
+		 * @since v0.1.2
+		 * @param {Element} sub
+		 * @param {Boolean} obj
+		 * @returns {Object}
+		 */
+		_parents: function(sub, obj) {
+			var result = {},
+				parent = sub.parent(),
+				parents = parent.parents('ul');
+
+			parents.each(function() {
+				var par = $(this),
+					idx = par.attr('data-index');
+
+				if (!idx) {
+					return false;
+				}
+				result[idx] = obj ? par : 1;
+			});
+			return result;
+		},
+		/**
+		 * If `save` option is on the internal object that keeps track of the sub-menus states is
+		 * saved with a cookie. For size reasons only the open sub-menus indexes are stored.		 *
+		 */
+		_save: function() {
+			if (this.options.save) {
+				var save = {};
+				for (var key in this.state) {
+					if (this.state[key] === 1) {
+						save[key] = 1;
+					}
+				}
+				cookie[this.uuid] = this.state = save;
+				$.cookie(this.options.cookie.name, JSON.stringify(cookie), this.options.cookie);
+			}
+		},
+		/**
+		 * If `save` option is on it reads the cookie data. The cookie contains data for all
+		 * navgoco menus so the read happens only once and stored in the global `cookie` var.
+		 */
+		_load: function() {
+			if (this.options.save) {
+				if (cookie === null) {
+					var data = $.cookie(this.options.cookie.name);
+					cookie = (data) ? JSON.parse(data) : {};
+				}
+				this.state = cookie.hasOwnProperty(this.uuid) ? cookie[this.uuid] : {};
+			}
+		},
+		/**
+		 * Public method toggle to manually show|hide sub-menus. If no indexes are provided all
+		 * items will be toggled. You can pass sub-menus indexes as regular params. eg:
+		 * navgoco('toggle', true, 1, 2, 3, 4, 5);
+		 *
+		 * Since v0.1.2 it will also open parents when providing sub-menu indexes.
+		 *
+		 * @param {Boolean} open
+		 */
+		toggle: function(open) {
+			var self = this,
+				length = arguments.length;
+
+			if (length <= 1) {
+				self.$el.find('ul').each(function() {
+					var sub = $(this);
+					self._toggle(sub, open);
+				});
+			} else {
+				var idx,
+					list = {},
+					args = Array.prototype.slice.call(arguments, 1);
+				length--;
+
+				for (var i = 0; i < length; i++) {
+					idx = args[i];
+					var sub = self.$el.find('ul[data-index="' + idx + '"]').first();
+					if (sub) {
+						list[idx] = sub;
+						if (open) {
+							var parents = self._parents(sub, true);
+							for (var pIdx in parents) {
+								if (!list.hasOwnProperty(pIdx)) {
+									list[pIdx] = parents[pIdx];
+								}
+							}
+						}
+					}
+				}
+
+				for (idx in list) {
+					self._toggle(list[idx], open);
+				}
+			}
+			self._save();
+		},
+		/**
+		 * Removes instance from JQuery data cache and unbinds events.
+		 */
+		destroy: function() {
+			$.removeData(this.$el);
+			this.$el.find("li:has(ul) > a").unbind('click');
+		}
+	};
+
+	/**
+	 * A JQuery plugin wrapper for navgoco. It prevents from multiple instances and also handles
+	 * public methods calls. If we attempt to call a public method on an element that doesn't have
+	 * a navgoco instance, one will be created for it with the default options.
+	 *
+	 * @param {Object|String} options
+	 */
+	$.fn.navgoco = function(options) {
+		if (typeof options === 'string' && options.charAt(0) !== '_' && options !== 'init') {
+			var callback = true,
+				args = Array.prototype.slice.call(arguments, 1);
+		} else {
+			options = $.extend({}, $.fn.navgoco.defaults, options || {});
+			if (!$.cookie) {
+				options.save = false;
+			}
+		}
+		return this.each(function(idx) {
+			var $this = $(this),
+				obj = $this.data('navgoco');
+
+			if (!obj) {
+				obj = new Plugin(this, callback ? $.fn.navgoco.defaults : options, idx);
+				$this.data('navgoco', obj);
+			}
+			if (callback) {
+				obj[options].apply(obj, args);
+			}
+		});
+	};
+	/**
+	 * Global var holding all navgoco menus open states
+	 *
+	 * @type {Object}
+	 */
+	var cookie = null;
+
+	/**
+	 * Default navgoco options
+	 *
+	 * @type {Object}
+	 */
+	$.fn.navgoco.defaults = {
+		caret: '<span class="caret"></span>',
+		accordion: false,
+		openClass: 'open',
+		save: true,
+		cookie: {
+			name: 'navgoco',
+			expires: false,
+			path: '/'
+		},
+		slide: {
+			duration: 400,
+			easing: 'swing'
+		},
+		onClickBefore: $.noop,
+		onClickAfter: $.noop,
+		onToggleBefore: $.noop,
+		onToggleAfter: $.noop
+	};
+})(jQuery);

+ 26 - 21
angular/partials/githubTopContributions.partial.html

@@ -1,24 +1,29 @@
-<div class="row text-center">
-	<h1> Github Top Contributed Repositories</h1>
-</div>
+<div class="jumbotron">
+  <div class="container">
 
-<div class="col-lg-12">
-    <div class="table-responsive">
-        <table class="table table-bordered table-hover table-striped tablesorter">
-            <thead>
-                <tr>
-                    <th class="header">Repository Name</th>
-                    <th class="header">Total Commits</th>
-                    <th class="header">Author</th>
-                </tr>
-            </thead>
-            <tbody>
-                <tr data-ng-repeat="data in githubTopContributions.data.committed">
-                        <td>{{ data.repo_name }}</td>
-                        <td>{{ data.total }}</td>
-                        <td>{{ data.author }}</td>
-                </tr>
-            </tbody>
-        </table>
+    <div class="row text-center">
+    	<h1> Github Top Contributed Repositories</h1>
     </div>
+
+    <div class="col-lg-12">
+        <div class="table-responsive">
+            <table class="table table-bordered table-hover table-striped tablesorter">
+                <thead>
+                    <tr>
+                        <th class="header">Repository Name</th>
+                        <th class="header">Total Commits</th>
+                        <th class="header">Author</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    <tr data-ng-repeat="data in githubTopContributions.data.committed">
+                            <td>{{ data.repo_name }}</td>
+                            <td>{{ data.total }}</td>
+                            <td>{{ data.author }}</td>
+                    </tr>
+                </tbody>
+            </table>
+        </div>
+    </div>
+  </div>
 </div>

+ 34 - 28
angular/partials/githubUser.partial.html

@@ -1,33 +1,39 @@
-<div class="row text-center"> <h1> Github User Data </h1>
-</div>
+<div class="jumbotron">
+  <div class="container">
+
+    <div class="row text-center"> 
+        <h1> Github User Data </h1>
+    </div>
 
-<div class="col-lg-12">
-    <div class="table-responsive">
-        <table class="table table-bordered table-hover table-striped tablesorter">
-            <thead>
-                <tr>
-                    <th class="header">Public Repos</th>
-                    <th class="header">Public Gists</th>
-                    <th class="header">Name</th>
-                    <th class="header">Blog</th>
-                    <th class="header">Followers</th>
-                    <th class="header">Following</th>
-                    <th class="header">E-mail</th>
-                </tr>
-            </thead>
-            <tbody>
-                <tr data-ng-repeat="data in githubUser.data.userData">
-                        <td>{{ data.public_repos }}</td>
-                        <td>{{ data.public_gists }}</td>
-                        <td>{{ data.name }}</td>
-                        <td>{{ data.blog }}</td>
-                        <td>{{ data.followers }}</td>
-                        <td>{{ data.following }}</td>
-                        <td>{{ data.email }}</td>
-                </tr>
-            </tbody>
-        </table>
+    <div class="col-lg-12">
+        <div class="table-responsive">
+            <table class="table table-bordered table-hover table-striped tablesorter">
+                <thead>
+                    <tr>
+                        <th class="header">Public Repos</th>
+                        <th class="header">Public Gists</th>
+                        <th class="header">Name</th>
+                        <th class="header">Blog</th>
+                        <th class="header">Followers</th>
+                        <th class="header">Following</th>
+                        <th class="header">E-mail</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    <tr data-ng-repeat="data in githubUser.data.userData">
+                            <td>{{ data.public_repos }}</td>
+                            <td>{{ data.public_gists }}</td>
+                            <td>{{ data.name }}</td>
+                            <td>{{ data.blog }}</td>
+                            <td>{{ data.followers }}</td>
+                            <td>{{ data.following }}</td>
+                            <td>{{ data.email }}</td>
+                    </tr>
+                </tbody>
+            </table>
+        </div>
     </div>
+  </div>
 </div>
 
 

+ 26 - 21
angular/partials/snippets.partial.html

@@ -1,24 +1,29 @@
-<div class="row text-center">
-	<h1> Code Snippets </h1>
-</div>
+<div class="jumbotron">
+  <div class="container">
+
+    <div class="row text-center">
+    	<h1> Code Snippets </h1>
+    </div>
 
-<div class="col-lg-12">
-    <div class="table-responsive">
-        <table class="table table-bordered table-hover table-striped tablesorter">
-            <thead>
-                <tr>
-                    <th class="header">Code</th>
-                    <th class="header">ID</th>
-                    <th class="header">Line Numbers</th>
-                </tr>
-            </thead>
-            <tbody>
-                <tr data-ng-repeat="data in restData">
-	                    <td>{{ data.code }}</td>
-	                    <td>{{ data.id }}</td>
-	                    <td>{{ data.linenos }}</td>
-                </tr>
-            </tbody>
-        </table>
+    <div class="col-lg-12">
+        <div class="table-responsive">
+            <table class="table table-bordered table-hover table-striped tablesorter">
+                <thead>
+                    <tr>
+                        <th class="header">Code</th>
+                        <th class="header">ID</th>
+                        <th class="header">Line Numbers</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    <tr data-ng-repeat="data in restData">
+    	                    <td>{{ data.code }}</td>
+    	                    <td>{{ data.id }}</td>
+    	                    <td>{{ data.linenos }}</td>
+                    </tr>
+                </tbody>
+            </table>
+        </div>
     </div>
+</div>
 </div>

+ 28 - 23
angular/partials/steamSales.partial.html

@@ -1,29 +1,34 @@
-<div class="row text-center"> 
-    <h1> Latest Steam Sale Data </h1>
-</div>
+<!-- Main jumbotron for a primary marketing message or call to action -->
+<div class="jumbotron">
+  <div class="container">
+    <div class="row text-center"> 
+        <h1> Latest Steam Sale Data </h1>
+    </div>
 
-<div class="col-lg-12">
-    <div class="table-responsive">
-        <table class="table table-bordered table-hover table-striped tablesorter">
-            <thead>
-                <tr>
-                    <th class="header">Name</th>
-                    <th class="header">Release Date</th>
-                    <th class="header">Discount</th>
-                    <th class="header">Price</th>
-                </tr>
-            </thead>
-            <tbody>
-                <tr data-ng-repeat="data in steamSales.data ">
-                        <td>{{ data.name }}</td>
-                        <td>{{ data.releaseDates }}</td>
-                        <td>{{ data.discount }} </td>
-                        <td>{{ data.price }}</td>
-                </tr>
-            </tbody>
-        </table>
+    <div class="col-lg-12">
+        <div class="table-responsive">
+            <table class="table table-bordered table-hover table-striped tablesorter">
+                <thead>
+                    <tr>
+                        <th class="header">Name</th>
+                        <th class="header">Release Date</th>
+                        <th class="header">Discount</th>
+                        <th class="header">Price</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    <tr data-ng-repeat="data in steamSales.data ">
+                            <td>{{ data.name }}</td>
+                            <td>{{ data.releaseDates }}</td>
+                            <td>{{ data.discount }} </td>
+                            <td>{{ data.price }}</td>
+                    </tr>
+                </tbody>
+            </table>
+        </div>
     </div>
 </div>
+</div>
 
 
 

+ 1 - 0
angular/scripts/app.js

@@ -5,6 +5,7 @@ var restApp = angular.module('restApp', [
 ])
 .config(function($stateProvider, $urlRouterProvider) {
     $stateProvider
+
         .state('snippets', {
             url: '/snippets',
             templateUrl: 'partials/snippets.partial.html',

+ 41 - 1
hackathon_starter/hackathon/scripts/scraper.py

@@ -7,13 +7,53 @@ import requests
 import itertools 
 from bs4 import BeautifulSoup
 
+def fetchHTML(url):
+	'''
+	Returns HTML retrived from a url.
+
+	Parameters:
+		url: String
+			- The URL to fetch HTML from
+
+	Returns:
+		html: String
+			- The HTML from a given URL
+	'''
+	req = requests.get(url)
+	html = req.text
+	return html
+
+def extractTag(content, tag, className=None):
+	'''
+	Returns data embed within a tag, along
+	with an optional class for filtering.
+
+	Parameters:
+		content: String
+			- The HTML to parse
+		tag: String
+			- The HTML tag to scan for
+		class: String
+			- Optional filter for tag
+
+	Returns:
+		filteredData: List
+			- Content embed within searched tags
+	'''
+	soup = BeautifulSoup(content)
+	data = soup.findAll(tag, { 'class': className })
+	filteredData = []
+	for datum in data:
+		filteredData.append(datum.text)
+	return filteredData
+
+
 def steamDiscounts():
 	req = requests.get('http://store.steampowered.com/search/?specials=1#sort_by=_ASC&sort_order=ASC&specials=1&page=1')
 	content = req.text
 	soup = BeautifulSoup(content)
 	allData = {id: {} for id in range(0, 25)}
 
-
 	# Get all divs of a specific class
 	releaseDate = soup.findAll('div', {'class': 'col search_released'})