Skip to content

Commit

Permalink
Merge pull request #6071 from swayam-agrahari/master
Browse files Browse the repository at this point in the history
add visual indicator for campaign view
  • Loading branch information
ragesoss authored Dec 20, 2024
2 parents 2f658ef + 5223d0d commit 15624e0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/modules/_tables.styl
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@
.table > tbody > .table-row--faded
background-color #fafafa

.table > tbody > .table-row--closed
background-color: #f8d7da;
color: #721c24;
font-weight: bold;


// Align buttons/text to the right of the action cell
Expand Down
5 changes: 5 additions & 0 deletions app/helpers/course_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,9 @@ def format_wiki_namespaces(wiki_namespaces)
"#{wiki_domain}-namespace-#{namespace}"
end
end

def closed_course_class(course)
return 'table-row--closed' if course.flags&.dig(:closed_date)
return ''
end
end
2 changes: 1 addition & 1 deletion app/views/campaigns/_course_row.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%tr{:class => "#{user ? date_highlight_class(course) : private_highlight_class(course)}", "data-link" => "#{course_slug_path(course.slug)}"}
%tr{:class => "#{user ? date_highlight_class(course) : private_highlight_class(course)} #{closed_course_class(course)}", "data-link" => "#{course_slug_path(course.slug)}"}
%td{:class => "table-link-cell", :role => "button", :tabindex => "0"}
%a.course-link{:href => "#{course_slug_path(course.slug)}"}
%span.title
Expand Down

0 comments on commit 15624e0

Please sign in to comment.