Use divs for login form layout, start adding styles, extract strings
Use divs for login form layout, start adding styles, extract strings

--- a/css/gitphp.css
+++ b/css/gitphp.css
@@ -160,6 +160,25 @@
 	float: right;
 }
 
+/*
+ * login form
+ */
+div.loginError {
+	padding: 10px 5px 5px 96px;
+}
+div.loginForm {
+	padding: 5px 5px;
+}
+div.loginForm label {
+	float: left;
+	display: block;
+	width: 90px;
+	line-height: 23px;
+}
+div.loginForm input[type='submit'] {
+	margin-left: 92px;
+}
+
 
 /*
  * Geshi styles

--- a/locale/gitphp.pot
+++ b/locale/gitphp.pot
@@ -6,9 +6,9 @@
 #, fuzzy
 msgid ""
 msgstr ""
-"Project-Id-Version: GitPHP 0.2.7\n"
+"Project-Id-Version: GitPHP 0.2.8\n"
 "Report-Msgid-Bugs-To: xiphux@gmail.com\n"
-"POT-Creation-Date: 2012-10-10 20:32-0500\n"
+"POT-Creation-Date: 2012-10-13 16:53-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -61,7 +61,7 @@
 #: templates/treelist.tpl
 #: templates/projectlist.tpl
 #: templates/shortloglist.tpl
-#: include/controller/Controller_Snapshot.class.php:110
+#: include/controller/Controller_Snapshot.class.php:112
 msgid "snapshot"
 msgstr ""
 
@@ -306,9 +306,10 @@
 msgstr ""
 
 # Link back to the list of projects
+#: templates/login.tpl
 #: templates/main.tpl
 #: templates/projectbase.tpl
-#: include/controller/ControllerBase.class.php:487
+#: include/controller/ControllerBase.class.php:509
 #: include/controller/Controller_ProjectList.class.php:76
 msgid "projects"
 msgstr ""
@@ -438,7 +439,7 @@
 msgstr ""
 
 # Error message when user tries to do an action that requires a project but a project isn't specified
-#: include/controller/Controller_Message.class.php:142
+#: include/controller/Controller_Message.class.php:144
 msgid "Project is required"
 msgstr ""
 
@@ -455,7 +456,7 @@
 
 # Error message when user tries to access a project that doesn't exist
 # %1$s: the project the user tried to access
-#: include/controller/Controller_Message.class.php:136
+#: include/controller/Controller_Message.class.php:138
 #, php-format
 msgid "Invalid project %1$s"
 msgstr ""
@@ -472,18 +473,18 @@
 msgstr ""
 
 # Error message when a user tries to search but searching has been disabled in the config
-#: include/controller/Controller_Message.class.php:153
+#: include/controller/Controller_Message.class.php:155
 msgid "Search has been disabled"
 msgstr ""
 
 # Error message when a user tries to do a file search but searching files has been disabled in the config
-#: include/controller/Controller_Message.class.php:149
+#: include/controller/Controller_Message.class.php:151
 msgid "File search has been disabled"
 msgstr ""
 
 # Error message when a user's search query is too short
 # %1$d: the minimum number of characters
-#: include/controller/Controller_Message.class.php:166
+#: include/controller/Controller_Message.class.php:168
 #, php-format
 msgid "You must enter search text of at least %1$d character"
 msgid_plural "You must enter search text of at least %1$d characters"
@@ -491,7 +492,7 @@
 msgstr[1] ""
 
 # Error message when the user enters an unsupported search type
-#: include/controller/Controller_Message.class.php:160
+#: include/controller/Controller_Message.class.php:162
 msgid "Invalid search type"
 msgstr ""
 
@@ -520,49 +521,49 @@
 
 # Error message when user specifies a path for a project root or project, but the path given isn't a directory
 # %1$s: the path the user specified
-#: include/controller/Controller_Message.class.php:196
+#: include/controller/Controller_Message.class.php:198
 #, php-format
 msgid "%1$s is not a directory"
 msgstr ""
 
 # Error message when a path specified in the config is not a git repository
 # %1$s: the specified path
-#: include/controller/Controller_Message.class.php:208
+#: include/controller/Controller_Message.class.php:210
 #, php-format
 msgid "%1$s is not a git repository"
 msgstr ""
 
 # Error message when a path specified is using '..' to break out of the project root (a hack attempt)
 # %1$s: The specified path
-#: include/controller/Controller_Message.class.php:220
+#: include/controller/Controller_Message.class.php:222
 #, php-format
 msgid "%1$s is attempting directory traversal"
 msgstr ""
 
 # Error message when a path specified is outside of the project root
 # %1$s: The specified path
-#: include/controller/Controller_Message.class.php:226
+#: include/controller/Controller_Message.class.php:228
 #, php-format
 msgid "%1$s is outside of the projectroot"
 msgstr ""
 
 # Error message when user tries to specify a file with a list of the projects, but it isn't a file
 # %1$s: the path the user specified
-#: include/controller/Controller_Message.class.php:202
+#: include/controller/Controller_Message.class.php:204
 #, php-format
 msgid "%1$s is not a file"
 msgstr ""
 
 # Error message when user tries to specify a file with a list of the projects, but the system can't read the file
 # %1$s: the file the user specified
-#: include/controller/Controller_Message.class.php:214
+#: include/controller/Controller_Message.class.php:216
 #, php-format
 msgid "Failed to open project list file %1$s"
 msgstr ""
 
 # Error message when a hash specified in a URL isn't a valid git hash
 # %1$s: the hash entered
-#: include/controller/Controller_Message.class.php:172
+#: include/controller/Controller_Message.class.php:174
 #, php-format
 msgid "Invalid hash %1$s"
 msgstr ""
@@ -637,7 +638,7 @@
 
 # Error message when user hasn't defined a project root in the config
 # "projectroot" refers to a root directory where the user's git projects are stored
-#: include/controller/Controller_Message.class.php:184
+#: include/controller/Controller_Message.class.php:186
 msgid "A projectroot must be set in the config"
 msgstr ""
 
@@ -719,7 +720,7 @@
 
 # Used as an error message when memcache is turned
 # on without the appropriate PHP extension installed
-#: include/controller/Controller_Message.class.php:190
+#: include/controller/Controller_Message.class.php:192
 msgid ""
 "The Memcached or Memcache PHP extension is required for Memcache support"
 msgstr ""
@@ -739,7 +740,7 @@
 # Error message displayed when the git executable isn't found or doesn't work
 # %1$s: the git executable the system is trying to run
 # %2$s: the config value the user needs to set to specify the correct path
-#: include/controller/Controller_Message.class.php:178
+#: include/controller/Controller_Message.class.php:180
 #, php-format
 msgid ""
 "Could not run the git executable \"%1$s\".  You may need to set the \"%2$s\" "
@@ -780,7 +781,7 @@
 
 # Message when the config file failed to load
 # %1$s: the config file that we tried to load
-#: include/controller/Controller_Message.class.php:232
+#: include/controller/Controller_Message.class.php:234
 #, php-format
 msgid "Could not load config file %1$s"
 msgstr ""
@@ -803,22 +804,45 @@
 # Message displayed when an abbreviated hash is given
 # but it is ambiguous because there are multiple hashes
 # in the system with this abbreviation
-#: include/controller/Controller_Message.class.php:238
+#: include/controller/Controller_Message.class.php:240
 #, php-format
 msgid "Ambiguous abbreviated hash %1$s"
 msgstr ""
 
 # Message displayed when a directory that doesn't exist
 # is specified
-#: include/controller/Controller_Message.class.php:245
+#: include/controller/Controller_Message.class.php:247
 #, php-format
 msgid "Directory %1$s not found"
 msgstr ""
 
 # Message displayed when a file that doesn't exist is
 # specified
-#: include/controller/Controller_Message.class.php:252
+#: include/controller/Controller_Message.class.php:254
 #, php-format
 msgid "File %1$s not found"
 msgstr ""
 
+# Label for the username field on the login form
+#: templates/login.tpl
+msgid "username:"
+msgstr ""
+
+# Label for the password field on the login form
+#: templates/login.tpl
+msgid "password:"
+msgstr ""
+
+# Label for the link/button for a user to login to an account
+#: templates/login.tpl
+#: templates/main.tpl
+#: include/controller/Controller_Login.class.php:67
+msgid "login"
+msgstr ""
+
+# Label for the link for a user to log out of an account
+# %1: the account username
+#: templates/main.tpl
+msgid "logout %1"
+msgstr ""
+

--- a/templates/login.tpl
+++ b/templates/login.tpl
@@ -14,28 +14,25 @@
 
 {block name=main}
 {if $loginerror}
-<div class="loginerror">
+<div class="loginError error">
 {$loginerror}
 </div>
 {/if}
-<form method="post" action="{geturl action=login}">
-<table>
-  <tr>
-    <td><label for="username">Username:</label></td>
-    <td><input type="text" name="username" {if $username}value="{$username}"{/if} /></td>
-  </tr>
-  <tr>
-    <td><label for="password">Password:</label></td>
-    <td><input type="password" name="password" /></td>
-  </tr>
-  <tr>
-    <td></td>
-    <td><input type="submit" value="Login" /></td>
-  </tr>
-</table>
-{if $redirect}
-<input type="hidden" name="redirect" value="{$redirect|escape}" />
-{/if}
-</form>
+<div class="loginForm">
+  <form method="post" action="{geturl action=login}">
+    <div class="field">
+      <label for="username">{t}username:{/t}</label>
+      <input type="text" name="username" {if $username}value="{$username}"{/if} />
+    </div>
+    <div class="field">
+      <label for="password">{t}password:{/t}</label>
+      <input type="password" name="password" />
+    </div>
+    {if $redirect}
+    <input type="hidden" name="redirect" value="{$redirect|escape}" />
+    {/if}
+    <input type="submit" value="{t}login{/t}" />
+  </form>
+</div>
 {/block}
 

--- a/templates/main.tpl
+++ b/templates/main.tpl
@@ -90,9 +90,9 @@
       {if $loginenabled}
       <div class="login">
       {if $loggedinuser}
-        <a href="{geturl action=logout}" />logout {$loggedinuser|escape}</a>
+        <a href="{geturl action=logout}" />{t 1=$loggedinuser}logout %1{/t}</a>
       {else}
-        <a href="{geturl action=login}" />login</a>
+        <a href="{geturl action=login}" />{t}login{/t}</a>
       {/if}
       </div>
       {/if}

comments