Skip to content
This repository has been archived by the owner on Jul 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #227 from lorenzorivosecchi/asset-manager
Browse files Browse the repository at this point in the history
Fix formatting error
  • Loading branch information
Lorenzo Rivosecchi authored May 16, 2019
2 parents 94c3581 + 09a5075 commit 15c5d91
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ If this doesn't enter you have to launch it manually

```bash
rails generate binda:setup
``
```

In order to edit javascript files you need to run Webpack and leave the terminal window open, so Webpack can compile everytime you save a file. To install Webpack run `npm install` from the root of your application. Then everytime you want to edit a javascript file run:

Expand Down
9 changes: 8 additions & 1 deletion lib/generators/binda/setup/setup_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,19 @@ def setup_maintenance_mode
puts "2) Setting up maintenance mode"

# Use radio field_type untill truefalse isn't available
unless FieldSetting.find_by(slug: 'maintenance-mode').present?
if FieldSetting.find_by(slug: 'maintenance-mode').nil?
maintenance_mode = @field_settings.create!( name: 'Maintenance Mode', field_type: 'radio', position: 1, allow_null: false, slug: 'maintenance-mode' )
# create active and disabled choices
disabled = maintenance_mode.choices.create!( label: 'disabled', value: 'false' )
maintenance_mode.choices.create!( label: 'active', value: 'true' )

# Create field settings for dashboard
instance_field_settings = FieldSetting
.includes(field_group: [ :structure ]).where(binda_structures: { id: @dashboard.structure.id })
instance_field_settings.each do |field_setting|
field_setting.create_field_instance_for( @dashboard )
end

# assign disabled choice and remove the temporary choice
@dashboard.reload
@dashboard.radios.first.choices << disabled
Expand Down

0 comments on commit 15c5d91

Please sign in to comment.