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
eae9958d
Commit
eae9958d
authored
Dec 02, 2014
by
gergely-ujvari
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1743 from hypothesis/remove-privacy-strings
Remove strings from the privacy template
parents
30cbdbf1
b5145653
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
privacy.coffee
h/static/scripts/directives/privacy.coffee
+5
-1
privacy.html
h/templates/client/privacy.html
+4
-4
No files found.
h/static/scripts/directives/privacy.coffee
View file @
eae9958d
...
...
@@ -14,6 +14,8 @@ privacy = ['$window', ($window) ->
return
level
undefined
isPublic
=
(
level
)
->
level
==
VISIBILITY_PUBLIC
# Detection is needed because we run often as a third party widget and
# third party storage blocking often blocks cookies and local storage
# https://github.com/Modernizr/Modernizr/blob/master/feature-detects/storage/localstorage.js
...
...
@@ -46,7 +48,7 @@ privacy = ['$window', ($window) ->
permissions
=
controller
.
$modelValue
if
privacy
.
name
is
VISIBILITY_PUBLIC
if
isPublic
(
privacy
.
name
)
permissions
.
read
=
[
'group:__world__'
]
else
permissions
.
read
=
[
attrs
.
user
]
...
...
@@ -70,6 +72,8 @@ privacy = ['$window', ($window) ->
storage
.
setItem
VISIBILITY_KEY
,
level
.
name
controller
.
$setViewValue
level
controller
.
$render
()
scope
.
isPublic
=
isPublic
require
:
'?ngModel'
restrict
:
'E'
scope
:
{}
...
...
h/templates/client/privacy.html
View file @
eae9958d
...
...
@@ -3,15 +3,15 @@
role=
"button"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"small"
ng-class=
"{'h-icon-earth':
level.name == 'public'
,
'h-icon-locked':
level.name == 'private'
}"
></i>
<i
class=
"small"
ng-class=
"{'h-icon-earth':
isPublic(level.name)
,
'h-icon-locked':
!isPublic(level.name)
}"
></i>
{{level.text}}
<i
class=
"h-icon-triangle"
></i>
</span>
<ul
class=
"dropdown-menu"
role=
"menu"
>
<li
ng-repeat=
"level in levels"
ng-click=
"setLevel(level)"
>
<i
class=
"small"
ng-class=
"{'h-icon-earth':
level.name == 'public'
,
'h-icon-locked':
level.name == 'private'
}"
></i>
<i
class=
"small"
ng-class=
"{'h-icon-earth':
isPublic(level.name)
,
'h-icon-locked':
!isPublic(level.name)
}"
></i>
{{level.text}}
</li>
</ul>
...
...
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