Nenhuma descrição

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

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