Skip to content

Commit

Permalink
Merge pull request #14 from AhmedKamal1432/test-v0.5
Browse files Browse the repository at this point in the history
Show warning message after choosing LVM partition
  • Loading branch information
cpg committed Aug 24, 2015
2 parents 3148845 + 70a3cde commit e14e3cb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/controllers/disk_wizard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class DiskWizardController < ApplicationController
DELETE_OPTION = '2'
CREATE_OPTION = '3'

LVM_FSTYPE = "LVM2_member"

# @return [Device Array] : Return array of Device objects, which are mounted(permanent or temporary) in the HDA.
# Render the first step of the Disk-Wizard(DW)
def select_device
Expand Down Expand Up @@ -58,6 +60,11 @@ def manage_disk
if partition.match(/^\/dev/).blank?
device = Device.find_with_unallocated(user_selections['disk'])
@selected_partiton = (device.partitions.select{|part| part.identifier == user_selections['path'] }).first
else
@selected_partiton = Device.find partition
end
if @selected_partiton.fstype.eql?(LVM_FSTYPE)
flash[:error] = %Q[We do not recommend <a href="#" target="_blank">LVM partitions at Amahi and here is why</a>.]
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/wizard.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ html[dir="#{@locale_direction}" lang="#{I18n.locale}" xml:lang="#{I18n.locale}"]
= render 'layouts/header'

#content
= render 'shared/flash_messages'
= render 'shared/dw_flash_messages'
#app.inner
.row.text-center
.col-md-12
Expand Down
6 changes: 6 additions & 0 deletions app/views/shared/_dw_flash_messages.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#errors
- flash.each do |name, msg|
- name = "danger" if name == "error"
div[class=" alert alert-#{name}"]
strong
=sanitize(msg)

0 comments on commit e14e3cb

Please sign in to comment.