Skip to content

Commit

Permalink
Merge pull request #2724 from Leantime/modal-header
Browse files Browse the repository at this point in the history
issue related to modal + modal header + modal buttons
  • Loading branch information
marcelfolaron authored Oct 3, 2024
2 parents 0e9c359 + ce281e5 commit e862539
Show file tree
Hide file tree
Showing 19 changed files with 193 additions and 119 deletions.
3 changes: 3 additions & 0 deletions app/Domain/Api/Templates/partials/apiKey.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<h4 class="widgettitle title-light"><i class="fa fa-key"></i> {{ __("headlines.api_key") }}</h4>

@displayNotification()
<x-global::content.modal.header>
API Key
</x-global::content.modal.header>

<x-global::content.modal.form action="{{ BASE_URL }}/api/apiKey/<?=(int)$_GET['id'] ?>" method="post" class="stdform formModal" >
<input type="hidden" name="<?=session("formTokenName")?>" value="<?=session("formTokenValue")?>" />
Expand Down
4 changes: 3 additions & 1 deletion app/Domain/Api/Templates/partials/delKey.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
@displayNotification()

<h5 class="subtitle">{{ __("subtitles.delete_key") }}</h5>

<x-global::content.modal.header>
Delete API Key
</x-global::content.modal.header>
<x-global::content.modal.form method="post">
<input type="hidden" name="<?=session("formTokenName")?>" value="<?=session("formTokenValue")?>" />
<p>{{ __("text.confirm_key_deletion") }}</p><br />
Expand Down
4 changes: 4 additions & 0 deletions app/Domain/Api/Templates/partials/newAPIKey.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
?>

<div style="min-width:700px;">

<x-global::content.modal.header>
New API Key
</x-global::content.modal.header>

<h4 class="widgettitle title-light"><i class="fa fa-key"></i> {{ __("headlines.new_api_key") }}</h4>

Expand Down
2 changes: 2 additions & 0 deletions app/Domain/Calendar/Templates/partials/delEvent.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
$id = (int) $_GET['id'];
?>

<x-global::content.modal.modal-buttons/>

<h4 class="widgettitle title-light">{{ __("subtitles.delete") }}</h4>

<x-global::content.modal.form method="post" class="formModal" action="{{ BASE_URL }}/calendar/delEvent/{{ $id }}">
Expand Down
3 changes: 3 additions & 0 deletions app/Domain/Canvas/Templates/delCanvas.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
$id = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT);
?>

<x-global::content.modal.header>
Del {{$canvasName}}
</x-global::content.modal.header>

<h4 class="widgettitle title-light"><?=$tpl->__("subtitles.delete") ?></h4>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<x-global::content.modal.modal-buttons/>

<x-global::content.modal.header>
Big Rock
</x-global::content.modal.header>

