Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
ba7bded8
Commit
ba7bded8
authored
Jul 05, 2016
by
Nick Stenning
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename 'signed-{in,out}' auth status to 'logged-{in,out}'
parent
c30735ac
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
27 additions
and
27 deletions
+27
-27
app-controller.js
h/static/scripts/app-controller.js
+2
-2
group-list-test.js
h/static/scripts/directive/test/group-list-test.js
+1
-1
app-controller-test.js
h/static/scripts/test/app-controller-test.js
+5
-5
widget-controller-test.js
h/static/scripts/test/widget-controller-test.js
+5
-5
widget-controller.js
h/static/scripts/widget-controller.js
+1
-1
group_list.html
h/templates/client/group_list.html
+2
-2
login_control.html
h/templates/client/login_control.html
+9
-9
viewer.html
h/templates/client/viewer.html
+2
-2
No files found.
h/static/scripts/app-controller.js
View file @
ba7bded8
...
...
@@ -10,13 +10,13 @@ function authStateFromUserID(userid) {
if
(
userid
)
{
var
parsed
=
parseAccountID
(
userid
);
return
{
status
:
'
sign
ed-in'
,
status
:
'
logg
ed-in'
,
userid
:
userid
,
username
:
parsed
.
username
,
provider
:
parsed
.
provider
,
};
}
else
{
return
{
status
:
'
sign
ed-out'
};
return
{
status
:
'
logg
ed-out'
};
}
}
...
...
h/static/scripts/directive/test/group-list-test.js
View file @
ba7bded8
...
...
@@ -64,7 +64,7 @@ describe('groupList', function () {
function
createGroupList
()
{
return
util
.
createDirective
(
document
,
'groupList'
,
{
auth
:
{
status
:
'
sign
ed-in'
,
status
:
'
logg
ed-in'
,
},
});
}
...
...
h/static/scripts/test/app-controller-test.js
View file @
ba7bded8
...
...
@@ -140,20 +140,20 @@ describe('AppController', function () {
assert
.
equal
(
$scope
.
auth
.
status
,
'unknown'
);
});
it
(
'sets auth.status to "
sign
ed-out" if userid is null'
,
function
()
{
it
(
'sets auth.status to "
logg
ed-out" if userid is null'
,
function
()
{
createController
();
return
fakeSession
.
load
().
then
(
function
()
{
assert
.
equal
(
$scope
.
auth
.
status
,
'
sign
ed-out'
);
assert
.
equal
(
$scope
.
auth
.
status
,
'
logg
ed-out'
);
});
});
it
(
'sets auth.status to "
sign
ed-in" if userid is non-null'
,
function
()
{
it
(
'sets auth.status to "
logg
ed-in" if userid is non-null'
,
function
()
{
fakeSession
.
load
=
function
()
{
return
Promise
.
resolve
({
userid
:
'acct:jim@hypothes.is'
});
};
createController
();
return
fakeSession
.
load
().
then
(
function
()
{
assert
.
equal
(
$scope
.
auth
.
status
,
'
sign
ed-in'
);
assert
.
equal
(
$scope
.
auth
.
status
,
'
logg
ed-in'
);
});
});
...
...
@@ -177,7 +177,7 @@ describe('AppController', function () {
userid
:
'acct:john@hypothes.is'
,
});
assert
.
deepEqual
(
$scope
.
auth
,
{
status
:
'
sign
ed-in'
,
status
:
'
logg
ed-in'
,
userid
:
'acct:john@hypothes.is'
,
username
:
'john'
,
provider
:
'hypothes.is'
,
...
...
h/static/scripts/test/widget-controller-test.js
View file @
ba7bded8
...
...
@@ -394,7 +394,7 @@ describe('WidgetController', function () {
it
(
'shows logged out message if selection is available'
,
function
()
{
$scope
.
auth
=
{
status
:
'
sign
ed-out'
status
:
'
logg
ed-out'
};
annotationUI
.
addAnnotations
([{
id
:
'123'
}]);
annotationUI
.
selectAnnotations
([
'123'
]);
...
...
@@ -404,7 +404,7 @@ describe('WidgetController', function () {
it
(
'does not show loggedout message if selection is unavailable'
,
function
()
{
$scope
.
auth
=
{
status
:
'
sign
ed-out'
status
:
'
logg
ed-out'
};
annotationUI
.
selectAnnotations
([
'missing'
]);
$scope
.
$digest
();
...
...
@@ -413,7 +413,7 @@ describe('WidgetController', function () {
it
(
'does not show loggedout message if there is no selection'
,
function
()
{
$scope
.
auth
=
{
status
:
'
sign
ed-out'
status
:
'
logg
ed-out'
};
annotationUI
.
selectAnnotations
([]);
$scope
.
$digest
();
...
...
@@ -422,7 +422,7 @@ describe('WidgetController', function () {
it
(
'does not show loggedout message if user is not logged out'
,
function
()
{
$scope
.
auth
=
{
status
:
'
sign
ed-in'
status
:
'
logg
ed-in'
};
annotationUI
.
addAnnotations
([{
id
:
'123'
}]);
annotationUI
.
selectAnnotations
([
'123'
]);
...
...
@@ -432,7 +432,7 @@ describe('WidgetController', function () {
it
(
'does not show loggedout message if not a direct link'
,
function
()
{
$scope
.
auth
=
{
status
:
'
sign
ed-out'
status
:
'
logg
ed-out'
};
delete
fakeSettings
.
annotations
;
annotationUI
.
addAnnotations
([{
id
:
'123'
}]);
...
...
h/static/scripts/widget-controller.js
View file @
ba7bded8
...
...
@@ -361,7 +361,7 @@ module.exports = function WidgetController(
$scope
.
shouldShowLoggedOutMessage
=
function
()
{
// If user is not logged out, don't show CTA.
if
(
$scope
.
auth
.
status
!==
'
sign
ed-out'
)
{
if
(
$scope
.
auth
.
status
!==
'
logg
ed-out'
)
{
return
false
;
}
...
...
h/templates/client/group_list.html
View file @
ba7bded8
<span
ng-if=
"auth.status === '
sign
ed-out'"
<span
ng-if=
"auth.status === '
logg
ed-out'"
ng-switch
on=
"groups.focused().public"
>
<i
class=
"group-list-label__icon h-icon-public"
ng-switch-when=
"true"
></i>
<!-- nospace
!-->
<i
class=
"group-list-label__icon h-icon-group"
ng-switch-default
></i>
...
...
@@ -6,7 +6,7 @@
</span>
<div
class=
"pull-right"
ng-if=
"auth.status === '
sign
ed-in'"
ng-if=
"auth.status === '
logg
ed-in'"
dropdown
keyboard-nav
>
<div
class=
"dropdown-toggle"
...
...
h/templates/client/login_control.html
View file @
ba7bded8
...
...
@@ -2,7 +2,7 @@
<span
class=
"login-text"
ng-if=
"vm.newStyle && vm.auth.status === 'unknown'"
>
⋯
</span>
<span
class=
"login-text"
ng-if=
"vm.newStyle && vm.auth.status === '
sign
ed-out'"
>
ng-if=
"vm.newStyle && vm.auth.status === '
logg
ed-out'"
>
<a
href=
"{{vm.serviceUrl}}register"
target=
"_blank"
>
Sign up
</a>
/
<a
href=
""
ng-click=
"vm.onLogin()"
>
Log in
</a>
</span>
...
...
@@ -15,23 +15,23 @@
data-toggle=
"dropdown"
dropdown-toggle
title=
"{{vm.auth.username}}"
>
<i
class=
"h-icon-account"
ng-if=
"vm.auth.status === '
sign
ed-in'"
></i>
<!--
<i
class=
"h-icon-account"
ng-if=
"vm.auth.status === '
logg
ed-in'"
></i>
<!--
!-->
<i
class=
"h-icon-arrow-drop-down top-bar__dropdown-arrow"
></i>
</a>
<ul
class=
"dropdown-menu pull-right"
role=
"menu"
>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
sign
ed-in'"
>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
logg
ed-in'"
>
<a
href=
"{{vm.serviceUrl}}stream?q=user:{{vm.auth.username}}"
class=
"dropdown-menu__link"
title=
"View all your annotations"
target=
"_blank"
>
{{vm.auth.username}}
</a>
</li>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
sign
ed-in'"
>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
logg
ed-in'"
>
<a
class=
"dropdown-menu__link"
href=
"{{vm.serviceUrl}}profile"
target=
"_blank"
>
Account settings
</a>
</li>
<li
class=
"dropdown-menu__row"
>
<a
class=
"dropdown-menu__link"
ng-click=
"vm.onShowHelpPanel()"
>
Help
</a>
</li>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
sign
ed-in'"
>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
logg
ed-in'"
>
<a
class=
"dropdown-menu__link dropdown-menu__link--subtle"
href=
""
ng-click=
"vm.onLogout()"
>
Log out
</a>
</li>
...
...
@@ -40,7 +40,7 @@
<!-- Old controls -->
<span
ng-if=
"!vm.newStyle && vm.auth.status === 'unknown'"
>
⋯
</span>
<span
ng-if=
"!vm.newStyle && vm.auth.status === '
sign
ed-out'"
>
<span
ng-if=
"!vm.newStyle && vm.auth.status === '
logg
ed-out'"
>
<a
href=
""
ng-click=
"vm.onLogin()"
>
Log in
</a>
</span>
<div
ng-if=
"!vm.newStyle"
...
...
@@ -54,17 +54,17 @@
-->
<i
class=
"h-icon-arrow-drop-down"
></i>
</span>
<ul
class=
"dropdown-menu pull-right"
role=
"menu"
>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
sign
ed-in'"
>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
logg
ed-in'"
>
<a
class=
"dropdown-menu__link"
href=
"{{vm.serviceUrl}}profile"
target=
"_blank"
>
Account
</a>
</li>
<li
class=
"dropdown-menu__row"
>
<a
class=
"dropdown-menu__link"
ng-click=
"vm.onShowHelpPanel()"
>
Help
</a>
</li>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
sign
ed-in'"
>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
logg
ed-in'"
>
<a
class=
"dropdown-menu__link"
href=
"{{vm.serviceUrl}}stream?q=user:{{vm.auth.username}}"
target=
"_blank"
>
My Annotations
</a>
</li>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
sign
ed-in'"
>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
logg
ed-in'"
>
<a
class=
"dropdown-menu__link"
href=
""
ng-click=
"vm.onLogout()"
>
Log out
</a>
</li>
</ul>
...
...
h/templates/client/viewer.html
View file @
ba7bded8
...
...
@@ -32,14 +32,14 @@
ng-if=
"selectedAnnotationUnavailable()"
>
<div
class=
"annotation-unavailable-message__icon"
></div>
<p
class=
"annotation-unavailable-message__label"
>
<span
ng-if=
"auth.status === '
sign
ed-out'"
>
<span
ng-if=
"auth.status === '
logg
ed-out'"
>
This annotation is not available.
<br>
You may need to
<a
class=
"loggedout-message__link"
href=
""
ng-click=
"login()"
>
log in
</a>
to see it.
</span>
<span
ng-if=
"auth.status === '
sign
ed-in'"
>
<span
ng-if=
"auth.status === '
logg
ed-in'"
>
You do not have permission to view this annotation.
</span>
</p>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment