mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 19:16:37 +00:00
Show chore description on chorecard (closes #1759)
This commit is contained in:
@@ -202,3 +202,8 @@ function CleanFileName(fileName)
|
|||||||
// Umlaute seem to cause problems on Linux...
|
// Umlaute seem to cause problems on Linux...
|
||||||
return fileName.toLowerCase().replaceAll(/ä/g, 'ae').replaceAll(/ö/g, 'oe').replaceAll(/ü/g, 'ue').replaceAll(/ß/g, 'ss');
|
return fileName.toLowerCase().replaceAll(/ä/g, 'ae').replaceAll(/ö/g, 'oe').replaceAll(/ü/g, 'ue').replaceAll(/ß/g, 'ss');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function nl2br(s)
|
||||||
|
{
|
||||||
|
return s.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, "$1<br>$2");
|
||||||
|
}
|
||||||
|
@@ -6,6 +6,7 @@ Grocy.Components.ChoreCard.Refresh = function(choreId)
|
|||||||
function(choreDetails)
|
function(choreDetails)
|
||||||
{
|
{
|
||||||
$('#chorecard-chore-name').text(choreDetails.chore.name);
|
$('#chorecard-chore-name').text(choreDetails.chore.name);
|
||||||
|
$('#chorecard-chore-description').html(nl2br(choreDetails.chore.description));
|
||||||
$('#chorecard-chore-last-tracked').text((choreDetails.last_tracked || __t('never')));
|
$('#chorecard-chore-last-tracked').text((choreDetails.last_tracked || __t('never')));
|
||||||
$('#chorecard-chore-last-tracked-timeago').attr("datetime", choreDetails.last_tracked || '');
|
$('#chorecard-chore-last-tracked-timeago').attr("datetime", choreDetails.last_tracked || '');
|
||||||
$('#chorecard-chore-tracked-count').text((choreDetails.tracked_count || '0'));
|
$('#chorecard-chore-tracked-count').text((choreDetails.tracked_count || '0'));
|
||||||
|
@@ -22,6 +22,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h3><span id="chorecard-chore-name"></span></h3>
|
<h3><span id="chorecard-chore-name"></span></h3>
|
||||||
|
|
||||||
|
<p id="chorecard-chore-description"
|
||||||
|
class="text-muted mt-0"></p>
|
||||||
|
|
||||||
<strong>{{ $__t('Tracked count') }}:</strong> <span id="chorecard-chore-tracked-count"
|
<strong>{{ $__t('Tracked count') }}:</strong> <span id="chorecard-chore-tracked-count"
|
||||||
class="locale-number locale-number-generic"></span><br>
|
class="locale-number locale-number-generic"></span><br>
|
||||||
<strong>{{ $__t('Last tracked') }}:</strong> <span id="chorecard-chore-last-tracked"></span> <time id="chorecard-chore-last-tracked-timeago"
|
<strong>{{ $__t('Last tracked') }}:</strong> <span id="chorecard-chore-last-tracked"></span> <time id="chorecard-chore-last-tracked-timeago"
|
||||||
|
Reference in New Issue
Block a user