Skip to content

Commit 30b4fff

Browse files
committed
fix the canvas dialogue
1 parent 0d52c76 commit 30b4fff

File tree

1 file changed

+145
-71
lines changed

1 file changed

+145
-71
lines changed

app/Domain/Goalcanvas/Templates/canvasDialog.blade.php

+145-71
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<h1><i class="fas {{ $canvasTypes[$canvasItem['box']]['icon'] }}"></i>
1515
{{ $canvasTypes[$canvasItem['box']]['title'] }}</h1>
1616

17-
1817
<form class="formModal" method="post" action="{{ BASE_URL . "/goalcanvas/editCanvasItem/$id" }}">
1918

2019
<input type="hidden" value="{{ $currentCanvas }}" name="canvasId">
@@ -23,88 +22,163 @@
2322
<input type="hidden" name="milestoneId" value="{{ $canvasItem['milestoneId'] ?? '' }}">
2423
<input type="hidden" name="changeItem" value="1">
2524

26-
<div class="col-md-8">
27-
<label>{{ __('label.what_is_your_goal') }}</label>
28-
<input type="text" name="title" value="{{ $canvasItem['title'] }}" style="width:100%"><br>
29-
30-
@if (!empty($relatesLabels))
31-
<label>{{ __('label.relates') }}</label>
32-
<select name="relates" style="width: 50%" id="relatesCanvas">
33-
</select><br>
34-
@else
35-
<input type="hidden" name="relates"
36-
value="{{ $canvasItem['relates'] ?? array_key_first($hiddenRelatesLabels) }}">
37-
@endif
38-
<br>
39-
<h4 class="widgettitle title-light" style="margin-bottom:0px;"><i class="fa-solid fa-ranking-star"></i>
40-
{{ __('Metrics') }}</h4>
41-
42-
@dispatchEvent('beforeMeasureGoalContainer', $canvasItem)
43-
<div id="measureGoalContainer">
44-
<label>{{ __('text.what_metric_will_you_be_using') }}</label>
45-
<input type="text" name="description" value="{{ $canvasItem['description'] }}"
46-
style="width:100%"><br>
47-
</div>
48-
49-
<div class="row">
50-
<div class="col-md-3">
51-
<label>{{ __('label.starting_value') }}</label>
52-
<input type="number" step="0.01" name="startValue" value="{{ $canvasItem['startValue'] }}"
53-
style="width:105px">
54-
</div>
55-
<div class="col-md-3">
56-
<label>{{ __('label.current_value') }}</label>
57-
<input type="number" step="0.01" name="currentValue" id="currentValueField"
58-
value="{{ $canvasItem['currentValue'] }}"
59-
@if ($canvasItem['setting'] == 'linkAndReport') readonly data-tippy-content="Current value calculated from child goals" @endif
60-
style="width:105px">
61-
</div>
62-
<div class="col-md-3">
63-
<label>{{ __('label.goal_value') }}</label>
64-
<input type="number" step="0.01" name="endValue" value="{{ $canvasItem['endValue'] }}"
65-
style="width:105px">
25+
<div class="row">
26+
<div class="col-md-8">
27+
<label>{{ __('label.what_is_your_goal') }}</label>
28+
<input type="text" name="title" value="{{ $canvasItem['title'] }}" style="width:100%"><br>
29+
30+
@if (!empty($relatesLabels))
31+
<label>{{ __('label.relates') }}</label>
32+
<select name="relates" style="width: 50%" id="relatesCanvas">
33+
</select><br>
34+
@else
35+
<input type="hidden" name="relates"
36+
value="{{ $canvasItem['relates'] ?? array_key_first($hiddenRelatesLabels) }}">
37+
@endif
38+
<br>
39+
<h4 class="widgettitle title-light" style="margin-bottom:0px;"><i class="fa-solid fa-ranking-star"></i>
40+
{{ __('Metrics') }}</h4>
41+
42+
@dispatchEvent('beforeMeasureGoalContainer', $canvasItem)
43+
<div id="measureGoalContainer">
44+
<label>{{ __('text.what_metric_will_you_be_using') }}</label>
45+
<input type="text" name="description" value="{{ $canvasItem['description'] }}"
46+
style="width:100%"><br>
6647
</div>
67-
<div class="col-md-3">
68-
<label>{{ __('label.type') }}</label>
69-
<select name="metricType">
70-
<option value="number" @if ($canvasItem['metricType'] == 'number') selected @endif>
71-
{{ __('label.number') }}</option>
72-
<option value="percent" @if ($canvasItem['metricType'] == 'percent') selected @endif>
73-
{{ __('label.percent') }}</option>
74-
<option value="currency" @if ($canvasItem['metricType'] == 'currency') selected @endif>
75-
{{ __('language.currency') }}</option>
76-
</select>
48+
49+
<div class="row">
50+
<div class="col-md-3">
51+
<label>{{ __('label.starting_value') }}</label>
52+
<input type="number" step="0.01" name="startValue" value="{{ $canvasItem['startValue'] }}"
53+
style="width:105px">
54+
</div>
55+
<div class="col-md-3">
56+
<label>{{ __('label.current_value') }}</label>
57+
<input type="number" step="0.01" name="currentValue" id="currentValueField"
58+
value="{{ $canvasItem['currentValue'] }}"
59+
@if ($canvasItem['setting'] == 'linkAndReport') readonly data-tippy-content="Current value calculated from child goals" @endif
60+
style="width:105px">
61+
</div>
62+
<div class="col-md-3">
63+
<label>{{ __('label.goal_value') }}</label>
64+
<input type="number" step="0.01" name="endValue" value="{{ $canvasItem['endValue'] }}"
65+
style="width:105px">
66+
</div>
67+
<div class="col-md-3">
68+
<label>{{ __('label.type') }}</label>
69+
<select name="metricType">
70+
<option value="number" @if ($canvasItem['metricType'] == 'number') selected @endif>
71+
{{ __('label.number') }}</option>
72+
<option value="percent" @if ($canvasItem['metricType'] == 'percent') selected @endif>
73+
{{ __('label.percent') }}</option>
74+
<option value="currency" @if ($canvasItem['metricType'] == 'currency') selected @endif>
75+
{{ __('language.currency') }}</option>
76+
</select>
77+
</div>
7778
</div>
79+
80+
<br>
81+
@if ($login::userIsAtLeast($roles::$editor))
82+
<input type="submit" value="{{ __('buttons.save') }}" id="primaryCanvasSubmitButton">
83+
<button type="submit" class="btn btn-primary" id="saveAndClose" value="closeModal"
84+
onclick="leantime.goalCanvasController.setCloseModal();">{{ __('buttons.save_and_close') }}</button>
85+
@endif
86+
87+
@if ($id !== '')
88+
<br /><br /><br />
89+
<input type="hidden" name="comment" value="1" />
90+
<h4 class="widgettitle title-light"><span
91+
class="fa fa-comments"></span>{{ __('subtitles.discussion') }}</h4>
92+
@php
93+
$tpl->assign('formUrl', '/goalcanvas/editCanvasItem/' . $id . '');
94+
$tpl->displaySubmodule('comments-generalComment');
95+
@endphp
96+
@endif
7897
</div>
7998

