Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tried to get this shit working but it still isnt
- Loading branch information
1 parent
d80040b
commit 48777f3
Showing
10 changed files
with
1,270 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict'; | ||
|
||
(function(module) { | ||
const aboutController = {}; | ||
|
||
aboutController.init = function(){ | ||
$('.tab-content').hide(); | ||
$('#about').show(); | ||
} | ||
|
||
module.aboutController = aboutController; | ||
})(window); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
|
||
(function(module) { | ||
const articleController = {}; | ||
|
||
articleController.init = function(){ | ||
|
||
Article.fetchAll(articleView.initIndexPage); | ||
$('.tab-content').hide(); | ||
$('#articles').fadeIn(); | ||
} | ||
|
||
module.articleController = articleController; | ||
})(window); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
page('/', articleController.init); | ||
page('/about', aboutController.init); | ||
|
||
|
||
page(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
(function() { | ||
const adminView = { | ||
|
||
initAdminPage : () => { | ||
let template = Handlebars.compile($('#author-template').text()); | ||
Article.numberWordsByAuthor().forEach(stat => { | ||
$('.author-stats').append(template(stat)); | ||
}); | ||
$('#blog-stats .articles').text(Article.all.length); | ||
$('#blog-stats .words').text(Article.numberWordsAll()); | ||
} | ||
}; | ||
|
||
Article.fetchAll(adminView.initAdminPage); | ||
})(); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
(function() { | ||
const newArticle = {}; | ||
|
||
newArticle.initNewArticlePage = function() { | ||
$('.tab-content').show(); | ||
$('#export-field').hide(); | ||
$('#article-json').on('focus', function() { | ||
$(this).select(); | ||
}); | ||
$('#new-form').on('change', newArticle.create); | ||
}; | ||
|
||
newArticle.create = function() { | ||
$('#articles').empty(); | ||
let formArticle = new Article({ | ||
title: $('#article-title').val(), | ||
author: $('#article-author').val(), | ||
authorUrl: $('#article-author-url').val(), | ||
category: $('#article-category').val(), | ||
body: $('#article-body').val(), | ||
publishedOn: $('#article-published:checked').length ? new Date() : null | ||
}); | ||
$('#articles').append(formArticle.toHtml('#article-template')); | ||
$('pre code').each((i, block) => hljs.highlightBlock(block)); | ||
$('#export-field').show(); | ||
$('#article-json').val(JSON.stringify(formArticle) + ','); | ||
}; | ||
|
||
newArticle.initNewArticlePage(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>My Portfolio</title> | ||
<link rel="stylesheet" href="styles/normalize.css"> | ||
<link rel="stylesheet" href="styles/icons.css"> | ||
<link rel="stylesheet" href="styles/base.css"> | ||
<link rel="stylesheet" href="styles/layout.css"> | ||
<link rel="stylesheet" href="styles/modules.css"> | ||
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" rel="stylesheet"> | ||
|
||
<script id="author-template" type="text/x-handlebars-template"> | ||
<li><strong>{{name}}</strong>: {{numberWords}} words written</li> | ||
</script> | ||
</head> | ||
<body> | ||
<header class="site-header clearfix"> | ||
<section class="heading-group-h1 pull-left"> | ||
<h1> | ||
CAYLA ZABEL | ||
</h1> | ||
</section> | ||
<nav class="main-nav"> | ||
<div class="icon-menu"></div> | ||
<ul> | ||
<li class="tab"><a href="index.html" class="icon-home"></a>Blog</li> | ||
<li class="tab"><a href="admin.html"></a>Stats</li> | ||
<li class="tab"><a href="new.html">New Article</a></li> | ||
</ul> | ||
</nav> | ||
</header> | ||
<main class="clearfix"> | ||
<h1>Blog Stats</h1> | ||
<section id="blog-stats"> | ||
<dt>Total articles:</dt> <dd class="articles"></dd> | ||
<dt>Total words:</dt> <dd class="words"></dd> | ||
<h2>Author Stats</h2> | ||
<p><em>Details on who is writing, and how much writing they are doing...</em></p> | ||
<ul class="author-stats"> | ||
</ul> | ||
</section> | ||
</main> | ||
<footer> | ||
© 2017 Code Fellows | Static Blog | Happy Ipsum! | ||
</footer> | ||
|
||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | ||
|
||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.