<h4 class="widgettitle title-light">
<i class="fa-solid fa-mountain"></i>
{{ empty($bigRock->title) ? __('label.create_new_goalboard') : __('label.goalboard') }} {{ $bigRock->title }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

<div style="width:1000px">

<h1><i class="fas {{ $canvasTypes[$canvasItem['box']]['icon'] }}"></i>
{{ $canvasTypes[$canvasItem['box']]['title'] }}</h1>
<x-global::content.modal.header>
<i class="fas {{ $canvasTypes[$canvasItem['box']]['icon'] }}"></i>
{{ $canvasTypes[$canvasItem['box']]['title'] }}
</x-global::content.modal.header>

<x-global::content.modal.form action="{{ BASE_URL }}/goalcanvas/editCanvasItem/{{ $id }}">


<input type="hidden" value="{{ $currentCanvas }}" name="canvasId">
<input type="hidden" value="{{ $canvasItem['box'] }}" name="box" id="box">
<input type="hidden" value="{{ $id }}" name="itemId" id="itemId">
Expand Down
4 changes: 3 additions & 1 deletion app/Domain/Goalcanvas/Templates/partials/delCanvas.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<x-global::content.modal.modal-buttons/>

<x-global::content.modal.header>
Delete Goal
</x-global::content.modal.header>
<h4 class="widgettitle title-light">{!!__("subtitles.delete") !!}</h4>

<x-global::content.modal.form method="post" action="{{ BASE_URL."/goalcanvas/delCanvas/$id" }}">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<x-global::content.modal.modal-buttons/>

<x-global::content.modal.header>
Delete Goal item
</x-global::content.modal.header>
<h4 class="widgettitle title-light">{!! __("subtitles.delete") !!}</h4>
<hr style="margin-top: 5px; margin-bottom: 15px;">

Expand Down
8 changes: 5 additions & 3 deletions app/Domain/Ideas/Templates/partials/boardDialog.blade.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<x-global::content.modal.modal-buttons/>

<x-global::content.modal.header>
Idea Board
</x-global::content.modal.header>

<x-global::content.modal.form action="{{ BASE_URL }}/ideas/boardDialog{{ isset($_GET['id']) ? '/'.(int)$_GET['id'] : '' }}">
<div class="modal-header">
<h4 class="modal-title"><i class='fa fa-plus'></i> {!! __('subtitles.create_new_board') !!}</h4>
</div>

<div class="modal-body">
<x-global::forms.text-input
type="text"
Expand Down
4 changes: 3 additions & 1 deletion app/Domain/Ideas/Templates/partials/delCanvasItem.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<x-global::content.modal.modal-buttons/>

<h4 class="widgettitle title-light"><i class="fa fa-trash"></i> {!! __("buttons.delete") !!}</h4>
<x-global::content.modal.header>
<i class="fa fa-trash"></i> {!! __("buttons.delete") !!}
</x-global::content.modal.header>

<x-global::content.modal.form action="{{ BASE_URL }}/ideas/delCanvasItem/{{ (int) $_GET['id'] }}">
<p>{!! __('text.are_you_sure_delete_idea') !!}</p><br />
Expand Down
191 changes: 108 additions & 83 deletions app/Domain/Ideas/Templates/partials/ideaDialog.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,92 +5,117 @@
}
@endphp

<script type="text/javascript">
window.onload = function() {
if (!window.jQuery) {
//It's not a modal
location.href = "{{ BASE_URL }}/ideas/showBoards?showIdeaModal={{ $canvasItem->id }}";
}
}
</script>

<x-global::content.modal.form action="{{ BASE_URL }}/ideas/ideaDialog/{{ $id }}">

<div class="row">
<div class="col-md-8">
<input type="hidden" value="{{ $currentCanvas }}" name="canvasId" />
<input type="hidden" value="{{ $canvasItem->box }}" name="box" id="box" />
<input type="hidden" value="{{ $id }}" name="itemId" id="itemId" />
<input type="hidden" name="status" value="{{ $canvasItem->status }}" />
<input type="hidden" name="milestoneId" value="{{ $canvasItem->milestoneId }}" />
<input type="hidden" name="changeItem" value="1" />

<x-global::forms.text-input type="text" name="description" value="{{ $canvasItem->description }}"
labelText="{{ __('input.placeholders.short_name') }}" class="main-title-input" />

<x-global::forms.text-input type="text" name="tags" id="tags" value="{{ $canvasItem->tags }}" />
<textarea rows="3" cols="10" name="data" class="complexEditor" placeholder="">{!! htmlentities($canvasItem->data) !!}</textarea><br />

<x-global::forms.button type="submit" id="primaryCanvasSubmitButton">
{!! __('buttons.save') !!}
</x-global::forms.button>

<x-global::forms.button type="submit" class="btn btn-primary" value="closeModal" id="saveAndClose">
{!! __('buttons.save_and_close') !!}
</x-global::forms.button>


@if ($id !== '')
<br />
<hr>
<input type="hidden" name="comment" value="1" />

<h4 class="widgettitle title-light"><span class="fa fa-comments"></span>{!! __('subtitles.discussion') !!}</h4>
@include('comments::includes.generalComment', [
'formUrl' => BASE_URL . '/ideas/ideaDialog/' . $id,
])
@endif
</div>

<div class="col-md-4">
@if ($id !== '')
<br /><br />
<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>

