From 06ec855be2e108e23162d71a7228b437ee785fa8 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Mon, 21 Sep 2009 14:34:57 +0000 Subject: [PATCH] slice creation page - sites sorted and correctly show current site - layout reviewed register node not shown in planetlab.module to simple users various cosmetic --- modules/planetlab.module | 3 ++- planetlab/css/plc_style.css | 47 ++++++++++++++++++++++------------ planetlab/events/events.php | 2 +- planetlab/nodes/node.php | 1 - planetlab/slices/slice_add.php | 28 ++++++++++++-------- plekit/php/linetabs.php | 2 ++ 6 files changed, 53 insertions(+), 30 deletions(-) diff --git a/modules/planetlab.module b/modules/planetlab.module index ec784be..95647a2 100644 --- a/modules/planetlab.module +++ b/modules/planetlab.module @@ -182,7 +182,8 @@ function planetlab_block($op = 'list', $delta = 0, $edit = array()) { $bullet_item .= href(l_nodes(),"Nodes"); $bullet_item .= ul_start(); $bullet_item .= plc_my_node_links(); - $bullet_item .= leaf( href (l_register_node(),"Register Node")); + if (plc_is_admin() || plc_is_pi() || plc_is_tech()) + $bullet_item .= leaf( href (l_register_node(),"Register Node")); $bullet_item .= ul_end(); $items [] = expanded($bullet_item); diff --git a/planetlab/css/plc_style.css b/planetlab/css/plc_style.css index 7897556..8df53c4 100644 --- a/planetlab/css/plc_style.css +++ b/planetlab/css/plc_style.css @@ -79,16 +79,6 @@ p.node_download { font-size: larger; } -div.slice_add { - padding: 20px 40px; -} -div.slice_add p { - font-size: larger; -* text-align: center; */ -} -div.slice_add * { - font-style: italic; -} .bold { font-weight: bold; } @@ -98,13 +88,8 @@ div.slice_add * { h3.node_download { text-align: center; } -div#add_slice_in_site { - text-align:center; -} -#add_slice_choose_site { - margin:20px ; -} +/****************************************/ /* registrations */ div.site-register { background-color: #c8c7de; @@ -122,3 +107,33 @@ div.person-register { padding: 5px; margin: 10px; } + +/****************************************/ +/* slice creation page */ +#create-slice-choose-site { + margin:20px ; +} +div#create-slice-in-site { + text-align:center; +} +div.create-slice-instantiations { + padding: 5px 0px 0px 0px; +/* font-size: larger; */ + font-style: italic; +} +div#toggle-container-create-slice-details { + background-color: #e5dbb7; +} +div#toggle-area-create-slice-details { + padding: 20px 5px 5px 5px; +} +div#toggle-container-create-slice-persons { + background-color: #dfe6a1; +} +div#toggle-area-create-slice-persons { + padding: 20px 5px 5px 5px; +} +/* override details default */ +div#toggle-area-create-slice-details>table.plc_details { + margin:0 ; +} diff --git a/planetlab/events/events.php b/planetlab/events/events.php index 302bdc7..e04d762 100644 --- a/planetlab/events/events.php +++ b/planetlab/events/events.php @@ -263,7 +263,7 @@ foreach ($events as $event) { // the message button $trunc_mess=htmlentities(truncate($event['message'],40),ENT_QUOTES); $message="%s',$message,$message); $message=truncate($event['message'],40); diff --git a/planetlab/nodes/node.php b/planetlab/nodes/node.php index 5236503..ec3e03d 100644 --- a/planetlab/nodes/node.php +++ b/planetlab/nodes/node.php @@ -329,7 +329,6 @@ $form->start(); $table->row_start(); $peers->cell ($table,$slice['peer_id']); $table->cell (l_slice_t ($slice['slice_id'],$slice['name'])); - # xxx l_sliver not implemented yet - what should we show exactly ? $table->cell (l_sliver_t ($node_id,$slice['slice_id'],'sliver tags')); $table->row_end(); } diff --git a/planetlab/slices/slice_add.php b/planetlab/slices/slice_add.php index 26d6a23..4558e84 100644 --- a/planetlab/slices/slice_add.php +++ b/planetlab/slices/slice_add.php @@ -155,20 +155,20 @@ $multiple_sites=false; $site_columns=array('name','login_base','site_id'); if (plc_is_admin ()) { $multiple_sites=true; - $filter=NULL; + $filter=array('-SORT'=>'name'); } else if (count (plc_my_site_ids()) > 1) { $multiple_sites=true; - $filter=plc_my_site_ids(); + $filter=array('-SORT'=>'name','site_id'=>plc_my_site_ids()); } if ($multiple_sites) { - print "
"; + print "
"; $other_sites=$api->GetSites($filter,$site_columns); $selectors=array(); foreach ($other_sites as $other_site) { $selector=array('display'=>$other_site['name'], 'value'=>$other_site['site_id']); - if ($other_site['site_id']==$other_site_id) $selector['selected']='selected'; + if ($other_site['site_id']==$site_id) $selector['selected']='selected'; $selectors []= $selector; } @@ -176,13 +176,13 @@ if ($multiple_sites) { $site_form->start(); print $site_form->label_html('site_id','Or choose some other site'); print $site_form->select_html('site_id',$selectors,array('autosubmit'=>true, - 'id'=>'add_slice_choose_site')); + 'id'=>'create-slice-choose-site')); $site_form->end(); print "
"; } print <<< EOF -
+

You must provide a short description of the new slice as well as a link to a project website before creating it.
@@ -202,12 +202,15 @@ New software releases and available services are announced here as well.

EOF; +$toggle = new PlekitToggle ('create-slice-details','Slice Details', + array ('visible'=>get_arg('show_slice',true))); $details = new PlekitDetails(TRUE); $form_variables = array('site_id'=>plc_my_site_id()); $form = $details -> form_start("/db/slices/slice_add.php",$form_variables); print $form->hidden_html("site_id",$site_id); +$toggle->start(); $details->start(); $running=count($site['slice_ids']); @@ -230,10 +233,8 @@ $details->th_td("Instanciation",$instanciation_select,"instantiation", array('input_type'=>'select', 'value'=>$instantiation)); -$details->end(); - -print <<< EOF -
+$instantiation_text = <<< EOF +

There are four possible "instantiation" states for a slice.

  • PLC creates a slice with default settings.
  • @@ -244,9 +245,14 @@ print <<< EOF
EOF; +$details->tr($instantiation_text); + +$details->end(); +$toggle->end(); + if ($persons) { $title = count($persons) . " people can be added in slice"; - $toggle=new PlekitToggle ('persons',$title, + $toggle=new PlekitToggle ('create-slice-persons',$title, array('visible'=>get_arg('show_persons',true))); $toggle->start(); diff --git a/plekit/php/linetabs.php b/plekit/php/linetabs.php index 57af891..ce5e808 100644 --- a/plekit/php/linetabs.php +++ b/plekit/php/linetabs.php @@ -46,6 +46,8 @@ drupal_set_html_head(' // (*) you need to tune the image size, which is wrong, as the image should rather be bottom-aligned function plekit_linetabs ($tabs, $id=NULL) { + // do not output anything if $tabs has no entry (unpleasant rendering) + if (empty ($tabs)) return; $active_line_tab=$_GET['active_line_tab']; // need id to pass to the onclick function attached to the input buttons $id="linetabs"; -- 2.43.0