Нет описания

learning-outcomes-grad-undergrad.blade.php 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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._new_navigation')
  7. @elseif(Auth::user()->role==3)
  8. @include('local.managers.pCoords._new_navigation')
  9. @endif
  10. @stop
  11. @section('main')
  12. <div class="row">
  13. <div class="col-md-12">
  14. <p>Click on the values you want to change. Invalid values will be rejected automatically. To save your changes, click the 'Save' button at the bottom of the page.</p>
  15. <!-- Nav tabs -->
  16. <ul class="nav nav-tabs" role="tablist">
  17. <li role="presentation" class="active"><a href="#undergraduate" aria-controls="undergraduate" role="tab" data-toggle="tab"><h4>Undergraduate Program Participation</h4></a></li>
  18. <li role="presentation"><a href="#graduate" aria-controls="graduate" role="tab" data-toggle="tab"><h4>Graduate Program Participation</h4></a></li>
  19. </ul>
  20. <!-- Tab panes -->
  21. <div class="tab-content">
  22. <div role="tabpanel" class="tab-pane active" id="undergraduate">
  23. <table class="table table-striped table-condensed editable-table">
  24. <thead><tr class="center-text">
  25. <th class="col-md-4">Learning Outcome</th>
  26. <th class="col-md-7">Definition</th>
  27. <th class="col-md-1">Expected Value</th>
  28. </thead>
  29. <tbody>
  30. @foreach ($outcomes as $outcome)
  31. <tr data-id="{{ $outcome->id }}">
  32. <td contenteditable="true" class="name col-md-4" >{{ $outcome->name }}</td>
  33. <td contenteditable="true" data-type="textarea" class="definition col-md-6" >{{ $outcome->definition }}</td>
  34. <td contenteditable="true" class="expected-outcome col-md-1" >{{ $outcome->expected_outcome }}</td>
  35. </tr>
  36. @endforeach
  37. </tbody>
  38. </table>
  39. </div>
  40. <div role="tabpanel" class="tab-pane" id="graduate">
  41. <table class="table table-striped table-condensed editable-table">
  42. <thead><tr class="center-text">
  43. <th class="col-md-4">Learning Outcome</th>
  44. <th class="col-md-7">Definition</th>
  45. <th class="col-md-1">Expected Value</th>
  46. </thead>
  47. <tbody>
  48. @foreach ($outcomes as $outcome)
  49. <tr data-id="{{ $outcome->id }}">
  50. <td contenteditable="true" class="name col-md-4" >{{ $outcome->name }}</td>
  51. <td contenteditable="true" data-type="textarea" class="definition col-md-6" >{{ $outcome->definition }}</td>
  52. <td contenteditable="true" class="expected-outcome col-md-1" >{{ $outcome->expected_outcome }}</td>
  53. </tr>
  54. @endforeach
  55. </tbody>
  56. </table>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="row">
  62. <div class="col-md-12"><button class="btn btn-lg btn-primary center-block">Save</button></div>
  63. </div>
  64. @stop
  65. @section('javascript')
  66. $('button').on('click', function(e)
  67. {
  68. e.preventDefault();
  69. var outcomeArray= new Array();
  70. // For each learning outcome, get its value and put it into an array
  71. $('tbody tr').each(function( index )
  72. {
  73. var outcomeObject = new Object();
  74. outcomeObject.id= $(this).data('id');
  75. outcomeObject.name= $(this).children('.name').text();
  76. outcomeObject.definition= $(this).children('.definition').text();
  77. outcomeObject.expected_outcome= $(this).children('.expected-outcome').text();
  78. if($(this).find('.glyphicon-eye-close').length>0)
  79. {
  80. outcomeObject.delete=1;
  81. }
  82. else
  83. outcomeObject.delete=0;
  84. var clone = jQuery.extend({}, outcomeObject);
  85. outcomeArray.push(clone);
  86. });
  87. $.post(
  88. "{{ URL::action('OutcomesController@update') }}",
  89. { outcomeArray: JSON.stringify(outcomeArray)},
  90. function(data)
  91. {
  92. location.reload();
  93. }
  94. );
  95. });
  96. $('span').on('click', function()
  97. {
  98. if($(this).hasClass('glyphicon-eye-open'))
  99. $(this).removeClass('glyphicon-eye-open').addClass('glyphicon-eye-close');
  100. else
  101. $(this).removeClass('glyphicon-eye-close').addClass('glyphicon-eye-open');
  102. });
  103. @stop