Commit 6422ddc7 authored by Antek Grzanka's avatar Antek Grzanka

Showing short description of task.

parent b162112e
...@@ -3,6 +3,11 @@ ...@@ -3,6 +3,11 @@
$scope.apiAddress = AppSettings.getApiAddress(); $scope.apiAddress = AppSettings.getApiAddress();
APIProvider.getTasks(function(data){ APIProvider.getTasks(function(data){
// console.log(data); // console.log(data);
$.each(data, function(key){
data[key].short_description = data[key].description.split(" ").slice(0,6).join(" ").concat("...");
});
APIProvider.getMyCompletedLevelsList(function(completed){ APIProvider.getMyCompletedLevelsList(function(completed){
$.each(data, function(key, task){ $.each(data, function(key, task){
if (completed.indexOf(task.level) !== -1){ if (completed.indexOf(task.level) !== -1){
...@@ -13,7 +18,9 @@ ...@@ -13,7 +18,9 @@
} }
}); });
}); });
$scope.tasks = data; $scope.tasks = data;
}); });
}]); }]);
})(); })();
\ No newline at end of file
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<i ng-if="task.taskType === 'WEB'" class="fa fa-globe" alt="Zadanie webowe"></i> <i ng-if="task.taskType === 'WEB'" class="fa fa-globe" alt="Zadanie webowe"></i>
{{task.name}} {{task.name}}
</span> </span>
<p>Poziom {{task.level}}. Super zadanie.</p> <p>Poziom {{task.level}}. {{task.short_description}}</p>
</div> </div>
<div class="card-action"> <div class="card-action">
<a href="#/task/{{task.level}}">Przejdź do zadania</a></td> <a href="#/task/{{task.level}}">Przejdź do zadania</a></td>
......
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