diff --git a/market/lib/parser.rb b/market/lib/parser.rb index 1cb08bf8d7..6ff302dc25 100644 --- a/market/lib/parser.rb +++ b/market/lib/parser.rb @@ -27,7 +27,9 @@ module Parser UNITS = %W(B KiB MiB GiB TiB).freeze def self.humanize_size(number) - if number.to_i < 1024 + number = number.to_i + + if number < 1024 exponent = 0 else diff --git a/market/models/appliance.rb b/market/models/appliance.rb index 8ddfede51d..077b9c70c4 100644 --- a/market/models/appliance.rb +++ b/market/models/appliance.rb @@ -42,7 +42,8 @@ class Appliance :default => 'raw' }, 'size' => { - :type => :string + :type => :string, + :required => true }, 'compression' => { :type => :string, diff --git a/market/views/app_form.haml b/market/views/app_form.haml index 9751814a95..0d2d099e60 100644 --- a/market/views/app_form.haml +++ b/market/views/app_form.haml @@ -22,24 +22,35 @@ %label.control-label{'for' => 'short_description_form'} Short Description .controls %textarea.input-xlarge{'name' => 'short_description', 'id' => 'short_description_form', 'rows' => '3'} + %p This information will be shown in the list view .control-group %label.control-label{'for' => 'description_form'} Description .controls %textarea.input-xlarge{'name' => 'description', 'id' => 'description_form', 'rows' => '8'} + %p + This information will be shown in the detailed view + %br + Description is parsed with Markdown. .control-group %label.control-label{'for' => 'version_form'} Version .controls %input.input-xlarge{'name' => 'version', 'id' => 'version_form', 'type' => 'text'} + %p Example: 1.0 .control-group %label.control-label{'for' => 'tags_form'} Tags .controls %input.input-xlarge{'name' => 'tags', 'id' => 'tags_form', 'type' => 'text'} - %p.help-block Comma-separated tags + %p Comma-separated tags. Example: ubuntu,hpc,mysql %hr .control-group %label.control-label{'for' => 'url_form'} URL .controls %input.input-xlarge{'name' => 'files.0.url', 'id' => 'files.0.url_form', 'type' => 'text'} + .control-group + %label.control-label{'for' => 'files.0.size'} Size + .controls + %input.input{'name' => 'files.0.size', 'id' => 'files.0.size_form', 'type' => 'text'} + %p Bytes .control-group %label.control-label{'for' => 'files.0.md5'} MD5 .controls @@ -75,14 +86,17 @@ %label.control-label{'for' => 'files.0.os-id'} OS id .controls %input.input-xlarge{'name' => 'files.0.os-id', 'id' => 'files.0.os-id_form', 'type' => 'text'} + %p Example: Ubuntu .control-group %label.control-label{'for' => 'files.0.os-release'} OS release .controls %input.input-xlarge{'name' => 'files.0.os-release', 'id' => 'files.0.os-release_form', 'type' => 'text'} + %p Example: 12.04 .control-group %label.control-label{'for' => 'files.0.os-arch'} OS arch .controls %input.input-xlarge{'name' => 'files.0.os-arch', 'id' => 'files.0.os-arch_form', 'type' => 'text'} + %p Example: x86_64 - if @session.admin? Admin parameters %hr @@ -98,8 +112,4 @@ %label.control-label{'for' => 'publisher_form'} Publisher .controls %input.input-xlarge{'name' => 'publisher','id' => 'publisher_form', 'type' => 'text'} - .control-group - %label.control-label{'for' => 'files.0.size'} Size - .controls - %input.input-xlarge{'name' => 'files.0.size', 'id' => 'files.0.size_form', 'type' => 'text'} %hr \ No newline at end of file diff --git a/market/views/appliance_index.haml b/market/views/appliance_index.haml index b2f14b46dc..11f06afb7a 100644 --- a/market/views/appliance_index.haml +++ b/market/views/appliance_index.haml @@ -69,13 +69,13 @@ %select#format.span2 - %table{'class' => "table table-striped table-no-head", 'id' => "apps"} - %thead - %tr - %th Appliances - %th CATALOG - %th TAGS - %th Hypervisor +%table{'class' => "table table-striped table-no-head", 'id' => "apps"} + %thead + %tr + %th Appliances + %th CATALOG + %th TAGS + %th Hypervisor %hr diff --git a/market/views/appliance_show.haml b/market/views/appliance_show.haml index 5e4103a8ca..2be5279569 100644 --- a/market/views/appliance_show.haml +++ b/market/views/appliance_show.haml @@ -102,12 +102,18 @@ %h6 %small= @app['opennebula_version'] %hr - - if @app['files'][0]['checksum'] + - if @app['files'][0]['checksum'] && @app['files'][0]['checksum']['md5'] %dt %h6 Checksum MD5 %dd %h6 %small= @app['files'][0]['checksum']['md5'] + - if @app['files'][0]['checksum'] && @app['files'][0]['checksum']['sha1'] + %dt + %h6 Checksum SHA1 + %dd + %h6 + %small= @app['files'][0]['checksum']['sha1'] %dt %h6 Compression %dd diff --git a/market/views/user_form.haml b/market/views/user_form.haml index e99f0edd7a..71a68cccbb 100644 --- a/market/views/user_form.haml +++ b/market/views/user_form.haml @@ -18,6 +18,7 @@ %label.control-label{'for' => 'organization_form'} Organization .controls %input.input-xlarge{'name' => 'organization','id' => 'organization_form', 'type' => 'text'} + %p It will be used as publisher when posting new appliances .control-group %label.control-label{'for' => 'first_name_form'} First Name .controls @@ -51,6 +52,7 @@ - if @session.admin? Admin parameters %hr + %p This parameters will be filled by the AppMarket server, change them at your own risk .control-group %label.control-label{'for' => 'status'} Status .controls