Skip to content

Commit

Permalink
Add same behaviour for data section #4177
Browse files Browse the repository at this point in the history
  • Loading branch information
jlpereira committed Jan 29, 2025
1 parent ab40d26 commit a08f4b3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
21 changes: 18 additions & 3 deletions app/assets/stylesheets/helpers/hub/data.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,27 @@
animation-timing-function: linear;
animation-fill-mode: forwards;
margin: $standard_margin * 0.5;
[data-method='post'] {
position: absolute;
right: 12px;
}

.fav-link {
position: absolute;
right: 12px;
border-radius: 100%;
a {
padding: 8px;
border-radius: 100%;
right: 0px;
}
}

.fav-link .unfavorite_link:hover {
animation: pulse-red 2s infinite;
}

.fav-link .favourite_link:hover {
animation: pulse-green 2s infinite;
}

.data_card:hover {
transition: background-color 0.5s ease, box-shadow 0.5s ease;
box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.2);
Expand Down
4 changes: 3 additions & 1 deletion app/helpers/hub_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ def data_card(data)
content_tag(:div, class: 'data_card') do
content_tag(:div, '') +
content_tag(:div, '',
data.categories.inject({}){|hsh,c| hsh.merge!("data-category-#{c}" => 'true') }.merge(class: [:filter_data, :middle, 'card-categories', "#{data.status}", data.shared_css, data.application_css].flatten.join(' '), "data-category-#{data.status}" => 'true')
data.categories.inject({}){|hsh,c| hsh.merge!("data-category-#{c}" => 'true') }.merge(class: [:filter_data, :middle, 'card-categories', "#{data.status}", data.shared_css, data.application_css].flatten.join(' '), title: data.categories.map{|c| c.humanize}.join(', '), "data-category-#{data.status}" => 'true')
) +
data_link(data) +
content_tag(:div, '', class: 'fav-link') {
favorite_page_link('data', data.klass.to_s)
}
end
end

Expand Down

0 comments on commit a08f4b3

Please sign in to comment.