couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [2/5] fauxton commit: updated refs/heads/master to 14224ea
Date Wed, 30 Nov 2016 13:42:23 GMT
remove with_sidebar


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/a599d5a4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/a599d5a4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/a599d5a4

Branch: refs/heads/master
Commit: a599d5a44031686b250e2908bfb97ce28b9714d3
Parents: 75b8eb4
Author: Garren Smith <garren.smith@gmail.com>
Authored: Wed Nov 23 17:14:05 2016 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Wed Nov 30 11:38:39 2016 +0200

----------------------------------------------------------------------
 app/addons/auth/layout.js               | 25 +++++++++++++++++++++++++
 app/addons/auth/routes.js               | 25 ++++++++++++++-----------
 app/addons/cluster/cluster.actions.js   |  4 ++--
 app/core/layout.js                      |  2 +-
 app/core/routeObject.js                 |  2 +-
 app/templates/layouts/with_sidebar.html | 27 ---------------------------
 6 files changed, 43 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a599d5a4/app/addons/auth/layout.js
----------------------------------------------------------------------
diff --git a/app/addons/auth/layout.js b/app/addons/auth/layout.js
index 32559c4..648502e 100644
--- a/app/addons/auth/layout.js
+++ b/app/addons/auth/layout.js
@@ -14,6 +14,9 @@ import React from 'react';
 import FauxtonAPI from "../../core/api";
 import {OnePane, OnePaneContent} from '../components/layouts';
 import {Breadcrumbs} from '../components/header-breadcrumbs';
