Permalink
Browse files

add forms class to login, user add/edit

  • Loading branch information...
aaroniker committed Jan 10, 2019
1 parent f18ad69 commit c3d49f4537a5380d9a447d49881d3b808b2fcee3
@@ -10,5 +10,7 @@
"English": "Englisch",
"German": "Deutsch",
"Edit": "Bearbeiten",
"Delete": "Löschen"
"Delete": "Löschen",
"Save": "Speichern",
"Add": "Hinzufügen"
}
@@ -33,7 +33,7 @@
</svg>
</a>
<div class="user">
<a href="" class="avatar"><?= $app->auth->getCurrentUser()['username'][0]; ?></a>
<a href="<?= $route->getLink('/users', ['edit', $app->auth->getCurrentUser()['id']]); ?>" class="avatar"><?= $app->auth->getCurrentUser()['username'][0]; ?></a>
<nav>
<ul>
<li>
@@ -157,7 +157,7 @@
</li>
</ul>
</nav>
<a href="" class="avatar"><?= $app->auth->getCurrentUser()['username'][0]; ?></a>
<a href="<?= $route->getLink('/users', ['edit', $app->auth->getCurrentUser()['id']]); ?>" class="avatar"><?= $app->auth->getCurrentUser()['username'][0]; ?></a>
</div>
</div>

@@ -0,0 +1,32 @@
<div class="lightBox light">
<?php
$user = ($app->user->getUser($id)) ? $app->user->getUser($id) : [
'username' => null,
'email' => null
];
$form = new form();
$form->addText('username', $user['username'], [
'col' => 'md-6'
])->fieldName('Username');
$form->addText('email', $user['email'], [
'col' => 'md-6'
])->fieldName('Email');
if(!$app->user->getUser($id)) {
$form->addPassword('password', null, [
'col' => 'md-6'
])->fieldName('Password');
}
$label = (!$app->user->getUser($id)) ? __('Add') : __('Save');
$form->addRaw('<button type="submit" class="btn">'.$label.'</button>');
echo $form->show();
?>
</div>
@@ -1,7 +1,7 @@
<g-table :items='<?= json_encode($app->user->getUsers()); ?>'>
<g-column class="grow" field="username" label="Name">
<template slot-scope="props">
<a href="" v-text="props.value"></a>
<a :href="'<?= $app->route->getLink('/users', ['edit']); ?>/' + props.item.id" v-text="props.value"></a>
</template>
</g-column>
<g-column class="half" field="email" label="Email"></g-column>
@@ -12,7 +12,7 @@
<i></i>
</span>
<ul>
<li><a href=""><?= __('Edit'); ?></a></li>
<li><a :href="'<?= $app->route->getLink('/users', ['edit']); ?>/' + props.item.id"><?= __('Edit'); ?></a></li>
<li class="delete"><a href=""><?= __('Delete'); ?></a></li>
</ul>
</div>
@@ -1,21 +1,28 @@
<g-form>
<input type="hidden" name="action" value="login">
<div class="form-element">
<input class="form-field" type="text" name="email" placeholder="<?= __('Email'); ?>">
</div>
<div class="form-element">
<input class="form-field" type="password" name="password" placeholder="<?= __('Password'); ?>">
</div>
<div class="form-element">
<label class="checkbox">
<input type="checkbox" name="remember" value="1">
<span><?= __('Stay logged in'); ?></span>
</label>
</div>
<button class="btn block" type="submit">
<svg>
<use xlink:href="#lockUI" />
</svg>
<?= __('Login'); ?>
</button>
</g-form>
<?php
$form = new form();
$form->addHidden('action', 'login');
$form->addText('email', null, [
'placeholder' => __('Email')
]);
$form->addPassword('password', null, [
'placeholder' => __('Password')
]);
$form->addCheckbox('remember')->add(1, __('Stay logged in'));
$form->addRaw('
<button class="btn block" type="submit">
<svg>
<use xlink:href="#lockUI" />
</svg>
'.__('Login').'
</button>
');
echo $form->show();
?>

0 comments on commit c3d49f4

Please sign in to comment.