-
Notifications
You must be signed in to change notification settings - Fork 1
Python Media
Contains front-end public files.
Admin related HTML files, as well as images (because of relative path used by Django admin and django-filemanager apps).
| File | Description |
|---|---|
base.html |
Admin site HTML frame template. |
img/ |
Admin site SVG and django-filemanager icons. |
js/ |
Admin site JS scripts. |
CSS styling spreadsheet files.
| File | Description |
|---|---|
admin.css |
For admin site. |
theme.css, palette.css, code.css
|
For public site; general and color schemes. |
bootstrap.min.css, _suit.css, _filemanager.css
|
Vendor files. fullcalendar.min.css is modified and truncated. |
min/ |
Folder of minified CSS files, for production only. |
Contains Glyphicons, and local copy of fonts used by public and group sites: Helvetica.
HTML tempaltes.
| File | Description |
|---|---|
_public.html |
Public site frame template. |
user_login.html |
Login page. |
admin_*.html |
Admin console pages. |
error_*.html |
Custom HTTP error pages. |
public_*.html |
Public site pages. |
Image files. Public site images and group icons are consolidated into sprite images for fewer requests.
| File | Description |
|---|---|
doc/ |
Images used for tutorial and protocol pages. 96-well plate images are now rendered dynamically by d3.js using the JSON files. |
old/ |
Previously used logos. |
Contains Javascript files.
*.min.js Vendor libraries (Bootstrap, jQuery, fullcalendar, Moment, SWFObject).
** admin/** Admin Javascript files.
| File | Description |
|---|---|
_*.js |
Vendor libraries for django-suit and django-filemanager. |
apache.js |
Makes AJAX calls to /admin/apache_stat/, which passes through src/admin.py to restyle_apache() in src/console.py. The page refreshes every 3 seconds by setTimeout(). |
aws.js |
Uses gviz-api.py. Makes AJAX calls to /admin/aws_stat/, which passes through src/admin.py to aws_stats() in src/console.py. Data is retrieved on the fly (not cached). |
backup.js |
Makes AJAX calls to /admin/get_backup/, which passes to get_backup() in src/admin.py. Also makes AJAX calls to /admin/get_ver/, which passes to get_ver() in src/admin.py. |
doc.js, doc_cherrypy.js
|
Used by /admin/man/ and /admin/ref/ pages for scrollSpy side-bar resizing according to window.width(). The obsolete CherryPy documentation page (/admin/doc/) uses doc_cherrypy.js. |
ga.js |
Uses gviz-api.py, not Google Analytics API. Makes AJAX calls to /admin/ga_stat/, which passes through src/admin.py to ga_stats() in src/console.py. Data is retrieved on the fly (not cached). |
git.js |
Uses gviz-api.py. Makes AJAX calls to /admin/git_stat/, which passes through src/admin.py to git_stats() in src/console.py. Data is retrieved on the fly (not cached). |
group.js |
Used by /admin/auth/user/ page to render config/group.conf on the page. Makes AJAX calls to /admin/group_dash/, which passes to group_dash() in src/admin.py. |
home.js |
Similar to backup.js, makes AJAX calls to /admin/get_backup/ and /admin/get_ver/. Additionally, makes AJAX calls to /admin/backup_form/, which passes through src/admin.py to get_backup_form() in src/console.py; /admin/ssl_dash/, which passes through src/admin.py to dash_ssl() in src/console.py. |
load.js |
Loads vendor libraries using CDN, or fallback to local files. Used by entire site (both public and group)! Makes AJAX call to /get_js/, which passes to get_js() in src/views.py. It checks jQuery availability from https://cdnjs.com/ first, and decides whether to use it. Uses document.write() to dynamically add <script> and <link> in HTML. |
menu.js, table.js
|
Injection of Javascript to format menu (sidebar, navbar, breadcrumb, highlighting, collapsing) and table (column width and icon for <th>, and Date/Time <input>) for admin pages. Note that the window.resize() methods use setTimeout() to prevent overlapping trigger of the event that results in delay in updating the view. |
public/ Public Javascript files.
design_1d.js: Interactive script for Design1D job page.
- Input disabling / re filtering, sequence length tracking and warning toggle.
- Form submission is replaced by AJAX POST requests to prevent page refresh. The input values are updated from the JSON returned from the form submission, only once. The JOB_ID is assigned by python and returned inside the JSON response.
- After submission (or demo), the ajax_update_result() function is called at most every second (depending on sequence length). This function loads the HTML file of the current JOB_ID, and keep refreshing until it's no longer the "waiting" page (i.e., run finished with either success or error). This refreshing behavior makes sure the result is updated while the run is underway, if the user stays waiting on the page.
- The ajax_load_html() function handles job result retrieval when user returns with a JOB_ID after leaving the status-refreshing page.
- The current window URL is updated to /result/?job_id= with the actural JOB_ID once the run finishes.
- When retrieving a result after leaving the running page, the input parameters are retrieved from MySQL and loaded in the forms.Form model by result() in
src/views.py.
design_2d.js, design_3d.js: Interactive scripts for Design2D and Design3D job pages.
-
The AJAX POST form submission mechanism, page refreshing and/or loading by ajax_update_result() and ajax_load_html(), window URL rewrite are the same as
design_1d.js. -
Input length tracking, and appending input boxes for additional primer pairs (expand_primer_input()) and structures (expand_structure_input()).
-
The inherited input boxes for primer sets and structures from Django are hidden in order to use the rich multi-input interface. The track_primer_list() and track_structure_list() functions updates the original hidden inputs on keyup events of any of those visible input boxes. The original hidden inputs are actually used for form submission. And the sync_primer_input() and sync_structure_input() functions are in charge of updating those fields from the returned JSON.
-
Primer sets and structures are disabled upon form submission to make sure the original hidden inputs are up-to-date with the visible ones, and re-enabled right after AJAX POST.
-
When the page is referred by design_2d_from_1d(), design_3d_from_1d(), or design_3d_from_2d(), the pre-filled results are passed simiarly as the case of retrieving a result. This part of Javascript code resides in
media/html/public_design_?d.htmlsince it's dependent on templating variables from Django.
plate_96.js: Core script that handles 96-well plate drawing using d3.js.
- The draw_96_plate() function loads the corresponding JSON file for the specified JOB_ID (by default type is 2, meaning 2d for the path) and draw all the plates on the page with a naming scheme for SVG containers of #svg_plt_?prm?.
- Special colors are avaiable as parsed in get_fill_color(). This is mainly used by the /protocol/ page, as well as Wild-Type primer color override for
Design3Djobs.
| File | Description |
|---|---|
index.js |
Makes AJAX call to /get_ver/ for displaying server primerize running version. Also handles the result retrieval button gate control; and column height consistency. |
protocol.js, tutorial.js
|
tutorial.js takes care of the window.width() and scrollSpy similarly as media/js/admin/doc.js; used by /tutorial/ and /protocol/. protocol.js is responsible for the DNA/RNA concentration calculator and example 96-well plates rendering. |
util.js |
Shared by all public pages. It takes care of responsive resizing, loading animation, footer year display, and navbar menu highlighting. |
suit/ Vendor of django-suit scripts. Only *.min.js are used.
New Admin Setup
Admin Responsibility
Server Environment
Overview
Linux
Python