Skip to content

Commit

Permalink
Login Layout Added.
Browse files Browse the repository at this point in the history
  • Loading branch information
tarballz committed Nov 14, 2016
1 parent d9d2b6c commit 591163c
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 2 deletions.
2 changes: 1 addition & 1 deletion views/default/user.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{extend 'layout.html'}}
{{extend 'layout_login.html'}}
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8 main">
Expand Down
12 changes: 11 additions & 1 deletion views/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,18 @@
<!--[if lt IE 9]>
<script src="{{=URL('static','js/respond-1.4.2.min.js')}}"></script>
<![endif]-->

<script src="{{=URL('static', 'js/vue.js')}}"></script>
<script>
var people_url = "{{=URL('api', 'get_people')}}";
var do_search_url = "{{=URL('api', 'do_search')}}";
var like_image_url = "{{=URL('api', 'like_image', user_signature=False)}}";
var unlike_image_url = "{{=URL('api', 'unlike_image', user_signature=False)}}";
var toggle_like_url = "{{=URL('api', 'toggle_like', user_signature=False)}}";
var current_user = "{{=auth.user.username if auth.user_id else None}}";
console.log("Current user is " + current_user);

</script>


<!-- Favicons -->
{{include 'web2py_ajax.html'}} <!-- this includes jquery.js, calendar.js/.css and web2py.js -->
Expand Down
172 changes: 172 additions & 0 deletions views/layout_login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
<!DOCTYPE html>
<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js" lang="{{=T.accepted_language or 'en'}}"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<!-- www.phpied.com/conditional-comments-block-downloads/ -->
<!-- Always force latest IE rendering engine
(even in intranet) & Chrome Frame
Remove this if you use the .htaccess -->
<meta http-equiv="X-UA-Compatible" content="IE=edge{{=not request.is_local and ',chrome=1' or ''}}">
<!-- Mobile Viewport Fix
j.mp/mobileviewport & davidbcalhoun.com/2010/viewport-metatag
device-width: Occupy full width of the screen in its current orientation
initial-scale = 1.0 retains dimensions instead of zooming out if page height > device height
user-scalable = yes allows the user to zoom in -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{=response.title or request.application}}</title>
<!-- http://dev.w3.org/html5/markup/meta.name.html -->
<meta name="application-name" content="{{=request.application}}">
<!-- Speaking of Google, don't forget to set your site up:
http://google.com/webmasters -->
<meta name="google-site-verification" content="">
<!-- include stylesheets -->
<link rel="stylesheet" href="{{=URL('static','css/bootstrap.min.css')}}"/>
<link rel="stylesheet" href="{{=URL('static','css/web2py-bootstrap3.css')}}"/>
<link rel="stylesheet" href="{{=URL('static','css/myapp.css')}}"/>
<link rel="stylesheet" href="{{=URL('static', 'font-awesome-4.6.3/css/font-awesome.min.css')}}"/>

<link rel="shortcut icon" href="{{=URL('static','images/favicon.ico')}}" type="image/x-icon">
<link rel="apple-touch-icon" href="{{=URL('static','images/favicon.png')}}">
<!-- All JavaScript at the bottom, except for Modernizr which enables
HTML5 elements & feature detects -->
<script src="{{=URL('static','js/modernizr-2.8.3.min.js')}}"></script>
<!--[if lt IE 9]>
<script src="{{=URL('static','js/respond-1.4.2.min.js')}}"></script>
<![endif]-->
<script src="{{=URL('static', 'js/vue.js')}}"></script>
<script>
var people_url = "{{=URL('api', 'get_people')}}";
var do_search_url = "{{=URL('api', 'do_search')}}";
var like_image_url = "{{=URL('api', 'like_image', user_signature=False)}}";
var unlike_image_url = "{{=URL('api', 'unlike_image', user_signature=False)}}";
var toggle_like_url = "{{=URL('api', 'toggle_like', user_signature=False)}}";
var current_user = "{{=auth.user.username if auth.user_id else None}}";
console.log("Current user is " + current_user);

</script>


