Browse Source

Account page

NGPixel 8 years ago
parent
commit
1cf38be217

File diff suppressed because it is too large
+ 0 - 0
assets/css/app.css


File diff suppressed because it is too large
+ 0 - 0
assets/js/app.js


+ 1 - 1
client/js/app.js

@@ -37,7 +37,7 @@ jQuery( document ).ready(function( $ ) {
 	// Establish WebSocket connection
 	// Establish WebSocket connection
 	// ====================================
 	// ====================================
 
 
-	var socket = io(ioHost);
+	var socket = io(window.location.origin);
 
 
 	//=include components/search.js
 	//=include components/search.js
 
 

+ 3 - 1
client/scss/app.scss

@@ -12,4 +12,6 @@
 
 
 @import './layout/_header';
 @import './layout/_header';
 @import './layout/_footer';
 @import './layout/_footer';
-@import './layout/_content';
+@import './layout/_content';
+
+@import './pages/_account';

+ 1 - 1
client/scss/layout/_content.scss

@@ -100,7 +100,7 @@
 
 
 	img.pagelogo {
 	img.pagelogo {
 		float: right;
 		float: right;
-		margin-top: -50px;
+		margin-top: -75px;
 		max-width: 200px;
 		max-width: 200px;
 		background-color: #FFF;
 		background-color: #FFF;
 	}
 	}

+ 17 - 0
client/scss/pages/_account.scss

@@ -0,0 +1,17 @@
+.account-profile-provider {
+	height: 32px;
+	display: flex;
+	align-items: center;
+
+	.fa {
+		margin-right: 10px;
+	}
+
+	.is-blue {
+		color: $blue;
+	}
+	.is-purple {
+		color: $purple;
+	}
+
+}

+ 5 - 1
controllers/admin.js

@@ -7,7 +7,11 @@ var router = express.Router();
  * Admin
  * Admin
  */
  */
 router.get('/', (req, res) => {
 router.get('/', (req, res) => {
-	res.send('OK');
+	res.redirect('/admin/profile');
+});
+
+router.get('/profile', (req, res) => {
+	res.render('pages/account.pug');
 });
 });
 
 
 module.exports = router;
 module.exports = router;

+ 8 - 0
locales/en/auth.json

@@ -0,0 +1,8 @@
+{
+	"providers": {
+		"local": "Local",
+		"windowslive": "Microsoft Account",
+		"google": "Google ID",
+		"facebook": "Facebook"
+	}
+}

+ 8 - 0
locales/fr/auth.json

@@ -0,0 +1,8 @@
+{
+	"providers": {
+		"local": "Local",
+		"windowslive": "Compte Microsoft",
+		"google": "Google ID",
+		"facebook": "Facebook"
+	}
+}

+ 1 - 1
server.js

@@ -110,7 +110,7 @@ lang
   .use(i18next_mw.LanguageDetector)
   .use(i18next_mw.LanguageDetector)
   .init({
   .init({
     load: 'languageOnly',
     load: 'languageOnly',
-    ns: ['common'],
+    ns: ['common', 'auth'],
     defaultNS: 'common',
     defaultNS: 'common',
     saveMissing: false,
     saveMissing: false,
     supportedLngs: ['en', 'fr'],
     supportedLngs: ['en', 'fr'],

+ 0 - 2
views/layout.pug

@@ -24,8 +24,6 @@ html
 		// JS
 		// JS
 		script(type='text/javascript', src='/js/libs.js')
 		script(type='text/javascript', src='/js/libs.js')
 		script(type='text/javascript', src='/js/app.js')
 		script(type='text/javascript', src='/js/app.js')
-		script(type='text/javascript').
-			var ioHost = window.location.origin + ':!{appconfig.port}/';
 
 
 		block head
 		block head
 
 

+ 69 - 0
views/pages/account.pug

@@ -0,0 +1,69 @@
+extends ../layout.pug
+
+block rootNavCenter
+
+
+block rootNavRight
+	i.nav-item#notifload
+	span.nav-item
+		a.button.is-dark.is-outlined.btn-edit-discard(href='/')
+			span.icon
+				i.fa.fa-home
+			span Home
+
+block content
+
+	#page-type-account
+		section.hero.is-dark
+			.hero-body
+				.container
+					h1.title Account
+					h2.subtitle Manage your settings and site configuration
+		nav.nav.has-shadow
+			.container
+				.nav-left
+					a.nav-item.is-tab.is-active My Profile
+					a.nav-item.is-tab Stats
+					a.nav-item.is-tab Users
+					a.nav-item.is-tab Site Settings
+					a.nav-item.is-tab(href='/logout') Logout
+		section.section
+			.container
+				.columns
+					.column.is-two-thirds
+						label.label Email
+						p.control.has-icon.has-icon-right
+							input.input(type='email', placeholder='Email', value=user.email, disabled=(user.provider !== 'local'))
+							i.fa.fa-envelope
+						if user.provider == 'local'
+							label.label Password
+							p.control.has-icon.has-icon-right
+								input.input(type='password', placeholder='Password', value='********')
+								i.fa.fa-lock
+							label.label Verify Password
+							p.control.has-icon.has-icon-right
+								input.input(type='password', placeholder='Password', value='********')
+								i.fa.fa-lock
+						label.label Display Name
+						p.control.has-icon.has-icon-right
+							input.input(type='text', placeholder='John Smith', value=user.name)
+							i.fa.fa-user
+					.column
+						label.label Provider
+						p.control.account-profile-provider
+							case user.provider
+								when 'local': i.fa.fa-database
+								when 'windowslive': i.fa.fa-windows.is-blue
+								when 'google': i.fa.fa-google.is-blue
+								when 'facebook': i.fa.fa-facebook.is-purple
+								default: i.fa.fa-question-circle
+							= t('auth:providers.' + user.provider)
+						label.label Member since
+						p.control= userMoment(user.createdAt).format('LL')
+						label.label Last Profile Update
+						p.control= userMoment(user.updatedAt).format('LL')
+		section.section
+			.container
+				p.control
+					button.button.is-success
+						| Save Changes

+ 1 - 1
views/pages/view.pug

@@ -44,7 +44,7 @@ block content
 										li
 										li
 											a(href='/' + pageData.parent.path)= pageData.parent.title
 											a(href='/' + pageData.parent.path)= pageData.parent.title
 									li
 									li
-										a(href='/account') Account
+										a(href='/admin') Account
 						.box.stickyscroll(data-margin-top=70)
 						.box.stickyscroll(data-margin-top=70)
 							aside.menu(style= { 'min-width': '200px' })
 							aside.menu(style= { 'min-width': '200px' })
 								p.menu-label
 								p.menu-label

Some files were not shown because too many files changed in this diff