80-
<br>
81-
@if ($login::userIsAtLeast($roles::$editor))
82-
<input type="submit" value="{{ __('buttons.save') }}" id="primaryCanvasSubmitButton">
83-
<button type="submit" class="btn btn-primary" id="saveAndClose" value="closeModal"
84-
onclick="leantime.goalCanvasController.setCloseModal();">{{ __('buttons.save_and_close') }}</button>
85-
@endif
86-
87-
@if ($id !== '')
88-
<br /><br /><br />
89-
<input type="hidden" name="comment" value="1" />
90-
<h4 class="widgettitle title-light"><span
91-
class="fa fa-comments"></span>{{ $tpl->__('subtitles.discussion') }}</h4>
92-
@php
93-
$tpl->assign('formUrl', '/goalcanvas/editCanvasItem/' . $id . '');
94-
$tpl->displaySubmodule('comments-generalComment');
95-
@endphp
96-
@endif
99+
<div class="col-md-4">
100+
@if (!empty($statusLabels))
101+
<label>{{ __("label.status") }}</label>
102+
<select name="status" style="width: 50%" id="statusCanvas">
103+
</select><br /><br />
104+
@else
105+
<input type="hidden" name="status" value="{{ $canvasItem['status'] ?? array_key_first($hiddenStatusLabels) }}" />
106+
@endif
107+
108+
<h4 class="widgettitle title-light" style="margin-bottom:0px;"><i class="fa-solid fa-calendar"></i> {{ __('label.dates') }}</h4>
109+
110+
<label>{{ __('label.start_date') }}</label>
111+
<input type="text" autocomplete="off" value="{{ format($canvasItem['startDate'])->date() }}" name="startDate" class="startDate"/>
112+
113+
<label>{{ __('label.end_date') }}</label>
114+
<input type="text" autocomplete="off" value="{{ format($canvasItem['endDate'])->date() }}" name="endDate" class="endDate"/>
115+
116+
@if ($id !== '')
117+
<br /><br />
118+
<h4 class="widgettitle title-light"><span class="fa fa-link"></span> {{ __("headlines.linked_milestone") }} <i class="fa fa-question-circle-o helperTooltip" data-tippy-content="{{ __("tooltip.link_milestones_tooltip") }}"></i></h4>
119+
120+
@if ($canvasItem['milestoneId'] == '')
121+
<center>
122+
<h4>{{ __("headlines.no_milestone_link") }}</h4>
123+
<div class="row" id="milestoneSelectors">
124+
@if ($login::userIsAtLeast($roles::$editor))
125+
<div class="col-md-12">
126+
<a href="javascript:void(0);" onclick="leantime.goalCanvasController.toggleMilestoneSelectors('new');">{{ __("links.create_link_milestone") }}</a>
127+
@if (count($tpl->get('milestones')) > 0)
128+
| <a href="javascript:void(0);" onclick="leantime.goalCanvasController.toggleMilestoneSelectors('existing');">{{ __("links.link_existing_milestone") }}</a>
129+
@endif
130+
</div>
131+
@endif
132+
</div>
133+
<div class="row" id="newMilestone" style="display:none;">
134+
<div class="col-md-12">
135+
<input type="text" width="50%" name="newMilestone"></textarea><br />
136+
<input type="hidden" name="type" value="milestone" />
137+
<input type="hidden" name="goalcanvasitemid" value="{{ $id }}" />
138+
<input type="button" value="{{ __("buttons.save") }}" onclick="jQuery('#primaryCanvasSubmitButton').click()" class="btn btn-primary" />
139+
<input type="button" value="{{ __("buttons.cancel") }}" onclick="leantime.goalCanvasController.toggleMilestoneSelectors('hide')" class="btn btn-primary" />
140+
</div>
141+
</div>
142+
143+
<div class="row" id="existingMilestone" style="display:none;">
144+
<div class="col-md-12">
145+
<select data-placeholder="{{ __("input.placeholders.filter_by_milestone") }}" name="existingMilestone" class="user-select">
146+
<option value=""></option>
147+
@foreach ($tpl->get('milestones') as $milestoneRow)
148+
<option value="{{ $milestoneRow->id }}" {{ isset($searchCriteria['milestone']) && ($searchCriteria['milestone'] == $milestoneRow->id) ? 'selected' : '' }}>
149+
{{ $milestoneRow->headline }}
150+
</option>
151+
@endforeach
152+
</select>
153+
<input type="hidden" name="type" value="milestone" />
154+
<input type="hidden" name="goalcanvasitemid" value="{{ $id }}" />
155+
<input type="button" value="{{ __("buttons.save") }}" onclick="jQuery('#primaryCanvasSubmitButton').click()" class="btn btn-primary" />
156+
<input type="button" value="{{ __("buttons.cancel") }}" onclick="leantime.goalCanvasController.toggleMilestoneSelectors('hide')" class="btn btn-primary" />
157+
</div>
158+
</div>
159+
</center>
160+
@else
161+
<div hx-trigger="load"
162+
hx-indicator=".htmx-indicator"
163+
hx-get="{{ BASE_URL }}/hx/tickets/milestones/showCard?milestoneId={{ $canvasItem['milestoneId'] }}">
164+
<div class="htmx-indicator">
165+
{{ __("label.loading_milestone") }}
166+
</div>
167+
</div>
168+
<a href="{{ BASE_URL }}/goalcanvas/editCanvasItem/{{ $id }}?removeMilestone={{ $canvasItem['milestoneId'] }}" class="goalCanvasModal delete formModal"><i class="fa fa-close"></i> {{ __("links.remove") }}</a>
169+
@endif
170+
@endif
171+
</div>
97172
</div>
98173

99174
@if ($id != '')
100-
<a href="{{ BASE_URL . "goalcanvas/delCanvasItem/$id" }}" class="formModal delete right">
175+
<a href="{{ BASE_URL . "/goalcanvas/delCanvasItem/$id" }}" class="formModal delete right">
101176
<i class='fa fa-trash-can'></i> {{ __('links.delete') }}
102177
</a>
103178
@endif
104179

105180
</form>
106181

107-
108182
</div>
109183

110184
<script type="text/javascript">
@@ -164,4 +238,4 @@ class="fa fa-comments"></span>{{ $tpl->__('subtitles.discussion') }}</h4>
164238
165239
});
166240
</script>
167-
@endsection
241+
@endsection

0 commit comments

Comments
 (0)