Commit f40fda3f authored by Antek Grzanka's avatar Antek Grzanka

Pages for tasks. Changed the background.

parent 20220c97
...@@ -7,6 +7,11 @@ nav { ...@@ -7,6 +7,11 @@ nav {
background: none; background: none;
line-height: 120px; line-height: 120px;
height: 120px; height: 120px;
box-shadow: none;
}
p {
color:white;
} }
.typed-cursor{ .typed-cursor{
...@@ -49,4 +54,27 @@ nav { ...@@ -49,4 +54,27 @@ nav {
#telephoners img { #telephoners img {
max-width: 100px; max-width: 100px;
}
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: local('Material Icons'), local('MaterialIcons-Regular'), url(https://fonts.gstatic.com/s/materialicons/v12/2fcrYFNaTjcS6g4U3t-Y5ZjZjT5FdEJ140U2DJYC3mY.woff2) format('woff2');
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
} }
\ No newline at end of file
...@@ -19,6 +19,11 @@ ...@@ -19,6 +19,11 @@
templateUrl: '/page/tasks.html' templateUrl: '/page/tasks.html'
}) })
.state('task', {
url: '/task/:taskLevel',
templateUrl: '/page/task.html'
})
.state('scores', { .state('scores', {
url: '/scores', url: '/scores',
templateUrl: '/page/scoresheet.html' templateUrl: '/page/scoresheet.html'
...@@ -32,13 +37,53 @@ ...@@ -32,13 +37,53 @@
} }
}); });
app.controller('TasksController', ['$scope', '$http', 'AppSettings', function($scope, $http, AppSettings) { app.factory('APIProvider', ['$http', 'AppSettings', function($http, AppSettings){
var tasks, teams, scores;
var getTasks = function(callback){
$http.get(AppSettings.apiAddress + '/tasks').
success(function(data) {
tasks = data;
if (callback) callback(data);
});
};
var getScores = function(){};
var getTaskById = function(id, callback){
var result;
if (!tasks) {
getTasks(function(data){
result = getTaskById(id, callback)
});
}
else {
result = tasks.filter(function(task){
return task.level == id;
})[0];
}
callback(result);
};
return {
getScores: getScores,
getTasks: getTasks,
getTaskById: getTaskById
};
}]);
app.controller('TasksController', ['$scope', '$http', 'APIProvider', 'AppSettings', function($scope, $http, APIProvider, AppSettings) {
$scope.apiAddress = AppSettings.apiAddress; $scope.apiAddress = AppSettings.apiAddress;
$http.get(AppSettings.apiAddress + '/tasks'). APIProvider.getTasks(function(data){
success(function(data) { console.log(data);
console.log(data); $scope.tasks = data;
$scope.tasks = data; });
}); }]);
app.controller('TaskController', ['$scope', '$http', '$stateParams', 'APIProvider', 'AppSettings', function($scope, $http, $stateParams, APIProvider, AppSettings) {
$scope.apiAddress = AppSettings.apiAddress;
$scope.selectedTaskId = $stateParams.taskLevel;
console.log('SELECTED TASK ID', $scope.selectedTaskId);
APIProvider.getTaskById($scope.selectedTaskId, function(data){
console.log(data);
$scope.task = data;
});
}]); }]);
app.controller('ScoreboardController', ['$scope', '$http', 'AppSettings', function($scope, $http, AppSettings) { app.controller('ScoreboardController', ['$scope', '$http', 'AppSettings', function($scope, $http, AppSettings) {
......
<!DOCTYPE html> <div ng-controller="TaskController">
<html lang="en">
<head> <div class="row">
<meta charset="UTF-8"> <div class="s12">
<title></title> <a href="/page#/tasks" class="breadcrumb"><i class="fa fa-angle-left" style="margin-right:20px"></i> Powrót</a>
</head> <h1>{{task.name}}</h1>
<body> </div>
</div>
</body> <div class="row">
</html> <div class="col s12 m8">
\ No newline at end of file <h4><div class="row">
<div class="col s1"> <i class="fa fa-question"></i></div>
<div class="col s11">Opis</div>
</div></h4>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
</p>
<h4><div class="row">
<div class="col s1"> <i class="fa fa-flag"></i></div>
<div class="col s11">Flagi</div>
</div></h4>
<p>
Nie dodano żadnych flag.
</p>
</div>
<div class="col s12 m4" style="text-align:center">
<img src="http://lorempixel.com/400/300/" />
<a class="waves-effect waves-light btn"target="_blank" href="{{apiAddress}}/task/{{task.level}}">Otwórz stronę z zadaniem</a>
</div>
</div>
</div>
\ No newline at end of file
<div ng-controller="TasksController"> <div ng-controller="TasksController">
<div class="row"> <div class="row">
<div class="col s12 m6" ng-repeat="task in tasks"> <div class="col s12 m6" ng-repeat="task in tasks">
<div class="card blue-grey darken-1" > <div class="card blue-grey darken-1" >
<div class="card-content white-text"> <div class="card-content white-text">
<span class="card-title"> <span class="card-title">
<!--<div class="chip">--> <i ng-if="task.taskType === 'CRYPTO'" class="fa fa-key" alt="Zadanie kryptograficzne"></i>
<!--&lt;!&ndash;<img src="" alt="Contact Person">&ndash;&gt;--> <i ng-if="task.taskType === 'WEB'" class="fa fa-globe" alt="Zadanie webowe"></i>
<!--</div>--> {{task.name}}
{{task.name}}
</span> </span>
<p>Poziom {{task.level}}. Super zadanie.</p> <p>Poziom {{task.level}}. Super zadanie.</p>
</div> </div>
<div class="card-action"> <div class="card-action">
<a href="{{apiAddress}}/task/{{task.level}}">Go!</a></td>--> <a href="/page#/task/{{task.level}}">Przejdź do zadania</a></td>
</div> </div>
</div> </div>
</div> </div>
......
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