Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some UI updates #269

Merged
merged 5 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions app/plot_app/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,25 @@ body {
h1 {
margin: 2em 0 0 0;
color: #2e484c;
font-family: 'Titillium Web', sans-serif;
font-family: 'Play', sans-serif;
font-size: 23px;
font-weight: 700;
font-weight: 400;
text-transform: uppercase;
}
h1 img {
vertical-align: top;
}
h1 .name {
color: #444;
font-size: 26px;
color: #e3e3e3;
font-size: 32px;
text-transform: none;
padding-left: 3px;
padding-left: 8px;
padding-top: 15px;
display: inline-block;
}

.bg-blue {
background-color: #06465c !important;
}

/* bootstrap buttons */
Expand Down
Binary file modified app/plot_app/static/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions app/plot_app/static/js/upload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@

function restoreSetting(key) {
var value = localStorage.getItem(key);
if (value !== null) {
var field = $("#"+key)[0];
if (field.type == 'checkbox'){
field.checked = (value == 'true');
} else {
field.value = value;
}
console.log(key+', '+value);
}
}
function saveSetting(key) {
var field = $("#"+key)[0];
if (field.type == 'checkbox'){
var value = field.checked;
} else {
var value = field.value;
}
localStorage.setItem(key, value);
console.log(key+', '+value);
}

function saveSettings() {
saveSetting('email');
saveSetting('access');
}

function updateAccess() {
var access = document.getElementById('access').value;
var ids = ["flightreport", "personal"];
ids.forEach((value) => {
if (value == access) {
document.getElementById(value).style.display='table-row';
} else {
document.getElementById(value).style.display='none';
}
});
document.getElementById('public').value = access == "flightreport" ? "true" : "false";
}

function validateForm() {
var valid = true;
var error_html = "";
if (document.getElementById('access').value == "notset") {
error_html += "Access, "
valid = false;
}
var email = document.getElementById('email').value;
if (!email.includes("@") || email.length < 5) { // very simple check
error_html += "E-Mail, "
valid = false;
}
if (document.getElementById('file').value.length == 0) {
error_html += "Log File, "
valid = false;
}

// Report
if (!valid) {
error_html = "<div><font color='red'>Missing fields: " + error_html.substring(0, error_html.length - 2) + "</font></div";
}
document.getElementById('feedback').innerHTML = error_html;

if (valid) {
saveSettings();
}

return valid;
}


$(function() { // on startup
restoreSetting('email');
restoreSetting('access');
updateAccess();
});

4 changes: 2 additions & 2 deletions app/plot_app/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>Flight Review</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href='https://fonts.googleapis.com/css?family=Titillium+Web:700,400' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Play:400' rel='stylesheet' type='text/css'>
<link href='https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.3/chosen.css' rel='stylesheet' type='text/css'>
<link href="plot_app/static/css/bootstrap.min.css" rel="stylesheet">
<link href="plot_app/static/css/font-awesome.min.css" rel="stylesheet">
Expand All @@ -28,7 +28,7 @@
</head>
<body>

<nav id="header" class="navbar navbar-expand-lg navbar-light bg-light">
<nav id="header" class="navbar navbar-expand-lg navbar-dark bg-blue">
<div class="navbar-brand">
<h1>
<a href="http://px4.io">
Expand Down
Loading
Loading