Style exercise description as a card and display an additional (more obvious) toggle
This commit is contained in:
@ -591,17 +591,16 @@ configureEditors: function () {
|
|||||||
},
|
},
|
||||||
|
|
||||||
initializeDescriptionToggle: function() {
|
initializeDescriptionToggle: function() {
|
||||||
$('#exercise-headline').on('click',this.toggleDescriptionPanel.bind(this))
|
$('#exercise-headline').on('click', this.toggleDescriptionPanel.bind(this));
|
||||||
|
$('a#toggle').on('click', this.toggleDescriptionPanel.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleDescriptionPanel: function() {
|
toggleDescriptionPanel: function() {
|
||||||
$('#description-panel').toggleClass('description-panel-collapsed');
|
$('#description-panel').toggleClass('description-panel-collapsed').toggleClass('description-panel');
|
||||||
$('#description-panel').toggleClass('description-panel');
|
$('#description-symbol').toggleClass('fa-chevron-down').toggleClass('fa-chevron-right');
|
||||||
$('#description-symbol').toggleClass('fa-chevron-down');
|
var toggle = $('a#toggle');
|
||||||
$('#description-symbol').toggleClass('fa-chevron-right');
|
toggle.text(toggle.text() == toggle.data('hide') ? toggle.data('show') : toggle.data('hide'));
|
||||||
// resize ace editors
|
|
||||||
this.resizeAceEditors();
|
this.resizeAceEditors();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,6 +12,34 @@ input[type='file'] {
|
|||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.exercise {
|
||||||
|
border-radius: 3px;
|
||||||
|
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.2);
|
||||||
|
padding: 1px 10px 1px 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
a#toggle {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
a#toggle:before {
|
||||||
|
content: "(";
|
||||||
|
}
|
||||||
|
|
||||||
|
a#toggle:after {
|
||||||
|
content: ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
h1#exercise-headline {
|
||||||
|
margin: 10px 0 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lead.description-panel-collapsed {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Graph Settings
|
// Graph Settings
|
||||||
|
|
||||||
.axis path {
|
.axis path {
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
.row
|
.row
|
||||||
#editor-column.col-md-12
|
#editor-column.col-md-12
|
||||||
div
|
.exercise.clearfix
|
||||||
span.badge.pull-right.score
|
div
|
||||||
|
span.badge.pull-right.score
|
||||||
|
|
||||||
h1 id="exercise-headline"
|
h1 id="exercise-headline"
|
||||||
i class="fa fa-chevron-down" id="description-symbol"
|
i class="fa fa-chevron-down" id="description-symbol"
|
||||||
= @exercise
|
= @exercise.title
|
||||||
|
|
||||||
#description-panel.lead.description-panel
|
#description-panel.lead.description-panel
|
||||||
= render_markdown(@exercise.description)
|
= render_markdown(@exercise.description)
|
||||||
|
|
||||||
|
a#toggle href="#" data-show=t('shared.show') data-hide=t('shared.hide') = t('shared.hide')
|
||||||
|
|
||||||
#alert.alert.alert-danger role='alert'
|
#alert.alert.alert-danger role='alert'
|
||||||
h4 = t('.alert.title')
|
h4 = t('.alert.title')
|
||||||
|
@ -695,6 +695,7 @@ de:
|
|||||||
upload_file: Datei hochladen
|
upload_file: Datei hochladen
|
||||||
time:
|
time:
|
||||||
before: "%{time} zuvor"
|
before: "%{time} zuvor"
|
||||||
|
hide: "Verstecken"
|
||||||
submissions:
|
submissions:
|
||||||
causes:
|
causes:
|
||||||
autosave: Autosave
|
autosave: Autosave
|
||||||
|
@ -695,6 +695,7 @@ en:
|
|||||||
upload_file: Upload file
|
upload_file: Upload file
|
||||||
time:
|
time:
|
||||||
before: "%{time} ago"
|
before: "%{time} ago"
|
||||||
|
hide: "Hide"
|
||||||
submissions:
|
submissions:
|
||||||
causes:
|
causes:
|
||||||
autosave: Autosave
|
autosave: Autosave
|
||||||
|
Reference in New Issue
Block a user