Skip to content

Commit

Permalink
Merge pull request #15 from danleedham/mobile-site
Browse files Browse the repository at this point in the history
Made application more mobile friendly
  • Loading branch information
danleedham authored Oct 1, 2017
2 parents b934999 + 9b3f32d commit 36b58ed
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 28 deletions.
26 changes: 22 additions & 4 deletions src/css/bootcards-desktop.min.css
Original file line number Diff line number Diff line change
Expand Up @@ -561,15 +561,33 @@ a.list-group-item.bootcards-list-subheading.collapsed:before {
.modal-dialog.modal-sm {
margin: 15px
}
#list {
display: none;
}
.hidemobile {
display: none;
}
#navbar {
display: none;
}
}
.membersearch-options {
padding-bottom: 6px !important;
}

.questions-options {
padding-top: 6px !important;
}

body {
padding-top: 4px !important;
margin-top: 0px !important;
margin-left: 0px !important;
margin-right: 0px !important;
margin-bottom: 0px !important;
}

.panel-body {
padding-top: 2px !important;
padding-bottom: 2px !important;
}

}
@media (min-width: 768px) {
.modal-dialog.modal-sm {
Expand Down
6 changes: 3 additions & 3 deletions src/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
<div class="panel-body">
<div class="row">
<div class="col-xs-6 col-sm-4">
<a class="bootcards-summary-item" href="stacker.php">
<a class="bootcards-summary-item" href="search.php">
<img src="favicons/android-chrome-192x192.png" height="64" width="64">
<h4>Stacker <span class="label label-info">650</span></h4>
<h4>Member Search <span class="label label-info">650</span></h4>
</a>
</div>
<div class="col-xs-6 col-sm-4">
<a class="bootcards-summary-item" href="qs.php">
<img src="favicons/android-chrome-192x192.png" height="64" width="64">
<h4>Questions <span class="label label-danger"><?php echo date("Y-m-d");?></span></h4>
<h4>Question Stacker <span class="label label-danger"><?php echo date("Y-m-d");?></span></h4>
</a>
</div>
<div class="col-xs-6 col-sm-4">
Expand Down
18 changes: 8 additions & 10 deletions src/qs.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function togglemenu(){
}
function togglemobilelist(){
var list = document.getElementById("list");
list.style.display = list.style.display === 'block' ? '' : 'block';
list.style.display = list.style.display === 'none' ? 'block' : 'none';
}

document.onkeydown = checkKey;
Expand Down Expand Up @@ -163,22 +163,20 @@ function checkKey(e) {
<div class="container-fluid bootcards-container push-right">
<div class="row">
<!-- Mobile Menu -->
<div class="col-sm-4 bootcards-list" id="mobilemenu" data-title="Mobile Menu">
<div class="panel panel-default">
<div class="panel-body">
<a href="#" onclick="togglemobilelist();return false;" class="btn btn-warning" role="button">
Toggle List</a>
</div><!--panel body-->
</div><!--panel-->
</div><!--list-->
<div class="panel-body" id="mobilemenu">
<a href="#" onclick="togglemobilelist();return false;" class="btn btn-warning" role="button">
Toggle List</a>
</div><!--panel body-->
<!-- left list column -->
<div class="col-sm-4 bootcards-list" id="list" data-title="Contacts">
<div class="panel panel-default">
<div class="panel-body">
<div class="search-form" id="menu">
<div class="form-inline">
<input id="date-input" type="date" class="input-sm form-control" onchange="loaddepts(this.value)" value="<?php echo $date ?>" name="date" >
<input id="photos-input" style="float:right !important;" type="checkbox" value="screenshot" name="photos" data-toggle="toggle" data-onstyle="danger" data-offstyle="success" data-on="ScreenShot" data-off="Stock">
<div class="questions-options"">
<input id="photos-input" style="float:right !important;" type="checkbox" value="screenshot" name="photos" data-toggle="toggle" data-onstyle="danger" data-offstyle="success" data-on="ScreenShot" data-off="Stock">
</div>
</div>
<div class="form-inline" style="padding-top:6px !important;">
<label for="dept-input">Department:</label><br />
Expand Down
25 changes: 18 additions & 7 deletions src/stacker.php → src/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ function load(id){
$('.active').removeClass('active');
$('#m'+id).addClass("active");
}

function togglemobilelist(){
var list = document.getElementById("list");
list.style.display = list.style.display === 'none' ? 'block' : 'none';
}
</script>

</head>
Expand All @@ -88,7 +93,13 @@ function load(id){
<div class="container-fluid bootcards-container push-right">

<div class="row">

<!--panel body-->
<div id="mobilemenu">
<div class="panel-body">
<a href="#" onclick="togglemobilelist();return false;" class="btn btn-warning" role="button">
Toggle Search</a>
</div><!--panel body-->
</div><!--panel-->
<!-- left list column -->
<div class="col-sm-4 bootcards-list" id="list" data-title="Contacts">
<div class="panel panel-default">
Expand All @@ -100,25 +111,25 @@ function load(id){
</div>

</div>
<div class="col-sm-3" style="padding-left: 2px !important; padding-right: 2px !important;">
<div class="col-sm-3 membersearch-options" style="padding-left: 2px !important; padding-right: 2px !important;">
<span id="loader" style="display:none;">
<i class="fa fa-refresh fa-spin" class="pull-right" style="font-size:20px"></i>
</span>
<div id="chooseposition-button">
<input id="chooseposition" type="checkbox" value="position" name="house" data-toggle="toggle" data-onstyle="danger" data-offstyle="info" data-on="Position" data-off="Name">
</div>
</div>
<div class="col-sm-4 input-toggle">
<div class="col-sm-4 membersearch-options input-toggle">
<input id="choosehouse" type="checkbox" value="Lords" name="house" data-toggle="toggle" data-onstyle="danger" data-offstyle="success" data-on="Lords" data-off="Commons">
</div>
<div class="col-sm-4 input-toggle">
<div class="col-sm-4 membersearch-options input-toggle">
<input id="searchby" type="checkbox" value="constituency" name="searchby" data-toggle="toggle" data-onstyle="warning" data-offstyle="primary" data-on="Constit" data-off="Name">
</div>
<div class="col-sm-4 input-toggle" >
<div class="col-sm-4 membersearch-options input-toggle" >
<input id="photos" type="checkbox" value="screenshot" name="photos" data-toggle="toggle" data-onstyle="warning" data-offstyle="primary" data-on="ScreenShot" data-off="Stock">
</div>
</div>
</div><!--panel body-->
</div>
</div>

<div class="list-group" id="livesearchmember">

Expand Down
2 changes: 1 addition & 1 deletion src/template/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div id="navbar" class="navbar navbar-default navbar-fixed-bottom">
<div class="bootcards-desktop-footer clearfix">
<div class="btn-group">
<a href="stacker.php" class="btn btn-default <?php if ($_SERVER['REQUEST_URI'] === "/stacker.php") { echo 'active'; } ?>">
<a href="search.php" class="btn btn-default <?php if ($_SERVER['REQUEST_URI'] === "/search.php") { echo 'active'; } ?>">
<i class="fa fa-2x fa-font"></i>Member Picker
</a>
<a href="qs.php" class="btn btn-default <?php if ($_SERVER['REQUEST_URI'] === "/qs.php") { echo 'active'; } ?>">
Expand Down
6 changes: 3 additions & 3 deletions src/who.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@ function loadresults(){
function hidejobs(){
elements = document.getElementsByClassName("joblist");
for (var i = 0; i < elements.length; i++) {
elements[i].style.display = elements[i].style.display == 'block' ? 'none' : 'block';
elements[i].style.display = elements[i].style.display == 'none' ? 'block' : 'none';
}
}
function hideconst(){
elements = document.getElementsByClassName("constituency");
for (var i = 0; i < elements.length; i++) {
elements[i].style.display = elements[i].style.display == 'block' ? 'none' : 'block';
elements[i].style.display = elements[i].style.display == 'none' ? 'block' : 'none';
}
}
function hideparty(){
elements = document.getElementsByClassName("party");
for (var i = 0; i < elements.length; i++) {
elements[i].style.display = elements[i].style.display == 'block' ? 'none' : 'block';
elements[i].style.display = elements[i].style.display == 'none' ? 'block' : 'none';
}
}
</script>
Expand Down

0 comments on commit 36b58ed

Please sign in to comment.