Convert classes to use data attributes
- Remote resolved classes on post flags since they were unused
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
div#c-dmails {
|
div#c-dmails {
|
||||||
tr.read-false {
|
tr[data-is-read="false"] {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
div#c-user-feedbacks, div#c-moderator-dashboards div#col2 {
|
div#c-user-feedbacks, div#c-moderator-dashboards div#col2 {
|
||||||
.feedback-category-positive {
|
[data-category="positive"] {
|
||||||
background: var(--success-background-color);
|
background: var(--success-background-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.feedback-category-negative {
|
[data-category="negative"] {
|
||||||
background: var(--error-background-color);
|
background: var(--error-background-color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,13 +23,12 @@ class TableBuilder
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_reader :columns, :table_attributes, :row_attributes, :items
|
attr_reader :columns, :table_attributes, :items
|
||||||
|
|
||||||
def initialize(items, table_attributes=nil, row_attributes=nil)
|
def initialize(items, table_attributes=nil)
|
||||||
@items = items
|
@items = items
|
||||||
@columns = []
|
@columns = []
|
||||||
@table_attributes = table_attributes
|
@table_attributes = table_attributes
|
||||||
@row_attributes = row_attributes
|
|
||||||
yield self if block_given?
|
yield self if block_given?
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -50,17 +49,6 @@ class TableBuilder
|
|||||||
class_attributes = {}
|
class_attributes = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
if !row_attributes.nil?
|
standard_attributes.merge(class_attributes)
|
||||||
mapped_row_attributes = row_attributes.clone
|
|
||||||
mapped_row_attributes.clone.each do |key, value|
|
|
||||||
if value.kind_of?(Array)
|
|
||||||
mapped_row_attributes[key] = value[0] % value.slice(1,value.length).map {|param| eval(param)}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
mapped_row_attributes = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
standard_attributes.merge(class_attributes).merge(mapped_row_attributes)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ class Dmail < ApplicationRecord
|
|||||||
|
|
||||||
module ApiMethods
|
module ApiMethods
|
||||||
def html_data_attributes
|
def html_data_attributes
|
||||||
[:owner_id, :from_id, :to_id]
|
[:owner_id, :from_id, :to_id, :is_read?]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class UserFeedback < ApplicationRecord
|
|||||||
|
|
||||||
module ApiMethods
|
module ApiMethods
|
||||||
def html_data_attributes
|
def html_data_attributes
|
||||||
[:user_id, :creator_id]
|
[:user_id, :creator_id, :category]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
<%= render "search" %>
|
<%= render "search" %>
|
||||||
|
|
||||||
<%= table_for @dmails, {class: "striped", width: "100%"}, {class: ["read-%s", "item.is_read?"]} do |t| %>
|
<%= table_for @dmails, {class: "striped", width: "100%"} do |t| %>
|
||||||
<% t.column "Date" do |dmail| %>
|
<% t.column "Date" do |dmail| %>
|
||||||
<%= compact_time(dmail.created_at) %>
|
<%= compact_time(dmail.created_at) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<%= render "search" %>
|
<%= render "search" %>
|
||||||
<%= render "posts/partials/common/inline_blacklist" %>
|
<%= render "posts/partials/common/inline_blacklist" %>
|
||||||
|
|
||||||
<%= table_for @post_flags, {class: "striped", width: "100%"}, {class: ["resolved-%s", "item.is_resolved?"]} do |t| %>
|
<%= table_for @post_flags, {class: "striped", width: "100%"} do |t| %>
|
||||||
<% t.column "Post", {width: "1%"} do |post_flag| %>
|
<% t.column "Post", {width: "1%"} do |post_flag| %>
|
||||||
<%= PostPresenter.preview(post_flag.post, :tags => "status:any") %>
|
<%= PostPresenter.preview(post_flag.post, :tags => "status:any") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<%= f.submit "Search" %>
|
<%= f.submit "Search" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= table_for @user_feedbacks, {class: "striped autofit"}, {class: ["feedback-category-%s", "item.category"]} do |t| %>
|
<%= table_for @user_feedbacks, {class: "striped autofit"} do |t| %>
|
||||||
<% t.column "User" do |feedback| %>
|
<% t.column "User" do |feedback| %>
|
||||||
<%= link_to_user feedback.user %>
|
<%= link_to_user feedback.user %>
|
||||||
<%= link_to "»", user_feedbacks_path(search: { user_name: feedback.user.name }) %>
|
<%= link_to "»", user_feedbacks_path(search: { user_name: feedback.user.name }) %>
|
||||||
|
|||||||
Reference in New Issue
Block a user