Skip to content

Commit

Permalink
CSS styles and some website layout re-working. Login box fixes.
Browse files Browse the repository at this point in the history
modified:   app/assets/javascripts/angular/controllers/login.js
modified:   app/assets/javascripts/app.js
-- added login box close functionality
modified:   app/assets/stylesheets/_base.css.scss
modified:   app/assets/stylesheets/_layout.css.scss
modified:   app/assets/stylesheets/_login_control.css.scss
modified:   app/assets/stylesheets/_projects.css.scss
modified:   app/assets/templates/error_404.html
-- tiny change to add some (kind of) decent content.

modified:   app/assets/templates/projects_index.html
-- changes for styling

modified:   app/views/layouts/application.html.erb
-- changed layout to get sticky footer to work
  • Loading branch information
Mark Cottman-Fields committed Dec 18, 2012
1 parent c4e03db commit ee74ae1
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 59 deletions.
3 changes: 1 addition & 2 deletions app/assets/javascripts/angular/controllers/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ function LoginCtrl($scope, $http, $location, authService, AuthenticationProvider
};

$scope.cancelLogin = function(){
$location.path('/');
$scope.$emit('event:auth-loginCancelled');
$location.path('/')
};


$scope.displayName = "";
$scope.email = "";

Expand Down
3 changes: 2 additions & 1 deletion app/assets/javascripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ var bawApp = (function (undefined) {
var detailsPath = path + "/" + id;
var asset = "/assets/" + resourceName + "_index.html";
var assetDetails = "/assets/" + singularResourceName + "_details.html";
var assetManage = "/assets/" + resourceName + "_manager.html";

return this
// many
.when(path, {templateUrl: asset, controller: controllerMany})
// manage
.fluidIf(addManageView, function () {
this.when(path + "/manage", {templateUrl: asset.replace("index.html", "manager.html"), controller: controllerMany})
this.when(path + "/manage", {templateUrl: assetManage, controller: controllerMany})
})
// details
.when(detailsPath, {templateUrl: assetDetails, controller: controllerOne})
Expand Down
7 changes: 7 additions & 0 deletions app/assets/stylesheets/_base.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ $standard-border-radius: 6px;

$standard-glow-alpha: 0.2;

/*
*
* Specific styles
*
*/
$footer-height: 40px;

/*
*
* Functions
Expand Down
74 changes: 48 additions & 26 deletions app/assets/stylesheets/_layout.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@
*/

* {
margin: 0;
padding: 0;
color: nth($master-dark, 1);
margin: 0;
padding: 0;
color: nth($master-dark, 1);
}

html, body {
height:100%;
}

a {
Expand Down Expand Up @@ -69,7 +73,7 @@ img {
}

html {
height: 100%;
height: 100%;
}

label {
Expand All @@ -91,7 +95,7 @@ li {
}

p {
margin: 0 0 18px;
margin: 0 0 18px;
}

pre {
Expand Down Expand Up @@ -137,13 +141,6 @@ button {
margin: 2px;
}

/*
*
* Specific styles
*
*/
$footer-height: 40px;

/* Header
-----------------------------------------------------------------------------*/
header {
Expand Down Expand Up @@ -179,11 +176,14 @@ header {
#page-wrapper {
width: 100%;
min-width: 768px;
min-height: 100%;
height: auto !important;
//height: auto !important;
//height: 100%;
position: relative;
//top: -5px;

/* for sticky footer */
min-height: 100%;
/* end for sticky footer */
}

#content-wrapper{
Expand All @@ -193,6 +193,11 @@ header {
margin-bottom: $footer-height;

padding-top: 15px;

/* for sticky footer */
overflow:auto;
padding-bottom: $footer-height;
/* end for sticky footer */
}

#content {
Expand All @@ -202,19 +207,36 @@ header {
/* Footer
-----------------------------------------------------------------------------*/
footer {
margin: 0;
min-width: 768px;
height: $footer-height;
background: nth($master-highlight-2, 2);

border-top:2px solid nth($master-highlight,1);
ul{
list-style-type:none;
li {
float:left;
margin: 0 15px 0 0;
}
margin: 0;
min-width: 768px;

background: nth($master-highlight-2, 2);
border-top:2px solid nth($master-highlight,1);

/* for sticky footer */
/* from: http://www.cssstickyfooter.com/using-sticky-footer-code.html */
position:relative;
margin-top:-($footer-height + 42);
height: $footer-height;
clear:both;
/* end for sticky footer */

ul{
list-style-type:none;
li {
float:left;
margin: 0 15px 0 0;
}
}
}

/* stick footer Opera Fix */
body:before {
content:"";
height:100%;
float:left;
width:0;
margin-top:-32767px;
}

/* General Classes
Expand Down
4 changes: 2 additions & 2 deletions app/assets/stylesheets/_login_control.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ body.waiting-for-angular div#initializing-panel {
display: none;

position: absolute;
top: 0;
top: 62px;
left: 0;
margin-bottom: $footer-height;

width: 100%;
height: 100%;
z-index: 1000;
padding-bottom: 5px;

}
#loginbox {
margin: 50px auto 0 auto;
Expand Down
29 changes: 23 additions & 6 deletions app/assets/stylesheets/_projects.css.scss
Original file line number Diff line number Diff line change
@@ -1,30 +1,47 @@
@import "base.css.scss";

#project-list {
list-style-type: none;


& li{


& div{
float:left;
margin: 5px;
@extend .rounded-corners;
border-color: nth($primary-color, 2);
background-color: nth($master-background, 2);
display:block;
width:400px;
height:180px;

& div.project-text{
vertical-align: top;
display: inline-block;
padding: $standard-padding;
width: 180px;
float:left;
}

& div.project-image {
width:150px;
height:150px;
float:left;
}

& img{
padding: $standard-padding;

display: inline-block;
}
}

}

.tile-image {
max-height: 200px;
max-width: 200px;
max-height: 150px;
max-width: 150px;
margin-left: auto;
margin-right: auto;
display:block;
}

.thumb-image {
Expand Down
5 changes: 4 additions & 1 deletion app/assets/templates/error_404.html
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
not found
<div id="content">
<h2>Not Found</h2>
<p>The page you requested could not be found.</p>
</div>
20 changes: 11 additions & 9 deletions app/assets/templates/projects_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ <h2>Projects</h2>

<ul id="project-list">
<li ng-repeat="project in projects">
<div>
<h3><a ng-href="/projects/{{project.id}}" title="urn: {{project.urn}}">{{project.name}}</a></h3>
<p ng-bind="project.description" ></p>
<small>{{project.updated_at}}</small>
<p ng-bind="project.sites.length" ></p>

</div>

<img class="tile-image" ng-src="{{project.photos[0].uri}}" >
<div class="project-text">
<h3><a ng-href="/projects/{{project.id}}" title="urn: {{project.urn}}">{{project.name}}</a></h3>
<p ng-bind="project.description" ></p>
<small>{{project.updated_at}}</small>
<small>{{project.created_at}}</small>
<small>{{project.creator_id}}</small>
<small ng-bind="project.sites.length" ></small>
</div>
<div class="project-image">
<img class="tile-image" ng-src="{{project.photos[0].uri}}" >
</div>
</li>

</ul>
Expand Down
32 changes: 20 additions & 12 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,37 @@
<script src="https://login.persona.org/include.js"></script>
<%= csrf_meta_tags %>
<%= yield(:head) %>

<!-- fot sticky footer -->
<!--[if !IE 7]>
<style type="text/css">
#wrap {display:table;height:100%}
</style>
<![endif]-->
</head>
<body baw-auth class="waiting-for-angular">

<%= "" #yield
%>
<header>
<div id="page-wrapper" >

<h1><a href="/">Bioacoustic Workbench</a></h1>
<ul>
<li><a href="/projects">Browse Projects</a></li>
<li><a href="/searches">Search</a></li>
<li><a href ng-click="$reloadView()">refresh</a></li>
<li ng-controller="LoginCtrl">
<header>

<h1><a href="/">Bioacoustic Workbench</a></h1>
<ul>
<li><a href="/projects">Browse Projects</a></li>
<li><a href="/searches">Search Recordings</a></li>
<li><a href ng-click="$reloadView()">refresh</a></li>
<li ng-controller="LoginCtrl">
<span ng-show="loggedIn">
Welcome <a href="/user/{{userData.user_id}}" ng-bind="friendly_name" title="{{email}}"></a>&nbsp;&nbsp;<a href ng-click="logout()">Sign Out</a>
Welcome <a href="/user/{{userData.user_id}}" title="{{friendly_name}}: {{email}}">{{email}}</a>&nbsp;&nbsp;<a href ng-click="logout()">Sign Out</a>
</span>
<span ng-hide="loggedIn">
<a href ng-click="login()">Sign In</a>
</span>
</li>
</ul>
</header>
<div id="page-wrapper" >
</li>
</ul>
</header>

<div id="login-holder">
<div id="loginbox">
Expand Down

0 comments on commit ee74ae1

Please sign in to comment.