Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
student_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Galkin Dmitry
student_project
Commits
354b408c
Commit
354b408c
authored
4 years ago
by
Galkin Dmitry
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/mission-7' into 'develop'
mission-7 See merge request
!6
parents
0dc7991c
0ff0d707
Branches
Branches containing commit
No related tags found
1 merge request
!6
mission-7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/Models/Student.php
+15
-1
15 additions, 1 deletion
app/Models/Student.php
resources/views/journal/journal.blade.php
+29
-1
29 additions, 1 deletion
resources/views/journal/journal.blade.php
resources/views/students/show.blade.php
+1
-1
1 addition, 1 deletion
resources/views/students/show.blade.php
with
45 additions
and
3 deletions
app/Models/Student.php
+
15
−
1
View file @
354b408c
...
...
@@ -2,7 +2,6 @@
namespace
App\Models
;
use
App\Http\Requests\JournalPostRequest
;
use
Illuminate\Database\Eloquent\Builder
;
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
use
Illuminate\Database\Eloquent\Model
;
...
...
@@ -43,4 +42,19 @@ class Student extends Model
return
$query
;
}
public
function
getFullNameAttribute
()
:
string
{
return
$this
->
surname
.
" "
.
substr
(
$this
->
name
,
0
,
1
)
.
". "
.
substr
(
$this
->
patronymic
,
0
,
1
);
}
public
function
getExelentMarksAttribute
()
:
bool
{
return
$this
->
subjects
()
->
get
([
'marks.mark'
])
->
pluck
(
'mark'
)
->
min
()
==
5
;
}
public
function
getGoodMarksAttribute
()
:
bool
{
return
$this
->
subjects
()
->
get
([
'marks.mark'
])
->
pluck
(
'mark'
)
->
min
()
==
4
;
}
}
This diff is collapsed.
Click to expand it.
resources/views/journal/journal.blade.php
+
29
−
1
View file @
354b408c
...
...
@@ -10,7 +10,15 @@
<
tbody
>
@
foreach
(
$students
as
$student
)
<
tr
>
<
th
scope
=
"row"
>
{{
$student
->
name
}}
</
th
>
<
th
scope
=
"row"
@
if
(
$student
->
exelent_marks
)
class
=
"bg-success"
@
elseif
(
$student
->
good_marks
)
class
=
"bg-warning"
@
else
class
=
"bg-danger"
@
endif
>
{{
$student
->
full_name
}}
</
th
>
@
foreach
(
$subjects
as
$subject
)
<
th
scope
=
"row"
>
@
if
(
$student
->
subjects
()
->
get
()
->
pluck
(
'id'
)
->
contains
(
$subject
->
id
))
...
...
@@ -32,4 +40,24 @@
</
tr
>
</
tbody
>
</
table
>
<
div
class
=
"mt-5"
>
<
ul
class
=
"list-group"
style
=
"width: 500px"
>
<
li
class
=
"list-group-item active"
>
Список
отличников
</
li
>
@
foreach
(
$students
as
$student
)
@
if
(
$student
->
exelent_marks
)
<
li
>
{{
$student
->
full_name
}}
</
li
>
@
endif
@
endforeach
</
ul
>
</
div
>
<
div
class
=
"mt-5 mb-5"
style
=
"width: 500px"
>
<
ul
class
=
"list-group"
>
<
li
class
=
"list-group-item active"
>
Список
хорошистов
</
li
>
@
foreach
(
$students
as
$student
)
@
if
(
$student
->
good_marks
)
<
li
>
{{
$student
->
full_name
}}
</
li
>
@
endif
@
endforeach
</
ul
>
</
div
>
@
endsection
This diff is collapsed.
Click to expand it.
resources/views/students/show.blade.php
+
1
−
1
View file @
354b408c
...
...
@@ -4,7 +4,7 @@
@
foreach
(
$students
as
$student
)
<
div
class
=
"card"
>
<
div
class
=
"card-body"
>
<
h5
class
=
"card-title"
>
{{
$student
->
name
}}
{{
$student
->
surname
}}
{{
$student
->
patronymic
}}
</
h5
>
<
h5
class
=
"card-title"
>
{{
$student
->
full_name
}}
</
h5
>
<
p
class
=
"card-text"
>
Группа
:
{{
$student
->
group
->
name
}}
</
p
>
<
a
class
=
"card-link"
href
=
"{{ route('students.edit_form',
$student->id
) }}"
>
Edit
</
a
>
<
a
class
=
"card-link"
href
=
{{
route
(
'students.profile'
,
$student
->
id
)
}}
>
Profile
</
a
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment