Return-Path: X-Original-To: apmail-deltacloud-commits-archive@www.apache.org Delivered-To: apmail-deltacloud-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E5C2F10D2A for ; Mon, 15 Jul 2013 07:00:17 +0000 (UTC) Received: (qmail 70982 invoked by uid 500); 15 Jul 2013 07:00:17 -0000 Delivered-To: apmail-deltacloud-commits-archive@deltacloud.apache.org Received: (qmail 70953 invoked by uid 500); 15 Jul 2013 07:00:13 -0000 Mailing-List: contact commits-help@deltacloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltacloud.apache.org Delivered-To: mailing list commits@deltacloud.apache.org Received: (qmail 70892 invoked by uid 99); 15 Jul 2013 07:00:11 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jul 2013 07:00:11 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2B63A89D29C; Mon, 15 Jul 2013 07:00:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dkoper@apache.org To: commits@deltacloud.apache.org Date: Mon, 15 Jul 2013 07:00:12 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/8] git commit: CIMI: added/changed conditionals to only show machine operations for which the action url was returned in client UI CIMI: added/changed conditionals to only show machine operations for which the action url was returned in client UI Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/7bab5887 Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/7bab5887 Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/7bab5887 Branch: refs/heads/master Commit: 7bab5887904435d6c66116a9163b8887318bd035 Parents: 5c2c9dc Author: Dies Koper Authored: Mon Jul 15 10:31:28 2013 +1000 Committer: Dies Koper Committed: Mon Jul 15 10:53:01 2013 +1000 ---------------------------------------------------------------------- clients/cimi/views/machines/show.haml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/deltacloud/blob/7bab5887/clients/cimi/views/machines/show.haml ---------------------------------------------------------------------- diff --git a/clients/cimi/views/machines/show.haml b/clients/cimi/views/machines/show.haml index cc31f0c..7d36da0 100644 --- a/clients/cimi/views/machines/show.haml +++ b/clients/cimi/views/machines/show.haml @@ -19,12 +19,14 @@ %form{ :action => "/cimi/machines/#{href_to_id @machine.id}/restart", :method => :post, :style => 'display:inline', :id => 'frm_restart'} %form{ :action => "/cimi/machines/#{href_to_id @machine.id}/delete", :method => :post, :style => 'display:inline', :id => 'frm_delete'} %input{ :type => :hidden, :name => '_method', :value => 'delete'} - - if @machine.state == 'STARTED' + - if @machine.operations.find {|o| o.rel == 'http://schemas.dmtf.org/cimi/1/action/stop'} %button{ :class => 'btn btn-warning', :type => :button, :onclick => '$("#frm_stop").submit()'} Stop - - if @machine.state == 'STOPPED' + - if @machine.operations.find {|o| o.rel == 'http://schemas.dmtf.org/cimi/1/action/start'} %button{ :class => 'btn btn-success', :type => :button, :onclick => '$("#frm_start").submit()'} Start - %button{ :class => 'btn btn-info', :type => :button, :onclick => '$("#frm_restart").submit()'} Reboot - %button{ :class => 'btn btn-danger', :type => :button, :onclick => '$("#frm_delete").submit()'} Destroy + - if @machine.operations.find {|o| o.rel == 'http://schemas.dmtf.org/cimi/1/action/restart'} + %button{ :class => 'btn btn-info', :type => :button, :onclick => '$("#frm_restart").submit()'} Reboot + - if @machine.operations.find {|o| o.rel == 'delete'} + %button{ :class => 'btn btn-danger', :type => :button, :onclick => '$("#frm_delete").submit()'} Destroy %p{:style => 'margin-top:1em;'} %a{ :href => "#{@machine.id}?format=xml", :class => 'label warning' } XML