diff --git a/app/assets/stylesheets/models/activities.css.scss b/app/assets/stylesheets/models/activities.css.scss index 37d47c35e6..e0453265d8 100644 --- a/app/assets/stylesheets/models/activities.css.scss +++ b/app/assets/stylesheets/models/activities.css.scss @@ -129,7 +129,7 @@ center img { // editor #editor-text .cm-editor { - height: 300px; + height: 775px; } // white background for transparent images diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb index c55b68f742..cf06460a01 100644 --- a/app/controllers/activities_controller.rb +++ b/app/controllers/activities_controller.rb @@ -106,6 +106,12 @@ def available end def show + @repository = @activity.repository + @config = @activity.ok? ? @activity.merged_config : {} + @config_locations = @activity.ok? ? @activity.merged_config_locations : {} + @courses_series = policy_scope(@activity.series).group_by(&:course).sort do |a, b| + [b.first.year, a.first.name] <=> [a.first.year, b.first.name] + end flash.now[:alert] = I18n.t('activities.show.not_a_member') if @course && !current_user&.member_of?(@course) # Double check if activity still exists within this course (And throw a 404 when it does not) diff --git a/app/views/activities/_info.html.erb b/app/views/activities/_info.html.erb new file mode 100644 index 0000000000..a0f3aff7c3 --- /dev/null +++ b/app/views/activities/_info.html.erb @@ -0,0 +1,219 @@ +<% content_for :javascripts do %> + <%= javascript_include_tag 'submission' %> +<% end %> +<% + solutions = if @activity.exercise? + @activity.solutions.sort(&method(:compare_solutions)) + end +%> +
+ + <%= mail_to(contact_info) %> +
+ + <% if policy(@activity.judge).show? %> + <%= link_to @activity.judge.name, judge_path(@activity.judge) %> + <% else %> + <%= @activity.judge.name %> + <% end %> +
+ + <% if policy(@repository).show? %> + <%= link_to @repository.name, repository_path(@repository) %> + <% else %> + <%= @repository.name %> + <% end %> +
+ + <%= github_link @repository, @activity.path %> + <% end %> +
<%= t('.courses_using_this_activity', count: @courses_series.count) %>
+ <% if @courses_series.any? %> +<%= Course.human_attribute_name("name") %> | +<%= Course.human_attribute_name("series") %> | +<%= Course.human_attribute_name("teacher") %> | +<%= Course.human_attribute_name("year") %> | +<%= Course.human_attribute_name("institution") %> | +<%= t 'courses.index.users' %> | ++ |
---|---|---|---|---|---|---|
+ <%= link_to course.name, course %> + | ++ <%= raw series.map{ |s| link_to(s.name, s, class: "course-link", title: s.name).html_safe }.to_sentence %> + | +<%= course.teacher %> | +<%= course.formatted_year %> | +<%= course.institution&.short_name || t('courses.form.no_institution') %> | +<%= course.subscribed_members_count %> | ++ <% if policy(course).edit? %> + <%= link_to edit_course_path(course), class: "btn btn-icon" do %> + + <% end %> + <% end %> + | +