-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sidebar: Add toggle icons #6011
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,99 @@ | ||
<div class="d-print-none btn-toolbar float-right" style="margin-left:10px;margin-top:0;"> | ||
<ul class="btn-group"> | ||
<% if logged_in_as(['admin', 'moderator']) || (current_user && (current_user.uid == node.uid || node.has_tag("with:#{current_user.username}"))) %> | ||
<div class="d-print-none btn-toolbar float-left mb-3" style="margin-top:0;"> | ||
<% if logged_in_as(['admin', 'moderator']) || (current_user && (current_user.uid == node.uid || node.has_tag("with:#{current_user.username}"))) %> | ||
<% if node.type == 'note' %> | ||
<a <% if current_user && current_user.uid != node.uid %>data-confirm='Please be aware that you are editing a post by another contributor, a privilege you have only because you are an admin or co-author.' <% end %> class='btn btn-outline-secondary btn-sm' href='/notes/edit/<%= node.id %>?t=<%= Time.now.to_i %><% if params[:controller] == "questions" %>&redirect=question&template=question<% end %>'> | ||
<i class='fa fa-pencil'></i><span class='d-none d-lg-inline'> Edit</span> | ||
<a <% if current_user && current_user.uid != node.uid %>data-confirm='Please be aware that you are editing a post by another contributor, a privilege you have only because you are an admin or co-author.' <% end %> class='btn btn-outline-secondary btn-circle btn-sm' href='/notes/edit/<%= node.id %>?t=<%= Time.now.to_i %><% if params[:controller] == "questions" %>&redirect=question&template=question<% end %>'> | ||
<i class='ml-1 ff fa fa-pencil'></i> | ||
</a> | ||
<% end %> | ||
<% end %> | ||
|
||
<li data-toggle="tooltip" data-placement="top" rel="tooltip" title="Helpful? Like it and get updates!" class="btn btn-outline-secondary btn-sm btn-like" node-id="<%= node.id %>" id="like-button-<%= node.id %>"> | ||
<li data-toggle="tooltip" data-placement="top" rel="tooltip" title="Like by <%= node.likers.length %> people" class="btn btn-outline-secondary btn-circle btn-like" node-id="<%= node.id %>" id="like-button-<%= node.id %>"> | ||
<% if !current_user %> | ||
<a id="open-login-like" data-hashparams="like" data-toggle="modal" data-target="#loginModal"> | ||
<span id="like-star-<%= node.id %>" class="fa fa-star"></span> | ||
<span id="like-count-<%= node.id %>"><%= node.likers.length %></span> | ||
<span id="like-star-<%= node.id %>" class="ff fa fa-star"></span> | ||
</a> | ||
<% else %> | ||
<span id="like-star-<%= node.id %>" class="fa fa-star<% if !node.liked_by(current_user.uid) %>-o<% end %>"></span> | ||
<span id="like-count-<%= node.id %>"><%= node.likers.length %> </span> | ||
<span id="like-star-<%= node.id %>" class="ff fa fa-star<% if !node.liked_by(current_user.uid) %>-o<% end %>"></span> | ||
<% end %> | ||
</li> | ||
|
||
<li data-toggle="tooltip" data-placement="top" title="Print and more tools" class="btn btn-outline-secondary btn-sm" rel="popover" data-placement="left" data-html="true" style="overflow: auto; max-height: 500px" data-content=" | ||
|
||
<p><b>Users who liked this</b></p> | ||
<% node.likers.each do |user| %> | ||
<i class='fa fa-star-o'></i> <a href='/profile/<%= user.username %>/'><%= user.username %></a><br /> | ||
<% end %> | ||
<% if node.likers.length == 0 %><i>None</i><% end %> | ||
<% if node.type == 'note' && current_user && node.uid != current_user.uid%> | ||
<hr style='margin-bottom:3px;' /> | ||
<p><b>Award a Barnstar:</b></p> | ||
<form class='form' action='/barnstar/give'> | ||
<select name='star' class='form-control'> | ||
<option value='basic'>The basic barnstar</option> | ||
<option value='photo-documentation'>The photo documentation barnstar</option> | ||
<option value='video-documentation'>The video documentation barnstar</option> | ||
<option value='watchdog'>The watchdog barnstar</option> | ||
<option value='empiricism'>The empiricism barnstar</option> | ||
<option value='excessive-enthusiasm'>The enthusiasm barnstar</option> | ||
</select><br /> | ||
<input type='hidden' name='nid' value='<%= node.id %>'/> | ||
<input type='submit' class='btn btn-primary' value='Give'/> <a _target='blank' href='/wiki/barnstars'>Learn more</a> | ||
</form> | ||
<% end %> | ||
|
||
<% if logged_in_as(['admin', 'moderator']) || (current_user && current_user.uid == node.uid) %> | ||
|
||
<hr /> | ||
|
||
<div class='btn-group'> | ||
<a rel='tooltip' title='Flag as spam' class='btn btn-sm btn-outline-secondary btn-flag-spam-<%= node.id %>' href='mailto:[email protected]?subject=Reporting+spam+on+Public+Lab&body=Hi,+I+found+this+item+that+looks+like+spam+or+needs+to+be+moderated:+<%= node.title.gsub(/ /,'+') %>+https://publiclab.org/n/<%= node.id %>+by+https://publiclab.org/profile/<%= node.author.username %>+Thanks!'> | ||
<i class='fa fa-flag'></i> | ||
</a> | ||
<li data-toggle='tooltip' data-placement='top' title='Follow by tag or author' class='btn btn-outline-secondary btn-sm requireLogin nestedPopover' data-html='true' rel='popover' data-placement='left' data-content=" <%= "No tags" if tagnames.nil? || tagnames.length == 0 %> <% if tagnames %><% tagnames.each do |tagname| %><p style='margin-bottom:3px; overflow: hidden; text-overflow: ellipsis;'><a href='/subscribe/tag/<%= tagname %>' class='btn btn-outline-secondary btn-sm'><%= tagname %></a></p><% end %><% end %><hr /><i class='fa fa-user'></i><% if current_user && !current_user.following?(node.author) %> <a class='btn btn-sm' href='/relationships?followed_id=<%= node.author.id %>' data-method='post' > <%= node.author.name %></a><% else %> <%= node.author.name %><% end %>"> | ||
<i class='fa fa-user-plus' aria-hidden='true'></i> | ||
</li> | ||
|
||
<a href='/notes/delete/<%= node.id %>' class='btn btn-outline-secondary btn-sm' data-confirm='Are you sure?'> | ||
<i class='fa fa-trash'></i><span class='d-none d-lg-inline'> Delete</span> | ||
</a> | ||
<a href='/notes/raw/<%= node.id %>' class='btn btn-outline-secondary btn-sm'> | ||
<i class='fa fa-code'></i><span class='d-none d-lg-inline'> Raw</span> | ||
</a> | ||
<% if logged_in_as(['admin', 'moderator']) %> | ||
<% if node.type == 'note' %> | ||
<a class='btn btn-outline-secondary btn-sm' href='/moderate/spam/<%= node.id %>'><i class='fa fa-ban-circle'></i> Spam</a> | ||
<% elsif node.type == 'page' %> | ||
<a class='btn btn-outline-secondary btn-sm' href='/moderate/revision/spam/<%= @revision.vid %>'><i class='fa fa-ban-circle'></i> Spam revision</a> | ||
<% end %> | ||
<% if @node %> | ||
<% subpage_count = Tag.find_pages("parent:#{@node.slug}", 100).count %> | ||
<% if subpage_count > 0 %> | ||
<li class="btn btn-outline-secondary btn-circle" data-toggle="tooltip" data-placement="top" rel="tooltip" title="<%= subpage_count %> sub-pages"> | ||
<a href="/wiki/tag/parent:<%= @node.slug %>"> | ||
<i class="ff fa fa-book"></i> | ||
</a> | ||
</li> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
|
||
<br /> | ||
<hr style='clear:both;' /> | ||
|
||
<div> | ||
<p><a id='print-command-no-links'><i class='fa fa-print'></i> Print without page links</a></p> | ||
<p><a id='print-command-3-col'><i class='fa fa-print'></i> Print in 3-column layout</a></p> | ||
</div> | ||
|
||
<% end %> | ||
|
||
"> | ||
<span class="fa fa-caret-down"></span></li> | ||
</ul> | ||
<li data-toggle="tooltip" data-placement="top" title="Print and more tools" class="btn btn-outline-secondary btn-circle btn-sm" rel="popover" data-placement="left" data-html="true" style="overflow: auto; max-height: 500px" data-content=" | ||
|
||
<p><b>Users who liked this</b></p> | ||
<% node.likers.each do |user| %> | ||
<i class='fa fa-star-o'></i> <a href='/profile/<%= user.username %>/'><%= user.username %></a><br /> | ||
<% end %> | ||
<% if node.likers.length == 0 %><i>None</i><% end %> | ||
<% if node.type == 'note' && current_user && node.uid != current_user.uid%> | ||
<hr style='margin-bottom:3px;' /> | ||
<p><b>Award a Barnstar:</b></p> | ||
<form class='form' action='/barnstar/give'> | ||
<select name='star' class='form-control'> | ||
<option value='basic'>The basic barnstar</option> | ||
<option value='photo-documentation'>The photo documentation barnstar</option> | ||
<option value='video-documentation'>The video documentation barnstar</option> | ||
<option value='watchdog'>The watchdog barnstar</option> | ||
<option value='empiricism'>The empiricism barnstar</option> | ||
<option value='excessive-enthusiasm'>The enthusiasm barnstar</option> | ||
</select><br /> | ||
<input type='hidden' name='nid' value='<%= node.id %>'/> | ||
<input type='submit' class='btn btn-primary' value='Give'/> <a _target='blank' href='/wiki/barnstars'>Learn more</a> | ||
</form> | ||
<% end %> | ||
|
||
<% if logged_in_as(['admin', 'moderator']) || (current_user && current_user.uid == node.uid) %> | ||
|
||
<hr /> | ||
|
||
<div class='btn-group'> | ||
<a rel='tooltip' title='Flag as spam' class='btn btn-sm btn-outline-secondary btn-flag-spam-<%= node.id %>' href='mailto:[email protected]?subject=Reporting+spam+on+Public+Lab&body=Hi,+I+found+this+item+that+looks+like+spam+or+needs+to+be+moderated:+<%= node.title.gsub(/ /,'+') %>+https://publiclab.org/n/<%= node.id %>+by+https://publiclab.org/profile/<%= node.author.username %>+Thanks!'> | ||
<i class='fa fa-flag'></i> | ||
</a> | ||
<li data-toggle='tooltip' data-placement='top' title='Follow by tag or author' class='btn btn-outline-secondary btn-sm requireLogin nestedPopover' data-html='true' rel='popover' data-placement='left' data-content=" <%= "No tags" if tagnames.nil? || tagnames.length == 0 %> <% if tagnames %><% tagnames.each do |tagname| %><p style='margin-bottom:3px; overflow: hidden; text-overflow: ellipsis;'><a href='/subscribe/tag/<%= tagname %>' class='btn btn-outline-secondary btn-sm'><%= tagname %></a></p><% end %><% end %><hr /><i class='fa fa-user'></i><% if current_user && !current_user.following?(node.author) %> <a class='btn btn-sm' href='/relationships?followed_id=<%= node.author.id %>' data-method='post' > <%= node.author.name %></a><% else %> <%= node.author.name %><% end %>"> | ||
<i class='fa fa-user-plus' aria-hidden='true'></i> | ||
</li> | ||
|
||
<a href='/notes/delete/<%= node.id %>' class='btn btn-outline-secondary btn-sm' data-confirm='Are you sure?'> | ||
<i class='fa fa-trash'></i><span class='d-none d-lg-inline'> Delete</span> | ||
</a> | ||
<a href='/notes/raw/<%= node.id %>' class='btn btn-outline-secondary btn-sm'> | ||
<i class='fa fa-code'></i><span class='d-none d-lg-inline'> Raw</span> | ||
</a> | ||
<% if logged_in_as(['admin', 'moderator']) %> | ||
<% if node.type == 'note' %> | ||
<a class='btn btn-outline-secondary btn-sm' href='/moderate/spam/<%= node.id %>'><i class='fa fa-ban-circle'></i> Spam</a> | ||
<% elsif node.type == 'page' %> | ||
<a class='btn btn-outline-secondary btn-sm' href='/moderate/revision/spam/<%= @revision.vid %>'><i class='fa fa-ban-circle'></i> Spam revision</a> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
|
||
<br /> | ||
<hr style='clear:both;' /> | ||
|
||
<div> | ||
<p><a id='print-command-no-links'><i class='fa fa-print'></i> Print without page links</a></p> | ||
<p><a id='print-command-3-col'><i class='fa fa-print'></i> Print in 3-column layout</a></p> | ||
</div> | ||
"> | ||
<span class="ff fa fa-copy"></span> | ||
</li> | ||
|
||
<style type="text/css"> | ||
/*Styling the links to remove underline on hover and setting pointer as cursor*/ | ||
/*Styling the links to remove underline on hover and setting pointer as cursor*/ | ||
#print-command-3-col , #print-command-no-links { | ||
text-decoration : none; | ||
cursor : pointer; | ||
|
@@ -149,3 +156,21 @@ | |
}); | ||
</script> | ||
</div> | ||
|
||
<style> | ||
|
||
.btn-circle { | ||
height: 45px; | ||
width: 45px; | ||
border-radius: 50%; | ||
display: flex; | ||
align-items: center; | ||
margin-right: 5px; | ||
border-color: #ccc; | ||
} | ||
|
||
.ff { | ||
font-size: 1.5em; | ||
} | ||
|
||
</style> |
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 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only one I'm not sure of. Maybe this should be a
...
menu instead? I'm just worried the 2-pages icon isn't clear enough. What do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So What does that copy icon in style guide mean ? I thought copy icon looks like pages , so its something similar to print of 2 pages and other stuff menu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or should I just remove copy icon from this and just have
...
menu ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jywarren The style guide doesn't seem to have this menu icon in sidebar ? Instead it's usually in main left column.