Skip to content

Commit

Permalink
Adding tags to Modals of Nodes (publiclab#8238)
Browse files Browse the repository at this point in the history
* adding tags in modals of Nodes publiclab#8230

* refactored publiclab#8230

* fixed tag path in the modal publiclab#8230
also fixed extra spacing when no tags on the modal
  • Loading branch information
renugasaraswathy authored and Piyush Swain committed Oct 22, 2020
1 parent ab7b95c commit c05660d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/views/spam2/_nodes.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ $(document).ready(function () {
</button>
</div>
<div class="modal-body">
<% if node.tags.length>0 %>
<div class="mb-2">
<% node.tags.limit(4).each do |tag| %>
<%= link_to tag.name, tag_path(tag.name), class: 'badge badge-primary' %>
<% end %>
</div>
<% end %>
<%= node.body %>
</div>
<div class="modal-footer">
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
put 'tag/add_tag' => 'tag#add_tag'
put 'tag/remove_tag/:id' => 'tag#remove_tag'
put 'tag/remove_all_tags' => 'tag#remove_all_tags'
get 'tag/:id' => 'tag#show'
get 'tag/:id' => 'tag#show', :as => :tag
get 'tag/:id/stats' => 'tag#stats', :as => :tag_stats
get 'locations/form' => 'tag#location'
get 'locations/modal' => 'tag#location_modal'
Expand Down

0 comments on commit c05660d

Please sign in to comment.