]> git.wh0rd.org - tt-rss.git/blob - include/login_form.php
dijit style updates
[tt-rss.git] / include / login_form.php
1 <?php startup_gettext(); ?>
2 <html>
3 <head>
4 <title>Tiny Tiny RSS : Login</title>
5 <?php echo stylesheet_tag("lib/dijit/themes/claro/claro.css") ?>
6 <?php echo stylesheet_tag("css/tt-rss.css") ?>
7 <?php echo stylesheet_tag("css/dijit.css") ?>
8 <link rel="shortcut icon" type="image/png" href="images/favicon.png">
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
10 <?php
11 foreach (array("lib/prototype.js",
12 "lib/dojo/dojo.js",
13 "lib/dojo/tt-rss-layer.js",
14 "js/functions.js",
15 "errors.php?mode=js") as $jsfile) {
16
17 echo javascript_tag($jsfile);
18
19 } ?>
20
21 <script type="text/javascript">
22 require({cache:{}});
23 Event.observe(window, 'load', function() {
24 init();
25 });
26 </script>
27 <style type="text/css">
28 body#ttrssLogin {
29 padding : 2em;
30 font-size : 14px;
31 }
32
33 fieldset {
34 margin-left : auto;
35 margin-right : auto;
36 display : block;
37 width : 400px;
38 border-width : 0px;
39 }
40
41 /*input.input {
42 font-family : sans-serif;
43 font-size : medium;
44 border-spacing : 2px;
45 border : 1px solid #b5bcc7;
46 padding : 2px;
47 }*/
48
49 label {
50 width : 120px;
51 margin-right : 20px;
52 display : inline-block;
53 text-align : right;
54 color : gray;
55 }
56
57 div.header {
58 border-width : 0px 0px 1px 0px;
59 border-style : solid;
60 border-color : #0088cc;
61 margin-bottom : 1em;
62 padding-bottom : 5px;
63 }
64
65 div.footer {
66 margin-top : 1em;
67 padding-top : 5px;
68 border-width : 1px 0px 0px 0px;
69 border-style : solid;
70 border-color : #0088cc;
71 text-align : center;
72 color : gray;
73 font-size : 12px;
74 }
75
76 a.forgotpass {
77 text-align : right;
78 font-size : 11px;
79 display : inline-block;
80 }
81
82 a {
83 color : #0088cc;
84 }
85
86 a {
87 color: #0088cc;
88 text-decoration: none;
89 }
90
91 a:hover,
92 a:focus {
93 color: #005580;
94 text-decoration: underline;
95 }
96
97 div.footer a {
98 color : gray;
99 }
100
101 div.footer a:hover {
102 color : #0088cc;
103 }
104
105 div.row {
106 padding : 0px 0px 5px 0px;
107 }
108
109 div.row-error {
110 color : red;
111 text-align : center;
112 padding : 0px 0px 5px 0px;
113 }
114
115 </style>
116 </head>
117
118 <body id="ttrssLogin" class="claro">
119
120 <script type="text/javascript">
121 function init() {
122
123 require(['dojo/parser','dijit/form/Button','dijit/form/CheckBox','dijit/form/Form',
124 'dijit/form/Select','dijit/form/TextBox','dijit/form/ValidationTextBox'],function(parser){
125 parser.parse();
126 //show tooltip node only after this widget is instaniated.
127 dojo.query('div[dojoType="dijit.Tooltip"]').style({
128 display:''
129 });
130 fetchProfiles();
131 dijit.byId("bw_limit").attr("checked", getCookie("ttrss_bwlimit") == 'true');
132 document.forms.loginForm.login.focus();
133 });
134
135 }
136
137 function fetchProfiles() {
138 try {
139 var query = "op=getProfiles&login=" + param_escape(document.forms["loginForm"].login.value);
140
141 if (query) {
142 new Ajax.Request("public.php", {
143 parameters: query,
144 onComplete: function(transport) {
145 if (transport.responseText.match("select")) {
146 $('profile_box').innerHTML = transport.responseText;
147 dojo.parser.parse('profile_box');
148 }
149 } });
150 }
151
152 } catch (e) {
153 exception_error("fetchProfiles", e);
154 }
155 }
156
157
158 function gotoRegForm() {
159 window.location.href = "register.php";
160 return false;
161 }
162
163 function bwLimitChange(elem) {
164 try {
165 var limit_set = elem.checked;
166
167 setCookie("ttrss_bwlimit", limit_set,
168 <?php print SESSION_COOKIE_LIFETIME ?>);
169
170 } catch (e) {
171 exception_error("bwLimitChange", e);
172 }
173 }
174 </script>
175
176 <?php $return = urlencode($_SERVER["REQUEST_URI"]) ?>
177
178 <form action="public.php?return=<?php echo $return ?>"
179 dojoType="dijit.form.Form" method="POST" id="loginForm" name="loginForm">
180
181 <input dojoType="dijit.form.TextBox" style="display : none" name="op" value="login">
182
183 <div class='header'>
184 <img src="images/logo_wide.png">
185 </div>
186
187 <div class='form'>
188
189 <fieldset>
190 <?php if ($_SESSION["login_error_msg"]) { ?>
191 <div class="row-error">
192 <?php echo $_SESSION["login_error_msg"] ?>
193 </div>
194 <?php $_SESSION["login_error_msg"] = ""; ?>
195 <?php } ?>
196 <div class="row">
197 <label><?php echo __("Login:") ?></label>
198 <input name="login" class="input input-text" type="text"
199 onchange="fetchProfiles()" onfocus="fetchProfiles()" onblur="fetchProfiles()"
200 style="width : 220px"
201 required="1"
202 value="<?php echo $_SESSION["fake_login"] ?>" />
203 </div>
204
205
206 <div class="row">
207 <label><?php echo __("Password:") ?></label>
208 <input type="password" name="password" required="1"
209 style="width : 220px" class="input input-text"
210 value="<?php echo $_SESSION["fake_password"] ?>"/>
211 <label></label>
212 <?php if (strpos(PLUGINS, "auth_internal") !== FALSE) { ?>
213 <a class='forgotpass' href="public.php?op=forgotpass"><?php echo __("I forgot my password") ?></a>
214 <?php } ?>
215 </div>
216
217
218 <div class="row">
219 <label><?php echo __("Profile:") ?></label>
220
221 <span id='profile_box'><select disabled='disabled' dojoType='dijit.form.Select'
222 style='width : 220px; margin : 0px'>
223 <option><?php echo __("Default profile") ?></option></select></span>
224
225 </div>
226
227 <div class="row">
228 <label>&nbsp;</label>
229 <input dojoType="dijit.form.CheckBox" name="bw_limit" id="bw_limit" type="checkbox"
230 onchange="bwLimitChange(this)">
231 <label id="bw_limit_label" style='display : inline' for="bw_limit"><?php echo __("Use less traffic") ?></label>
232 </div>
233
234 <div dojoType="dijit.Tooltip" connectId="bw_limit_label" position="below" style="display:none">
235 <?php echo __("Does not display images in articles, reduces automatic refreshes."); ?>
236 </div>
237
238 <?php if (SESSION_COOKIE_LIFETIME > 0) { ?>
239
240 <div class="row">
241 <label>&nbsp;</label>
242 <input dojoType="dijit.form.CheckBox" name="remember_me" id="remember_me" type="checkbox">
243 <label style='display : inline' for="remember_me"><?php echo __("Remember me") ?></label>
244 </div>
245
246 <?php } ?>
247
248 <div class="row" style='text-align : right'>
249 <button dojoType="dijit.form.Button" type="submit"><?php echo __('Log in') ?></button>
250 <?php if (defined('ENABLE_REGISTRATION') && ENABLE_REGISTRATION) { ?>
251 <button onclick="return gotoRegForm()" dojoType="dijit.form.Button">
252 <?php echo __("Create new account") ?></button>
253 <?php } ?>
254 </div>
255
256 </fieldset>
257
258
259 </div>
260
261 <div class='footer'>
262 <a href="http://tt-rss.org/">Tiny Tiny RSS</a>
263 &copy; 2005&ndash;<?php echo date('Y') ?> <a href="http://fakecake.org/">Andrew Dolgov</a>
264 </div>
265
266 </form>
267
268 </body></html>