<!-- Favicons -->
{{include 'web2py_ajax.html'}} <!-- this includes jquery.js, calendar.js/.css and web2py.js -->
{{block head}}{{end}}
{{
# using sidebars need to know what sidebar you want to use
mc0 = 'col-md-12'
mc1 = 'col-md-9'
mc2 = 'col-md-6'
left_sidebar_enabled = globals().get('left_sidebar_enabled', False)
right_sidebar_enabled = globals().get('right_sidebar_enabled', False)
middle_column = {0: mc0, 1: mc1, 2: mc2}[
(left_sidebar_enabled and 1 or 0)+(right_sidebar_enabled and 1 or 0)]
}}
</head>
<body>
<!--[if lt IE 8]><p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p><![endif]-->
<div class="w2p_flash alert alert-dismissable">{{=response.flash or ''}}</div>
<!-- Masthead ===================================== -->
{{block header}}
{{end}}
<!-- Main ========================================= -->
<!-- Begin page content -->
<div class="container-fluid main-container">
<div class="{{=middle_column}}">
<div class="row display:none" id="vue-div">
<div class="col-md-2"></div>
<div class="col-md-8 main">
<div class="row">
<div class="heading">
<a href="{{=URL('default','index')}}">
<img width="100" height="100" src="{{=URL('static', 'images/ico.png')}}"/>
</a>
</div>

<div style="background-color: #e0dbe2">
<table>
<tr>
<td>
<a href="{{=URL('default','profile')}}" class="btn btn-primary">
<i class="fa fa-user" aria-hidden="true"></i> Profile
</a>
</td>
<td>
<a href="{{=URL('default','upload')}}" class="btn btn-info">
<i class="fa fa-upload" aria-hidden="true"></i> Upload
</a>
</td>
<td>
<button class="btn btn-warning" v-on:click="search_button()">
<i class="fa fa-search" aria-hidden="true"></i> Search
</button>
</td>
<td>
<a href="{{=URL('default','user', args=['logout'])}}" class="btn btn-danger">
<i class="fa fa-sign-out" aria-hidden="true"></i> Logout
</a>
</td>
</tr>
</table>
</div>
<div v-if="is_searching" id="search-div">
<!-- do_search() effectively does nothing rn -->
<form action="#" v-on:submit.prevent="do_search(form_search_content); results_button();" class="form-horizontal" enctype="multipart/form-data" method="post">

<div class="form-group col-xs-10" id="table_post_content__row">
<div>
<input class="form-control string" id="table_search_content" name="search_content" v-model="form_search_content" placeholder="ayyy lmao"/>
<span class="help-block"></span>
</div>
</div>
<div class="form-group col-xs-2" id="submit_record__row">
<input class="btn btn-success" id="search_submit" type="submit" value="Go!" />
</div>
</form>
</div>

</div><!-- end "row" -->

<div v-if="search_results && valid_q(form_search_content)">
<table class="table table-striped">
<tr>
<th>Username</th>
<th>First Name</th>
</tr>
<tr v-for="person in people" v-if="person.username.indexOf(form_search_content)!=-1" class="post_list">
<td>
<a v-on:click="goto_profile(person.username)" href="#">${person.username}</a>
</td>
<td>
${person.first_name}
</td>
</tr>
</table>
</div>

{{block center}}
{{include}}
{{end}}

<div class="col-md-2"></div>
</div>
</div>
</div>
</div>

<!-- The javascript =============================== -->
<script src="{{=URL('static','js/bootstrap.min.js')}}"></script>
<script src="{{=URL('static','js/web2py-bootstrap3.js')}}"></script>
<script src="{{=URL('static', 'js/default.js')}}"></script>
{{block page_js}}{{end page_js}}
{{if response.google_analytics_id:}}
<!-- Analytics ==================================== -->
<script src="{{=URL('static','js/analytics.min.js')}}"></script>
<script type="text/javascript">
analytics.initialize({
'Google Analytics':{trackingId:'{{=response.google_analytics_id}}'}
});
</script>
{{pass}}
<!-- Share ============================y============ -->
<script src="{{=URL('static','js/share.js',vars=dict(static=URL('static','images')))}}"></script>
</body>

</html>

0 comments on commit 591163c

Please sign in to comment.