No Description

view_template.blade.php 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. @extends('layouts.master')
  2. @section('navigation')
  3. @include('local.managers.admins._navigation')
  4. @stop
  5. @section('main')
  6. <div class="row">
  7. <div class="col-md-12">
  8. <div class="btn-group pull-right">
  9. {{ HTML::linkAction('TemplatesController@printview', 'Print', array($template->id), array('class'=>'btn btn-default')) }}
  10. </div>
  11. <p>Passing Criteria:
  12. <span id="expected_percentage">{{{ $template->expected_percentage }}}% of students must obtain at least </span>
  13. <span id="expected_points">{{{$template->expected_points}}}</span> points
  14. </p>
  15. <table class="table table-striped table-condensed datatable">
  16. <thead>
  17. <tr>
  18. <th></th>
  19. <th>Criterion</th>
  20. <th>Beginning (1-2)</th>
  21. <th>In Progress (3-4)</th>
  22. <th>Good (5-6)</th>
  23. <th>Excellent (7-8)</th>
  24. <th>Learning Outcome</th>
  25. </tr>
  26. </thead>
  27. <tbody>
  28. @foreach(json_decode($template->contents) as $index => $criterion)
  29. <tr data-criterion-copyright="{{ $criterion->copyright }}" data-criterion-notes="{{ $criterion->notes }}">
  30. @if(isset($criterion->notes))
  31. <td>{{ $index + 1 }}.</td>
  32. <td>
  33. <span><em data-toggle="tooltip" data-placement="top" title="{{ $criterion->notes }}">{{{ $criterion->name }}}</em></span>
  34. <sup></sup>
  35. @if(property_exists($criterion, 'subcriteria'))
  36. <ul class="list-unstyled">
  37. @foreach($criterion->subcriteria as $subcriterion)
  38. <li>{{ $subcriterion }}</li>
  39. @endforeach
  40. </ul>
  41. @endif
  42. </td>
  43. @else
  44. <td>{{ $index + 1 }}.</td>
  45. <td>
  46. <span>{{{ $criterion->name }}}</span>
  47. <sup></sup>
  48. @if(property_exists($criterion, 'subcriteria'))
  49. <ul class="list-unstyled">
  50. @foreach($criterion->subcriteria as $subcriterion)
  51. <li>{{ $subcriterion }}</li>
  52. @endforeach
  53. </ul>
  54. @endif
  55. </td>
  56. @endif
  57. <td>{{{ $criterion->description12 }}}</td>
  58. <td>{{{ $criterion->description34 }}}</td>
  59. <td>{{{ $criterion->description56 }}}</td>
  60. <td>{{{ $criterion->description78 }}}</td>
  61. <td>{{{ Outcome::where('id', $criterion->outcome_id)->first()->name }}}</td>
  62. </tr>
  63. @endforeach
  64. </tbody>
  65. </table>
  66. <br>
  67. <br>
  68. <div id="copyright-info">
  69. <hr>
  70. <p class="small"><strong>Copyright Information</strong></p>
  71. <ul id="copyright-list" class="list-unstyled small">
  72. </ul>
  73. <hr>
  74. </div>
  75. <br>
  76. <br>
  77. <br>
  78. </div>
  79. </div>
  80. @stop
  81. @section('included-js')
  82. @include('global._datatables_js')
  83. @stop
  84. @section('javascript')
  85. // --------------------------------------------------------------------------
  86. // Page load
  87. // --------------------------------------------------------------------------
  88. buildCopyrightList();
  89. // --------------------------------------------------------------------------
  90. // Functions
  91. // --------------------------------------------------------------------------
  92. // Build list from copyright info in template
  93. function buildCopyrightList()
  94. {
  95. // Empty the copyright list
  96. $('#copyright-list').empty();
  97. $('tbody tr').each(function( index )
  98. {
  99. var criterion = $(this);
  100. // If there's copyright info (in this particular view, it checks for empty strings)
  101. if(criterion.data('criterion-copyright')!='')
  102. {
  103. var copyright = criterion.data('criterion-copyright');
  104. // If there is anything in the copyright list
  105. if($('#copyright-list li').length>0)
  106. {
  107. // Check copyright list for the same copyright text
  108. var found = false;
  109. $('#copyright-list li').each(function()
  110. {
  111. // If found, give the string its number
  112. if(copyright==$(this).find('span').text())
  113. {
  114. copyrightNumber = Number.parseInt($(this).find('sup').text());
  115. criterion.children('td:nth-child(2)').find('sup').text(copyrightNumber);
  116. found =true;
  117. //to break
  118. return false;
  119. }
  120. });
  121. // Otherwise, give it the next number and append a new item to the
  122. // list
  123. if(!found)
  124. {
  125. var copyrightNumber = $('#copyright-list li').length+1;
  126. criterion.children('td:nth-child(2)').find('sup').text(copyrightNumber);
  127. $('#copyright-list').append('<li><sup>'+copyrightNumber+' </sup><span>'+copyright+'<span></li>');
  128. }
  129. }
  130. // Otherwise, give it number 1 and append it
  131. else
  132. {
  133. criterion.children('td:nth-child(2)').find('sup').text('1');
  134. $('#copyright-list').append('<li><sup>1 </sup><span>'+copyright+'<span></li>');
  135. }
  136. }
  137. });
  138. if($('#copyright-info li').length>0)
  139. {
  140. $('#copyright-info').show();
  141. }
  142. else
  143. {
  144. $('#copyright-info').hide();
  145. }
  146. }
  147. @stop