slice creation page - sites sorted and correctly show current site - layout reviewed
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 21 Sep 2009 14:34:57 +0000 (14:34 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 21 Sep 2009 14:34:57 +0000 (14:34 +0000)
register node not shown in planetlab.module to simple users
various cosmetic

modules/planetlab.module
planetlab/css/plc_style.css
planetlab/events/events.php
planetlab/nodes/node.php
planetlab/slices/slice_add.php
plekit/php/linetabs.php

index ec784be..95647a2 100644 (file)
@@ -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);
 
index 7897556..8df53c4 100644 (file)
@@ -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 ;
+}
index 302bdc7..e04d762 100644 (file)
@@ -263,7 +263,7 @@ foreach ($events as $event) {
   // the message button
   $trunc_mess=htmlentities(truncate($event['message'],40),ENT_QUOTES);
   $message="<input type=button name='message' value='" . $trunc_mess ."' onclick='alert(\"" . $text . "\")'";
-  $details="<input type=button name='message' value='X' onclick='alert(\"" . $text . "\")'";
+  $details="<input type=button name='message' value='+' onclick='alert(\"" . $text . "\")'";
   //    $message=sprintf('<span title="%s">%s</span>',$message,$message);
   
   $message=truncate($event['message'],40);
index 5236503..ec3e03d 100644 (file)
@@ -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();
     }
index 26d6a23..4558e84 100644 (file)
@@ -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 "<div id='add_slice_in_site'>";
+  print "<div id='create-slice-in-site'>";
   $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 "</div>";
  }
                  
 print <<< EOF
-<div class='slice_add'>
+<div class='create-slice-instantiations'>
 <p>You must provide a short description of the new slice 
 as well as a link to a project website before creating it. 
 <br/>
@@ -202,12 +202,15 @@ New software releases and available services are announced here as well.
 </div>
 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
-<div class='slice_add'>
+$instantiation_text = <<< EOF
+<div class='create-slice-instantiations'>
 <p>There are four possible "instantiation" states for a slice.</p>
 <ul>
 <li> <strong>PLC</strong> creates a slice with default settings. </li>
@@ -244,9 +245,14 @@ print <<< EOF
 </div>
 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();
   
index 57af891..ce5e808 100644 (file)
@@ -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";