Permalink
Browse files

Add views, don't ignore all the things

  • Loading branch information...
1 parent 8403b85 commit 0e078c5547ca104505bdfe95bf8c0e68740934ee @leehambley leehambley committed Mar 25, 2013
Showing with 100 additions and 2 deletions.
  1. +2 −2 .gitignore
  2. +5 −0 views/isos/form.haml
  3. +32 −0 views/isos/index.haml
  4. +21 −0 views/vms/form.haml
  5. +35 −0 views/vms/index.haml
  6. +2 −0 views/vms/select_one.haml
  7. +3 −0 views/vms/show.haml
View
@@ -1,2 +1,2 @@
-vms/
-isos/
+/vms/*
+/isos/*
@@ -0,0 +1,5 @@
+%form(method="post" enctype='multipart/form-data' action="/isos")
+ .control-group
+ %label.control-label(for="file")= t(:'isos.form.files')
+ .controls
+ %input.input-xxlarge(id="file" type='file' name='file')
View
@@ -0,0 +1,32 @@
+.container-fluid
+ .row-fluid
+ .span6
+ %h1= t(:'isos.index.heading')
+ :markdown
+ #{t(:'isos.index.introduction')}
+ %table.table.table-striped
+ %thead
+ %tr
+ %th= t(:'isos.table.heading.basename')
+ %th= t(:'isos.table.heading.uploaded_at')
+ %th= t(:'isos.table.heading.size')
+ %tbody
+ - @isos.each do |file|
+ %tr
+ %td
+ %i.icon-download-alt
+ %a{href: "isos/#{file.basename}"}= file.basename
+ %td= file.mtime
+ %td
+ = file.size
+ MB
+ %td
+ %form(action="/vms" method="get")
+ %input{type: "hidden", name: "bootiso", id: "bootiso", value: file.basename }
+ %button(type="submit" class="btn btn-primary btn-mini")
+ %i.icon-plus.icon-white
+ = t(:'isos.new')
+
+ .span6
+ %h1 Jumping The Shark
+ .well= haml :'isos/form'
View
@@ -0,0 +1,21 @@
+%h2
+ = t(:'vms.form.heading')
+%form.form-horizontal(action="/vms" method="post")
+ .control-group
+ %label.control-label(for="name")= t(:'vms.form.name')
+ .controls
+ %input(type="text" id="name" name="name")
+ .control-group
+ %label.control-label(for="cdiso")= t(:'vms.form.cdiso')
+ .controls
+ %select{id: "cdiso", name: "cdiso"}
+ - @isos.each do |file|
+ %option{value: file.basename}= file.basename
+ .control-group
+ %label.control-label(for="bootiso")= t(:'vms.form.bootiso')
+ .controls
+ %select{id: "bootiso", name: "bootiso"}
+ - @isos.each do |file|
+ %option{value: file.basename, selected: (file.basename == params[:bootiso] ? 'selected' : '')}= file.basename
+ .form-actions
+ %input.btn.btn-primary{type: "submit", value: t(:'vms.form.submit')}
View
@@ -0,0 +1,35 @@
+- vm_host_ip = VMHost.private_ip
+.container-fluid
+ .row-fluid
+ .span6
+ %table.table.table-striped
+ %thead
+ %tr
+ %th= t(:'vms.table.heading.name')
+ %th= t(:'vms.table.heading.vnc_port')
+ %th= t(:'vms.table.heading.state')
+
+ - @vms.each do |vm|
+ %tr
+ %td= vm.name
+ %td
+ - vnc_ip_and_port = sprintf("%s:%s", vm_host_ip, vm.vnc_port)
+ %a{ href: "vnc://#{vnc_ip_and_port}" }= vnc_ip_and_port
+ %td= vm.state
+ %td
+ - if vm.running?
+ %a.btn.btn-mini
+ %i.icon-stop
+ = t(:'vms.table.button.stop')
+ - else
+ %a.btn.btn-mini
+ %i.icon-play
+ = t(:'vms.table.button.start')
+
+ .span6
+ = haml :'vms/form'
+
+ - if @vm
+ = haml :'vms/show', vm: vm
+ - else
+ = haml :'vms/select_one'
@@ -0,0 +1,2 @@
+%p
+ SELECT A VM
View
@@ -0,0 +1,3 @@
+%h2
+ = vm.name
+

0 comments on commit 0e078c5

Please sign in to comment.