Question

I have a default with the navigation menu which I try to extend in the data_edit.blade file. The urls looks like this: http://localhost:85/nih/public/bassengweb/995/editData. I am really unsure why it wont extend the default correct.

This is how the navigation menu looks like in the other pages which I can extend:

enter image description here

This is how it looks in the data_edit.blade file. When I look in the source code, I can see the html code for the navigation.

enter image description here

Code in default.blade.php (master page)

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">


    <title>{{ $title }}</title>
</head>
<body>
    <link type="text/css" rel="stylesheet" href="../../public/css/bootstrap.css">
    <!-- Add custom CSS here -->
  <link type="text/css" rel="stylesheet" href="../../public/css/main.css">
  <!-- jQuery -->
    <script src="../../public/js/jquery.min.js"></script>
    <!-- JavaScript -->
    <script src="../../public/js/bootstrap.js"></script>

<?php
session_start(); 
 $_SESSION['bruker'] = Auth::user()->user_name;
?>

    <!-- Fixed navbar -->
    <div class="navbar navbar-default navbar-fixed-top" role="navigation">

        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
        </div>

        <div class="navbar-collapse collapse">
            <p class="navbar-text pull-right">
                <span class="glyphicon glyphicon-user"></span> 


<span class="label label-info" style="color:white"><a class='navbar-link {{ ($aktiv == 'minside') ? 'active' : '' }}'  >
    {{ HTML::linkRoute('user_data', 'Min side '.Auth::user()->user_name) }} </a> </span> 
         <span class="label label-danger"> {{ HTML::linkRoute('logout', 'Logg ut') }}</span></p> 




          <ul class="nav navbar-nav pull-left">

<li class='pil {{ ($aktiv == 'hvertime') ? 'active' : '' }}' > <a class='timemaling' {{HTML::linkRoute('hvertime','Timemåling')}}</a> </li>            
<li  class='pil {{ ($aktiv == 'hvertredjetime') ? 'active' : '' }}'> <a class='vannmaling' {{HTML::linkRoute('hvertredjetime','Vannmåling')}}</a </li>
<li  class='pil {{ ($aktiv == 'gjoremal') ? 'active' : '' }}'> <a class='gjoremal' {{HTML::linkRoute('gjoremal','Oppgaver')}}</a> </li>         


           <li class='pil dropdown {{ ($aktiv == 'dagvakt' || $aktiv== 'kveldsvakt' || $aktiv=='helgevakt') ? 'active' : '' }}'>
            <a    href="#" class="dropdown-toggle glyphicon glyphicon-ok" data-toggle="dropdown"><span class="glyphicon glyphicon-ok" ></span> <big>Rutiner</big> <b class="caret"></b></a>

                <ul class="dropdown-menu">
            <li class='{{ ($aktiv == 'dagvakt') ? 'active' : '' }}'> <a class='dagvakt' {{HTML::linkRoute('dagvakt','Dagvakt')}}</a> </li> 
            <li class='{{ ($aktiv == 'kveldsvakt') ? 'active' : '' }}'> <a class='kveldsvakt' {{HTML::linkRoute('kveldsvakt','Kveldsvakt')}}</a> </li>  
            <li class='{{ ($aktiv == 'helgevakt') ? 'active' : '' }}'> <a class='helgevakt' {{HTML::linkRoute('helgevakt','Helgevakt')}}</a> </li>      
              </ul>   
              </li>

<li  class='pil {{ ($aktiv == 'kontrollcm') ? 'active' : '' }}' > <a class='kontrollcm' {{HTML::linkRoute('kontrollcm','Kontroll CM')}}</a> </li> 
<li  class='pil  {{ ($aktiv == 'sok') ? 'active' : '' }}'> <a class='sok' {{HTML::linkRoute('sok','Søk')}}</a> </li>    
<li  class='pil {{ ($aktiv == 'rapport') ? 'active' : '' }}' > <a class='rapport' href='../rapport/index.php'>Rapport</a> </li>           
<li class='pil {{ ($aktiv == 'diagram') ? 'active' : '' }}'> <a class='diagram' href='../diagram/index.php'>Diagram</a> </li>   
          </ul>      
        </div><!--/.nav-collapse -->

    </div>
      <br><br>


    @yield('content')

</body>
</html>

Code in data_edit.blade

@extends('default')

@section('content')


<h1>Redigerer måling med ID : {{ $data->id }}</h1>

@if(Session::has('message'))
    <p style="color: green;">{{ Session::get('message') }}</p>
@endif

{{ Form::open(array('url' => 'bassengweb/updateData', 'method' => 'PUT')) }}

{{ Form::label('tittel', 'Tittel') }}
@if($data->tasks->isEmpty())
    {{ Form::text('tittel', $data->measurements[0]->title, array('disabled')) }}
    {{ Form::hidden('title', $data->measurements[0]->title) }}
@else
    {{ Form::text('tittel', $data->tasks[0]->title, array('disabled')) }}
    {{ Form::hidden('title', $data->tasks[0]->title) }}
@endif

{{ Form::hidden('id', $data->id) }}

{{ Form::label('value', 'Verdi') }}
{{ Form::text('value', $data->value) }}
{{ Form::hidden('value_old', $data->value) }}

{{ Form::label('date', 'Dato') }}
{{ Form::text('date', date('d/m/Y', strtotime($data->date))) }}
{{ Form::hidden('saved_date', $data->date) }}

{{ Form::label('time', 'Tid') }}
{{ Form::text('time', $data->time) }}

{{ Form::label('emp', 'Ansatt') }}
{{ Form::select('emp', $emp, $data->emp_id) }}

{{ Form::hidden('changed_by', Auth::user()->user_name) }}

{{ Form::submit('Lagre endringer') }}

{{ HTML::linkRoute('sok', 'Tilbake til søk') }}



@stop
Was it helpful?

Solution

you shouldn't use relative paths in your default.blade.php, so it doesn't get messy.

<link type="text/css" rel="stylesheet" href="../../public/css/main.css">

to

<link type="text/css" rel="stylesheet" href="{{ URL::to('css/main.css') }}">

the same with your javascript.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top