Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

Commit

Permalink
Data dashboard tweaks (#272)
Browse files Browse the repository at this point in the history
* provide async response to presence of taxon

* async response fix

* acess control header

* DWC and fix error increment

* remove broken grav thing

* tentative #271

* fix #250

* bump version

* rename via #224

* assets for #224

* tentative #224

* Fix #224

* tentative #273

* Fix #273

* version bump
  • Loading branch information
tigerhawkvok authored Aug 17, 2017
1 parent 083b451 commit 4184013
Show file tree
Hide file tree
Showing 20 changed files with 364 additions and 301 deletions.
6 changes: 3 additions & 3 deletions api.php
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ function getChartData($chartDataParams)
} else {
$where = "where " . $tested;
}
$stringDisease = "for B. d.";
$stringDisease = "for Bd";
break;
case "bsal":
$tested = "`diseasetested` = 'Bsal' AND `genus` IS NOT NULL";
Expand All @@ -1120,10 +1120,10 @@ function getChartData($chartDataParams)
} else {
$where = "where " . $tested;
}
$stringDisease = "for B. sal.";
$stringDisease = "for Bsal";
break;
default:
$stringDisease = "for B. d. and B. sal.";
$stringDisease = "for Bd and Bsal";
if (empty($ignoreSp)) {
$ignoreSp = " WHERE `genus` IS NOT NULL";
} else {
Expand Down
Binary file added assets/aweb_b+w-alpha.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/aweb_b+w-alpha512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/aweb_b+w.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "BD Web Tracker",
"version": "0.13.3",
"version": "0.13.9",
"homepage": "https://amphibiandisease.org/",
"authors": [
"Philip Kahn <[email protected]>"
Expand Down
3 changes: 2 additions & 1 deletion coffee/dashboard.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,9 @@ fetchMiniTaxonBlurb = (taxonResult, targetSelector, isGenus = false) ->
canvas.setAttribute "id", canvasId
canvasContainerId = "#{canvasId}-container"
chartContainer = $(targetSelector).find("#taxon-blurb-#{idTaxon}").find(".charts-container").get(0)
extraClasses = if window.noDefaultRender is true then "col-xs-6 col-md-4 col-lg-3 " else ""
containerHtml = """
<div id="#{canvasContainerId}" class="col-xs-6 col-md-4 col-lg-3 taxon-chart">
<div id="#{canvasContainerId}" class="#{extraClasses}taxon-chart">
</div>
"""
$(chartContainer).append containerHtml
Expand Down
11 changes: 10 additions & 1 deletion css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -10180,7 +10180,16 @@ paper-icon-button.shift-down {
.bs-callout p:last-child {
margin-bottom: 0;
}
copyright-statement {
footer img.footer-logo {
display: inline-block;
height: 40px;
}
@media (max-width: 767px) {
footer img.footer-logo {
display: none !important;
}
}
footer copyright-statement {
position: relative;
top: 1rem;
}
Expand Down
2 changes: 1 addition & 1 deletion css/main.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/main.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/main.min.css.map

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions dashboard.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
header('Access-Control-Allow-Origin: *');
$print_login_state = false;
require_once 'DB_CONFIG.php';
require_once dirname(__FILE__).'/core/core.php';
Expand Down Expand Up @@ -36,6 +37,8 @@
# Check the status for any async flags we may want
if (toBool($_REQUEST["async"]) === true) {
# Now we can do any feedbacks needed
# Public API
header('Access-Control-Allow-Origin: *');
switch ($_REQUEST["action"]) {
case "country_taxon":
# Get the taxa in a given country
Expand Down Expand Up @@ -95,6 +98,41 @@
"data" => $localeTaxonData,
));
break;
case "taxon_exists":
$db->setTable("records_list");
$taxonStringParts = explode(" ", deEscape($_REQUEST["taxon"]));
$genus = $db->sanitize(strtolower($taxonStringParts[0]));
$species = $db->sanitize(strtolower($taxonStringParts[1]));
$query = "SELECT count(*) AS count FROM `".$db->getTable()."` AS records $authorizedIntersect records.project_id WHERE lower(`genus`) = '$genus'";
if (!empty($species)) {
$query .= " AND lower(`specificepithet`) = '$species'";
}
$r = mysqli_query($db->getLink(), $query);
if ($r === false) {
returnAjax(array(
"status" => false,
"error" => "DATABASE_ERROR_2",
// "query" => $query,
// "dberr" => mysqli_error($db->getLink()),
));
}
$row = mysqli_fetch_row($r);
$response = array(
"status" => true,
"exists" => $row[0] > 0,
"taxon" => array(
"provided" => deEscape($_REQUEST["taxon"]),
"interpreted" => array(
"genus" => $genus,
"species" => $species,
"dwc" => array(
"genus" => $genus,
"specificepithet" => $species,
),
),
));
returnAjax($response);
break;
case "locale_taxon":
default:
returnAjax(array(
Expand Down
3 changes: 2 additions & 1 deletion footer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<footer class="row">
<div class="col-md-6 col-xs-12">
<img src="assets/aweb_b+w-alpha512.png" class="footer-logo" />
<copyright-statement copyrightStart="2015">AmphibiaWeb&#39;s Amphibian Disease Portal</copyright-statement>
</div>
<div class="col-md-1 col-xs-3">
Expand All @@ -21,6 +22,6 @@
</footer>
<?php

include_once("./analyticsTracking.php");
include_once("./analyticsTracking.php");

?>
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
<br/><br/>
<div class="row">
<div class="card-container col-xs-12 col-md-6 col-lg-3">
<paper-card heading="Get Involved" class="card-tile" elevation="2" animated-shadow>
<paper-card heading="How to Use" class="card-tile" elevation="2" animated-shadow>
<div class="card-content">
<p>
Learn the user workflow for the site
Expand Down
5 changes: 3 additions & 2 deletions js/dashboard.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dashboard.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dashboard.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/maps/dashboard.js.map

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions less/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,17 @@ paper-icon-button.shift-down {
margin-bottom: 0;
}

copyright-statement {
position: relative;
top: 1rem;

footer {
img.footer-logo {
display: inline-block;
height: 40px; // like paper-icon-button
.hidden-xs;
}
copyright-statement {
position: relative;
top: 1rem;
}
}

.code {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amphibian-disease-tracker",
"version": "0.13.3",
"version": "0.13.9",
"description": "Amphibian Disease Tracker Portal",
"main": "",
"scripts": {
Expand Down
Loading

0 comments on commit 4184013

Please sign in to comment.