[yast-devel] Re: [yast-commit] <web-client> master : Fixed footer content distance
On Mon, Dec 21, 2009 at 01:21:13PM +0530, Martin Schmidkunz wrote:
ref: refs/heads/master commit aed00ccad996bfe1be2d99ad42d0c0afb7bf15f3 Author: Martin Schmidkunz <mschmidkunz@suse.de> Date: Mon Dec 21 13:21:13 2009 +0530
Fixed footer content distance
ARGH! I hate it when people declare an innocent change like "fixed the spacing" while in fact adding substantial functionality. Full quote to appreciate the extent of the sin.
--- .../app/views/administrator/index.html.erb | 65 +++++++++++++++++--- .../app/views/mail_settings/index.html.erb | 60 +++++++++++++++++- plugins/network/app/views/network/index.html.erb | 39 ++++++++++++ webclient/public/stylesheets/style.css | 10 +++- 4 files changed, 159 insertions(+), 15 deletions(-)
diff --git a/plugins/administrator/app/views/administrator/index.html.erb b/plugins/administrator/app/views/administrator/index.html.erb index 07512bf..927ab13 100644 --- a/plugins/administrator/app/views/administrator/index.html.erb +++ b/plugins/administrator/app/views/administrator/index.html.erb @@ -8,6 +8,43 @@ label.error { display: none; color: red; padding-left: 11.5em; padding-bottom: 1em; text-align: left; vertical-align: top; width: 50% } </style>
+ <script type="text/javascript" charset="utf-8" src="/javascripts/jquery.example.js"></script> + + <script language="javascript"> + function changeBox() + { + document.getElementById('div1').style.display='none'; + document.getElementById('div2').style.display=''; + document.getElementById('password').focus(); + } + function restoreBox() + { + if(document.getElementById('password').value=='') + { + document.getElementById('div1').style.display=''; + document.getElementById('div2').style.display='none'; + } + } + </script> + + <script type="text/javascript"> + $(function() { + $('#administrator_password').example('Password'); + }); + </script> + + <script type="text/javascript"> + $(function() { + $('#administrator_confirm_password').example('Retype password'); + }); + </script> + + <script type="text/javascript"> + $(function() { + $('#administrator_aliases').example('Email adress to receive system mails'); + }); + </script> + <script type="text/javascript"> // define custom validation function // alias is actually a list of email aliases @@ -46,18 +83,28 @@
<% disabled = ! @permissions[:write] %>
- <p> - <%= - _("Here, configure the settings for system administrator ('root').") - %> - </p> - <% form_for(:administrator, @administrator, :url => { :action => "update" }, :html => { :method => :put, :id => "adminForm", :onsubmit => "$('#progress').show()", :autocomplete => :off } ) do |f| %> <%= f.error_messages %> - <fieldset id="password"> + <fieldset class="grid_12" id="div1"> + <label><%=_("Password")%></label> + <input name="pass_temp" type="text" value="New password for system administrator ('root')" size="20" maxlength="20" onfocus="changeBox()" /> + </fieldset> + <fieldset class="grid_12" id="div2" style="display:none"> + <label><%=_("Password")%></label> + <input name="password" id="password" type="password" value="" size="20" maxlength="20" onBlur="restoreBox()" /> + </fieldset> + <fieldset class="grid_12" id="div1"> + <label><%=_("Confirm password")%></label> + <input name="pass_temp" type="text" value="Retype new password" size="20" maxlength="20" onfocus="changeBox()" /> + </fieldset> + <fieldset class="grid_12" id="div2" style="display:none"> + <label><%=_("Confirm password")%></label> + <input name="password" id="password" type="password" value="" size="20" maxlength="20" onBlur="restoreBox()" /> + </fieldset> + <fieldset class="grid_12" id="password"> <p><label><%=_("Password")%></label> <!-- onkeyup handler is a workaround for a jQuery bug - it watches only one field for changes in equalTo check --> - <%= f.password_field :password, :disabled => disabled, :onkeyup => "if (password_validation_enabled) $('#adminForm').validate().element('#administrator_confirm_password');" %> + <%= f.password_field :password, :disabled => disabled, :onkeyup => "if (password_validation_enabled) $('#adminForm').validate().element('#administrator_confirm_password');", :onBlur=>"restoreBox()" %> </p> <p> <label><%=_("Confirm password")%></label> @@ -68,7 +115,7 @@ <p><label for="administrator_confirm_password" generated="true" class="error"></label><p> <p> <label><%=_("Forward mail to")%></label> - <%= f.text_field :aliases, :disabled => disabled, :class => "emails", :style => 'width: auto' %> + <%= f.text_field :aliases, :disabled => disabled, :class => "emails" %> <%= f.submit _("Save Mail"), :name => "save_aliases", :disabled => disabled, :onclick=>"return $('#adminForm').validate().element('#administrator_aliases');", :class=>'cancel' %> </p> <!-- this is a pre-generated placeholder for the validation messages --> diff --git a/plugins/mail_settings/app/views/mail_settings/index.html.erb b/plugins/mail_settings/app/views/mail_settings/index.html.erb index b5f5200..953802b 100644 --- a/plugins/mail_settings/app/views/mail_settings/index.html.erb +++ b/plugins/mail_settings/app/views/mail_settings/index.html.erb @@ -5,6 +5,39 @@ label.error { float: none; color: red; padding-left: .5em; vertical-align: top; } </style>
+ + <script type="text/javascript" src="/javascripts/jquery.example.js"></script> + + <script type="text/javascript"> + $(function() { + $('#mail_settings_smtp_server').example('SMTP server adress'); + }); + </script> + + <script type="text/javascript"> + $(function() { + $('#mail_settings_user').example('User name for SMTP server login'); + }); + </script> + + <script language="javascript"> + function changeBox() + { + document.getElementById('div1').style.display='none'; + document.getElementById('div2').style.display=''; + document.getElementById('password').focus(); + } + function restoreBox() + { + if(document.getElementById('password').value=='') + { + document.getElementById('div1').style.display=''; + document.getElementById('div2').style.display='none'; + } + } + </script> + + <script type="text/javascript"> // define custom validation function for SMTP server validation jQuery.validator.addMethod("smtp_server", function(value, element) { @@ -46,14 +79,16 @@ <%= f.error_messages %> <fieldset class="grid_12"> <p> - <label for="<%= :smtp_server %>"><%=_("Outgoing mail server <br> (SMTP)")%></label> + <label for="<%= :smtp_server %>"><%=_("Outgoing mail server")%></label> <%=f.text_field :smtp_server, :disabled => disabled, :class => "smtp_server" %></p> <p> - <label><%=_("Transport Layer Security<br> (TLS)")%></label> - <%= f.select :transport_layer_security, [ [_("Disabled"), "NONE" ], [_("If available"), "MAY"], [_("Always"), "MUST"]], :disabled => disabled %></p> + <label><%=_("Use secure connection (TLS)")%></label> + <%= f.select :transport_layer_security, [ [_("Never"), "NONE" ], [_("If available"), "MAY"], [_("Always"), "MUST"]], :disabled => disabled %></p> <p> <label><%=_("User name")%></label> <%= f.text_field :user, :disabled => disabled %></p> + </fieldset> + <fieldset class="grid_12"> <p> <label><%=_("Password")%></label> <%= f.password_field :password, :disabled => disabled, :onkeyup => "if (password_validation_enabled) $('#mailForm').validate().element('#mail_settings_confirm_password')" %></p> @@ -61,9 +96,26 @@ <label><%=_("Confirm password")%></label> <%= f.password_field :confirm_password, :disabled => disabled, :equalTo => "#mail_settings_password" %> </p> - </fieldset> + </fieldset> + <fieldset class="grid_12" id="div1"> + <label><%=_("Password")%></label> + <input name="pass_temp" type="text" value="Password for SMTP server login" size="20" maxlength="20" onfocus="changeBox()" /> + </fieldset> + <fieldset class="grid_12" id="div2" style="display:none"> + <label><%=_("Password")%></label> + <input name="password" id="password" type="password" value="" size="20" maxlength="20" onBlur="restoreBox()" /> + </fieldset> + <fieldset class="grid_12" id="div1"> + <label><%=_("Confirm password")%></label> + <input name="pass_temp" type="text" value="Retype password for SMTP server login" size="20" maxlength="20" onfocus="changeBox()" /> + </fieldset> + <fieldset class="grid_12" id="div2" style="display:none"> + <label><%=_("Confirm password")%></label> + <input name="password" id="password" type="password" value="" size="20" maxlength="20" onBlur="restoreBox()" /> + </fieldset> <p> <%= form_send_buttons :onclick=>"password_validation_enabled = true", :disabled => disabled %> </p> <% end %> </div> + diff --git a/plugins/network/app/views/network/index.html.erb b/plugins/network/app/views/network/index.html.erb index c7fc8ec..3933d7f 100644 --- a/plugins/network/app/views/network/index.html.erb +++ b/plugins/network/app/views/network/index.html.erb @@ -6,6 +6,45 @@ <%= javascript_include_tag :defaults %> <link rel="stylesheet" href="/inc/smoothness/jquery.ui.custom.css" type="text/css" media="screen" title="default" charset="utf-8" />
+ <script type="text/javascript" charset="utf-8" src="/javascripts/jquery.example.js"></script> + + <script type="text/javascript"> + $(function() { + $('#ip').example('Adress of this machine (e.g. 192.168.0.18)'); + }); + </script> + + <script type="text/javascript"> + $(function() { + $('#netmask').example('Adress shared with other machines (e.g. 255.255.255.0)'); + }); + </script> + + <script type="text/javascript"> + $(function() { + $('#name').example('Name of this machine in the network (e.g. mycomputer)'); + }); + </script> + + <script type="text/javascript"> + $(function() { + $('#domain').example('Network name (e.g. example.com)'); + }); + </script> + + <script type="text/javascript"> + $(function() { + $('#nameservers').example(''); + }); + </script> + + + <script type="text/javascript"> + $(function() { + $('#default_route').example('Target adress for outgoing IP data packages'); + }); + </script> + <% javascript_tag do -%> function disable_static_config(abool) { $("#ip")[0].disabled = abool; diff --git a/webclient/public/stylesheets/style.css b/webclient/public/stylesheets/style.css index a0a2138..4d541c7 100644 --- a/webclient/public/stylesheets/style.css +++ b/webclient/public/stylesheets/style.css @@ -64,9 +64,10 @@ input { color: #666; font-size: 1em; background: #fcfcfc; + width: 24em; } input[type="text"] { - width: 13em; + width: 24em; } input:focus { border: 1px solid #69c; @@ -122,7 +123,7 @@ ul li { }
#content { - min-height: 600px; + margin-top: 2em; } #content h2 { @@ -629,6 +630,9 @@ input { margin: 1em; }
+.example{ + font-style:italic; +}
/* Error Messages */ @@ -644,3 +648,5 @@ input { float: left; margin-right: 0.3em; } + + -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org -- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner
Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
participants (1)
-
Martin Vidner