Skip to content

Commit

Permalink
Make annotation UI more compact (#2208)
Browse files Browse the repository at this point in the history
* add no-padding-bottom class to input fields

* Reduce margin

* remove more padding
  • Loading branch information
jlge authored Sep 20, 2024
1 parent 502e05b commit e4714ba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
9 changes: 9 additions & 0 deletions app/assets/stylesheets/annotations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,22 @@
border: 1px solid red;
}

.code-table .annotation-line .annotation-form .row {
margin-bottom: 0;
}

.code-table .annotation-line .annotation-preview {
border: 1px solid $autolab-highlight-gray;
padding: 5px;
margin: 0 10px;
width: 100%;
}

.code-table .annotation-line .annotation-form .row .input-field {
margin-bottom: 0;
margin-top: 0.75rem !important;
}

.code-table .float-left {
float: left;
}
Expand Down
10 changes: 5 additions & 5 deletions app/views/submissions/_annotation_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="error" style="display: none;"></div>
<form>
<div class="row">
<div class="input-field col s12 annotation-comment">
<div class="input-field col s12 annotation-comment no-padding-bottom">
<textarea class="comment materialize-textarea" id="comment-textarea" placeholder=""></textarea>
<label for="comment-textarea">Comment</label>
<p>
Expand All @@ -17,29 +17,29 @@

<div class="row annotation-problem-score">
<% if global %>
<div class="input-field col s12">
<div class="input-field col s12 no-padding-bottom">
<input class="score" type="number" value="0" placeholder="0" step="any" id="comment-score" autocomplete="on">
<label for="comment-score">Score</label>
<span> Grading style: <b><%= @assessment.is_positive_grading ? "Positive grading" : "Negative grading" %></b>
<i class="material-icons" title="<%= "#{@assessment.is_positive_grading ? 'Score is added, starting from 0.' : 'Score is deducted from the total points.'} Change this setting in Edit Assessment > Problems" %>">info_outline</i> </span>
</div>
<% else %>
<div class="input-field col s6">
<div class="input-field col s6 no-padding-bottom">
<input class="score" type="number" value="0" placeholder="0" step="any" id="comment-score" autocomplete="on">
<label for="comment-score">Score</label>
<span> Grading style: <b><%= @assessment.is_positive_grading ? "Positive grading" : "Negative grading" %></b>
<i class="material-icons" title="<%= "#{@assessment.is_positive_grading ? 'Score is added, starting from 0.' : 'Score is deducted from the total points.'} Change this setting in Edit Assessment > Problems" %>">info_outline</i> </span>
</div>

<div class="input-field col s6">
<div class="input-field col s6 no-padding-bottom">
<select class="browser-default problem-id">
</select>
</div>
<% end %>
</div>

<div class="row">
<div class="input-field col s12">
<div class="input-field col s12 no-padding-bottom">
<input type="submit" class="btn" value="Add annotation">
<button class="btn grey annotation-cancel-button">Cancel</button>
</div>
Expand Down

0 comments on commit e4714ba

Please sign in to comment.