Skip to content

Commit

Permalink
Always show add score items button
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg-vr committed Dec 9, 2024
1 parent 9ee2ed9 commit 82a1b6c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
13 changes: 9 additions & 4 deletions app/assets/stylesheets/models/score_items.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
}

td.visibility {
width: 20px;
width: 60px;
}

td.maximum {
width: 105px;
width: 100px;
padding-right: 20px;
}

Expand All @@ -40,8 +40,13 @@
width: 250px;
}

td.wide-description {
width: 650px;
td.add-score-items {
text-align: center;

// padding is used to center the button
// padding-right: 90px = 250px (td.name) - 60px (td.visibility) - 100px (td.maximum)
// top and bottom padding is 0 to avoid double padding with the button
padding: 0 90px 0 0;
}

.maximum-row {
Expand Down
14 changes: 7 additions & 7 deletions app/views/score_items/_exercise.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@
<% if evaluation_exercise.score_items.empty? %>
<tr>
<td class="placeholder-text" colspan="4">
<div><%= t 'score_items.exercise.nothing' %></div>
<div>
<a class="btn btn-text edit-btn">
<%= t ".add" %>
</a>
</div>
<%= t 'score_items.exercise.nothing' %>
</td>
</tr>
<% else %>
Expand All @@ -47,7 +42,12 @@
<% end %>
<% end %>
<tr class="maximum-row">
<td colspan="2" class="wide-description"><%= t '.max' %></td>
<td class="name"><%= t '.max' %></td>
<td class="add-score-items">
<a class="btn btn-text edit-btn">
<%= t ".add" %>
</a>
</td>
<td class="maximum">
<%= format_score maximum_score %>
</td>
Expand Down

0 comments on commit 82a1b6c

Please sign in to comment.