Skip to content

Commit

Permalink
Merge pull request #23946 from code-dot-org/move-helper-library-prop-…
Browse files Browse the repository at this point in the history
…to-game-lab

Move `helper_library` prop up to Game Lab model
  • Loading branch information
joshlory committed Jul 27, 2018
2 parents a746a90 + a26fc0b commit 1b46042
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions dashboard/app/models/levels/gamelab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class Gamelab < Blockly
auto_run_setup
custom_setup_code
validation_code
helper_libraries
)

# List of possible skins, the first is used as a default.
Expand Down
1 change: 0 additions & 1 deletion dashboard/app/models/levels/gamelab_jr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

class GamelabJr < Gamelab
serialized_attrs %w(
helper_libraries
custom_helper_library
custom_blocks
hide_custom_blocks
Expand Down
10 changes: 10 additions & 0 deletions dashboard/app/views/levels/editors/_gamelab.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@
= f.label 'Custom setup code'
= f.text_field :custom_setup_code

.field
= f.label :helper_libraries
%p
Select
%a.select_all{href: '#'} all
\/
%a.select_none{href: '#'} none
(shift-click or cmd-click to select multiple).
= f.select :helper_libraries, (Library.distinct.pluck(:name) + @level.helper_libraries).uniq.sort, {}, {multiple: true}

.field
= f.label 'Validation code'
%p
Expand Down
10 changes: 0 additions & 10 deletions dashboard/app/views/levels/editors/_gamelab_jr.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@
= f.label :hide_custom_blocks, 'Do not automatically add block pool and custom blocks to the toolbox'
= boolean_check_box f, :hide_custom_blocks

.field
= f.label :helper_libraries
%p
Select
%a.select_all{href: '#'} all
\/
%a.select_none{href: '#'} none
(shift-click or cmd-click to select multiple).
= f.select :helper_libraries, (Library.distinct.pluck(:name) + @level.helper_libraries).uniq.sort, {}, {multiple: true}

.field
=f.label 'Custom helper library code'
%p
Expand Down

0 comments on commit 1b46042

Please sign in to comment.