Skip to content

Commit

Permalink
Merge pull request #5083 from dodona-edu/feature/blur-private-info
Browse files Browse the repository at this point in the history
Blur potentially sensitive info while in anonymous mode
  • Loading branch information
jorg-vr authored Oct 26, 2023
2 parents 1c1f907 + 7ace13b commit f65dceb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
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

0 comments on commit f65dceb

Please sign in to comment.