Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
pad-upe
Commits
5e7a3582
Commit
5e7a3582
authored
May 08, 2024
by
alissonalbuquerque
Browse files
fix view de atividades
parent
ad863605
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Models/TaskTime.php
View file @
5e7a3582
...
...
@@ -237,6 +237,11 @@ class TaskTime extends Model
// - - - - - - - - - -
}
/* @return boolean */
public
function
has_tarefa
()
{
return
$this
->
tarefa
!==
null
?
true
:
false
;
}
public
function
userPad
()
{
return
$this
->
hasOne
(
UserPad
::
class
,
'id'
,
'user_pad_id'
);
}
...
...
resources/views/components/buttons/btn-delete-by-alert.blade.php
View file @
5e7a3582
{{
--
{{
--
@
include
(
'components.buttons.btn-delete-by-alert'
,
[
'_id'
=>
''
,
'_class'
=>
''
,
'_route'
=>
route
(
''
)
'_remove_default_class'
=>
true
|
false
])
--
}}
<!--
Button
trigger
alert
-->
<
button
type
=
"button"
id
=
"{{
$_id
}}"
class
=
"btn btn-danger
{
{$_class}
}
"
>
<
button
type
=
"button"
id
=
"{{
$_id
}}"
@
if
(
isset
(
$_remove_default_class
)
&&
$_remove_default_class
==
true
)
class
=
"btn
{
{$_class}
}
"
@
else
class
=
"btn btn-danger
{
{$_class}
}
"
@
endif
>
<
i
class
=
"bi bi-trash"
></
i
>
</
button
>
...
...
@@ -21,4 +29,4 @@
$
(
'#form-delete-'
+
_id
)
.
submit
()
}
})
</
script
>
\ No newline at end of file
</
script
>
resources/views/task-time/index.blade.php
View file @
5e7a3582
...
...
@@ -38,10 +38,10 @@
$weekColumn
=
TaskTime
::
whereUserPadId
(
$user_pad_id
)
->
whereWeekday
(
$weekday
)
->
orderBy
(
'start_time'
,
'ASC'
)
->
get
();
$weekColumn
=
$weekColumn
->
filter
(
function
(
TaskTIme
$model
)
{
return
$model
->
tarefa
!==
null
;
});
//
$weekColumn =
//
$weekColumn->filter(function(TaskTIme $model) {
//
return $model->tarefa !== null;
//
});
$weekColumns
[
$weekday
]
=
$weekColumn
->
isNotEmpty
()
?
$weekColumn
:
collect
([
'--'
]);
...
...
@@ -81,14 +81,38 @@
<
p
class
=
"text-center"
>
<
i
class
=
"bi bi-clock"
></
i
>
{{
$model
->
formatStartTime
()
}}
</
p
>
</
div
>
<
div
class
=
"card-body"
>
<
div
class
=
"text-center"
>
<
a
href
=
"#modal"
class
=
"btn btn-edit_task"
id
=
"{{
$model->id
}}"
>
{{
"
{
$model
->
getCode
()
}
:
{
$model
->
getName
()
}
"
}}
<
i
class
=
"bi bi-pencil"
></
i
>
</
a
>
{{
--
--
}}
<
p
class
=
"text-center"
>
</
i
>
DIA
:
{{
$model
->
getWeekdayAsText
()
}}
</
p
>
{{
--
--
}}
</
div
>
@
if
(
$model
->
has_tarefa
())
<
div
class
=
"text-center"
>
<
a
href
=
"#modal"
class
=
"btn btn-edit_task"
id
=
"{{
$model->id
}}"
>
{{
"
{
$model
->
getCode
()
}
:
{
$model
->
getName
()
}
"
}}
<
i
class
=
"bi bi-pencil"
></
i
>
</
a
>
{{
--
--
}}
<
p
class
=
"text-center"
>
</
i
>
DIA
:
{{
$model
->
getWeekdayAsText
()
}}
</
p
>
{{
--
--
}}
</
div
>
@
endif
@
if
(
!
$model
->
has_tarefa
())
<
div
class
=
"text-center"
>
<
form
id
=
"form-delete-
{
{$model->id}
}
"
action
=
"{{ route('task_time_delete', ['id' =>
$model->id
]) }}"
method
=
"post"
>
@
method
(
'DELETE'
)
@
csrf
</
form
>
{{
"ATIVIDADE APAGADA !"
}}
@
include
(
'components.buttons.btn-delete-by-alert'
,
[
'_id'
=>
$model
->
id
,
'_class'
=>
"delete_task_time"
,
'_remove_default_class'
=>
true
])
{{
--
--
}}
<
p
class
=
"text-center"
>
</
i
>
DIA
:
{{
$model
->
getWeekdayAsText
()
}}
</
p
>
{{
--
--
}}
</
div
>
@
endif
</
div
>
<
div
class
=
"card-header"
>
<
p
class
=
"text-center"
>
<
i
class
=
"bi bi-clock-fill"
></
i
>
{{
$model
->
formatEndTime
()
}}
</
p
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment