gaku_frontend 0.3.0.pre.0 → 0.3.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/gaku/frontend/base.js.coffee +4 -9
  3. data/app/assets/javascripts/gaku/frontend/courses.js.coffee +21 -4
  4. data/app/assets/javascripts/gaku/frontend/exams.js.coffee +46 -7
  5. data/app/assets/javascripts/gaku/frontend/students.js.coffee +8 -8
  6. data/app/assets/javascripts/gaku/frontend.js.coffee +11 -0
  7. data/app/assets/stylesheets/gaku/bootstrap_and_theme.css.scss +31 -12
  8. data/app/assets/stylesheets/gaku/frontend/gaku.css.scss +36 -5
  9. data/app/controllers/gaku/exam_portion_scores_controller.rb +3 -2
  10. data/app/controllers/gaku/exams/exam_portions_controller.rb +8 -2
  11. data/app/helpers/gaku/frontend_helper.rb +6 -0
  12. data/app/views/gaku/courses/exams/_exam.html.slim +2 -1
  13. data/app/views/gaku/layouts/gaku.html.slim +1 -1
  14. data/app/views/gaku/shared/_menubar.html.slim +36 -7
  15. data/app/views/gaku/shared/form_fields/_exam_portion_form_fields.html.slim +5 -0
  16. data/app/views/gaku/shared/form_fields/exam_portions/_options_template.html.slim +7 -0
  17. data/app/views/gaku/shared/form_fields/exam_portions/_selection.html.slim +21 -0
  18. data/app/views/gaku/shared/grading/_grading_table_student_field.html.slim +2 -1
  19. data/app/views/gaku/shared/grading/_score.html.slim +1 -0
  20. data/app/views/gaku/shared/grading/_score_selection.html.slim +1 -0
  21. data/app/views/gaku/shared/grading/_score_text.html.slim +1 -0
  22. data/app/views/gaku/student_selection/add.js.erb +1 -1
  23. data/app/views/gaku/student_selection/clear.js.erb +1 -1
  24. data/app/views/gaku/student_selection/index.js.erb +1 -1
  25. data/app/views/gaku/student_selection/remove.js.erb +4 -3
  26. data/app/views/gaku/students/_chooser_widget.html.slim +13 -16
  27. data/app/views/gaku/students/index.html.slim +1 -1
  28. metadata +11 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d0c76c1618ebf30b430a907955f1acda641afa7
4
- data.tar.gz: dc74445eb99cd221e91116b59fd7b2d537571d12
3
+ metadata.gz: 03731db1f5ef308e869be124f20d9b3aa0424eef
4
+ data.tar.gz: 26a4b65f97cd0c644a0a50b8c41c54190a7020b7
5
5
  SHA512:
6
- metadata.gz: 585218010d9e0ad71bb416fbdd98d9dffe8043434c3da9651723f10d2581423d35c4acea463fd39bf702aafc97eddf16894494ad9b46c9be08c85fba552f7638
7
- data.tar.gz: 0e9f12084606338f49952b40542a56b04b4a5350bfa93b7a254a225dcb020fee649465683ae7a365094587313c0ea995f244e11c06b388f1289f4c45cde7f0d3
6
+ metadata.gz: 92c76b376f0e6f2d1fe67c479004a059d2d0b0a3e11c608cc8f2157731928fcb15e60a14045b9650732cfe495eac24499580ec1835c3bd8bf75b18bc4a105d4c
7
+ data.tar.gz: 29be2dc1052118106dcf8a77b1ca7417523155c3b94019a86bb3ba0d2cb2f8392350182b8f4bb2f8ddb5fd15fa59b664d01b12002eb8c80f6c74f4d173312891
@@ -137,16 +137,13 @@ class App
137
137
  url: '/student_selection'
138
138
  dataType: 'script'
139
139
 
140
- $(document).on 'click', '#clear-student-selection', (e)->
141
-
142
- e.preventDefault()
143
-
140
+ $(document).off('click', '#clear-student-selection').on 'click', '#clear-student-selection', ->
144
141
  $.ajax
