Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blur potentially sensitive info while in anonymous mode #5083

Merged
merged 4 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/assets/stylesheets/components.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,11 @@ blockquote {
border-left: var(--d-divider) 3px solid;
color: var(--d-on-surface-muted);
}

.blur {
filter: blur(5px);

&:hover {
filter: none;
}
}
2 changes: 1 addition & 1 deletion app/views/activities/_series_activities_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<td>
<%= "#{index + 1}." if local_assigns[:series]&.activity_numbers_enabled? %>
<% if activity.accessible?(current_user, @course) %>
<%= link_to activity.name, get_activity_path.call(activity) %>
<%= link_to activity.name, get_activity_path.call(activity), class: ('blur' if (local_assigns[:series].hidden? || local_assigns[:series].closed?) && Current.demo_mode) %>
<% else %>
<%= activity.name %>
<% if current_user&.course_admin?(@course) && current_user&.repository_admin?(activity.repository) %>
Expand Down
10 changes: 5 additions & 5 deletions app/views/pages/_user_card.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<i class="mdi mdi-chevron-right"></i>
<% end %>
<span class='float-start'><%= activity_icon exercise %></span>
<%= link_to exercise.name, activity_path(exercise), class: "course-link", title: exercise.name %>
<%= link_to exercise.repository.name, repository_path(exercise.repository), class: "small text-muted course-link", title: exercise.repository.name %>
<%= link_to exercise.name, activity_path(exercise), class: "course-link #{'blur' if Current.demo_mode }", title: exercise.name %>
<%= link_to exercise.repository.name, repository_path(exercise.repository), class: "small text-muted course-link #{'blur' if Current.demo_mode }", title: exercise.repository.name %>
</p>
<% end %>
<% if @draft_exercises.count > 5 %>
Expand Down Expand Up @@ -72,12 +72,12 @@
<% end %>
<span class='float-start'><%= submission_status_icon(submission) %></span>
<% if exercise.accessible?(current_user, submission.course) %>
<%= link_to exercise.name, activity_scoped_path(course: submission.course, activity: exercise), class: "course-link", title: exercise.name %>
<%= link_to exercise.name, activity_scoped_path(course: submission.course, activity: exercise), class: "course-link #{'blur' if Current.demo_mode }", title: exercise.name %>
<% else %>
<span title="<%= exercise.name %>"><%= exercise.name %></span>
<span title="<%= exercise.name %>" <%='class="blur"' if Current.demo_mode %>><%= exercise.name %></span>
<% end %>
<% unless submission.course.nil? %>
<%= link_to submission.course.name, course_path(submission.course), class: "small text-muted course-link", title: submission.course.name %>
<%= link_to submission.course.name, course_path(submission.course), class: "small text-muted course-link #{'blur' if Current.demo_mode }", title: submission.course.name %>
<% end %>
</p>
<% end %>
Expand Down