- Checkout the "master" branch in git
- Start the webserver
python webserverExtRest.py
- Open a browser to: http://localhost:8003
- Tweak the constants APIURL and PORT to meet your needs.
- Tip. clone this into a separate folder to be able to have this application running.
- Checkout the lab branch
git checkout lab-start
- Create index.html start with an empty page with a top menu.
- The top menu should consist of:
- Brand: GitHub Api Tests as the on the left
- Link on right: https://github.com/calmlow/modern-frameworks-lab/
- Bootstrap can be found here: http://getbootstrap.com/
- Bootstrap has some excelent sample pages on their page
- This one looks nice http://getbootstrap.com/examples/theme/
- Host your assets at via a CDN
- Bootstrap has some links for this
- Check download section here: http://getbootstrap.com/
- Host your librarys at via a CDN
- Angular has some links for this: https://angularjs.org/
- Use latest stable and minified version
- We need:
- angular
- angular-resource
- angular-route
- angular-sanitize (ish)
- ui-bootstrap-tpls-2.2.0 (in assets folder)
- Create anangular application module
- Attach the application to the index page
- What is the angular APPlication file called?
- Remeber that a folder structure makes thing simpler
- Some pretty unhelpful documentation can be found here: https://docs.angularjs.org/api/ng/directive/ngApp
- Dont forget to include the script at the bottom
- Create a new controller called list
- Add a single variable to the controller called "searchValue" with a default value of "Hello World".
- Bind the controller to the container div of the index page
- Show the value of the variable on the page.
- TODO
- Create a new view called list.html
- Move your logic over from the index.page
- Add routing for your view to the application
- Add the view to index.html
- TODO
- Add breadcrumbs to the top of the page
- Add a "Home" element (no link)
- Add a panel for the list with title: Instructions
- Remove the bound file (searchValue)
- TODO
- Use a boostrap list group component with custom content
- Add placeholder text for:
- Name
- Description
- And a "Show hint/restore to this" link (in a lsit)
- You might find some ideas here: http://getbootstrap.com/components/#list-group
- Create a new Service named "ReleaseService" in a file called release.js.
- Target the list opertion here: https://developer.github.com/v3/repos/releases
- The link is /repos/calmlow/modern-frameworks-lab/releases (as we use the proxy)
- Link to AngularJS $resource https://docs.angularjs.org/api/ngResource/service/$resource
- Services goes under services/...
- Add a call to fetch the data from the service to the list controller.
- Add the result to a variable called items
- TODO
- Replace the placeholders from 4.1 with real data from the view
- Add an icon that shows the avatar to the list
- Add all assests as links below the "Hint" button
- Look at the GitHub API page. See how the objects returned look like. https://developer.github.com/v3/repos/releases/
- Add an input filter above the list
- Bind this to the searchValue
- Add filtering using this variable to the list
- TODO
- Add the button to the top
- Bind it to a function (resfresh) which refreshes the view
- bootstrap has utility classes for putting on the "right"
- http://getbootstrap.com/css/#helper-classes-floats
- Create a call-back function to prevent "flickering" of the list when refreshing
- the argument in the callback is the data
- Make sure the surrounding div clears
- bootstrap has utility classes for putting on the "right"
- http://getbootstrap.com/css/#helper-classes-clearfix
- Call the view: restore.html
- Add so the breadcrumb show the tag name
- Call the controller: RestoreController in restore.js
- Add a bound variable for the tagName
- The "hint" button should go to this page (and send the tag_name along)
- Dont forget to include it
- Dont forget to add routing (we need a routing paremeter this time)
- Dont forget to fix the link
- Your routing can have parameters :id
- $routeParams containes your parameters from the view
- Call the service TagService in service.js
- The URL should be /repos/calmlow/modern-frameworks-lab/git/refs/tags/:tag
- Dont forget to include it
- Fetch tag metadata and show the hash on the page
- TODO
- TODO
- TODO
- As the data (body) of the release is markdown rendering of markdown
- TODO