Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vueify login page #4634

Merged
merged 13 commits into from
Jul 12, 2018
9 changes: 9 additions & 0 deletions themes-default/slim/static/js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const VueRouter = window.vueRouter;
const { routes, httpVueLoader } = window;

if (!window.router) {
const loginComponent = httpVueLoader('js/templates/login.vue');
const configComponent = httpVueLoader('js/templates/config.vue');
const addShowsComponent = httpVueLoader('js/templates/add-shows.vue');
const addRecommendedComponent = httpVueLoader('js/templates/add-recommended.vue');
Expand All @@ -11,6 +12,14 @@ if (!window.router) {
base: document.body.getAttribute('api-root').replace('api/v2/', ''),
mode: 'history',
routes: Object.assign(routes || [], [{
path: '/login',
name: 'login',
meta: {
title: 'Login',
header: 'Medusa'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No header for the login page. It has its own header.
It's not currently an issue, because it doesn't use the VueRouter template (index.mako),
but it will be when it does.

},
component: loginComponent
}, {
path: '/config',
name: 'config',
meta: {
Expand Down
22 changes: 22 additions & 0 deletions themes-default/slim/static/js/templates/login.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<template>
<div class="login">
<form action="" method="post">
<h1>Medusa</h1>
<div class="ctrlHolder"><input class="inlay" name="username" type="text" placeholder="Username" autocomplete="off" autocomplete="no" /></div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  static/js/templates/login.vue:5:128
  ✖  5:128  Duplicate attribute autocomplete.    vue/no-duplicate-attributes
  ✖  5:128  Parsing error: duplicate-attribute.  vue/no-parsing-error

off is the correct value.

<div class="ctrlHolder"><input class="inlay" name="password" type="password" placeholder="Password" autocomplete="off" /></div>
<div class="ctrlHolder">
<label class="remember_me" title="for 30 days"><input class="inlay" id="remember_me" name="remember_me" type="checkbox" value="1" checked="checked" /> Remember me</label>
<input class="button" name="submit" type="submit" value="Login" />
</div>
</form>
</div>
</template>

<script>
module.exports = {
name: 'login'
};
</script>

<style>
</style>
2 changes: 1 addition & 1 deletion themes-default/slim/views/layouts/main.mako
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<link rel="stylesheet" type="text/css" href="css/lib/vue-snotify-material.css?${sbPID}"/>
<%block name="css" />
</head>
<body ${('data-controller="' + controller + '" data-action="' + action + '" api-key="' + app.API_KEY +'" api-root="' + app.WEB_ROOT + '/api/v2/"', '')[title == 'Login']}>
<body ${('data-controller="' + controller + '" data-action="' + action + '" api-key="' + app.API_KEY + '"', '')[title == 'Login']} api-root="${app.WEB_ROOT}/api/v2/">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's expose web-root="${app.WEB_ROOT}" instead.
(see non-review comment above)

<div v-cloak id="vue-wrap" class="container-fluid">

<!-- These are placeholders used by the displayShow template. As they transform to full width divs, they need to be located outside the template. -->
Expand Down
9 changes: 9 additions & 0 deletions themes/dark/assets/js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const VueRouter = window.vueRouter;
const { routes, httpVueLoader } = window;

if (!window.router) {
const loginComponent = httpVueLoader('js/templates/login.vue');
const configComponent = httpVueLoader('js/templates/config.vue');
const addShowsComponent = httpVueLoader('js/templates/add-shows.vue');
const addRecommendedComponent = httpVueLoader('js/templates/add-recommended.vue');
Expand All @@ -11,6 +12,14 @@ if (!window.router) {
base: document.body.getAttribute('api-root').replace('api/v2/', ''),
mode: 'history',
routes: Object.assign(routes || [], [{
path: '/login',
name: 'login',
meta: {
title: 'Login',
header: 'Medusa'
},
component: loginComponent
}, {
path: '/config',
name: 'config',
meta: {
Expand Down
2 changes: 1 addition & 1 deletion themes/dark/assets/js/router.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions themes/dark/assets/js/templates/login.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<template>
<div class="login">
<form action="" method="post">
<h1>Medusa</h1>
<div class="ctrlHolder"><input class="inlay" name="username" type="text" placeholder="Username" autocomplete="off" autocomplete="no" /></div>
<div class="ctrlHolder"><input class="inlay" name="password" type="password" placeholder="Password" autocomplete="off" /></div>
<div class="ctrlHolder">
<label class="remember_me" title="for 30 days"><input class="inlay" id="remember_me" name="remember_me" type="checkbox" value="1" checked="checked" /> Remember me</label>
<input class="button" name="submit" type="submit" value="Login" />
</div>
</form>
</div>
</template>

<script>
module.exports = {
name: 'login'
};
</script>

<style>
</style>
2 changes: 1 addition & 1 deletion themes/dark/templates/layouts/main.mako
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<link rel="stylesheet" type="text/css" href="css/lib/vue-snotify-material.css?${sbPID}"/>
<%block name="css" />
</head>
<body ${('data-controller="' + controller + '" data-action="' + action + '" api-key="' + app.API_KEY +'" api-root="' + app.WEB_ROOT + '/api/v2/"', '')[title == 'Login']}>
<body ${('data-controller="' + controller + '" data-action="' + action + '" api-key="' + app.API_KEY + '"', '')[title == 'Login']} api-root="${app.WEB_ROOT}/api/v2/">
<div v-cloak id="vue-wrap" class="container-fluid">

<!-- These are placeholders used by the displayShow template. As they transform to full width divs, they need to be located outside the template. -->
Expand Down
9 changes: 9 additions & 0 deletions themes/light/assets/js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const VueRouter = window.vueRouter;
const { routes, httpVueLoader } = window;

if (!window.router) {
const loginComponent = httpVueLoader('js/templates/login.vue');
const configComponent = httpVueLoader('js/templates/config.vue');
const addShowsComponent = httpVueLoader('js/templates/add-shows.vue');
const addRecommendedComponent = httpVueLoader('js/templates/add-recommended.vue');
Expand All @@ -11,6 +12,14 @@ if (!window.router) {
base: document.body.getAttribute('api-root').replace('api/v2/', ''),
mode: 'history',
routes: Object.assign(routes || [], [{
path: '/login',
name: 'login',
meta: {
title: 'Login',
header: 'Medusa'
},
component: loginComponent
}, {
path: '/config',
name: 'config',
meta: {
Expand Down
2 changes: 1 addition & 1 deletion themes/light/assets/js/router.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions themes/light/assets/js/templates/login.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<template>
<div class="login">
<form action="" method="post">
<h1>Medusa</h1>
<div class="ctrlHolder"><input class="inlay" name="username" type="text" placeholder="Username" autocomplete="off" autocomplete="no" /></div>
<div class="ctrlHolder"><input class="inlay" name="password" type="password" placeholder="Password" autocomplete="off" /></div>
<div class="ctrlHolder">
<label class="remember_me" title="for 30 days"><input class="inlay" id="remember_me" name="remember_me" type="checkbox" value="1" checked="checked" /> Remember me</label>
<input class="button" name="submit" type="submit" value="Login" />
</div>
</form>
</div>
</template>

<script>
module.exports = {
name: 'login'
};
</script>

<style>
</style>
2 changes: 1 addition & 1 deletion themes/light/templates/layouts/main.mako
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<link rel="stylesheet" type="text/css" href="css/lib/vue-snotify-material.css?${sbPID}"/>
<%block name="css" />
</head>
<body ${('data-controller="' + controller + '" data-action="' + action + '" api-key="' + app.API_KEY +'" api-root="' + app.WEB_ROOT + '/api/v2/"', '')[title == 'Login']}>
<body ${('data-controller="' + controller + '" data-action="' + action + '" api-key="' + app.API_KEY + '"', '')[title == 'Login']} api-root="${app.WEB_ROOT}/api/v2/">
<div v-cloak id="vue-wrap" class="container-fluid">

<!-- These are placeholders used by the displayShow template. As they transform to full width divs, they need to be located outside the template. -->
Expand Down