+import Components from "./components.react";
+
+const { CreateAdminForm, ChangePasswordForm } = Components;
 
 export const OnePaneHeader = ({crumbs}) => {
   return (
@@ -41,4 +44,26 @@ export const AuthLayout = ({crumbs, component}) => {
   );
 };
 
+export const AdminLayout = ({crumbs, changePassword, component}) => {
+  let content = changePassword ? <ChangePasswordForm /> : <CreateAdminForm loginAfter={false}
/>;
+  return (
+    <div id="dashboard" className="template-with-sidebar flex-layout flex-col">
+      <OnePaneHeader
+        crumbs={crumbs}
+      >
+      </OnePaneHeader>
+      <div className="template-content flex-body flex-layout flex-row">
+        <div id="sidebar-content">
+          <Components.CreateAdminSidebar />
+        </div>
+        <div id="dashboard-content" className="flex-body">
+          {content}
+        </div>
+      </div>
+    </div>
+
+  );
+
+};
+
 export default AuthLayout;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a599d5a4/app/addons/auth/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/auth/routes.js b/app/addons/auth/routes.js
index be30171..3f67c64 100644
--- a/app/addons/auth/routes.js
+++ b/app/addons/auth/routes.js
@@ -17,7 +17,7 @@ import Auth from "./resources";
 import AuthActions from "./actions";
 import Components from "./components.react";
 import ClusterActions from "../cluster/cluster.actions";
-import Layout from './layout';
+import {AuthLayout, AdminLayout} from './layout';
 
 const {LoginForm, CreateAdminForm} = Components;
 
@@ -40,7 +40,7 @@ var AuthRouteObject = FauxtonAPI.RouteObject.extend({
 
   login: function () {
     const crumbs = [{ name: 'Log In to CouchDB' }];
-    this.setComponent(".template", Layout, {
+    this.setComponent(".template", AuthLayout, {
       crumbs: crumbs,
       component: <LoginForm urlBack={app.getParams().urlback } />
     });
@@ -56,7 +56,7 @@ var AuthRouteObject = FauxtonAPI.RouteObject.extend({
   createAdminForNode: function () {
     ClusterActions.fetchNodes();
     const crumbs = [{ name: 'Create Admin' }];
-    this.setComponent(".template", Layout, {
+    this.setComponent(".template", AuthLayout, {
       crumbs: crumbs,
       component: <CreateAdminForm loginAfter={true} />
     });
@@ -65,7 +65,9 @@ var AuthRouteObject = FauxtonAPI.RouteObject.extend({
 
 
 var UserRouteObject = FauxtonAPI.RouteObject.extend({
-  layout: 'with_sidebar',
+  layout: 'empty',
+  hideNotificationCenter: true,
+  hideApiBar: true,
 
   routes: {
     'changePassword': {
@@ -98,23 +100,24 @@ var UserRouteObject = FauxtonAPI.RouteObject.extend({
     return FauxtonAPI.session.user().name;
   },
 
-  initialize: function () {
-    this.setComponent('#sidebar-content', Components.CreateAdminSidebar);
-  },
-
   changePassword: function () {
     ClusterActions.fetchNodes();
     AuthActions.selectPage('changePassword');
-    this.setComponent('#dashboard-content', Components.ChangePasswordForm);
+    this.setComponent(".template", AdminLayout, {
+      crumbs: [{name: 'User Management'}],
+      changePassword: true
+    });
   },
 
   addAdmin: function () {
     ClusterActions.fetchNodes();
     AuthActions.selectPage('addAdmin');
-    this.setComponent('#dashboard-content', Components.CreateAdminForm, { loginAfter: false
});
+    this.setComponent(".template", AdminLayout, {
+      crumbs: [{name: 'User Management'}],
+      changePassword: false
+    });
   },
 
-  crumbs: [{name: 'User Management'}]
 });
 
 Auth.RouteObjects = [AuthRouteObject, UserRouteObject];

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a599d5a4/app/addons/cluster/cluster.actions.js
----------------------------------------------------------------------
diff --git a/app/addons/cluster/cluster.actions.js b/app/addons/cluster/cluster.actions.js
index f515548..47dcf0c 100644
--- a/app/addons/cluster/cluster.actions.js
+++ b/app/addons/cluster/cluster.actions.js
@@ -18,11 +18,11 @@ export default {
   fetchNodes: function () {
     var memberships = new ClusterResources.ClusterNodes();
 
-    memberships.fetch().then(function () {
+    memberships.fetch().then(() => {
       this.updateNodes({
         nodes: memberships.get('nodes_mapped')
       });
-    }.bind(this));
+    });
   },
 
   updateNodes: function (options) {

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a599d5a4/app/core/layout.js
----------------------------------------------------------------------
diff --git a/app/core/layout.js b/app/core/layout.js
index c277889..21ecfd1 100644
--- a/app/core/layout.js
+++ b/app/core/layout.js
@@ -17,7 +17,7 @@ import "backbone.layoutmanager";
 // Allows the main layout of the page to be changed by any plugin.
 var Layout = function () {
   this.layout = new Backbone.Layout({
-    template: "templates/layouts/with_sidebar",
+    template: "templates/layouts/empty",
     className: 'pusher'
   });
 

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a599d5a4/app/core/routeObject.js
----------------------------------------------------------------------
diff --git a/app/core/routeObject.js b/app/core/routeObject.js
index de1a4bb..61a145f 100644
--- a/app/core/routeObject.js
+++ b/app/core/routeObject.js
@@ -72,7 +72,7 @@ _.extend(RouteObject.prototype, Backbone.Events, {
   routes: {},
   events: {},
   crumbs: [],
-  layout: "with_sidebar",
+  layout: "empty",
   apiUrl: null,
   hideNotificationPanel: null,
   loaderClassname: 'loader',

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/a599d5a4/app/templates/layouts/with_sidebar.html
----------------------------------------------------------------------
diff --git a/app/templates/layouts/with_sidebar.html b/app/templates/layouts/with_sidebar.html
deleted file mode 100644
index 6edd592..0000000
--- a/app/templates/layouts/with_sidebar.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<%/*
-Licensed under the Apache License, Version 2.0 (the "License"); you may not
-use this file except in compliance with the License. You may obtain a copy of
-the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations under
-the License.
-*/%>
-<div id="dashboard" class="template-with-sidebar flex-layout flex-col">
-  <header class="flex-layout flex-row">
-    <div class="flex-layout flex-row">
-      <div id="breadcrumbs" class="flex-body"></div>
-      <div id="api-navbar" class="flex-fill"></div>
-      <div id="notification-center-btn" class="flex-fill"></div>
-    </div>
-  </header>
-
-  <div class="template-content flex-body flex-layout flex-row">
-    <div id="sidebar-content"></div>
-    <div id="dashboard-content" class="flex-body"></div>
-  </div>
-</div>


Mime
View raw message