Skip to content

Commit

Permalink
remove show more tags in favor of add tags now that both buttons do t… (
Browse files Browse the repository at this point in the history
#8400)

* remove show more tags in favor of add tags now that both buttons do the same thing

follow-up to #8386

* tooltip

* Update _tagging.html.erb

* Update post_test.rb

* Update post_test.rb

* Update _tagging.html.erb

* try classname instead of id

* switch to a#tags-open

* re-show tags input on profile pages
  • Loading branch information
jywarren authored Sep 22, 2020
1 parent 2e01a92 commit e4a0bbf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
15 changes: 8 additions & 7 deletions app/views/tag/_tagging.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<script>
$(function () {
$('#tags [data-toggle="tooltip"]').tooltip()
$('#tags [data-toggle="tooltip"]').tooltip();
var pops = $("[data-toggle=popover]");
$(".label").on("click", function(e){
Expand All @@ -46,14 +46,15 @@ $(function () {
<% parent ||= nil %>
<% if current_user && (parent != :profile || (current_user.id == user.id || logged_in_as(['admin']))) %>
<a data-toggle="tooltip" title="Add tags/View all" aria-label="Add tags/View all" id="tags-open" class="btn btn-circle btn-circle-sm tags-open" style="float:left;">
<i class="fa fa-plus" style="color:#808080;"></i>
</a>
<a aria-label="Add tags" id="tags-open" class="btn btn-circle btn-circle-sm" style="float:left;"><i class="fa fa-plus" style="color:#808080;"></i></a>
<% if @node && @node.tags.count == 0 %>
<span style="float:left;color:#666;margin-top:14px;margin-left:5px;">Add tags</a>
<% end %>
<%= render partial: 'tag/form', locals: { node: @node ||= nil, user: user ||= nil, url: url ||= nil } %>
<% if @node && @node.tags.count == 0 %>
<span style="float:left;color:#666;margin-top:14px;margin-left:5px;">Add tags</span>
<% end %>
<%= render partial: 'tag/form', locals: { node: @node ||= nil, user: user ||= nil, url: url ||= nil } %>
<% end %>
<script>
Expand Down
15 changes: 0 additions & 15 deletions app/views/tag/_tags.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<% user = user || @user # allow overriding w/ local variable %>
<div class="tags-list">
<% if tags.length > 0 && power_tag %>
<a aria-label="Show more tags" class="btn btn-circle btn-circle-sm show-more-tags" href="javascript:void(0);" style="float:left;"><i class="fa fa-ellipsis-h" style="color:#808080;"></i></a>
<% end %>
<% tags.each_with_index do |tag, i| %>
<% if tag.class == NodeTag %>
Expand All @@ -27,18 +24,6 @@
<% end %>
<script>
(function() {
$('.show-more-tags').click(function showMoreTags() {
$('.more-tags').show();
$('.show-more-tags').hide();
$("#tagform").show();
$("#tags-open").hide();
$(".tag-input").focus();
});
})();
</script>
<% elsif tag.class == UserTag && (tag.name[0..4] != "oauth" || (logged_in_as(['admin', 'moderator']) || (current_user && current_user.uid == tag.uid))) %>
<li style="width: 100%;">
Expand Down
4 changes: 3 additions & 1 deletion test/system/post_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ def assert_page_does_not_reload(message = "page should not reload")

# Wait for the location to be added
wait_for_ajax
find('.tags-list a.show-more-tags').click()

# there should also be a page reload now, because we want to reload to see the sidebar mini-map
find('a#tags-open').click()

# Make sure proper latitude and longitude tags are added
assert_selector('.tags-list .badge a[href="/tag/lat:22"]', text: "lat:22")
Expand Down

0 comments on commit e4a0bbf

Please sign in to comment.