2020-08-04 11:21:23 +00:00
@ extends ( " admin.layout.base " )
@ extends ( " admin.layout.header " )
@ section ( " title " )
2020-10-27 08:32:23 +00:00
Vejledning - Vis
2020-08-04 11:21:23 +00:00
@ endsection
@ section ( " path " )
2020-10-07 06:25:00 +00:00
< a href = " { { route('guides.index') }} " class = " text-white " > Vis Vejledning </ a > /
2020-08-04 11:21:23 +00:00
@ endsection
@ section ( " content " )
2020-10-21 07:12:53 +00:00
< style >
. letterSpaceTable {
letter - spacing : 1.2 px ;
}
</ style >
2020-08-31 08:57:26 +00:00
@ if ( auth () -> user () -> can ( 'guides.create' ))
< div class = " row align-items-center mb-2 " >
< a class = " btn btn-inline btn-sde-blue mb-0 " href = " { { route('guides.create') }} " >< img src = " { { asset('/images/icons/plus.svg') }} " alt = " Create " > Opret Bruger Vejledning </ a >
2020-09-10 13:31:06 +00:00
< a class = " btn btn-inline btn-sde-blue mb-0 ml-1 " href = " { { route('guides-category.create') }} " >< img src = " { { asset('/images/icons/plus.svg') }} " alt = " Create " > Opret vejlednings kategori </ a >
2020-08-31 08:57:26 +00:00
</ div >
@ endif
2020-10-21 07:12:53 +00:00
< div id = " guides " class = " letterSpaceTable " >
2020-09-10 13:31:06 +00:00
< label > Vejledninger </ label >
2020-11-24 12:14:25 +00:00
< table class = " tbl fixOverflow " >
2020-08-04 11:21:23 +00:00
< tr >
< th > Navn </ th >
2020-09-11 10:30:37 +00:00
< th > Kategori </ th >
2020-08-31 08:57:26 +00:00
@ if ( auth () -> user () -> can ( 'guides.edit' ))
2020-11-26 09:19:12 +00:00
< th class = " w-1em " >< img class = " w-100 " src = " { { asset('/images/icons/pencil.svg') }} " alt = " Update " ></ th >
2020-08-31 08:57:26 +00:00
@ endif
@ if ( auth () -> user () -> can ( 'guides.delete' ))
2020-11-26 09:19:12 +00:00
< th class = " w-1em " >< img class = " w-100 " src = " { { asset('/images/icons/trashcan.svg') }} " alt = " Delete " ></ th >
2020-08-31 08:57:26 +00:00
@ endif
2020-08-04 11:21:23 +00:00
</ tr >
@ foreach ( $guides as $guide )
< tr >
< td > {{ $guide -> name }} </ td >
2020-09-11 10:30:37 +00:00
< td > {{ \App\GuidesCategory :: query () -> where ( 'id' , '=' , $guide -> guide_category_id ) -> first () -> guidesCategoryName }} </ td >
2020-08-31 08:57:26 +00:00
@ if ( auth () -> user () -> can ( 'guides.edit' ))
2020-10-30 13:18:28 +00:00
<!-- < td >< input type = " image " name = " preview " onclick = " preview() " src = " { { asset('/images/icons/preview-dark.svg') }} " alt = " preview " ></ td >-->
2020-08-31 08:57:26 +00:00
< td >< a href = " { { route( " guides . edit " , [ " guide " => $guide ]) }} " >< img class = " w-100 " src = " { { asset('/images/icons/pencil-dark.svg') }} " alt = " Update " ></ a ></ td >
@ endif
@ if ( auth () -> user () -> can ( 'guides.delete' ))
< td >< form method = " post " action = " { { route( " guides . destroy " , [ " guide " => $guide ]) }} " class = " w-100 nostyle " >
@ csrf
@ method ( " delete " )
2020-08-04 11:21:23 +00:00
2020-10-30 13:18:28 +00:00
< button onclick = " return confirm('Er DU sikker på at du vil slette vejledningen? Der er igen vej tilbage hvis du sletter den!'); " class = " w-100 nostyle " type = " submit " >< img class = " w-100 cursor-pointer " src = " { { asset('/images/icons/trashcan-dark.svg') }} " alt = " Delete " ></ button >
2020-08-31 08:57:26 +00:00
</ form >
</ td >
@ endif
2020-08-04 11:21:23 +00:00
</ tr >
@ endforeach
2020-10-07 06:25:00 +00:00
@ if ( count ( $guides ) == 0 )
< tr >
2020-10-30 13:18:28 +00:00
< td colspan = " 5 " > Ingen vejledninger </ td >
2020-10-07 06:25:00 +00:00
</ tr >
@ endif
2020-08-04 11:21:23 +00:00
</ table >
2020-09-10 13:31:06 +00:00
</ div >
2020-10-21 07:12:53 +00:00
< div id = " guidesCategory " class = " mt-2 letterSpaceTable " >
2020-09-10 13:31:06 +00:00
< label > Kategorier til de forskellige vejledninger </ label >
< table class = " tbl " >
< tr >
< th > Vejlednings kategorier </ th >
@ if ( auth () -> user () -> can ( 'guides.edit' )) <!-- Jeg ved ikke om vi lave mere specifike permissions -->
2020-11-26 09:19:12 +00:00
< th class = " w-1em " >< img class = " w-100 " src = " { { asset('/images/icons/pencil.svg') }} " alt = " Update " ></ th >
2020-09-10 13:31:06 +00:00
@ endif
@ if ( auth () -> user () -> can ( 'guides.delete' )) <!-- Jeg ved ikke om vi lave mere specifike permissions -->
2020-11-26 09:19:12 +00:00
< th class = " w-1em " >< img class = " w-100 " src = " { { asset('/images/icons/trashcan.svg') }} " alt = " Delete " ></ th >
2020-09-10 13:31:06 +00:00
@ endif
</ tr >
@ foreach ( \App\GuidesCategory :: query () -> get () as $guideCategory )
< tr >
< td > {{ $guideCategory -> guidesCategoryName }} </ td >
2020-09-14 06:57:31 +00:00
@ if ( auth () -> user () -> can ( 'guides.edit' ))
< td >< a href = " { { route( " guides - category . edit " , $guideCategory ) }} " >< img class = " w-100 " src = " { { asset('/images/icons/pencil-dark.svg') }} " alt = " Update2 " ></ a ></ td >
@ endif
@ if ( auth () -> user () -> can ( 'guides.delete' ))
< td >< form method = " post " action = " { { route( " guides - category . destroy " , $guideCategory ) }} " class = " w-100 nostyle " >
@ csrf
@ method ( " delete " )
2020-10-30 13:18:28 +00:00
< button onclick = " return confirm('Er du sikker på at du vil slette denne kategori?'); " class = " w-100 nostyle " type = " submit " >< img class = " w-100 cursor-pointer " src = " { { asset('/images/icons/trashcan-dark.svg') }} " alt = " Delete " ></ button >
2020-09-14 06:57:31 +00:00
</ form >
</ td >
@ endif
2020-09-10 13:31:06 +00:00
</ tr >
@ endforeach
</ table >
</ div >
2020-10-30 13:18:28 +00:00
< script >
function preview (){
$value = $ ( '#preview' ) . val ();
console . log ( $value );
}
</ script >
2020-08-04 11:21:23 +00:00
@ endsection