Skip to content

Commit

Permalink
css info text color, sign in translated
Browse files Browse the repository at this point in the history
  • Loading branch information
dxwc committed Jan 11, 2019
1 parent bef6cc5 commit 357f2d7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
15 changes: 10 additions & 5 deletions controller/sign_in.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ router.post('/sign_in', (req, res) =>
// Check captcha
if(!captcha.captcha_is_valid(req))
{
req.body.info = `Captcha invalid, retry`;
req.body.info = `অক্ষরগুলি ঠিক হয়নি, আবার চেষ্টা করুন`;
return render(req, res, 'sign_in', req.body, true, 409);
}

Expand All @@ -44,15 +44,18 @@ router.post('/sign_in', (req, res) =>
if(err)
{
console.log(err);
req.body.info = `Unexpected error, you may retry or contact admin`;
req.body.info =
`দুঃখিত, কোথাও গরমিল হয়েছে। ` +
`আবার চেষ্টা করে দেখতে পারেন অথবা নিচে যোগাযোগ লিংক এ চাপ দিয়ে ` +
`পরিচালকদের জানাতে পারেন।`;
return render(req, res, 'sign_in', req.body, true, 500);

}
if(!user) /* User not found */
{
req.body.info =
`No such user and password combination found. ` +
`Double check or re-enter your inputs and then retry`;
`ওই নাম ও গুপ্ত অক্ষর মিলিত কোনো নিবন্ধন পাওয়া যায়নি। ` +
`নাম ও গুপ্ত অক্ষর ঠিক করে আবার চেষ্টা করতে পারেন।`
return render(req, res, 'sign_in', req.body, true, 409);
}
else
Expand All @@ -64,7 +67,9 @@ router.post('/sign_in', (req, res) =>
console.error(err);

req.body.info =
`Unexpected error, you may retry or contact admin`;
`দুঃখিত, কোথাও গরমিল হয়েছে। ` +
`আবার চেষ্টা করে দেখতে পারেন অথবা নিচে যোগাযোগ লিংক এ চাপ দিয়ে ` +
`পরিচালকদের জানাতে পারেন।`;
return render(req, res, 'sign_in', req.body, true, 500);
}
else
Expand Down
5 changes: 5 additions & 0 deletions view/public/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,9 @@ h6 { font-size: 1.2em; }
.read h6
{
text-align: left !important;
}

.warn_text
{
color: red;
}
24 changes: 13 additions & 11 deletions view/template/sign_in.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@
<? if(locals.name === false) { ?>
<form class='main_form' method='POST' action='/sign_in'>
<div>
<label for='user_name'>Enter your user name:</label>
<input
name='user_name'
placeholder='নিবন্ধিত নাম লিখুন'
title='নিবন্ধিত নাম লিখুন। আপনি যদি নিবন্ধন না করে থাকেন, উপরে ডানে "নিবন্ধন" লিংক এ চাপ দিয়ে নিবন্ধন করে নিতে পারেন।'
type='text'
placeholder='user name'
minlength='1'
maxlength='30'
autocomplete='off'
<? if(locals.user_name){ ?>
value='<?= user_name ?>'
<? } ?>
required>
</div>
<div>
<label for='password'>Enter your password:</label>
<input
name='password'
title='নিবন্ধিত গুপ্ত অক্ষরগুলি লিখুন।'
placeholder='নিবন্ধিত গুপ্ত অক্ষরগুলি লিখুন'
type='password'
placeholder='password'
minlength='1'
autocomplete='off'
<? if(locals.password) { ?>
Expand All @@ -29,28 +28,31 @@
required>
</div>
<div>
<label for='captcha'>Solve captcha</label>
<?- svg ?>
<label
title='স্বয়ংক্রিয় কিছু কম্পিউটার সবসময় ওয়েবসাইট ভাঙার চেষ্টা করে এবং সেগুলো আঁকানো লেখা পড়তে পারে না। সে কারণে, আপনি যে মানুষ, সেটা প্রমানের জন্য আপনাকে এটা করতে হচ্ছে।'
for='captcha'>এই চারটি অক্ষর লিখুন:</label>
<span title='নিচে এই চারটি অক্ষর লিখুন'><?- svg ?></span>
<input
name='captcha'
placeholder='আঁকানো অক্ষরগুলি লিখুন'
title='স্বয়ংক্রিয় কিছু কম্পিউটার সবসময় ওয়েবসাইট ভাঙার চেষ্টা করে এবং সেগুলো আঁকানো লেখা পড়তে পারে না। সে কারণে, আপনি যে মানুষ, সেটা প্রমানের জন্য আপনাকে এটা করতে হচ্ছে।'
type='text'
placeholder='captcha'
minlength='4'
maxlength='4'
autocomplete='off'
required>
</div>
<? if(locals.info) { ?>
<h6 class='meta_info'>
<h6 class='meta_info warn_text'>
<?= info ?>
</h6>
<? } ?>
<div>
<button
type='submit'>Submit »</button>
type='submit'>ভেতরে ঢুকুন »</button>
</div>
</form>
<? } else { ?>
You are already signed in. No need to do it again.
আপনি আগেই নিবন্ধনযুক্তভাবে ভেতরে ঢুকেছেন। এই পাতায় আপনার এখন আর কিছু করার প্রয়োজন নেই।
<? } ?>
<?- include('./common/layout_post.ejs') ?>

0 comments on commit 357f2d7

Please sign in to comment.