Changeset:
        b851618aee0c
        
https://sourceforge.net/p/mrbs/hg-code/ci/b851618aee0c4978133b054fca1d81f49ce62cde
Author:
        Campbell Morrison <[email protected]>
Date:
        Mon Mar 06 14:15:20 2017 +0000
Log message:

Moved the colon after form labels out of HTML and into CSS so that it can easily
be changed for languages that expect a different treatment (eg French).

diffstat:

 web/admin.php                     |  12 +++---
 web/css/mrbs-ielte8.css           |  11 ++++++
 web/css/mrbs.css.php              |   8 ++++
 web/edit_area_room.php            |  70 +++++++++++++++++++-------------------
 web/edit_entry.php                |  30 ++++++++--------
 web/edit_users.php                |   4 +-
 web/functions.inc                 |   6 +-
 web/import.php                    |  14 +++---
 web/js/edit_area_room.js.php      |   2 +-
 web/report.php                    |  32 ++++++++--------
 web/search.php                    |   4 +-
 web/session/functions_session.inc |   4 +-
 12 files changed, 108 insertions(+), 89 deletions(-)

diffs (truncated from 855 to 300 lines):

diff -r f3e264491bb1 -r b851618aee0c web/admin.php
--- a/web/admin.php     Sun Mar 05 16:46:28 2017 +0000
+++ b/web/admin.php     Mon Mar 06 14:15:20 2017 +0000
@@ -97,7 +97,7 @@
     echo "<legend></legend>\n";
   
     // The area selector
-    echo "<label id=\"area_label\" for=\"area_select\">" . get_vocab("area") . 
":</label>\n";
+    echo "<label id=\"area_label\" for=\"area_select\">" . get_vocab("area") . 
"</label>\n";
     echo "<select class=\"room_area_select\" id=\"area_select\" name=\"area\" 
onchange=\"this.form.submit()\">";
     if ($is_admin)
     {
@@ -167,7 +167,7 @@
       <input type="hidden" name="type" value="area">
 
       <div>
-        <label for="area_name"><?php echo get_vocab("name") ?>:</label>
+        <label for="area_name"><?php echo get_vocab("name") ?></label>
         <input type="text" id="area_name" name="name" maxlength="<?php echo 
$maxlength['area.area_name'] ?>">
       </div>
           
@@ -396,22 +396,22 @@
         <input type="hidden" name="area" value="<?php echo $area; ?>">
         
         <div>
-          <label for="room_name"><?php echo get_vocab("name") ?>:</label>
+          <label for="room_name"><?php echo get_vocab("name") ?></label>
           <input type="text" id="room_name" name="name" maxlength="<?php echo 
$maxlength['room.room_name'] ?>">
         </div>
         
         <div>
-          <label for="room_description"><?php echo get_vocab("description") 
?>:</label>
+          <label for="room_description"><?php echo get_vocab("description") 
?></label>
           <input type="text" id="room_description" name="description" 
maxlength="<?php echo $maxlength['room.description'] ?>">
         </div>
         
         <div>
-          <label for="room_capacity"><?php echo get_vocab("capacity") 
?>:</label>
+          <label for="room_capacity"><?php echo get_vocab("capacity") 
?></label>
           <input type="text" id="room_capacity" name="capacity">
         </div>
 
         <div>
-          <label for="room_admin_email"><?php echo 
get_vocab("room_admin_email") ?>:</label>
+          <label for="room_admin_email"><?php echo 
get_vocab("room_admin_email") ?></label>
           <input type="text" id="room_admin_email" name="room_admin_email">
         </div>
        
diff -r f3e264491bb1 -r b851618aee0c web/css/mrbs-ielte8.css
--- a/web/css/mrbs-ielte8.css   Sun Mar 05 16:46:28 2017 +0000
+++ b/web/css/mrbs-ielte8.css   Mon Mar 06 14:15:20 2017 +0000
@@ -1,6 +1,17 @@
 
 /* Fixes for Internet Explorer 8 and below */
 
+/* IE8 can't do pseudo-elements ('::') so use a
+   pseudo-class (':') */
+   
+label:after {
+  content: ':';
+}
+
+label.no_suffix:after {
+  content: '';
+}
+
 /* ------------ PRIVATE BOOKINGS ---------------------------*/
 
 /* Opacity doesn't work well in IE8 and below, so we'll just change */
diff -r f3e264491bb1 -r b851618aee0c web/css/mrbs.css.php
--- a/web/css/mrbs.css.php      Sun Mar 05 16:46:28 2017 +0000
+++ b/web/css/mrbs.css.php      Mon Mar 06 14:15:20 2017 +0000
@@ -69,6 +69,14 @@
 fieldset fieldset {position: relative; clear: left; width: 100%; padding: 0; 
border: 0; margin: 0}  /* inner fieldsets are invisible */
 fieldset fieldset legend {font-size: 0}        /* for IE: even if there is no 
legend text, IE allocates space  */
 
+label::after {
+  content: ':';
+}
+
+label.no_suffix::after {
+  content: '';
+}
+
 <?php
 // DataTables don't work well with border-collapse: collapse and scrollX: 
100%.   In fact they
 // don't work well either with a border round the table.   So we put the left 
and right borders
diff -r f3e264491bb1 -r b851618aee0c web/edit_area_room.php
--- a/web/edit_area_room.php    Sun Mar 05 16:46:28 2017 +0000
+++ b/web/edit_area_room.php    Mon Mar 06 14:15:20 2017 +0000
@@ -98,7 +98,7 @@
     }
   }
   
