Coder Social home page Coder Social logo

hansardalerts's Introduction

This is the source for the govhack-science website highlighing sciency datasets at govhack-science.github.io.

Content served by Jekyll, with layout and nice bits stolen shamelessly from Rasmus Andersson.

Planning

GovHack Data Model

Documentation

Requirements

  • Ruby
  • RubyGems
  • NodeJS
  • Python
  • Jekyll

Installation

https://jekyllrb.com/docs/installation/ https://jekyllrb.com/docs/github-pages/

Our friends at GitHub have provided the github-pages gem which is used to manage Jekyll and its dependencies on GitHub Pages. Using it in your projects means that when you deploy your site to GitHub Pages, you will not be caught by unexpected differences between various versions of the gems. To use the currently-deployed version of the gem in your project, add the following to your Gemfile

The best way to install Jekyll is via RubyGems. At the terminal prompt, simply run the following command to install Jekyll:

$ gem install github-pages

All of the GitHub pages flavour of Jekyll, and its gem dependencies are automatically installed by the above command, so you won’t have to worry about them at all.

Run

https://jekyllrb.com/docs/usage/

jekyll serve

If you receive a message like:

Could not find gem 'github-pages (= 67)' in any of the gem sources listed in your Gemfile or available on this machine. (Bundler::GemNotFound)

Then it means GitHub has upgraded their github-pages gem version, so just run bundle install from the root directory to upgrade to the latest set of deps GitHub is using.

hansardalerts's People

Contributors

keithamoss avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hansardalerts's Issues

Refactor the initial data load

Bad: Loading Your Initial Page View With AJAX Calls

Here's a common scenario with AngularJS: the user visits your page, and is greeted with a weird layout, that eventually resolves itself to what you intended. AngularJS has to do a large number of passes on your scopes to ensure that your models have "settled". So your visitor is confused, because the HTML seems to have rendered, wrongly, but then gets the AJAX data, re-runs your models, and everything updates to look fine.

Better: Ask Your Services To Talk To $window

You're already talking to your server, and know what you should get, because you already had the user interaction (the page visit). What I do is I get my initial load data server side, and then pass into Angular by attaching it to the window object. Then in Angular, I have a service whose job it is to fetch that information from the window and provide it to my app in a dependency injectable way. Because $window is injectable, I can then test by attaching whatever input data I want.

From http://miceplans.net/node/36

User sign-up/sign-in process

New User:

  • The first field in the form should be an email address field linked to Personas

Existing Logged in User:

  • Display logged in status at the top of the page

Existing User, not logged in:

  • The first field in the form should be an email address field linked to Personas
    Q. Can/should we auto-populate it?
    Q. Is the different behaviour of the field confusing (register vs login again)
    Q. Is not making the registration process explicit a problem? ("I just entered my email address here - it doesn't look like I've registered yet!")

Regardless, the top bar of the page should have Login/Register/Logged In buttons.

Learn about Bower

All of the hipsters JavaScript kids seem to be using it to distribute their packages these days. Would make installing (and presumably updating and uninstalling?) easier.

Alert management process

Depends on issue #9.

Users can see all of their current alerts on the index page. The table might be rendered with ngTable.

  • Search text
  • Leg. Assembly
  • Leg. Council
  • Status (Off/On)
  • Creation date - Do they care?
  • {Enable|Disable}/Delete/Edit buttons

{Enable|Disable}:

  • Display confirmation dialog? Who cares?
  • PUT to /api/alerts/{id}/{enable|disable}
  • Change status in Angular-land, hopefully magic data binding updates the table
  • Display confirmation of action completion - row colour fades to default? Toastr?

Delete:

  • Display confirmation dialog
  • DELETE to /api/alerts/{id}
  • Flag as deleted in DB
  • Remove from data in Angular-land
  • Display confirmation of action completion - whatever we did for alert creation (Alerts / Toastr)

Edit:

  • In-table edit vs modal edit. Whatever ngTable works nicest with (to start with, at least)
  • Edit button should become 'submit'-esque button
  • PUT to /api/alerts/{id}
  • Either return confirmation from API or let angular re-request from GET /api/alerts/{id} and update magically.
  • Display confirmation of action completion - whatever we did for alert creation (Alerts / Toastr)

Alert creation process

Depends on issue #8.

User is presented with a form:

  • Checkboxes for Leg. Assembly and Leg. Council
  • Search terms box - including some explanatory text around adv. searching abilities and placeholder text
  • Create alert button.

Create Alert:

  • Validation (in Angular-land)
  • Validation (in Python-land)
  • Create alert in DB at /api/alert/create POST
  • Return either alert_id (and have Angular re-request alert info)
  • .push() to alerts list in Angular-land and have it update the UI
  • Display temporary UI acknowledgement of creation (Bootstrap Alert / Toastr)
  • Reset alert creation form

Admin interface

The Admin interface should allow

  • View all users
  • Edit user information (Though we may not store anything worth editing)
  • View all alerts
  • View all alerts for a given user
  • Edit an alert (e.g. manually turn it off)

Final graphics

  • Finalised logo
  • Finalised header image w/ "Hansard Alerts" and a tagline
  • A favicon

Finalise design

The current is just default Bootstrap to get the backend working and UI stuff ironed out.

Alert errors mails

The alerts system should send automated error emails in case of something going awry:

e.g.

  • Any exceptions
  • Any unexpected responses from the Hansard searcher
  • Any failures from the mailer API

Links back to Hansard?

Where and how should we link back to Hansard and provide due credit to the Parliament folks for making the backend possible?

Introductory text

We'll need a brief bit of text explaining what it is, where it came from (inspired by OpenAustralia's thing), and some detail around when on sitting fays you can expect alerts to arrive (based on the info on Parliament's website).

About page

We need text for an about page.

Reuse it to fill in metatags in cover-layout.html

What should the Twitter account do?

Should it be regularly tweeting things to maintain interest and get RTs?

Or is it just an avenue for support and occasional promotional tweets?

Reconcile app.py vs __init__.py

Looks like I got halfway to refactoring it and got distracted by something. At the moment they're both doing much the same thing.

It's based on one of the published Flask patterns from...somewhere.

Social media integration in alert emails

Should alert emails have any social media integration?

e.g. Twitter links next to each alert that tweet "{search term} {section of Hansard} {members mentioned} #ourhashtag {link or @HansardAlerts)"

Log viewer

The alerts system should log some useful information and this should be made available via a web interface.

Welcome email

We need some text and a design for a "Welcome to HansardAlerts" email. To include account details (email, name {if we collect that}), a big fat "Create Alerts" button, and prods toward the Twitter account and website as well as legal requirements in the footer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.