GithubHelp home page GithubHelp logo

biocore / american-gut-web Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 24.0 222.24 MB

The website for the American Gut Project participant portal

License: BSD 3-Clause "New" or "Revised" License

Python 39.51% SQLPL 0.09% CSS 0.93% JavaScript 3.10% HTML 26.42% PLpgSQL 1.27% PLSQL 0.06% TSQL 28.62%

american-gut-web's People

Contributors

adamrp avatar alexanderfengfeng avatar antgonza avatar beaugunderson avatar eldeveloper avatar embrietteh avatar fedarko avatar josenavas avatar jwdebelius avatar mortonjt avatar sjanssen2 avatar squirrelo avatar teravest avatar wasade avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

american-gut-web's Issues

Centralize URL handling

If we modify one URL, we don't have an easy way to know how many files do we need to change. A potential solution for this, is to create a python file in which all the URLs are defined in variables, and use those variables in all the templates and python code.

Felons to people in prison

Req. from Victoria, can we change "felons" to "people in prison"? I believe the only location is within the FAQ

Add command line argument to load configuration file

webserver.py should have a parameter that lets you specify which configuration file to use, something like:

$ webserver.py --config-fp=british-gut.conf --port=7777 &
$ webserver.py --config-fp=american-gut.conf --port=8888 &

Create easy-to-use admin tool

...or extend existing admin tools. But it would be very nice to have either easy click commands or an interface that lets us:

  • post a banner status message on login and portal (e.g., "we are currently experiencing problems, blah blah")
  • disable login

Probably a few other things to the list

Get column order from query results object?

There are many places in the data access code (e.g., see these lines) where column order is hard-coded. It would be better if we could get the column names and values in a dict without hardcoding the order, probably by making use of a postgres results object method.

Dump strings for localization

To send for update by the British Gut, we need to take the text strings defined by amgut.lib.locale_data.american_gut, and convert them into a Google Spreadsheet with two columns: variable name, and the text value. Ideally, one sheet per template. We will instruct the group to, with great emphasis, not manipulate the variable names or modify any inline html.

FAQ: Non-fecal sample timelines

We say that we'll return non-fecal samples January 1st, 2014. I assume we have not done this yet, and we should update the text. We also need to get these done.

Change password link doesn't work

Currently the Change Password link in sitebase points to /authed/change_password/ which does not exist. I think this is supposed to be the change_pass_verify.html page but not 100% sure.

Pull out all text and media into localized dicts

Any text that is displayed to the user will need to be pulled out into project/locale specific dicts. These dicts will be located under amgut.lib.locale_data, and each portal will have its own. For instance, the American Gut portal text and media will fall under amgut.lib.locale_data.american_gut. The motivation for portal specific, instead of language specific localization is that many countries rely on en_UK, but we need to play for having different branding (e.g., Australian Gut) moving forward.

Each locale_data module needs to provide two dicts, text_locale and media_locale. The structure of text_locale is as follows:

text_locale = {
    'name_of_template.html': {
        'INFORMATIVE_VARIABLE_NAME': 'The text that is displayed'
    }
}

media_locale = {'INFORMATIVE_VARIABLE_NAME': '/path/to/media.jpg'}

text_locale is per-template which minimizes what needs to be passed into render from the handlers. media_locale is not per-template as much of the media is common across templates, such as the logo.

In the __init__ for amgut.lib.locale_data, there is a media_locale that represents anything common regardless of portal. This dict is updated by the project specific media_locale.

For localization data, all handlers will need to add:

from amgut import text_locale, media_locale

The package-level __init__ will resolve the appropriate locale data. All handlers wishing to use the locale data will need to specify the locale over render. For instance:

class MyHandler(BaseHandler):
    def get(self):
        # stuff of interest
        template = 'really_awesome.html'
        self.render(template, ...whatever..., text_locale=text_locale[template], media_locale=media_locale)

Within the templates, all user visible text will need to be replaced with:

<!-- former -->
<p><strong>very</strong> informative message</p>
<!-- new style -->
<p>{% raw text_locale['INFORMATIVE_MESSAGE'] %}</p>

All variables should be expressed with raw, which will let us preserve html formatting and tags within the locale dicts.

And finally, the list of templates to knock off. A template is considered completed once the text has been pulled out and replaced with locale lookups, the relevant locale entries updated, and the handler has been updated.

  • 404.html
  • international.html
  • FAQ.html
  • map.html
  • add_sample.html
  • new_participant.html
  • add_sample_overview.html
  • new_participant_overview.html
  • addendum.html
  • no_auth_404.html
  • animal_survey.html
  • no_auth_sitebase.html
  • authed_index.html
  • participant_overview.html
  • change_pass_verify.html
  • portal.html
  • construction.html
  • register_user.html
  • db_error.html
  • retrieve_kitid.html
  • error.html
  • sample_overview.html
  • forgot_password.html
  • sitebase.html
  • help_request.html
  • survey_main.html
  • index.html
  • taxa_summary.html

Centralize logging

Currently if something goes wrong the user is presented with the stacktrace and other info we really don't want them seeing. We need to have the python logger or some other centralized way of storing these errors for later examination.

Create database structures backing human survey

  • Create the structures that will be used to load questions, responses, question groups, etc.
  • Create the tables that will store user responses
  • Store user responses on post to human_survey.html (in human_survey.py)
  • Load user responses from database when they exist

american-gut-web / amgut / lib / data_access / AG_procedures.sql

This file seems out of place, and I don't think it's necessary any more (since the procedures were broken out into their own files, one per procedure) and placed in the american-gut-web / amgut / lib / data_access / procedures directory, but I wanted to make sure before removing it. Any objections?

Usage stats

Basic usage stats (may not be necessary if google analytics covers a lot). We do want an easy way to determine the current number of active users.

add project groups to database

currently there is only one group AG and the projects in that group are hard coded. This needs to be changed to be in the database then ag_data_access getBarcodeProjType needs to be updated to use the new table.

Future aggregated and project-specific data

This cam up in #132. We need to have the addendum specifically state American Gut for all the data shown currently, but it would be nice to have info for each project and all combined projects once we have enough samples.

Double check for american gut in british gut text

There are some situations where this is okay to have, and some where it needs to be project specific. This is unfortunately a bit case-by-case. Project/portal specific should be replaced with %(PROJECT_TITLE)s and formatted appropriately. This issue also entails going back through BG text to see if "British Gut" is present and whether it should be string formatted.

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.