145
142
  type: 'get'
146
143
  url: '/student_selection/clear'
147
144
  dataType: 'script'
148
145
 
149
- $(document).on 'click', '.remove-student', ->
146
+ $(document).off('click', '.remove-student').on 'click', '.remove-student', ->
150
147
  thisId = $(this).closest('a').attr('id')
151
148
 
152
149
  $.ajax
@@ -155,11 +152,10 @@ class App
155
152
  data: { id: thisId },
156
153
  dataType: 'script'
157
154
 
158
- $(document).on 'click', '.check-all', (e)->
155
+ $(document).off('click', '.check-all').on 'click', '.check-all', (e)->
159
156
  e.preventDefault()
160
157
 
161
158
  $checkboxes = $('.student-check')
162
-
163
159
  student_ids = []
164
160
  $('#students-index').find('tbody tr').map ->
165
161
  student_ids.push @id.split('-')[1]
@@ -182,13 +178,12 @@ class App
182
178
  data: { 'student_ids': student_ids },
183
179
  dataType: 'script'
184
180
 
185
- $('body').on 'change', 'input.student-check', ->
181
+ $('body').off('change', 'input.student-check').on 'change', 'input.student-check', ->
186
182
  thisCheck = $(this)
187
183
  tr_id = $(this).closest('tr').attr('id')
188
184
  parsed_id = tr_id.split('student-')
189
185
  thisId = parsed_id[1]
190
186
 
191
-
192
187
  if thisCheck.is (':checked')
193
188
  $('#selected-students, #enroll-to-class-form, #enroll-to-course-form, #enroll-to-extracurricular-activity-form').append('<input type="hidden" name="selected_students[]" value="' + thisId + '" class="' + thisId + '"/>')
194
189
 
@@ -7,6 +7,10 @@ ready = ->
7
7
  self.app.student_chooser()
8
8
 
9
9
  grading: ->
10
+ $(document).on 'change', '#exam_portion_score_score_selection', (e)->
11
+ $(@).parent('form').submit()
12
+
13
+
10
14
 
11
15
  socket = io.connect("http://localhost:5001")
12
16
 
@@ -14,12 +18,25 @@ ready = ->
14
18
  exam_id = message.exam_id
15
19
  gradable_id = message.gradable_id
16
20
  gradable_type = message.gradable_type
21
+ exam_portion_score = message.exam_portion_score.exam_portion_score
22
+ form = $("#edit_exam_portion_score_#{exam_portion_score.id}")
17
23
 
18
24
  if message.exam_portion_score
19
- exam_portion_score = message.exam_portion_score.exam_portion_score
20
- form = $("#edit_exam_portion_score_#{exam_portion_score.id}")
21
- input = form.children('input#exam_portion_score_score')
22
- input.val("#{exam_portion_score.score}")
25
+ switch message.exam_portion_score_type
26
+ when 'score_text'
27
+ input = form.children('input#exam_portion_score_score_text')
28
+ input.val("#{exam_portion_score.score_text}")
29
+ when 'score'
30
+ input = form.children('input#exam_portion_score_score')
31
+ input.val("#{exam_portion_score.score}")
32
+ when 'score_selection'
33
+ input = form.children('select#exam_portion_score_score_selection')
34
+ console.log form
35
+ input.val("#{exam_portion_score.score_selection}")
36
+
37
+ else null
38
+
39
+
23
40
  for grading_method_id, calculation of message.calculations
24
41
  if calculation.student_results
25
42
  for result in calculation.student_results
@@ -18,20 +18,60 @@ ready = ->
18
18
  # $('.exam_weightformError').remove()
19
19
  edit: ->
20
20
  $('.datetimepicker').datetimepicker()
21
+ $(document).on 'change', '#exam_portion_score_type', (e)->
22
+ selectValue = $(@).val()
23
+ if selectValue == 'score_selection'
24
+ $('#score_selection_options').removeClass('hide')
25
+ else
26
+ $('#score_selection_options').addClass('hide')
27
+
28
+
29
+ $(document).on 'click', '.remove-option-row', (e)->
30
+ e.preventDefault()
31
+ if confirm('Are you sure?')
32
+ $(@).closest('.row').html ''
33
+
34
+ $(document).on 'click', '.add-option-row', (e)->
35
+ e.preventDefault()
36
+ container = $('.attributeContainer')
37
+
38
+ contents = "<div class='row'> #{$('.options-template').html()} </div>"
39
+
40
+ container.append(contents)
41
+ container.find('input:last').attr('name', 'exam_portion[score_selection_options][]')
42
+
43
+
21
44
  grading: ->
45
+ $(document).on 'change', '#exam_portion_score_score_selection', (e)->
46
+ $(@).parent('form').submit()
47
+
48
+
49
+
22
50
  socket = io.connect("http://localhost:5001")
23
51
 
24
52
  socket.on "grading-change", (message) ->
25
53
  exam_id = message.exam_id
26
54
  gradable_id = message.gradable_id
27
55
  gradable_type = message.gradable_type
28
- console.log message
29
-
56
+ exam_portion_score = message.exam_portion_score.exam_portion_score
57
+ form = $("#edit_exam_portion_score_#{exam_portion_score.id}")
58
+
30
59
  if message.exam_portion_score
31
- exam_portion_score = message.exam_portion_score.exam_portion_score
32
- form = $("#edit_exam_portion_score_#{exam_portion_score.id}")
33
- input = form.children('input#exam_portion_score_score')
34
- input.val("#{exam_portion_score.score}")
60
+ switch message.exam_portion_score_type
61
+ when 'score_text'
62
+ input = form.children('input#exam_portion_score_score_text')
63
+ input.val("#{exam_portion_score.score_text}")
64
+ when 'score'
65
+ input = form.children('input#exam_portion_score_score')
66
+ input.val("#{exam_portion_score.score}")
67
+ when 'score_selection'
68
+ input = form.children('select#exam_portion_score_score_selection')
69
+ console.log form
70
+ input.val("#{exam_portion_score.score_selection}")
71
+
72
+ else null
73
+
74
+
35
75
  for grading_method_id, calculation of message.calculations
36
76
  if calculation.student_results
37
77
  for result in calculation.student_results
@@ -40,7 +80,6 @@ ready = ->
40
80
 
41
81
  else
42
82
  el = $("##{gradable_type}-#{gradable_id}-exam-#{exam_id}-student-#{calculation.id}-grading-method-#{grading_method_id}-score")
43
- console.log el
44
83
  el.html calculation.score
45
84
 
46
85
 
@@ -4,14 +4,14 @@ ready = ->
4
4
 
5
5
  class StudentsController
6
6
  index: ->
7
- self.app.student_chooser()
8
-
9
- $('body').on 'click', '.hide-chosen-table', (event) ->
10
- event.preventDefault()
11
- $('.hide-chosen-table').hide()
12
- $('.show-chosen-table').show()
13
- $('#chosen-table').slide()
14
- $('#chosen-actions').slide()
7
+ # self.app.student_chooser()
8
+
9
+ # $('body').on 'click', '.hide-chosen-table', (event) ->
10
+ # event.preventDefault()
11
+ # $('.hide-chosen-table').hide()
12
+ # $('.show-chosen-table').show()
13
+ # $('#chosen-table').slide()
14
+ # $('#chosen-actions').slide()
15
15
 
16
16
  edit: ->
17
17
  self.app.country_dropdown()
@@ -47,3 +47,14 @@
47
47
  NProgress.configure
48
48
  showSpinner: false
49
49
  ease: 'ease-in-out'
50
+
51
+ $ ->
52
+ $(document)[0].app.student_chooser()
53
+
54
+ $('#btn-students-chooser').popover(
55
+ html: true
56
+ ).on "shown.bs.popover", ->
57
+ $(document)[0].app.student_chooser()
58
+
59
+ $('[data-toggle="popover"]').popover
60
+ html: true
@@ -1,3 +1,7 @@
1
+ $navbar-padding-vertical: 8px;
2
+ $navbar-height: 72px;
3
+ $popover-max-width: 512px + $navbar-padding-vertical * 2 ;
4
+
1
5
  @import "bootstrap";
2
6
  @import "bootstrap/glyphicons";
3
7
 
@@ -11,25 +15,38 @@
11
15
 
12
16
  .center-block {float: none !important}
13
17
 
14
- // for fix --------
18
+ // for GAKUEngine UI --------
19
+ ul.nav.navbar-nav {
20
+ .btn-group {
21
+ margin: 7px 0px;
22
+ }
23
+ }
24
+
25
+ .popover {
26
+ .popover-content {
27
+ padding: $navbar-padding-vertical;
28
+ }
29
+ .panel {
30
+ margin: 0px;
31
+ }
32
+ }
33
+
15
34
  .nav-pills {
16
35
  li {
17
36
  background-color: #F8F8F8;
18
37
  }
19
38
  }
20
39
 
21
- //.index-header { margin-bottom: 10px; }
22
-
23
40
  .container {
24
41
  max-width: 1900px;
25
42
  }
26
43
 
27
44
  .alert-dismissable .close {
28
- position: relative;
29
- top: -2px;
30
- right: 0px;
31
- color: red;
32
- font-size: 24px;
45
+ position: relative;
46
+ top: -2px;
47
+ right: 0px;
48
+ color: red;
49
+ font-size: 24px;
33
50
  }
34
51
 
35
52
  .table {
@@ -51,6 +68,12 @@ font-size: 24px;
51
68
  }
52
69
  }
53
70
 
71
+ .btn-xs {
72
+ .badge {
73
+ margin-top: 2px;
74
+ }
75
+ }
76
+
54
77
  // theme main --------
55
78
  .btn-default,
56
79
  .btn-primary,
@@ -304,10 +327,6 @@ font-size: 24px;
304
327
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);
305
328
  }
306
329
 
307
- #user_menu {
308
- margin-right: 25px;
309
- }
310
-
311
330
  .navbar .navbar-nav > .active > a {
312
331
  background-color: #f8f8f8;
313
332
  }
@@ -2,6 +2,7 @@
2
2
  $nprogress-color: #bbbcde;
3
3
  @import 'nprogress';
4
4
  @import 'nprogress-bootstrap';
5
+ @import '../bootstrap_and_theme';
5
6
 
6
7
  // for HTML tag ----------------
7
8
  $c_red: #e45353; /* Error red */
@@ -16,7 +17,7 @@ html {
16
17
  }
17
18
 
18
19
  body {
19
- padding-top: 70px;
20
+ padding-top: $navbar-height + 20px;
20
21
  }
21
22
 
22
23
  hr {
@@ -29,9 +30,39 @@ h1, h2, h3, h4, h5, h6 {
29
30
 
30
31
 
31
32
  // for GAKUEngine ----------------
32
- .container {
33
- width: 100%;
34
- max-width: 1900px;
33
+ #user_menu {
34
+ padding-right: 30px;
35
+ }
36
+
37
+ $logo-width: 205px;
38
+ .navbar.navbar-fixed-top {
39
+ #logo {
40
+ height: $navbar-height;
41
+ vertical-align: middle;
42
+ display: table-cell;
43
+ position: relative;
44
+ z-index: 10;
45
+ }
46
+ .row[id^="navbar-"]{
47
+ height: $navbar-height / 2;
48
+ .col-md-12{
49
+ margin-left: -$logo-width;
50
+ padding-left: $logo-width + 15px;
51
+ }
52
+ }
53
+ .row#navbar-sub {
54
+ ul.nav.navbar-nav {
55
+ .btn.btn-xs {
56
+ margin: 7px 0px 7px 15px;
57
+ }
58
+ }
59
+ }
60
+ }
61
+
62
+ .popover {
63
+ #students-checked-div {
64
+ width: $popover-max-width - 20px;
65
+ }
35
66
  }
