-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add usage info popup for visibility. Fixes #514
- Loading branch information
Showing
9 changed files
with
67 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
app/assets/stylesheets/curation_concerns/modules/icons.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.large-icon { | ||
font-size: 1.5em; | ||
} | ||
|
||
.help-icon { | ||
@extend .glyphicon; | ||
@extend .glyphicon-question-sign; | ||
@extend .large-icon; | ||
top: 5px; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module CurationConcerns | ||
module PermissionsHelper | ||
def help_link(file, title, aria_label) | ||
link_to help_icon, '#', 'data-toggle': 'popover', 'data-content': capture_content(file), | ||
'data-original-title': title, 'aria-label': aria_label | ||
end | ||
|
||
private | ||
|
||
def capture_content(file) | ||
capture do | ||
render file | ||
end | ||
end | ||
|
||
def help_icon | ||
content_tag 'i', '', 'aria-hidden': true, class: 'help-icon' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<p>This setting will determine who can view your file, and the associated metadata. Setting | ||
the visibility to <span class='label label-success'>Open Access</span> will allow your | ||
content to be discovered in Google and viewed by anyone. The visibility setting | ||
<span class='label label-info'><%=t('curation_concerns.institution_name') %></span> will only allow | ||
users who are logged into <%=t('curation_concerns.product_name') %> (via WebAccess) to view the content. | ||
Files that are marked <span class='label label-danger'>Private</span> are only able to be viewed | ||
by users and/or groups that have been given specific access in the "Share With" section. | ||
</p> | ||
|
||
<p> | ||
Permissions in <%=t('curation_concerns.product_name') %> are hierarchical. This means that you cannot set | ||
the visibility of a file to <span class='label label-success'>Open Access</span> or | ||
<span class='label label-info'><%=t('curation_concerns.institution_name') %></span> and simultaneously | ||
try to restrict the access of a single user. However, you may mark the visibility of | ||
a file as <span class='label label-danger'>Private</span> and then grant access to | ||
particular users and/or groups for that file in the "Share With" section. | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require 'spec_helper' | ||
|
||
describe CurationConcerns::PermissionsHelper do | ||
describe "#help_link" do | ||
subject { helper.help_link 'curation_concerns/base/visibility', 'Visibility', 'Usage information for visibility' } | ||
|
||
it "draws help_icon" do | ||
expect(subject).to match(/data-content="<p>This setting will determine who can view your file/) | ||
expect(subject).to have_selector 'a i.help-icon' | ||
end | ||
end | ||
end |