Footer for frontend and report errors link.

This commit is contained in:
baldo 2016-06-26 22:00:58 +02:00
parent 124f330895
commit fa2a047370
10 changed files with 128 additions and 14 deletions

View file

@ -45,8 +45,13 @@ angular.module('ffffngAdmin').config(function(NgAdminConfigurationProvider, Rest
'</a>' + '</a>' +
'</div>' + '</div>' +
'<p class="navbar-text navbar-right">' + '<p class="navbar-text navbar-right">' +
'<a href="https://github.com/freifunkhamburg/ffffng/issues" target="_blank">' +
'<i class="fa fa-bug" aria-hidden="true"></i> Report Error' +
'</a>' +
'</p>' +
'<p class="navbar-text navbar-right">' +
'<a href="https://github.com/freifunkhamburg/ffffng" target="_blank">' + '<a href="https://github.com/freifunkhamburg/ffffng" target="_blank">' +
'<i class="fa fa-github" aria-hidden="true"></i> Source Code' + '<i class="fa fa-code" aria-hidden="true"></i> Source Code' +
'</a>' + '</a>' +
'</p>' + '</p>' +
'<p class="navbar-text navbar-right">' + '<p class="navbar-text navbar-right">' +

View file

@ -4,7 +4,7 @@ angular.module('ffffngAdmin')
.directive('faVersion', function ($http, $state, notification) { .directive('faVersion', function ($http, $state, notification) {
var link = function (scope) { var link = function (scope) {
scope.version = '?'; scope.version = '?';
$http.get('/internal/api/version') $http.get('/api/version')
.then(function (result) { scope.version = result.data.version; }) .then(function (result) { scope.version = result.data.version; })
.catch(function (e) { .catch(function (e) {
notification.log('Error: ' + e.data, { addnCls: 'humane-flatty-error' }); notification.log('Error: ' + e.data, { addnCls: 'humane-flatty-error' });

View file

@ -20,7 +20,10 @@
<body ng-app="ffffng"> <body ng-app="ffffng">
<f-navbar></f-navbar> <f-navbar></f-navbar>
<div ng-view=""></div> <div class="wrapper">
<div class="main" ng-view=""></div>
<f-footer></f-footer>
</div>
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="bower_components/es5-shim/es5-shim.js"></script> <script src="bower_components/es5-shim/es5-shim.js"></script>
@ -58,6 +61,7 @@
<script src="scripts/directives/help.js"></script> <script src="scripts/directives/help.js"></script>
<script src="scripts/directives/navbar.js"></script> <script src="scripts/directives/navbar.js"></script>
<script src="scripts/directives/footer.js"></script>
<script src="scripts/directives/nodeForm.js"></script> <script src="scripts/directives/nodeForm.js"></script>
<script src="scripts/directives/nodeSaved.js"></script> <script src="scripts/directives/nodeSaved.js"></script>
<script src="scripts/directives/tokenForm.js"></script> <script src="scripts/directives/tokenForm.js"></script>

View file

@ -0,0 +1,16 @@
'use strict';
angular.module('ffffng')
.directive('fFooter', function ($http) {
var ctrl = function ($scope) {
$scope.version = '?';
$http.get('/api/version')
.then(function (result) { $scope.version = result.data.version; })
};
return {
'controller': ctrl,
'restrict': 'E',
'templateUrl': 'views/directives/footer.html'
};
});

View file

@ -8,6 +8,8 @@
@import "../bower_components/font-awesome/scss/font-awesome"; @import "../bower_components/font-awesome/scss/font-awesome";
@import "views/_main"; @import "views/_main";
@import "views/_navbar";
@import "views/_footer";
@import "views/_newNodeForm"; @import "views/_newNodeForm";
@import "views/_updateNodeForm"; @import "views/_updateNodeForm";
@import "views/_deleteNodeForm"; @import "views/_deleteNodeForm";
@ -20,8 +22,13 @@
@import "views/dialogs/_confirmDeletionDialog"; @import "views/dialogs/_confirmDeletionDialog";
@import "views/dialogs/_outsideOfCommunityDialog"; @import "views/dialogs/_outsideOfCommunityDialog";
html, body {
height: 100%;
margin: 0;
padding: 0;
}
body { body {
padding-bottom: 40px;
text-align: justify; text-align: justify;
} }
@ -40,14 +47,6 @@ button.cancel {
@extend .btn, .btn-default; @extend .btn, .btn-default;
} }
a[target="_blank"]:after {
@extend .fa;
content: "\f08e";
vertical-align: 0.3em;
font-size: 0.8em;
margin-left: 0.1em;
}
.has-error .help-block { .has-error .help-block {
color: $text-color; color: $text-color;
} }

View file

@ -0,0 +1,36 @@
.footer {
position: absolute;
bottom: 0;
width: 100%;
margin: 0;
padding: 0;
height: 30px;
line-height: 30px;
color: $gray-light;
background-color: $gray-dark;
text-align: center;
ul {
margin: 0;
}
.list-inline > li:first-child {
padding-left: 10px;
}
li {
padding: 0 10px;
}
a {
color: $gray-light;
&:hover, &:active, &:visited, &:focus {
text-decoration: none;
}
}
}

View file

@ -44,3 +44,31 @@
} }
} }
} }
.wrapper {
position: relative;
padding: {
top: 72px;
bottom: 30px;
}
min-height: 100%;
height: auto !important;
height: 100%;
width: 100%;
margin: 0 auto;
}
.main {
padding-bottom: 30px;
a[target="_blank"]:after {
@extend .fa;
content: "\f08e";
vertical-align: 0.3em;
font-size: 0.8em;
margin-left: 0.1em;
}
}

View file

@ -0,0 +1,9 @@
.navbar {
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: 1;
}

View file

@ -0,0 +1,17 @@
<footer class="footer">
<ul class="list-inline list-unstyled">
<li>
ffffng ({{version}})
</li>
<li>
<a href="https://github.com/freifunkhamburg/ffffng" target="_blank">
<i class="fa fa-code" aria-hidden="true"></i> Source Code
</a>
</li>
<li>
<a href="https://github.com/freifunkhamburg/ffffng/issues" target="_blank">
<i class="fa fa-bug" aria-hidden="true"></i> Fehler melden
</a>
</li>
</ul>
</footer>

View file

@ -13,6 +13,8 @@ angular.module('ffffng').factory('Router', function (
init: function () { init: function () {
app.post('/', FrontendResource.render); app.post('/', FrontendResource.render);
app.get('/api/version', VersionResource.get);
app.post('/api/node', NodeResource.create); app.post('/api/node', NodeResource.create);
app.put('/api/node/:token', NodeResource.update); app.put('/api/node/:token', NodeResource.update);
app.delete('/api/node/:token', NodeResource.delete); app.delete('/api/node/:token', NodeResource.delete);
@ -21,8 +23,6 @@ angular.module('ffffng').factory('Router', function (
app.put('/api/monitoring/confirm/:token', MonitoringResource.confirm); app.put('/api/monitoring/confirm/:token', MonitoringResource.confirm);
app.put('/api/monitoring/disable/:token', MonitoringResource.disable); app.put('/api/monitoring/disable/:token', MonitoringResource.disable);
app.get('/internal/api/version', VersionResource.get);
app.get('/internal/api/tasks', TaskResource.getAll); app.get('/internal/api/tasks', TaskResource.getAll);
app.put('/internal/api/tasks/run/:id', TaskResource.run); app.put('/internal/api/tasks/run/:id', TaskResource.run);
app.put('/internal/api/tasks/enable/:id', TaskResource.enable); app.put('/internal/api/tasks/enable/:id', TaskResource.enable);