mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
Support markdown in notes.
Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
@@ -17,11 +17,13 @@ use Carbon\Carbon;
|
||||
use ExpandedForm;
|
||||
use FireflyIII\Http\Requests\PiggyBankFormRequest;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\PiggyBank;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
use Input;
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
use Log;
|
||||
use Preferences;
|
||||
use Session;
|
||||
@@ -347,7 +349,11 @@ class PiggyBankController extends Controller
|
||||
*/
|
||||
public function show(PiggyBankRepositoryInterface $repository, PiggyBank $piggyBank)
|
||||
{
|
||||
$note = $piggyBank->notes()->first();
|
||||
/** @var Note $note */
|
||||
$note = $piggyBank->notes()->first();
|
||||
$converter = new CommonMarkConverter;
|
||||
$note->text = $converter->convertToHtml($note->text);
|
||||
|
||||
$events = $repository->getEvents($piggyBank);
|
||||
$subTitle = e($piggyBank->name);
|
||||
|
||||
|
@@ -70,6 +70,7 @@ return [
|
||||
'source_accounts' => 'Source account(s)',
|
||||
'destination_accounts' => 'Destination account(s)',
|
||||
'user_id_is' => 'Your user id is <strong>:user</strong>',
|
||||
'field_supports_markdown' => 'This field supports <a href="https://en.support.wordpress.com/markdown-quick-reference/">Markdown</a>.',
|
||||
|
||||
// repeat frequencies:
|
||||
'repeat_freq_monthly' => 'monthly',
|
||||
|
@@ -3,6 +3,7 @@
|
||||
|
||||
<div class="col-sm-8">
|
||||
{{ Form.textarea(name, value, options) }}
|
||||
{% include 'form/help.twig' %}
|
||||
{% include 'form/feedback.twig' %}
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -31,7 +31,7 @@
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{{ ExpandedForm.date('targetdate') }}
|
||||
{{ ExpandedForm.textarea('note') }}
|
||||
{{ ExpandedForm.textarea('note', null, {helpText: trans('firefly.field_supports_markdown')} ) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{{ ExpandedForm.date('targetdate') }}
|
||||
{{ ExpandedForm.textarea('note') }}
|
||||
{{ ExpandedForm.textarea('note', null, {helpText: trans('firefly.field_supports_markdown')}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@@ -73,20 +73,6 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if note %}
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ trans('form.notes') }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>
|
||||
{{ note.text|nl2br }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'table'|_ }}</h3>
|
||||
@@ -96,8 +82,23 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% if note %}
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ trans('form.notes') }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{{ note.text|raw }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
|
Reference in New Issue
Block a user