36
67
 
37
68
  .notice {
@@ -157,7 +188,7 @@ form {
157
188
  }
158
189
 
159
190
  .navbar-brand {
160
- padding: 12px 15px 0px 15px;
191
+ height: $line-height-computed + $navbar-padding-vertical * 2;
161
192
  }
162
193
 
163
194
  .divider-vertical {
@@ -19,7 +19,8 @@ module Gaku
19
19
  gradable_type: gradable_type,
20
20
  gradable_id: @gradable_scope.id,
21
21
  calculations: calculations,
22
- exam_portion_score: exam_portion_score
22
+ exam_portion_score: exam_portion_score,
23
+ exam_portion_score_type: exam_portion_score.exam_portion.score_type
23
24
  }
24
25
 
25
26
  $redis.publish('grading-change', message.to_json)
@@ -34,7 +35,7 @@ module Gaku
34
35
  end
35
36
 
36
37
  def attributes
37
- %i( score )
38
+ %i( score score_text score_selection )
38
39
  end
39
40
 
40
41
  def set_resource
@@ -33,7 +33,9 @@ module Gaku
33
33
 
34
34
  def update
35
35
  @exam_portion.update(exam_portion_params)
36
- respond_with @exam_portion# , location: [@exam, :exam_portions]
36
+ #if params doesnt exist that mean options are removed
37
+ @exam_portion.update_attribute(:score_selection_options, nil) unless score_selection_options?
38
+ respond_with @exam_portion
37
39
  end
38
40
 
39
41
  def destroy
@@ -61,7 +63,7 @@ module Gaku
61
63
  end
62
64
 
63
65
  def attributes
64
- %i( name weight problem_count max_score description adjustments )
66
+ [ :name, :weight, :problem_count, :max_score, :description, :adjustments, :score_type, score_selection_options: [] ]
65
67
  end
66
68
 
67
69
  def set_exam_portion
@@ -80,5 +82,9 @@ module Gaku
80
82
  @attachable = @exam_portion
81
83
  @attachable_resource = 'exam-exam-portion-attachment'
82
84
  end
85
+
86
+ def score_selection_options?
87
+ not params[:exam_portion][:score_selection_options].blank?
88
+ end
83
89
  end
84
90
  end
@@ -58,5 +58,11 @@ module Gaku
58
58
  end
59
59
  end
60
60
 
61
+ def score_type_options
62
+ Gaku::ExamPortion.score_types.keys.map do |option|
63
+ [I18n.t("exam_portion.score_type.#{option}"), option]
64
+ end
65
+ end
66
+
61
67
  end
62
68
  end
@@ -2,4 +2,5 @@ tr
2
2
  td = exam.name
3
3
  td = exam_completion_info(exam)
4
4
  td
5
- = link_to content_tag(:i, '', class: 'icon-white icon-pencil') + t('grade.grading'), grading_course_exam_path(@course, exam), class: "span12 btn btn-mini btn-primary grading_link"
5
+ = link_to grading_course_exam_path(@course, exam), class: "span12 btn btn-sm btn-primary grading_link" do
6
+ = icon_label 'glyphicon glyphicon-pencil', t(:'grade.grading')
@@ -9,7 +9,7 @@ html
9
9
  = javascript_include_tag "gaku/frontend/all"
10
10
  = csrf_meta_tags
11
11
  body data-action=current_controller_action data-parent-controller=current_parent_controller data-locale=I18n.locale
12
- .container
12
+ .container-fluid
13
13
  = render 'gaku/shared/modal_config'
14
14
  = render 'gaku/shared/menubar'
15
15
  #notice
@@ -1,7 +1,36 @@
1
- nav.navbar.navbar-inverse.navbar-fixed-top role="navigation"
2
- .navbar-header
3
- a.navbar-brand href=root_path = image_tag('gaku-logo.png')
4
- - if user_signed_in?
5
- = render partial: "gaku/shared/menu/global"
6
- = render partial: "gaku/shared/login_widget"
7
- /= render partial: "shared/language_bar"
1
+ .col-md-12
2
+ nav.navbar.navbar-inverse.navbar-fixed-top role="navigation"
3
+ .pull-left.ml-s
4
+ a#logo href=root_path
5
+ = image_tag 'gaku-logo.png', class: 'img-responsive'
6
+
7
+ - if user_signed_in?
8
+ .row#navbar-main
9
+ .col-md-12
10
+ = render partial: "gaku/shared/menu/global"
11
+ = render partial: "gaku/shared/login_widget"
12
+ /= render partial: "shared/language_bar"
13
+ .row#navbar-sub
14
+ .col-md-12
15
+ ul.nav.navbar-nav
16
+ li
17
+ button#btn-students-chooser.btn.btn-xs.btn-info.pull-left [
18
+ data-content=("#{render 'gaku/students/chooser_widget'}")
19
+ data-toggle="popover" type="button" data-placement="bottom"
20
+ ]
21
+ | Collector
22
+ span.chosen-count.badge.ml-xs
23
+ / li
24
+ button#btn-students-chooser.btn.btn-xs.btn-warning.pull-left [
25
+ data-content=("Events")
26
+ data-toggle="popover" type="button" data-placement="bottom"
27
+ ]
28
+ | Events
29
+ span.events-count.badge.ml-xs 123
30
+ / li
31
+ button#btn-students-chooser.btn.btn-xs.btn-danger.pull-left [
32
+ data-content=("Warning")
33
+ data-toggle="popover" type="button" data-placement="bottom"
34
+ ]
35
+ | Notifications
36
+ span.notifications-count.badge.ml-xs 123
@@ -12,3 +12,8 @@
12
12
  = ep_form.text_area :description, size: "0x2", label: t(:'exam_portion.description')
13
13
  .col-md-6
14
14
  = ep_form.text_area :adjustments, size: "0x2", label: t(:'exam_portion.adjustments')
15
+ .row
16
+ .col-md-6
17
+ = ep_form.select :score_type, options_for_select(score_type_options, ep_form.object.score_type), {}, class:'form-control', label: t(:'exam_portion.score_type.plural')
18
+ #score_selection_options.row class="#{'hide' unless ep_form.object.score_selection?}"
19
+ = render 'gaku/shared/form_fields/exam_portions/selection', f: ep_form
@@ -0,0 +1,7 @@
1
+ .row.options-template class='hide'
2
+ .col-md-9
3
+ .form-group
4
+ .controls
5
+ = text_field_tag nil, nil, class: 'form-control', placeholder: 'e.g Good'
6
+ .col-md-3
7
+ = link_to t('exam_portion.remove_option'), '#', class: 'remove-option-row btn btn-danger col-md-12'
@@ -0,0 +1,21 @@
1
+
2
+ .col-md-6
3
+ .attributeContainer
4
+ = label_tag 'exam_portion[score_selection_options][]', t('exam_portion.score_selection_options'), class: 'control-label'
5
+ - unless f.object.score_selection_options.blank?
6
+ - f.object.score_selection_options.each do |option|
7
+ .row
8
+ .col-md-9
9
+ .form-group
10
+ .controls
11
+ = text_field_tag 'exam_portion[score_selection_options][]', option, class: 'form-control', placeholder: 'e.g Good'
12
+ .col-md-3
13
+ = link_to t('exam_portion.remove_option'), '#', class: 'remove-option-row btn btn-danger col-md-12'
14
+ = render 'gaku/shared/form_fields/exam_portions/options_template', f: f
15
+
16
+
17
+
18
+ .row
19
+ .col-md-12
20
+ .form-group
21
+ = link_to t('exam_portion.add_option'), '#', class: 'add-option-row btn btn-primary'
@@ -7,7 +7,8 @@
7
7
  - if score.student_id == student.id && score.gradable == @gradable_scope
8
8
  td
9
9
  = form_for [@gradable_scope, @exam, score], remote: true do |f|
10
- = f.number_field :score, min: 0, max: portion.max_score, class: 'span12'
10
+ = render "gaku/shared/grading/#{portion.score_type}", f: f, portion: portion
11
+ /= "gaku/shared/grading/#{portion.score_type}"
11
12
  - @grading_methods.each do |grading_method|
12
13
  td.vm id="#{gradable_resource(@gradable_scope)}-#{@gradable_scope.id}-exam-#{@exam.id}-student-#{student.id}-grading-method-#{grading_method.id}-score"
13
14
  = @grading_calculations[grading_method.id]['student_results'].find { |h| h['id'] == student.id }['score']
@@ -0,0 +1 @@
1
+ = f.number_field :score, min: 0, max: portion.max_score, class: 'span12 form-control'
@@ -0,0 +1 @@
1
+ = f.select :score_selection, portion.score_selection_options.to_a, {}, class: 'form-control'
@@ -0,0 +1 @@
1
+ = f.text_field :score_text, class: 'form-control'
@@ -1,3 +1,3 @@
1
1
  $('#students-checked').html('<%= j render(partial: "selected_student", collection: @selection, as: :student) %>');
2
- $('.chosen-count').html('<%= "(#{@selection.size})" %>');
2
+ <%= "#{@selection.size}" %> != 0 ? $('.chosen-count').html('<%= "#{@selection.size}" %>') : $('.chosen-count').html("");
3
3
  $('#students-checked-div').slideDown();
@@ -1,2 +1,2 @@
1
1
  $('#students-checked').html('<%= j render(partial: "selected_student", collection: @selection, as: :student) %>');
2
- $('.chosen-count').html('<%= "(#{@selection.size})" %>');
2
+ <%= "#{@selection.size}" %> != 0 ? $('.chosen-count').html('<%= "#{@selection.size}" %>') : $('.chosen-count').html("");
@@ -1,5 +1,5 @@
1
1
  $('#students-checked').html('<%= j render(partial: "selected_student", collection: @selection, as: :student) %>');
2
- $('.chosen-count').html('<%= "(#{@selection.size})" %>');
2
+ <%= "#{@selection.size}" %> != 0 ? $('.chosen-count').html('<%= "#{@selection.size}" %>') : $('.chosen-count').html("");
3
3
 
4
4
  var selection = JSON.parse(("<%=j @selection.pluck(:id).to_json %>"))
5
5
 
@@ -1,8 +1,9 @@
1
1
  $('#students-checked').html('<%= j render(partial: "selected_student", collection: @selection, as: :student) %>');
2
+ <%= "#{@selection.size}" %> != 0 ? $('.chosen-count').html('<%= "#{@selection.size}" %>') : $('.chosen-count').html("");
3
+
4
+ var selection = JSON.parse(("<%=j @selection.to_json.html_safe %>"))
2
5
 
3
6
  $('.chosen-count').html('<%= "(#{@count})" %>');
4
7
  $(".student-check#student-" + '<%= @student.id %>').prop('checked', false)
5
8
 
6
- <%- if @count.zero? %>
7
- $('#students-checked-div').slideUp();
8
- <%- end %>
9
+ // if(selection.length == 0) { $('#students-checked-div').slideUp(); }
@@ -1,18 +1,15 @@
1
1
  .row.d-none#students-checked-div.center-block
2
- .col-md-12
3
- .panel.panel-success
4
- .panel-heading
5
- = t(:'student.chosen_students')
6
- span.chosen-count
7
- .table-action.show-chosen-table.pull-right
8
- = button t(:show), chosen_students_path, remote: true, class: 'btn-xs'
9
- = button t(:clear), nil, id: 'clear-student-selection', remote: true, class: 'btn-xs'
10
- .table-action.hide-chosen-table.pull-right.d-none
11
- = button t(:hide), nil, class: 'btn-xs'
12
- = button t(:clear), nil, id: 'clear-student-selection', remote: true, class: 'btn-xs'
13
- .panel-body
14
-
15
- table#chosen-table.table.d-none
16
- tbody#students-checked
17
- #chosen-actions.d-none.panel-footer
2
+ .panel.panel-success
3
+ .panel-heading
4
+ = t(:'student.chosen_students')
5
+ .table-action.show-chosen-table.pull-right
6
+ = button t(:clear), nil, id: 'clear-student-selection', remote: true, class: 'btn-xs'
7
+ / = button t(:show), chosen_students_path, remote: true, class: 'btn-xs'
8
+ / .table-action.hide-chosen-table.pull-right.d-none
9
+ = button t(:hide), nil, class: 'btn-xs'
10
+ = button t(:clear), nil, id: 'clear-student-selection', remote: true, class: 'btn-xs'
11
+ /.panel-body
18
12
 
13
+ table#chosen-table.table
14
+ tbody#students-checked
15
+ /#chosen-actions.d-none.panel-footer
@@ -15,7 +15,7 @@
15
15
  #student-advanced-search.d-none
16
16
 
17
17
  #chooser-widget
18
- = render 'chooser_widget'
18
+ / = render 'chooser_widget'
19
19
 
20
20
  #students-index-div
21
21
  = render 'gaku/students/students'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gaku_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.pre.0
4
+ version: 0.3.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rei Kagetsuki
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-11-25 00:00:00.000000000 Z
13
+ date: 2017-12-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: deface
@@ -312,28 +312,28 @@ dependencies:
312
312
  requirements:
313
313
  - - '='
314
314
  - !ruby/object:Gem::Version
315
- version: 0.3.0.pre.0
315
+ version: 0.3.0.pre.1
316
316
  type: :runtime
317
317
  prerelease: false
318
318
  version_requirements: !ruby/object:Gem::Requirement
319
319
  requirements:
320
320
  - - '='
321
321
  - !ruby/object:Gem::Version
322
- version: 0.3.0.pre.0
322
+ version: 0.3.0.pre.1
323
323
  - !ruby/object:Gem::Dependency
324
324
  name: gaku_testing
325
325
  requirement: !ruby/object:Gem::Requirement
326
326
  requirements:
327
327
  - - '='
328
328
  - !ruby/object:Gem::Version
329
- version: 0.3.0.pre.0
329
+ version: 0.3.0.pre.1
330
330
  type: :runtime
331
331
  prerelease: false
332
332
  version_requirements: !ruby/object:Gem::Requirement
333
333
  requirements:
334
334
  - - '='
335
335
  - !ruby/object:Gem::Version
336
- version: 0.3.0.pre.0
336
+ version: 0.3.0.pre.1
337
337
  description: The default Rails front end for GAKU Engine, with web views etc.
338
338
  email: info@gakuengine.com
339
339
  executables: []
@@ -726,9 +726,14 @@ files:
726
726
  - app/views/gaku/shared/fields/_semester_fields.html.slim
727
727
  - app/views/gaku/shared/form_fields/_exam_portion_form_fields.html.slim
728
728
  - app/views/gaku/shared/form_fields/_person_form_fields.html.slim
729
+ - app/views/gaku/shared/form_fields/exam_portions/_options_template.html.slim
730
+ - app/views/gaku/shared/form_fields/exam_portions/_selection.html.slim
729
731
  - app/views/gaku/shared/grading/_exam_portion_head.html.slim
730
732
  - app/views/gaku/shared/grading/_grading_table_head.html.slim
731
733
  - app/views/gaku/shared/grading/_grading_table_student_field.html.slim
734
+ - app/views/gaku/shared/grading/_score.html.slim
735
+ - app/views/gaku/shared/grading/_score_selection.html.slim
736
+ - app/views/gaku/shared/grading/_score_text.html.slim
732
737
  - app/views/gaku/shared/grading/grading.html.slim
733
738
  - app/views/gaku/shared/js/remove_picture.js.erb
734
739
  - app/views/gaku/shared/js/set_picture.js.erb