-
Notifications
You must be signed in to change notification settings - Fork 70
SOLUTION: Reduan Senoun & Víctor García-Vao #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
victor-gv
wants to merge
39
commits into
assembler-institute:main
Choose a base branch
from
victor-gv:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
76daced
html structure
victor-gv 1d576cc
structure created in main
7fb5a78
added showTitle function
8a02dcf
feature(localhost dependencies)
reduansj 0dd52a7
added id attributes to titles
252455c
get the body when click on the title
e551c7f
added bootstrap to main container and modal
5f6d150
separate js in different diles
c65f6c4
added css hover & pointer at class list-group-item
a59c8e9
centered title align
f39eec6
comments deleted
2e7dffe
feature(get all data json)
reduansj a73787d
added comment functions
b7d51d9
deleted unused div
62de896
comments accordion in progress
e2fa45b
added css on comments
d6dbcf7
feature (change style to grid, optimize js)
reduansj 2e48492
addedgrid with bootstrap
f4e4b1a
css improvements added
ddcf3de
css improvements added
45bdba9
(feature: modal close key esc)
reduansj b05249a
change
reduansj 13ecdde
css finished
80ea38a
(modal close key ESC)
reduansj 7030d85
feature: modal
reduansj efe489f
Merge remote-tracking branch 'origin/improve' into develop
8cee060
deleted functions file
e54c444
add comments js
reduansj 334e728
deletePost event added
eef0990
delete function works
91adb02
delete function finished
baf90db
function delete moved on the code
53f93a8
added confirmation question before removing post
122f5bc
added edit modal
cda81d5
edit function finished
2523df3
edit and delete functions finished
b51bce8
improved comments
ca78e6f
deleted unused code
d7cc1fc
unused code deleted
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,2 @@ | ||
| node_modules | ||
| package-lock.json |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,21 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2021 Assembler School Of Software Engineering | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. | ||
| MIT License | ||
| Copyright (c) 2021 Assembler School Of Software Engineering | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,60 +1,60 @@ | ||
| `#html` `#css` `#js` `#dom` `#JSON` `#HTTP` `#API` `#Bootstrap` `#master-in-software-development` | ||
|
|
||
| # Blog with API <!-- omit in toc --> | ||
|
|
||
| <p> | ||
| <img alt="Version" src="https://img.shields.io/badge/version-1.0-blue.svg?cacheSeconds=2592000" /> | ||
| </p> | ||
|
|
||
| > In this pill you will put into practice the knowledge learned about making HTTP requests to create a blog consuming the information from a third-party API. You will also learn how to use Bootstrap Framework for the layout. | ||
|
|
||
| ## Index <!-- omit in toc --> | ||
|
|
||
| - [Requirements](#requirements) | ||
| - [Repository](#repository) | ||
| - [Technologies used](#technologies-used) | ||
| - [Project delivery](#project-delivery) | ||
| - [Resources](#resources) | ||
|
|
||
| ## Requirements | ||
|
|
||
| - You must use semantic HTML5 elements for all the contents of the application | ||
| - You must use JSON server library to create your own local repository | ||
| - You must use fecth to do the requests | ||
| - You have to use Bootstrap Framework for the Layout and the styles | ||
|
|
||
|
|
||
| ## Repository | ||
|
|
||
| First of all you must fork this project into your GitHub account. | ||
|
|
||
| To create a fork on GitHub is as easy as clicking the “fork” button on the repository page. | ||
|
|
||
| <img src="https://docs.github.com/assets/images/help/repository/fork_button.jpg" alt="Fork on GitHub" width='450'> | ||
|
|
||
| ## Technologies used | ||
|
|
||
| \* HTML | ||
|
|
||
| \* CSS | ||
|
|
||
| \* JS | ||
|
|
||
| \* Bootstrap | ||
|
|
||
| \* HTTP Requests | ||
|
|
||
| \* JSON | ||
|
|
||
| \* API | ||
|
|
||
| ## Project delivery | ||
|
|
||
| To deliver this project you must follow the steps indicated in the document: | ||
|
|
||
| - [Submitting a solution](https://www.notion.so/Submitting-a-solution-524dab1a71dd4b96903f26385e24cdb6) | ||
|
|
||
| ## Resources | ||
|
|
||
| - [JSON server](https://github.com/typicode/json-server) | ||
| `#html` `#css` `#js` `#dom` `#JSON` `#HTTP` `#API` `#Bootstrap` `#master-in-software-development` | ||
| # Blog with API <!-- omit in toc --> | ||
| <p> | ||
| <img alt="Version" src="https://img.shields.io/badge/version-1.0-blue.svg?cacheSeconds=2592000" /> | ||
| </p> | ||
| > In this pill you will put into practice the knowledge learned about making HTTP requests to create a blog consuming the information from a third-party API. You will also learn how to use Bootstrap Framework for the layout. | ||
| ## Index <!-- omit in toc --> | ||
| - [Requirements](#requirements) | ||
| - [Repository](#repository) | ||
| - [Technologies used](#technologies-used) | ||
| - [Project delivery](#project-delivery) | ||
| - [Resources](#resources) | ||
| ## Requirements | ||
| - You must use semantic HTML5 elements for all the contents of the application | ||
| - You must use JSON server library to create your own local repository | ||
| - You must use fecth to do the requests | ||
| - You have to use Bootstrap Framework for the Layout and the styles | ||
| ## Repository | ||
| First of all you must fork this project into your GitHub account. | ||
| To create a fork on GitHub is as easy as clicking the “fork” button on the repository page. | ||
| <img src="https://docs.github.com/assets/images/help/repository/fork_button.jpg" alt="Fork on GitHub" width='450'> | ||
| ## Technologies used | ||
| \* HTML | ||
| \* CSS | ||
| \* JS | ||
| \* Bootstrap | ||
| \* HTTP Requests | ||
| \* JSON | ||
| \* API | ||
| ## Project delivery | ||
| To deliver this project you must follow the steps indicated in the document: | ||
| - [Submitting a solution](https://www.notion.so/Submitting-a-solution-524dab1a71dd4b96903f26385e24cdb6) | ||
| ## Resources | ||
| - [JSON server](https://github.com/typicode/json-server) | ||
| - [Official Bootstrap](https://getbootstrap.com/) |
This file contains hidden or 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,90 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
|
|
||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" | ||
| integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> | ||
| <link rel="stylesheet" href="./src/styles/style.css"> | ||
| <script src="./src/js/main.js" type="module"></script> | ||
| <title>Blog with API</title> | ||
| </head> | ||
|
|
||
| <body> | ||
| <header class="blog__header__title"> | ||
| <nav class="navbar navbar-dark bg-dark"> | ||
| <div class="container-fluid"> | ||
| <a class="navbar-brand">Blog with API</a> | ||
| <img class="blog__header__img" src="./src/assets/pngwing.com.png" alt="logo"> | ||
| </div> | ||
| </nav> | ||
| </header> | ||
|
|
||
| <main class="container-fluid"> | ||
| <section id="postsTitlesContainer" | ||
| class="row row-cols-1 row-cols-md-2 row-cols-lg-3 row-cols-xl-4 g-lg-2 blog__postTitle--container"> | ||
|
|
||
| </section> | ||
|
|
||
| <!-- MODAL CONTENT--> | ||
| <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> | ||
| <div class="modal-dialog"> | ||
| <div class="modal-content"> | ||
| <div class="modal-header"> | ||
| <h5 class="modal-title" id="exampleModalLabel">Modal title</h5> | ||
| <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> | ||
| </div> | ||
| <div id="bodyContent" class="modal-body"> | ||
| </div> | ||
| <div id="userName" class="modal-body modal-body-name"></div> | ||
| <div class="accordion" id="accordionExample"> | ||
| <div class="accordion-item"> | ||
| <h2 class="accordion-header" id="headingTwo"> | ||
| <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" | ||
| data-bs-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> | ||
| COMMENTS | ||
| </button> | ||
| </h2> | ||
| <div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo" | ||
| data-bs-parent="#accordionExample"> | ||
| <div id="commentContainer" class="accordion-body"> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="modal-footer modal-footer-flex"> | ||
| <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
|
|
||
|
|
||
| <!-- Modal --> | ||
| <div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true"> | ||
| <div class="modal-dialog"> | ||
| <div class="modal-content"> | ||
| <div class="modal-header"> | ||
| <h5 class="modal-title" id="staticBackdropLabel">Modal title</h5> | ||
| <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> | ||
| </div> | ||
| <div id="editBodyContent" class="modal-body"> | ||
| ... | ||
| </div> | ||
| <div class="modal-footer"> | ||
| <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> | ||
| <button id="saveChanges" type="button" class="btn btn-primary" data-bs-dismiss="modal">Save changes</button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </main> | ||
| <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" | ||
| integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"> | ||
| </script> | ||
| </body> | ||
|
|
||
| </html> |
This file contains hidden or 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,25 @@ | ||
| { | ||
| "name": "blog-with-api", | ||
| "version": "1.0.0", | ||
| "description": "`#html` `#css` `#js` `#dom` `#JSON` `#HTTP` `#API` `#Bootstrap` `#master-in-software-development`", | ||
| "main": "index.js", | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1", | ||
| "server": "json-server --watch ./src/data/db.json", | ||
| "start": "concurrently \"npm run json_server\" \"npm run server\" " | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/victor-gv/blog-with-api.git" | ||
| }, | ||
| "keywords": [], | ||
| "author": "", | ||
| "license": "ISC", | ||
| "bugs": { | ||
| "url": "https://github.com/victor-gv/blog-with-api/issues" | ||
| }, | ||
| "homepage": "https://github.com/victor-gv/blog-with-api#readme", | ||
| "dependencies": { | ||
| "json-server": "^0.17.0" | ||
| } | ||
| } | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

Excellent script, I copy it for future projects! Pikachu approves this JSON