Commit 1234d17a authored by Dominik Rosiek's avatar Dominik Rosiek

Merge branch 'master' of gitlab.telemabk.pl:jifwin/CTF

parents b599a7b5 cbe5da43
<div style="text-align:center"> <div style="position: absolute; bottom: 5%;">
KrakYournet 7 coś tam elo EESTEC fajnie <img style="max-height:40px" src="/statics/img/telephoners_small.png" /> + <img style="max-height:40px" src="/statics/img/eestec_small.png" /> = <i class="fa fa-heart"></i>
</div> </div>
<div style="text-align:center;width:100%">made with <i class="fa fa-heart"></i> by <a
href="http://telephoners.agh.edu.pl" id="telephoners"><img
src="/statics/img/logo_telephoners.svg"></a></div>
\ No newline at end of file
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
<div class="form-group"> <div class="form-group">
<label for="username">Username</label> <label for="username">Username</label>
<i class="fa fa-key"></i> <i class="fa fa-key"></i>
<input type="text" name="username" id="username" class="form-control" ng-model="username" required /> <input type="text" name="username" id="username" class="form-control" autocomplete="off" ng-model="username" required />
<span ng-show="form.username.$dirty && form.username.$error.required" class="help-block">Username is required</span> <span ng-show="form.username.$dirty && form.username.$error.required" class="help-block">Username is required</span>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="password">Password</label> <label for="password">Password</label>
<i class="fa fa-lock"></i> <i class="fa fa-lock"></i>
<input type="password" name="password" id="password" class="form-control" ng-model="password" required /> <input type="password" name="password" id="password" class="form-control" ng-model="password" autocomplete="off" required />
<span ng-show="form.password.$dirty && form.password.$error.required" class="help-block">Password is required</span> <span ng-show="form.password.$dirty && form.password.$error.required" class="help-block">Password is required</span>
</div> </div>
<div class="form-actions"> <div class="form-actions">
......
...@@ -9,13 +9,17 @@ ...@@ -9,13 +9,17 @@
$scope.task = data; $scope.task = data;
}); });
$scope.submitFlag = function(){ $scope.submitFlag = function(){
var flag = $('input#flag-to-submit').val(); var $flag = $('input#flag-to-submit');
$scope.submitUnknown = true; $scope.submitUnknown = true;
APIProvider.submitFlag($stateParams.taskLevel, flag).success(function(){ APIProvider.submitFlag($stateParams.taskLevel, $flag.val()).success(function(data){
Materialize.toast('Poprawna flaga! :)', 5000, 'toast-success'); Materialize.toast('Poprawna flaga! :)', 5000, 'toast-success');
if (!$scope.task.completedFlags){
$scope.task.completedFlags = [];
}
$scope.task.completedFlags.push(data.description);
$scope.submitUnknown = false; $scope.submitUnknown = false;
$flag.val('');
}).error(function(){ }).error(function(){
// console.log("Flaga zla!");
Materialize.toast('Błędna flaga! :(', 5000 ,'toast-error'); Materialize.toast('Błędna flaga! :(', 5000 ,'toast-error');
$scope.submitUnknown = false; $scope.submitUnknown = false;
}); });
......
...@@ -82,7 +82,16 @@ ...@@ -82,7 +82,16 @@
* @returns {HttpPromise} * @returns {HttpPromise}
*/ */
submitFlag: function(level, flag){ submitFlag: function(level, flag){
return $http.post(AppSettings.getApiAddress() + '/solutions/' + level, flag); return $http.post(AppSettings.getApiAddress() + '/solutions/' + level, flag).success(function(data){
$.each(tasks, function(task){
if (task.level == level){
if (!task.completedFlags){
task.completedFlags = [];
}
task.completedFlags.push(data.description);
}
});
}.bind(this));
} }
}; };
}]); }]);
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</div> </div>
<div class="circle-clipper right"> <div class="circle-clipper right">
<div class="circle"></div> <div class="circle"></div>
</div>c </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