No Description

view-learning-outcomes-criteria.blade.php 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. @extends('layouts.master')
  2. @section('navigation')
  3. @if(Auth::user()->role==1)
  4. @include('local.managers.admins._navigation')
  5. @elseif(Auth::user()->role==2)
  6. @include('local.managers.sCoords._navigation')
  7. @elseif(Auth::user()->role==3)
  8. @include('local.managers.pCoords._navigation')
  9. @elseif(Auth::user()->role==4)
  10. @include('local.professors._navigation')
  11. @endif
  12. @stop
  13. @section('main')
  14. <div class="row">
  15. <div class="col-md-3">
  16. <div class="list-group">
  17. @foreach ($outcomes as $outcome)
  18. @foreach ($semesters as $semester)
  19. {{-- activation_date --}}
  20. @if(!$outcome->deleted_at && $outcome->activation_date >= $semester->start && $outcome->activation_date <= $semester->end)
  21. {{-- <li data-outcome-id="{{ $outcome->id }}"class="list-group-item">{{ $outcome->name }}</li> --}}
  22. <li data-outcome-id="{{ $outcome->id }}"class="list-group-item">{{ $outcome->name }} [{{$semester->code}}]</li>
  23. {{-- <li data-outcome-id="{{ $outcome->id }}"class="list-group-item">[{{$semester->code}}] {{ $outcome->name }}</li> --}}
  24. @endif
  25. @endforeach
  26. @endforeach
  27. </div>
  28. </div>
  29. <div class="col-md-9">
  30. <div id="outcome-display" class="panel panel-default">
  31. <div class="panel-heading">
  32. <h4 class=" panel-title" style="cursor:auto!important;">
  33. </h4>
  34. </div>
  35. <div class="panel-body">
  36. <p class="outcome-definition "></p>
  37. <div class="table-responsive">
  38. <table class="table table-striped table-condensed datatable">
  39. <thead><tr><th>Criterion</th><th>Beginning (1-2)</th><th>In Progress (3-4)</th><th>Satisfactory (5-6)</th><th>Excellent (7-8)</th></tr></thead>
  40. <tfoot>
  41. <tr class="column-search">
  42. <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
  43. <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
  44. <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
  45. <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
  46. <th><input class="column-search-bar form-control" type="text" placeholder="Buscar"/></th>
  47. </tr>
  48. </tfoot>
  49. <tbody>
  50. </tbody>
  51. </table>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="col-md-9">
  57. <div class="no-outcome alert alert-info">
  58. <p>Select a Learning Outcome to view its information</p>
  59. </div>
  60. </div>
  61. </div>
  62. @stop
  63. @section('included-js')
  64. @include('global._datatables_js')
  65. @stop
  66. @section('javascript')
  67. $(document).ready(function()
  68. {
  69. // --------------------------------------------------------------------------
  70. // Page load
  71. // --------------------------------------------------------------------------
  72. // Hide accordion panel contents by default
  73. $('.panel-group .panel-body').hide();
  74. $('#outcome-display').parent().hide();
  75. // --------------------------------------------------------------------------
  76. // Functions
  77. // --------------------------------------------------------------------------
  78. // --------------------------------------------------------------------------
  79. // Events
  80. // --------------------------------------------------------------------------
  81. // When list item is clicked, load corresponding info
  82. $('.list-group-item').on('click', function()
  83. {
  84. var id = $(this).data('outcome-id');
  85. $.post(
  86. "{{ URL::action('OutcomesController@fetchOutcome') }}",
  87. { id: id },
  88. function(json)
  89. {
  90. // Retrieve datatable instance
  91. var table = $('.datatable').DataTable();
  92. var name = json.outcome.name;
  93. var definition = json.outcome.definition;
  94. var criteria =json.outcome.criteria;
  95. $('#outcome-display').parent().show();
  96. $('.no-outcome').parent().hide();
  97. //Display title and definition
  98. $('#outcome-display .panel-title').html(name);
  99. $('#outcome-display .outcome-definition').html(definition);
  100. //Empty table
  101. table.clear();
  102. // Add new criteria
  103. if(criteria.length>0)
  104. {
  105. $('table').show();
  106. $.each(criteria, function(index, value)
  107. {
  108. table.row.add([
  109. value.name,
  110. value.description12,
  111. value.description34,
  112. value.description56,
  113. value.description78
  114. ]);
  115. });
  116. }
  117. else
  118. {
  119. $('table').hide();
  120. }
  121. // Update display
  122. table.draw();
  123. },
  124. 'json'
  125. );
  126. })
  127. });
  128. @stop