tweak styles for fav button
This commit is contained in:
@@ -157,16 +157,10 @@ body[data-user-can-approve-posts="true"] .post-preview {
|
|||||||
div#c-posts {
|
div#c-posts {
|
||||||
.fav-buttons {
|
.fav-buttons {
|
||||||
font-size: 14pt;
|
font-size: 14pt;
|
||||||
text-align: center;
|
|
||||||
margin: 0.5em 0;
|
margin: 0.5em 0;
|
||||||
|
|
||||||
form {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
i {
|
i {
|
||||||
margin-right: 0.1em;
|
margin-right: 0.1em;
|
||||||
color: deeppink;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
button.ui-button {
|
button.ui-button {
|
||||||
@@ -174,22 +168,18 @@ div#c-posts {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#remove-fav-button i {
|
||||||
|
color: deeppink;
|
||||||
|
}
|
||||||
|
|
||||||
.fav-buttons-true #add-fav-button {
|
.fav-buttons-true #add-fav-button {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fav-buttons-true #remove-fav-button {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fav-buttons-false #remove-fav-button {
|
.fav-buttons-false #remove-fav-button {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fav-buttons-false #add-fav-button {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ugoira-controls {
|
#ugoira-controls {
|
||||||
div#seek-slider {
|
div#seek-slider {
|
||||||
margin-top: 0.5em;
|
margin-top: 0.5em;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fav-buttons button {
|
||||||
|
font-size: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
div#page aside#sidebar {
|
div#page aside#sidebar {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
$("#add-to-favorites, #add-fav-button, #remove-from-favorites, #remove-fav-button").toggle();
|
$("#add-to-favorites, #add-fav-button, #remove-from-favorites, #remove-fav-button").toggle();
|
||||||
$("#score-for-post-<%= @post.id %>").text(<%= @post.score %>);
|
$("#score-for-post-<%= @post.id %>").text(<%= @post.score %>);
|
||||||
$("#favcount-for-post-<%= @post.id %>").text(<%= @post.fav_count %>);
|
$("#favcount-for-post-<%= @post.id %>").text(<%= @post.fav_count %>);
|
||||||
|
$(".fav-buttons").toggleClass("fav-buttons-false").toggleClass("fav-buttons-true");
|
||||||
|
|
||||||
<% if CurrentUser.is_gold? %>
|
<% if CurrentUser.is_gold? %>
|
||||||
var fav_count = <%= @post.fav_count %>;
|
var fav_count = <%= @post.fav_count %>;
|
||||||
|
|||||||
@@ -56,11 +56,11 @@
|
|||||||
<% if CurrentUser.is_member? %>
|
<% if CurrentUser.is_member? %>
|
||||||
<%= content_tag(:div, class: "fav-buttons fav-buttons-#{@post.is_favorited?}") do %>
|
<%= content_tag(:div, class: "fav-buttons fav-buttons-#{@post.is_favorited?}") do %>
|
||||||
<%= form_tag(favorites_path(post_id: @post.id), method: "post", id: "add-fav-button", "data-remote": true) do %>
|
<%= form_tag(favorites_path(post_id: @post.id), method: "post", id: "add-fav-button", "data-remote": true) do %>
|
||||||
<%= button_tag tag.i(class: "far fa-heart") + " Favorite", class: "ui-button ui-widget ui-corner-all gradient", "data-disable-with": "Favoriting..." %>
|
<%= button_tag tag.i(class: "far fa-heart"), class: "ui-button ui-widget ui-corner-all gradient", "data-disable-with": "..." %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= form_tag(favorite_path(@post.id), method: "delete", id: "remove-fav-button", "data-remote": true) do %>
|
<%= form_tag(favorite_path(@post.id), method: "delete", id: "remove-fav-button", "data-remote": true) do %>
|
||||||
<%= button_tag tag.i(class: "fas fa-heart") + " Unfavorite", class: "ui-button ui-widget ui-corner-all gradient", "data-disable-with": "Updating..." %>
|
<%= button_tag tag.i(class: "fas fa-heart"), class: "ui-button ui-widget ui-corner-all gradient", "data-disable-with": "..." %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user