Kaynağa Gözat

Updating AngularJS Front-end

David Leonard 10 yıl önce
ebeveyn
işleme
b2109e8e40

+ 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>

+ 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',

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

@@ -54,7 +54,6 @@ def steamDiscounts():
 	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'})