Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#### Single-line Summary
**Today, _ and _ paired together. It took about _**
**Today, Ford and Jonny paired together. It took about 40 mins**

#### Reflect and summarize on your process for each `TODO` item :
1. First, we started on ...
2. Next, we ...
3.
1. First, we started on adding all the scripts to the HTML
2. Next, we filled out the articles constructor function.
3. Third, we added jQuery to remove the 'template' class from the articles clone.
4. Forth, we added jQuery to set the title, author, author url, and body text.
5. Fifth, we fixed the jQuery for the published on date so that the attributed was set to 'datetime' instead of 'title'.
6. Celebrated a completed lab!

#### Checklist (before submitting, fill in each set of square brackets with an 'x')
- [] We have titled the Pull Request similar to our branch name (ex: 'brian-rick').
- [] This PR includes commits from both myself and my partner; e.g. We followed good pair programming practices by switching driver/navigator roles.
- [] There is no extraneous, unrelated code included in this PR.
- [] We have summarized our `TODO:` process above.
- [x] We have titled the Pull Request similar to our branch name (ex: 'brian-rick').
- [x] This PR includes commits from both myself and my partner; e.g. We followed good pair programming practices by switching driver/navigator roles.
- [x] There is no extraneous, unrelated code included in this PR.
- [x] We have summarized our `TODO:` process above.
3 changes: 2 additions & 1 deletion starter-code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

This is a simple blogging system front end. The code is organized with MVC principles in mind.

It starts small, but will be gaining new features regularly.
It starts small, but will be gaining new features regularly.
TESETIN
4 changes: 4 additions & 0 deletions starter-code/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,9 @@ <h1>Title</h1>
&copy; 2016 Code Fellows | Static Blog | Happy Ipsum!
</footer>
<!-- // TODO: Intentionally vague: include all necessary script tags, in proper order! -->
<!-- DONE -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="scripts/blogArticles.js"></script>
<script src="scripts/article.js"></script>
</body>
</html>
21 changes: 17 additions & 4 deletions starter-code/scripts/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ function Article (options) {
a placeholder for the object that will ultimately be
passed in. Use all of the properties in blogArticles
to populate the new Article data that we'll use. */
this.title = options.title;
// DONE
this.title = options.title;
this.category = options.category;
this.author = options.author;
this.authorUrl = options.authorUrl;
this.publishedOn = options.publishedOn;
this.body = options.body;
};

Article.prototype.toHtml = function() {
Expand All @@ -19,10 +25,17 @@ Article.prototype.toHtml = function() {
3. article title
4. article body
5. publication*/
$newArticle.find('time[pubdate]').attr('title', this.publishedOn);
// DONE
$newArticle.find('h1').text(this.title);
$newArticle.find('a').text(this.author);
$newArticle.find('a').attr('href', this.authorUrl);
$newArticle.find('.article-body').html(this.body);
$newArticle.find('time[pubdate]').attr('datetime', this.publishedOn);
$newArticle.find('time').text('about ' + parseInt((new Date() - new Date(this.publishedOn))/60/60/24/1000) + ' days ago');
/* TODO: This cloned article is no longer a template, as it now
has real data attached to it. Remove the class from this new article! */
/* TODO: This cloned article is no longer a template, as it now
has real data attached to it. Remove the class from this new article! */
// DONE
$newArticle.removeClass('template');
return $newArticle;
};

Expand Down