Ei kuvausta

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

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