Skip to content

Commit

Permalink
Added [target] Attribute to the Log-In Form
Browse files Browse the repository at this point in the history
  • Loading branch information
taufik-nurrohman committed Mar 5, 2020
1 parent 315e769 commit 8691942
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ User Extension for Mecha
Release Notes
-------------

### 1.11.4

- Added `target` attribute to the log-in form.

### 1.11.3

- Fix broken user profile page that always redirect to the log-in page.
Expand Down
2 changes: 1 addition & 1 deletion user/about.page
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: User
description: Rich user data.
author: Taufik Nurrohman
type: Markdown
version: 1.11.3
version: 1.11.4

use:
'.\lot\x\alert': 1
Expand Down
4 changes: 2 additions & 2 deletions user/engine/r/layout/exit.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
$_state = State::get('x.user', true);

?>
<form class="form-user form-user:exit">
<form class="form-user form-user:exit" target="_top">
<?= $alert; ?>
<p style="
text-align: center;
">
<a class="button" href="<?= $url . $_state['path'] . '/' . $user->name; ?>"><?= i('Profile'); ?></a> <a class="button" href="<?= $url . $_state['path'] . '/' . $user->name . $url->query('&amp;', ['exit' => $user->token]); ?>" title="<?= $user->user; ?>"><?= i('Exit'); ?></a>
</p>
</form>
</form>
4 changes: 2 additions & 2 deletions user/engine/r/layout/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$_path = $_state['guard']['path'] ?? $_state['path'];

?>
<form action="<?= $url . $_path . $url->query('&amp;'); ?>" class="form-user form-user:<?= ($_enter = Is::user()) ? 'exit' : 'enter'; ?>" method="post" name="user">
<form action="<?= $url . $_path . $url->query('&amp;'); ?>" class="form-user form-user:<?= ($_enter = Is::user()) ? 'exit' : 'enter'; ?>" method="post" name="user" target="_top">
<?= $alert; ?>
<?php if ($some = $users->count() > 1): ?>
<p title="<?= i('User'); ?>">
Expand All @@ -21,4 +21,4 @@
<?php if ("" !== ($_kick = strtr(Get::get('kick') ?? "", ['&' => '&amp;']))): ?>
<input name="kick" type="hidden" value="<?= $_kick; ?>">
<?php endif; ?>
</form>
</form>
4 changes: 2 additions & 2 deletions user/engine/r/layout/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<meta content="width=device-width" name="viewport">
<meta content="noindex" name="robots">
<title><?= w($t->reverse); ?></title>
<link href="<?= $url; ?>/favicon.ico" rel="shortcut icon">
<link href="<?= $url; ?>/favicon.ico" rel="icon">
</head>
<body style="
margin: 0;
Expand All @@ -32,4 +32,4 @@
<?= self::form('user'); ?>
</div>
</body>
</html>
</html>
4 changes: 2 additions & 2 deletions user/engine/r/layout/set.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$_path = $_state['guard']['path'] ?? $_state['path'];

?>
<form action="<?= $url . $_path . $url->query('&amp;'); ?>" class="form-user form-user:set" method="post" name="user">
<form action="<?= $url . $_path . $url->query('&amp;'); ?>" class="form-user form-user:set" method="post" name="user" target="_top">
<?= $alert; ?>
<p title="<?= i('User'); ?>">
<input autofocus class="input width" name="user" placeholder="<?= i('New %s', 'user'); ?>" type="text">
Expand All @@ -19,4 +19,4 @@
<?php if ("" !== ($_kick = strtr(Get::get('kick') ?? "", ['&' => '&amp;']))): ?>
<input name="kick" type="hidden" value="<?= $_kick; ?>">
<?php endif; ?>
</form>
</form>

0 comments on commit 8691942

Please sign in to comment.