Skip to content

Commit

Permalink
Merge branch '4.0-dev' into my-calendar-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ctanveer authored Dec 30, 2024
2 parents f2496ca + dd9e6cf commit b69255d
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 29 deletions.
2 changes: 1 addition & 1 deletion app/Domain/Projects/Hxcontrollers/ProjectCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class ProjectCard extends HtmxController
{
protected static string $view = 'projects::partials.projectCard';
protected static string $view = 'projects::includes.projectCard';

private ProjectService $projectsService;

Expand Down
1 change: 0 additions & 1 deletion app/Domain/Projects/Hxcontrollers/ProjectHubProjects.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ public function init(

public function get()
{

$clientId = '';
$currentClientName = '';
if (isset($_GET['client']) === true && $_GET['client'] != '') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,31 @@
// Determine label text based on the current client name
$labelText = $currentClientName != '' ? $currentClientName : __('headline.all_clients');
@endphp
<x-global::actions.dropdown :label-text="$labelText" contentRole="secondary" position="bottom" align="end"
class=""
>
<x-slot:label-text>
@if ($currentClientName != '')
{{ $currentClientName }}
@else
{{ __("headline.all_clients") }}
@endif

<x-global::actions.dropdown :label-text="$labelText" contentRole="link" position="bottom" align="start"
class="header-title-dropdown btn btn-default">
<i class="fa fa-caret-down"></i>
</x-slot:label-text>


<x-slot:menu>
<!-- All Clients Option -->
<x-global::actions.dropdown.item href="{{ BASE_URL }}/hx/projects/showMy">
<x-global::actions.dropdown.item href="{{ BASE_URL }}/projects/showMy">
{{ __('headline.all_clients') }}
</x-global::actions.dropdown.item>

<!-- Clients List -->
@foreach ($clients as $key => $value)
@if (!empty($key))
<x-global::actions.dropdown.item href="javascript:void(0);"
<x-global::actions.dropdown.item
href="javascript:void(0);"
hx-get="{{ BASE_URL }}/hx/projects/projectHubProjects/get?client={{ $key }}"
hx-target="#myProjectsHub" hx-swap="outerHTML transition:true">
{{ $value['name'] }}
Expand Down Expand Up @@ -63,7 +74,7 @@ class='btn btn-primary'>{{ __('link.new_project') }}</a>
@endphp
@foreach ($allProjects as $project)
@if ($project['isFavorite'] == true)
<div class="col-md-4">
<div class="col-md-3">
@include("projects::includes.projectCard", ["project" => $project, "type" => "detailed"])
</div>
@php
Expand Down
59 changes: 39 additions & 20 deletions app/Domain/Projects/Templates/projectHub.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
<span style="font-size:18px; color:var(--main-titles-color););">
{{ __("text.project_hub_intro") }}
@if ($login::userIsAtLeast("manager"))
<br /><br /><a class="btn btn-default" href="#/projects/createnew">{!! __("menu.create_something_new") !!}</a>
<br /><br />
<x-global::forms.button tag="a" content-role="secondary" href="#/projects/createnew">
{!! __("menu.create_something_new") !!}
</x-global::forms.button>
@endif
</span>
<br />
Expand All @@ -38,27 +41,43 @@

@if (count($clients) > 0)
<div class="dropdown dropdownWrapper pull-right">
<a href="javascript:void(0)" class="btn btn-default dropdown-toggle header-title-dropdown" data-toggle="dropdown">
@if ($currentClientName != '')
{{ $currentClientName }}
@else
{{ __("headline.all_clients") }}
@endif

<i class="fa fa-caret-down"></i>
</a>
<x-global::actions.dropdown content-role="secondary" position="bottom" align="end"
class=""
>
<x-slot:label-text>
@if ($currentClientName != '')
{{ $currentClientName }}
@else
{{ __("headline.all_clients") }}
@endif

<ul class="dropdown-menu">
<li><a href="{{ CURRENT_URL }}">{{ __("headline.all_clients") }}</a></li>
@foreach ($clients as $key => $value)
<li>
<a href="javascript:void(0);"
<i class="fa fa-caret-down"></i>
</x-slot:label-text>

<x-slot:menu>
<!-- All Clients Option -->
<x-global::actions.dropdown.item variant="link"
href="{{ CURRENT_URL }}"
>
{{ __("headline.all_clients") }}
</x-global::actions.dropdown.item>

<!-- Clients List -->
@foreach ($clients as $key => $value)
<x-global::actions.dropdown.item variant="link"
href="javascript:void(0);"
hx-get="{{BASE_URL}}/hx/projects/projectHubProjects/get?client={{ $key }}"
hx-target="#myProjectsHub"
hx-swap="outerHTML transition:true">{{ $value['name'] }}</a>
</li>
@endforeach
</ul>
hx-swap="outerHTML transition:true"
>
{{ $value['name'] }}
</x-global::actions.dropdown.item>
@endforeach

</x-slot:menu>

</x-global::actions.dropdown>

</div>
@endif

Expand Down Expand Up @@ -86,7 +105,7 @@
@endphp
@foreach ($allProjects as $project)
@if($project['isFavorite'] == true)
<div class="col-md-4">
<div class="col-md-3">
@include("projects::includes.projectCard", ["project" => $project, "type" => "detailed"])
</div>
@php
Expand Down
5 changes: 3 additions & 2 deletions app/Views/Templates/components/forms/button.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
$variantClasses = "w-full input justify-start";
}
// btn-outline border-primary text-primary
switch($contentRole){
case 'secondary':
$typeClass = 'btn-secondary border-secondary hover:bg-primary/80';
Expand All @@ -39,12 +40,12 @@
default:
$typeClass = 'btn-primary border-primary hover:bg-primary/80 ';
}
$sizeClass = $scale ? 'btn-'.$scale : '';
$sizeClass = $scale ? 'btn-'.$scale : 'btn-sm';
$stateClass = $state ? 'btn-'.$state : '';
$shapeClass = $shape ? 'btn-'.$shape : '';
@endphp

<{{ $tag }} role="button" {{ $attributes->merge(['class' => 'btn btn-sm active:shadow-inner '. $typeClass.' '.$sizeClass. ' '.$stateClass. ' '.$shapeClass . ' '.$variantClasses])->class([
<{{ $tag }} role="button" {{ $attributes->merge(['class' => 'btn active:shadow-inner '. $typeClass.' '.$sizeClass. ' '.$stateClass. ' '.$shapeClass . ' '.$variantClasses])->class([
'join-item' => $join,
'mr-1' => ! $join,
]) }}>
Expand Down

0 comments on commit b69255d

Please sign in to comment.