<ul class="sortableTicketList" style="width:99%">
@if ($canvasItem->milestoneId == '')
<li class="ui-state-default center" id="milestone_0">
<h4>{!! __('headlines.no_milestone_link') !!}</h4>
{!! __('text.use_milestone_to_track_idea') !!}<br />
<div class="row" id="milestoneSelectors">
@if ($login::userIsAtLeast($roles::$editor))
<script type="text/javascript">
window.onload = function() {
if (!window.jQuery) {
//It's not a modal
location.href = "{{ BASE_URL }}/ideas/showBoards?showIdeaModal={{ $canvasItem->id }}";
}
}
</script>

<x-global::content.modal.header>
Add Ideas
</x-global::content.modal.header>

<x-global::content.modal.form action="{{ BASE_URL }}/ideas/ideaDialog/{{ $id }}">


<div class="row">
<div class="col-md-8">
<input type="hidden" value="{{ $currentCanvas }}" name="canvasId" />
<input type="hidden" value="{{ $canvasItem->box }}" name="box" id="box" />
<input type="hidden" value="{{ $id }}" name="itemId" id="itemId" />
<input type="hidden" name="status" value="{{ $canvasItem->status }}" />
<input type="hidden" name="milestoneId" value="{{ $canvasItem->milestoneId }}" />
<input type="hidden" name="changeItem" value="1" />

<x-global::forms.text-input
type="text"
name="description"
value="{{ $canvasItem->description }}"
labelText="{{ __('input.placeholders.short_name') }}"
class="main-title-input"
/>

<x-global::forms.text-input
type="text"
name="tags"
id="tags"
value="{{ $canvasItem->tags }}"
/>
<textarea rows="3" cols="10" name="data" class="complexEditor" placeholder="">{!! htmlentities($canvasItem->data) !!}</textarea><br />

<x-global::forms.button
type="submit"
id="primaryCanvasSubmitButton">
{!! __('buttons.save') !!}
</x-global::forms.button>

<x-global::forms.button
type="submit"
class="btn btn-primary"
value="closeModal"
contentRole="ghost"
id="saveAndClose">
{!! __('buttons.save_and_close') !!}
</x-global::forms.button>


@if ($id !== '')
<br />
<hr>
<input type="hidden" name="comment" value="1" />

<h4 class="widgettitle title-light"><span class="fa fa-comments"></span>{!! __('subtitles.discussion') !!}</h4>
@include("comments::includes.generalComment", ["formUrl" => BASE_URL . '/ideas/ideaDialog/' . $id])
@endif
</div>

<div class="col-md-4">
@if ($id !== '')
<br /><br />
<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>

<ul class="sortableTicketList" style="width:99%">
@if ($canvasItem->milestoneId == '')
<li class="ui-state-default center" id="milestone_0">
<h4>{!! __('headlines.no_milestone_link') !!}</h4>
{!! __('text.use_milestone_to_track_idea') !!}<br />
<div class="row" id="milestoneSelectors">
@if ($login::userIsAtLeast($roles::$editor))
<div class="col-md-12">
<a href="javascript:void(0);"
onclick="leantime.canvasController.toggleMilestoneSelectors('new');">{!! __('links.create_link_milestone') !!}</a>
| <a href="javascript:void(0);"
onclick="leantime.canvasController.toggleMilestoneSelectors('existing');">{!! __('links.link_existing_milestone') !!}</a>
</div>
@endif
</div>
<div class="row" id="newMilestone" style="display:none;">
<div class="col-md-12">
<a href="javascript:void(0);"
onclick="leantime.canvasController.toggleMilestoneSelectors('new');">{!! __('links.create_link_milestone') !!}</a>
| <a href="javascript:void(0);"
onclick="leantime.canvasController.toggleMilestoneSelectors('existing');">{!! __('links.link_existing_milestone') !!}</a>
<textarea name="newMilestone"></textarea><br />
<input type="hidden" name="type" value="milestone" />
<input type="hidden" name="leancanvasitemid" value="{{ $id }}" />
<x-global::forms.button
type="button"
onclick="jQuery('#primaryCanvasSubmitButton').click()"
class="btn btn-primary">
{!! __('buttons.save') !!}
</x-global::forms.button>

