-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4885 from dodona-edu/enhance/saved-annotation-page
Create separate show and edit page for saved-annotations
- Loading branch information
Showing
21 changed files
with
155 additions
and
122 deletions.
There are no files selected for viewing
83 changes: 0 additions & 83 deletions
83
app/assets/javascripts/components/saved_annotations/edit_saved_annotation.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<div class="row"> | ||
<div class="col-md-10 offset-md-1 col-12"> | ||
<div class="card"> | ||
<div class="card-title card-title-colored"> | ||
<h2 class="card-title-text"><%= t ".title" %></h2> | ||
</div> | ||
<div class="card-supporting-text"> | ||
<div class="callout callout-warning mt-0"><%= t ".warning_no_annotations_changed" %></div> | ||
<%= form_for(@saved_annotation, html: { class: 'form-horizontal' }) do |f| %> | ||
<% if @saved_annotation.errors.any? %> | ||
<div class="callout callout-danger" id="error_explanation"> | ||
<h4><%= t('errors.validation_errors', count: @saved_annotation.errors.count) %></h4> | ||
<ul> | ||
<% @saved_annotation.errors.full_messages.each do |message| %> | ||
<li><%= message %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
<div class="field form-group row"> | ||
<%= f.label :title, class: "col-sm-3 col-form-label" %> | ||
<div class="col-sm-6"><%= f.text_field :title, class: "form-control" %></div> | ||
</div> | ||
<div class="field form-group row"> | ||
<%= f.label :annotation_text, class: "col-sm-3 col-form-label" %> | ||
<div class="col-sm-6"><%= f.text_area :annotation_text, class: "form-control" %></div> | ||
<span class="help-block offset-sm-3 col-sm-6"><%= t ".markdown_html" %></span> | ||
</div> | ||
<% end %> | ||
</div> | ||
<div class="card-actions card-border"> | ||
<% if policy(@saved_annotation).destroy? %> | ||
<%= link_to @saved_annotation, method: :delete, data: { confirm: t("general.are_you_sure") }, class: "btn btn-filled with-icon d-btn-danger" do %> | ||
<i class="mdi mdi-delete"></i> | ||
<%= t ".destroy" %> | ||
<% end %> | ||
<% end %> | ||
<button type="submit" class="btn btn-filled with-icon" form="<%= "edit_saved_annotation_#{@saved_annotation.id}"%>"> | ||
<i class="mdi mdi-send"></i> | ||
<%= t ".save" %> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<div class="row"> | ||
<div class="col-md-10 offset-md-1 col-12"> | ||
<div class="card"> | ||
<div class="card-title card-title-colored"> | ||
<h2 class="card-title-text"><%= @saved_annotation.title %></h2> | ||
<% if policy(@saved_annotation).edit? %> | ||
<div class="card-title-fab"> | ||
<%= render 'fab_link', url: edit_saved_annotation_path(@saved_annotation), icon: 'pencil' %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<div class="card-supporting-text"> | ||
<p><strong><%= @saved_annotation.title %></strong></p> | ||
<blockquote><%= markdown @saved_annotation.annotation_text %></blockquote> | ||
<%= t ".usage_info_html", | ||
exercise_path: course_activity_path(@saved_annotation.course ,@saved_annotation.exercise), | ||
exercise_name: @saved_annotation.exercise.name, | ||
course_path: course_path(@saved_annotation.course), | ||
course_name: @saved_annotation.course.name | ||
%><br/> | ||
<%= t ".count_info_html", count: @saved_annotation.annotations_count %> | ||
</div> | ||
<div class="card-supporting-text card-border"> | ||
<h4><%= t ".linked_submissions" %></h4> | ||
<%= render partial: 'submissions/submissions_table', locals: {submissions: @submissions, exercise: @saved_annotation.exercise, course: @saved_annotation.course, user: nil} %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
json.extract! @saved_annotation, :id, :title, :annotation_text, :user_id, :exercise_id, :course_id, :created_at, :updated_at | ||
json.url saved_annotation_url(@saved_annotation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.