mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Moved show counters to directive (#8537)
* Moved show counters to directive - hide counters on challenge page - hide counters on group page * Changed let to var
This commit is contained in:
@@ -72,6 +72,18 @@
|
|||||||
$scope.showChallengeList = function () {
|
$scope.showChallengeList = function () {
|
||||||
return $state.includes("options.social.challenges");
|
return $state.includes("options.social.challenges");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.showDoubleTaskCounter = function (task, obj) {
|
||||||
|
var objectIsGroup = obj.type && (obj.type === 'guild' || obj.type === 'party');
|
||||||
|
var objectIsChallenge = $state.includes("options.social.challenges");
|
||||||
|
return !objectIsGroup && !objectIsChallenge && task.up && task.down;
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.showSingleTaskCounter = function (task, obj) {
|
||||||
|
var objectIsGroup = obj.type && (obj.type === 'guild' || obj.type === 'party');
|
||||||
|
var objectIsChallenge = $state.includes("options.social.challenges");
|
||||||
|
return !objectIsGroup && !objectIsChallenge && task.type === "habit" && (!task.up || !task.down);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
.task-meta-controls
|
.task-meta-controls
|
||||||
|
|
||||||
// Counter
|
// Counter
|
||||||
span(ng-if='task.up && task.down')
|
span(ng-if='showDoubleTaskCounter(task, obj)')
|
||||||
span(tooltip=env.t('habitCounterUp')) +{{task.counterUp}}|
|
span(tooltip=env.t('habitCounterUp')) +{{task.counterUp}}|
|
||||||
span(tooltip=env.t('habitCounterDown')) -{{task.counterDown}}
|
span(tooltip=env.t('habitCounterDown')) -{{task.counterDown}}
|
||||||
|
|
||||||
span(ng-if='task.type=="habit" && (!task.up || !task.down)')
|
span(ng-if='showSingleTaskCounter(task, obj)')
|
||||||
span(tooltip=env.t('habitCounter')) {{task.up ? task.counterUp : task.counterDown}}
|
span(tooltip=env.t('habitCounter')) {{task.up ? task.counterUp : task.counterDown}}
|
||||||
|
|
||||||
// Due Date
|
// Due Date
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ script(id='templates/task-list.html', type="text/ng-template")
|
|||||||
ng-if='showNormalList()')
|
ng-if='showNormalList()')
|
||||||
task
|
task
|
||||||
|
|
||||||
div(ng-init='setObj(obj); console.log(obj)')
|
div(ng-init='setObj(obj);')
|
||||||
div(
|
div(
|
||||||
ng-repeat="(key, taskList) in groupedList[list.type]",
|
ng-repeat="(key, taskList) in groupedList[list.type]",
|
||||||
ng-if='user.preferences.tasks.groupByChallenge && !$state.includes("options.social.challenges")')
|
ng-if='user.preferences.tasks.groupByChallenge && !$state.includes("options.social.challenges")')
|
||||||
|
|||||||
Reference in New Issue
Block a user