<x-global::forms.button
tag="a"
href="javascript:void(0);"
contentRole="ghost"
onclick="leantime.canvasController.toggleMilestoneSelectors('hide');">
<i class="fas fa-times"></i> {!! __('links.cancel') !!}
</x-global::forms.button>
</div>
@endif
</div>
<div class="row" id="newMilestone" style="display:none;">
<div class="col-md-12">
<textarea name="newMilestone"></textarea><br />
<input type="hidden" name="type" value="milestone" />
<input type="hidden" name="leancanvasitemid" value="{{ $id }}" />
<x-global::forms.button type="button"
onclick="jQuery('#primaryCanvasSubmitButton').click()" class="btn btn-primary">
{!! __('buttons.save') !!}
</x-global::forms.button>

<x-global::forms.button tag="a" href="javascript:void(0);"
onclick="leantime.canvasController.toggleMilestoneSelectors('hide');">
<i class="fas fa-times"></i> {!! __('links.cancel') !!}
</x-global::forms.button>

</div>
</div>

<div class="row" id="existingMilestone" style="display:none;">
Expand Down
2 changes: 1 addition & 1 deletion app/Domain/Ideas/Templates/showBoards.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class="delete">
<div class="col-md-4">
<div class="pull-right">
<div class="btn-group viewDropDown">
<x-global::actions.dropdown class="btn dropdown-toggle" align="start" contentRole="accent">
<x-global::actions.dropdown class="btn dropdown-toggle" align="start" contentRole="ghost">
<x-slot:labelText>
{!! __('buttons.idea_wall') !!} {!! __('links.view') !!}
</x-slot:labelText>
Expand Down
5 changes: 4 additions & 1 deletion app/Domain/Sprints/Templates/partials/delSprint.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<x-global::content.modal.modal-buttons/>

<h4 class="widgettitle title-light"><?=$tpl->__("headlines.delete_sprint") ?></h4>
<x-global::content.modal.header class="widgettitle title-light">
<?=$tpl->__("headlines.delete_sprint") ?>
</x-global::content.modal.header>


<x-global::content.modal.form action="{{ BASE_URL }}/sprints/delSprint/{{ $id }}">
<p><?=$tpl->__("text.are_you_sure_delete_sprint") ?></p><br />
Expand Down
4 changes: 3 additions & 1 deletion app/Domain/Sprints/Templates/partials/sprintdialog.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
$currentSprint = $tpl->get('sprint');
?>

<h4 class="widgettitle title-light"><i class="fa fa-list-1-2"></i> <?=$tpl->__('label.sprint') ?> <?php echo $currentSprint->name?></h4>
<x-global::content.modal.header class="widgettitle title-light">
<i class="fa fa-list-1-2"></i> <?=$tpl->__('label.sprint') ?> <?php echo $currentSprint->name?>
</x-global::content.modal.header>

@displayNotification()

Expand Down
1 change: 1 addition & 0 deletions app/Domain/Wiki/Templates/partials/delArticle.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

<x-global::content.modal.modal-buttons/>

<?php
$ticket = $tpl->get('ticket');
Expand Down
8 changes: 8 additions & 0 deletions app/Views/Templates/components/content/modal/header.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<h1 {{ $attributes->merge(['class'=>'modal-title']) }}>
{!! $slot !!}
</h1>


{{-- <div {{ $attributes->merge(['class'=>'modal-title']) }}>
<h4 class="modal-title"><i class='fa fa-plus'></i> {!! __('subtitles.create_new_board') !!}</h4>
</div> --}}
2 changes: 2 additions & 0 deletions app/Views/Templates/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@

</div><!-- mainwrapper -->
<div id="modal-wrapper" hx-indicator="#global-loader">
<x-global::content.modal.modal-buttons/>

<x-global::content.modal id="main-page-modal" />
</div>

Expand Down
Loading

0 comments on commit e862539

Please sign in to comment.