Skip to content

Commit

Permalink
- Login Name and Content List improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
alegauss committed May 4, 2018
1 parent 24ef862 commit 06674a1
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,21 @@ shioharaApp.controller('ShContentCtrl', [
"$window",
function($scope, $http, $rootScope, $location, shAPIServerService,
$state,$window) {
$rootScope.principal = null;
var authenticate = function(credentials) {

var headers = credentials ? {
authorization : "Basic "
+ btoa(credentials.username + ":"
+ credentials.password)
} : {};

$http.get(shAPIServerService.get().concat("/v2"), {
headers : headers
}).then(function(response) {
if (response.data.product) {
$rootScope.authenticated = true;
$state.go('content.home');
} else {
$rootScope.authenticated = false;
$state.go('content.login');
}

}, function() {
$rootScope.authenticated = false;
$state.go('content.login');
});
}

// authenticate();
if (!$rootScope.authenticated) {
$http.get(shAPIServerService.get().concat("/v2/user/current")).then(function(response) {
if (response.data.product) {
$http.get(shAPIServerService.get().concat("/v2/user/current")).then(function(response) {
if (response.data.username) {
$rootScope.principal = response.data.firstName;
$rootScope.authenticated = true;
$state.go('content.home');
} else {
Expand Down
19 changes: 19 additions & 0 deletions src/main/resources/public/template/breadcrumb/breadcrumb-list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div class="row"
style="margin: 0px; background-color: #f5f5f5; height: 45px;margin-bottom:20px">
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-9" style="padding: 0px;height: 45px">
<ul class="breadcrumb" style="margin-top: 5px; margin-bottom: 25px;">
<li><a ui-sref="content" ui-sref-opts="{reload:true}">Content</a></li>
<li><a
ui-sref="content.children({objectId: shSite.shGlobalId.id})"
ui-sref-opts="{reload:true}">{{shSite.name}} (Site)</a></li>
</ul>
</div>
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3"
style="padding: 0px; text-align: right; padding-top: 7px; padding-right: 10px;height: 45px">

<a ng-click="objectPreview(shSite)" class="btn btn-viglet btn-sm"><i
class="fa fa-eye" aria-hidden="true"></i> View Site</a> <a
ui-sref="content.site.edit({siteId: shSite.id})"
class="btn btn-default btn-sm">Site Properties</a>
</div>
</div>
25 changes: 14 additions & 11 deletions src/main/resources/public/template/breadcrumb/breadcrumb.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<ul class="breadcrumb" style="margin-top: 5px; margin-bottom: 25px;">
<li><a
ui-sref="content"
ui-sref-opts="{reload:true}">Content</a></li>
<li><a
ui-sref="content.children({objectId: shSite.shGlobalId.id})"
ui-sref-opts="{reload:true}">{{shSite.name}} (Site)</a></li>
<li ng-repeat="breacrumbItem in breadcrumb"><a
ui-sref="content.children({objectId: breacrumbItem.shGlobalId.id})"
ui-sref-opts="{reload:true}">{{breacrumbItem.name}}</a></li>
</ul>
<div class="row"
style="margin: 0px; background-color: #f5f5f5; height: 45px;margin-bottom:20px">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="padding: 0px;height: 45px">
<ul class="breadcrumb" style="margin-top: 5px;">
<li><a ui-sref="content" ui-sref-opts="{reload:true}">Content</a></li>
<li><a
ui-sref="content.children({objectId: shSite.shGlobalId.id})"
ui-sref-opts="{reload:true}">{{shSite.name}} (Site)</a></li>
<li ng-repeat="breacrumbItem in breadcrumb"><a
ui-sref="content.children({objectId: breacrumbItem.shGlobalId.id})"
ui-sref-opts="{reload:true}">{{breacrumbItem.name}}</a></li>
</ul>
</div>
</div>
12 changes: 9 additions & 3 deletions src/main/resources/public/template/navigation/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@
style="padding-top: 8px; padding-bottom: 14px; padding-right: 18px; padding-left: 18px;">Modeling</a></li>
<li><a href="/swagger-ui.html" target="_blank"
style="padding-top: 8px; padding-bottom: 14px; padding-right: 18px; padding-left: 18px;">Documentation</a></li>
<li><a href ng-click="logout()"
style="padding-top: 8px; padding-bottom: 14px; padding-right: 18px; padding-left: 18px;"><i
class="fa fa-sign-out" aria-hidden="true"></i> Logout</a></li>
<li class="dropdown"><a href class="dropdown-toggle"
data-toggle="dropdown" role="button" aria-haspopup="true"
aria-expanded="false"
style="padding-top: 8px; padding-bottom: 14px; padding-right: 18px; padding-left: 18px;">{{principal}}
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href ng-click="logout()">Sign out</a></li>
</ul></li>
</ul>
</nav>
</div>
Expand Down
37 changes: 19 additions & 18 deletions src/main/resources/public/template/object/object-children.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@

<div ng-include="'/template/breadcrumb/breadcrumb.html'"></div>
<div class="settings" style="height: 85px">
<section class="content no-padding">

<fieldset class="user-details-top">
<div class="form-group"></div>
<div class="form-group" style="text-align: center">
<h3 class="hidden-lg hidden-md hidden-sm">&nbsp;</h3>
<h3 ng-show="shSite" class="hidden-xs">{{shSite.name}} Site</h3>
<div ng-include="'/template/breadcrumb/breadcrumb-list.html'"></div>
<div ng-if="shCurrentFolder == null && 1 == 0" style="margin-bottom: 20px">
<dl>
<dd style="padding-left: 15px;">{{shSite.description}}</dd>
</dl>
</div>
<div class="panel panel-default" ng-if="shCurrentFolder == null && 1 == 0">
<div class="panel-body">
<div class="row row-centered">
<div class="col-lg-2 col-md-2 col-sm-3 col-xs-3">
<i class="fa fa-history" aria-hidden="true" style="color: #6a737d;"></i>
<b>112</b> commits
</div>
<div class="pull-right" style="margin: -40px 0 0;">
<a ng-click="objectPreview(shSite)" class="btn btn-viglet"><i
class="fa fa-eye" aria-hidden="true"></i> View Site</a> <a
ui-sref="content.site.edit({siteId: shSite.id})"
class="btn btn-default">Site Properties</a>
<div class="col-lg-2 col-md-2 col-sm-3 col-xs-3">
<i class="fa fa-users" aria-hidden="true" style="color: #6a737d;"></i>
<b>1</b> contributor
</div>
</fieldset>
</section>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
Expand Down Expand Up @@ -112,8 +113,8 @@ <h3>It is also possible ...</h3>
<i class="fa fa-file-o fa-4x" aria-hidden="true"
style="float: left; margin: 10px"></i><span
style="display: inline-block; margin-top: 20px"><a
ui-sref="content.post-type-item-by-name.post-item-new({folderId: shCurrentFolder.id, postTypeName: 'PT-FILE'})">Upload
file</a></span>
ui-sref="content.post-type-item-by-name.post-item-new({folderId: shCurrentFolder.id, postTypeName: 'PT-FILE'})">Upload
file</a></span>
</div>
<div style="display: table;">
<i class="fa fa-folder-o fa-4x" aria-hidden="true"
Expand Down

0 comments on commit 06674a1

Please # to comment.