-  $params = array('label'   => get_vocab('timezone') . ':',
+  $params = array('label'   => get_vocab('timezone'),
                   'name'    => 'area_timezone',
                   'options' => $timezones,
                   'value'   => $timezone);
@@ -145,7 +145,7 @@
   echo "<legend>" . get_vocab("booking_creation") . "</legend>\n";
   // Minimum book ahead
   echo "<div>\n";
-  $params = array('label' => get_vocab("min_book_ahead") . ":",
+  $params = array('label' => get_vocab("min_book_ahead"),
                   'name'  => 'area_min_create_ahead_enabled',
                   'value' => $min_create_ahead_enabled,
                   'class' => 'enabler');
@@ -166,7 +166,7 @@
   
   // Maximum book ahead
   echo "<div>\n";
-  $params = array('label' => get_vocab("max_book_ahead") . ":",
+  $params = array('label' => get_vocab("max_book_ahead"),
                   'name'  => 'area_max_create_ahead_enabled',
                   'value' => $max_create_ahead_enabled,
                   'class' => 'enabler');
@@ -191,7 +191,7 @@
   echo "<legend>" . get_vocab("booking_deletion") . "</legend>\n";
   // Minimum book ahead
   echo "<div>\n";
-  $params = array('label' => get_vocab("min_book_ahead") . ":",
+  $params = array('label' => get_vocab("min_book_ahead"),
                   'name'  => 'area_min_delete_ahead_enabled',
                   'value' => $min_delete_ahead_enabled,
                   'class' => 'enabler');
@@ -211,7 +211,7 @@
   
   // Maximum book ahead
   echo "<div>\n";
-  $params = array('label' => get_vocab("max_book_ahead") . ":",
+  $params = array('label' => get_vocab("max_book_ahead"),
                   'name'  => 'area_max_delete_ahead_enabled',
                   'value' => $max_delete_ahead_enabled,
                   'class' => 'enabler');
@@ -255,7 +255,7 @@
   foreach ($interval_types as $interval_type)
   {
     echo "<tr>\n";
-    echo "<td><label>" . get_vocab("max_per_${interval_type}") . 
":</label></td>\n";
+    echo "<td><label>" . get_vocab("max_per_${interval_type}") . 
"</label></td>\n";
     echo "<td><input class=\"enabler checkbox\" type=\"checkbox\" 
id=\"area_max_per_${interval_type}_enabled\" 
name=\"area_max_per_${interval_type}_enabled\"" .
          (($max_per_interval_area_enabled[$interval_type]) ? " 
checked=\"checked\"" : "") .
          ">\n";
@@ -284,7 +284,7 @@
   echo "<legend>" . get_vocab("booking_durations") . "</legend>\n";
 
   echo "<div>\n";
-  $params = array('label' => get_vocab("max_duration") . ":",
+  $params = array('label' => get_vocab("max_duration"),
                   'name'  => 'area_max_duration_enabled',
                   'value' => $max_duration_enabled,
                   'class' => 'enabler');
@@ -297,7 +297,7 @@
                       'min="0"',
                       'step="1"');
   $params = array('name'       => 'area_max_duration_periods',
-                  'label'      => get_vocab("mode_periods") . ':',
+                  'label'      => get_vocab("mode_periods"),
                   'value'      => $max_duration_periods,
                   'attributes' => $attributes);
   generate_input($params);
@@ -311,7 +311,7 @@
                       'min="0"',
                       'step="1"');
   $params = array('name'       => 'area_max_duration_value',
-                  'label'      => get_vocab("mode_times") . ':',
+                  'label'      => get_vocab("mode_times"),
                   'value'      => $max_duration_value,
                   'attributes' => $attributes);
   generate_input($params);
@@ -917,7 +917,7 @@
       
       // The area select box
       echo "<div>\n";
-      $params = array('label'         => get_vocab("area") . ":",
+      $params = array('label'         => get_vocab("area"),
                       'name'          => 'new_area',
                       'options'       => $areas,
                       'force_assoc'   => TRUE,
@@ -931,7 +931,7 @@
       // First of all deal with the standard MRBS fields
       // Room name
       echo "<div>\n";
-      $params = array('label'         => get_vocab("name") . ":",
+      $params = array('label'         => get_vocab("name"),
                       'name'          => 'room_name',
                       'value'         => $room_data['room_name'],
                       'disabled'      => $disabled,
@@ -944,7 +944,7 @@
       if ($is_admin)
       {
         echo "<div>\n";
-        $params = array('label'         => get_vocab("sort_key") . ":",
+        $params = array('label'         => get_vocab("sort_key"),
                         'label_title'   => get_vocab("sort_key_note"),
                         'name'          => 'sort_key',
                         'value'         => $room_data['sort_key'],
@@ -960,7 +960,7 @@
         echo "<div>\n";
         $options = array('0' => get_vocab("enabled"),
                          '1' => get_vocab("disabled"));
-        $params = array('label'         => get_vocab("status") . ":",
+        $params = array('label'         => get_vocab("status"),
                         'label_title'   => get_vocab("disabled_room_note"),
                         'name'          => 'room_disabled',
                         'value'         => ($room_data['disabled']) ? '1' : 
'0',
@@ -974,7 +974,7 @@
 
       // Description
       echo "<div>\n";
-      $params = array('label'         => get_vocab("description") . ":",
+      $params = array('label'         => get_vocab("description"),
                       'name'          => 'description',
                       'value'         => $room_data['description'],
                       'disabled'      => $disabled,
@@ -984,7 +984,7 @@
       
       // Capacity
       echo "<div>\n";
-      $params = array('label'         => get_vocab("capacity") . ":",
+      $params = array('label'         => get_vocab("capacity"),
                       'name'          => 'capacity',
                       'value'         => $room_data['capacity'],
                       'disabled'      => $disabled,
@@ -994,7 +994,7 @@
       
       // Room admin email
       echo "<div>\n";
-      $params = array('label'         => get_vocab("room_admin_email") . ":",
+      $params = array('label'         => get_vocab("room_admin_email"),
                       'label_title'   => get_vocab("email_list_note"),
                       'name'          => 'room_admin_email',
                       'value'         => $room_data['room_admin_email'],
@@ -1009,7 +1009,7 @@
       {
         // Only show the raw HTML to admins.  Non-admins will see the rendered 
HTML
         echo "<div>\n";
-        $params = array('label'         => get_vocab("custom_html") . ":",
+        $params = array('label'         => get_vocab("custom_html"),
                         'label_title'   => get_vocab("custom_html_note"),
                         'name'          => 'custom_html',
                         'value'         => $room_data['custom_html'],
@@ -1026,7 +1026,7 @@
         if (!in_array($field['name'], $standard_fields['room']))
         {
           echo "<div>\n";
-          $params = array('label'         => get_loc_field_name($tbl_room, 
$field['name']) . ":",
+          $params = array('label'         => get_loc_field_name($tbl_room, 
$field['name']),
                           'name'          => VAR_PREFIX . $field['name'],
                           'value'         => $room_data[$field['name']],
                           'disabled'      => $disabled,
@@ -1131,7 +1131,7 @@
   
   // Area name  
   echo "<div>\n";
-  $params = array('label' => get_vocab("name") . ":",
+  $params = array('label' => get_vocab("name"),
                   'name'  => 'area_name',
                   'value' => $area_data['area_name']);
   generate_input($params);
@@ -1139,7 +1139,7 @@
   
   // Sort key
   echo "<div>\n";
-  $params = array('label'       => get_vocab("sort_key") . ":",
+  $params = array('label'       => get_vocab("sort_key"),
                   'label_title' => get_vocab("sort_key_note"),
                   'name'        => 'sort_key',
                   'value'       => $area_data['sort_key']);
@@ -1150,7 +1150,7 @@
   echo "<div id=\"status\">\n";
   $options = array('0' => get_vocab("enabled"),
                    '1' => get_vocab("disabled"));
-  $params = array('label'       => get_vocab("status") . ":",
+  $params = array('label'       => get_vocab("status"),
                   'label_title' => get_vocab("disabled_area_note"),
                   'name'        => 'area_disabled',
                   'value'       => ($area_data['disabled']) ? '1' : '0',
@@ -1164,7 +1164,7 @@
   
   // Area admin email
   echo "<div>\n";
-  $params = array('label'       => get_vocab("area_admin_email") . ":",
+  $params = array('label'       => get_vocab("area_admin_email"),
                   'label_title' => get_vocab("email_list_note"),
                   'name'        => 'area_admin_email',
                   'value'       => $area_data['area_admin_email'],
@@ -1174,7 +1174,7 @@
       
   // The custom HTML
   echo "<div>\n";
-  $params = array('label'       => get_vocab("custom_html") . ":",
+  $params = array('label'       => get_vocab("custom_html"),
                   'label_title' => get_vocab("custom_html_note"),
                   'name'        => 'custom_html',
                   'value'       => $area_data['custom_html'],
@@ -1186,7 +1186,7 @@
   echo "<div id=\"mode\">\n";
   $options = array('1' => get_vocab("mode_periods"),

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to