modified: templates/register.html

parent 0808875c
osm-leaderboard
=====
Deploy this web application written in python-flask to organize OpenStreetMap Mapathon.
Deploy this web application written in python-flask to organize OpenStreetMap Mapathon. This application was primarily written for [FSFTN](https://fsftn.org) to organize one such [OSM mapathon](http://osm-leaderboard.fsftn.org).
Note: **Python 3.6** is required to run the `background_runner.py` file as it is written **asynchronously** using the Python's new famous standard library called `asyncio` and `aiohttp`. At the time of writing this document,
python3.6 has to be manually compiled from source code. Compiling python from source is not a daunting task, if you installed the dependent libraraies properly.
......@@ -63,8 +63,7 @@ Instead of running the `background_runner.py` manually, the program can be sched
Contributors
====
1. Prasanna Venkadesh (FSFTN)
2. Veeraghav Reddy (Swecha)
3. Srikanth Reddy Arika (Swecha)
License
===
......
......@@ -39,7 +39,8 @@ def handle_register():
dist = request.form.get('dist1')
college = request.form.get('college')
id = request.form.get('id')
phone = request.form.get('phone')
if (osm_display_name and user_email) is not None:
db_connection = sqlite3.connect('data.sqlite3')
db_cursor = db_connection.cursor()
......@@ -55,8 +56,8 @@ def handle_register():
# if the query result is None, then add user
try:
if row_set is None:
insert_query = "insert into leaderboard (display_name, user_email, last_update, college, id, dist) values ('{}', '{}', '{}', '{}', '{}', '{}')"
db_cursor.execute(insert_query.format(osm_display_name, user_email, EVENT_DATE, college, id, dist))
insert_query = "insert into leaderboard (display_name, user_email, last_update, college, id, dist, phone) values ('{}', '{}', '{}', '{}', '{}', '{}', '{}')"
db_cursor.execute(insert_query.format(osm_display_name, user_email, EVENT_DATE, college, id, dist, phone))
db_connection.commit()
message = "Registered. Thanks."
except sqlite3.IntegrityError as ie:
......
No preview for this file type
<html>
<head>
<title>Swecha Mapthon</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='https://fonts.googleapis.com/css?family=Alex Brush' rel='stylesheet'>
<style>
#img{
width:8%;
height:15%;
border-style:none;
border-radius:50%;
margin-left:5%;
margin-top:2%;
}
.text{
color:#6495ED;
font-size:1.8em;
text-align:center;
}
.btn{
margin-left:5%;
margin-top:8%;
border-style:none;
width:12%;
height:25%;
background-color:#1E90FF;
border-radius:50%;
font-size:30px;
float:left;
font-family:Alex Brush;
}
.btn:hover {
border-radius:90%;
}
.btn1{
font-family:Alex Brush;
margin-left:13%;
margin-top:8%;
border-style:none;
width:12%;
height:25%;
background-color:#1E90FF;
border-radius:50%;
font-size:30px;
float:left;
}
</style>
</head>
<body>
<div>
<img src="1.gif" id="img"/>
<img src="2.gif" id="img" style="float:right;margin-right:3%"/>
</div>
<div>
<center><p class="text"><i><span style="color:red">Welcome To</span> <span style="font-family:font-family:Alex Brush;">Swecha</span> <span style="color:red">Mapthon</span></i></p></center>
</div>
<br />
<div class="container">
<a href="http://127.0.0.1" >
<input class="btn" type="submit" value="Wiki"/>
</a>
<a href="http://172.17.0.2:8780" >
<input class="btn1" type="submit" value="Register"/>
</a>
<a href="http://172.17.0.2:8780/leaderboard" >
<input class="btn1" type="submit" value="Leaderboard"/>
</a>
<a href="http//">
<input class="btn1" type="submit" value="EVENT" />
</a>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Country, State, City - Dropdown list</title>
<style>
div {
display: inline-block;
}
</style>
</head>
<body>
<select class="countries">
</select>
<div class="option">
<select class="Africa">
</select>
<select class="Antarctica">
</select>
<select class="Asia">
</select>
<select class="Europe">
</select>
</div>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script>
<script src="js/index.js">
</script>
</body>
</html>
$(function () {
'use strict';
var CountSelect = $('.countries'),
myCountries = ['Africa', 'Antarctica', 'Asia', 'Europe'],
Africa = ['Algeria', 'Angola', 'Benin', 'Botswana', 'Burundi'],
Antarctica = ['Amundsen-Scott'],
Asia = ['Bangladesh', 'Bhutan', 'Brunei', 'Cambodia', 'China', 'East Timor', 'India'],
Europe = ['Albania', 'Andorra', 'Austria', 'Belarus', 'Belgium', 'Bosnia-Herzegovina', 'Bulgaria'];
// Function Create Option
function CreateOption(valriable, elementToAppend) {
var i;
for (i = 0; i < valriable.length; i += 1) {
$('<option>', {value: valriable[i], text: valriable[i], id: valriable[i]})
.appendTo(elementToAppend);
}
}
// Create Option myCountries
CreateOption(myCountries, $('.countries'));
// Create Option Africa
CreateOption(Africa, $('.Africa'));
// Create Option Africa
CreateOption(Antarctica, $('.Antarctica'));
// Create Option Africa
CreateOption(Asia, $('.Asia'));
// Create Option Africa
CreateOption(Europe, $('.Europe'));
// Hide All Select
$('.option select').hide();
// Show First Selected
$('.Africa').show().css('display', 'inline-block');
// Show List Option City Whene user Chosse Countries
CountSelect.on('change', function () {
// get Id option
var myId = $(this).find(':selected').attr('id');
console.log($(this).val());
// Show Select Has class = Id And Hide Siblings
$('.option select').filter('.' + myId).fadeIn(400).siblings('select').hide();
});
});
div {
display: inline-block;
}
This diff is collapsed.
......@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="static/css/skeleton.css">
</head>
</head>
<body>
<div class="container" style="margin-top: 10px">
<div>
......@@ -40,22 +40,14 @@
<input type="email" placeholder="Your Email Address"
name="email" id="email" required> <br/>
<input type="text" name="id" id="id" placeholder="Enter your college id" /><br />
<select name="dist1" id="dist1">
<option value="Guntur" name="district">Guntur</option>
</select>
<select name="college" id="college">
<option value="NIT" name="clg">NIT</option>
<option value="SWECHA" name="clg">SWECHA</option>
<select name="dist1" id="dist1">
<option value="Guntur" name="district">Guntur</option>
</select>
<select name="college" id="college">
<option value="NIT" name="clg">NIT</option>
<option name="clg" value="Swecha">SWECHA</option>
</select><br />
<input type="text" name="phone" id="phone" value="phone number" />
<br /> <input type="submit" class="button-primary"
value="Register">
</form>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment