File tree Expand file tree Collapse file tree 4 files changed +24
-9
lines changed Expand file tree Collapse file tree 4 files changed +24
-9
lines changed Original file line number Diff line number Diff line change @@ -1362,6 +1362,10 @@ function initDiffEditor(editorId) {
13621362 }
13631363 } )
13641364
1365+ const diffTitle = document . getElementById ( `${ editorId } -title-diff` ) ;
1366+ const diffTag = diffTitle . querySelector ( 'span.diff-tag' ) ;
1367+ const diffLink = diffTitle . querySelector ( 'a.diff-link' ) ;
1368+
13651369 const editor = {
13661370 'getDiffMode' : ( ) => {
13671371 for ( let radio of radios ) {
@@ -1405,6 +1409,15 @@ function initDiffEditor(editorId) {
14051409 if ( selected && selected . dataset . tag ) {
14061410 setDiffTag ( selected . dataset . tag ) ;
14071411 }
1412+
1413+ if ( noDiff ) {
1414+ diffTitle . style . display = 'none' ;
1415+ } else {
1416+ diffTitle . style . display = 'inline' ;
1417+ diffTag . innerText = selected . dataset . tag ;
1418+ diffLink . href = selected . dataset . url ;
1419+ diffLink . innerText = `s${ submitId } ` ;
1420+ }
14081421 } ;
14091422 updateSelect ( parseInt ( select [ 0 ] . value ) , select [ 0 ] . value === "" ) ;
14101423 editor . onDiffSelectChange ( updateSelect ) ;
Original file line number Diff line number Diff line change @@ -248,3 +248,7 @@ table.table-full-clickable-cell tr .table-button-head-right-right{
248248.timebutton {
249249 min-width : 9em ;
250250}
251+
252+ .diff-title {
253+ display : none;
254+ }
Original file line number Diff line number Diff line change 3131 <select class =" diff-select btn btn-secondary btn-sm form-select-sm text-start" aria-label =" Submission to diff against" >
3232 <option value =" " data-tag =" no-diff" >No diff</option >
3333 {%- for other in otherSubmissions %}
34- <option value =" {{ other .submitid }}" {%- if other .tag %} data-tag =" {{ other .tag }}" {%- endif %}>
34+ <option value =" {{ other .submitid }}" data-url = " {{ path( ' jury_submission ' , { submitId : other . submitid }) }} " {%- if other .tag %} data-tag =" {{ other .tag }}" {%- endif %}>
3535 s{{ other .submitid }} {%- if other .tag %} ({{ other .tag }}) {%- endif %}
3636 </option >
3737 {%- endfor %}
Original file line number Diff line number Diff line change 88{% endblock %}
99
1010{% block content %}
11-
11+ {% set editor_id = " diffw " ~ submission . submitid %}
1212 <h1 >
1313 Source code for submission
1414 <a href =" {{ path(' jury_submission' , {submitId : submission .submitid }) }}" >s{{ submission .submitid }}</a >
2525 )
2626 {% endif %}
2727
28- {% if oldSubmission %}
29- and diff to previous submission
30- <a href =" {{ path(' jury_submission' , {submitId : oldSubmission .submitid }) }}" >
31- s{{ oldSubmission .submitid }}
32- </a >
33- {% endif %}
28+ <span class =" diff-title" id =" {{editor_id }}-title-diff" >
29+ and diff to <span class =" diff-tag" ></span > submission
30+ <a class =" diff-link" href =" #" ></a >
31+ </span >
3432 </h1 >
3533
3634 {%- if submission .entryPoint %}
3735 <p ><b >Entry point</b >: {{ submission .entryPoint }}</p >
3836 {%- endif %}
3937
40- {%- include ' jury/partials/submission_diff.html.twig' with {editor_id : " diffw " ~ submission . submitid } %}
38+ {%- include ' jury/partials/submission_diff.html.twig' with {editor_id : editor_id } %}
4139{% endblock %}
You can’t perform that action at this time.
0 commit comments