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 @@ -1369,6 +1369,10 @@ function initDiffEditor(editorId) {
13691369 }
13701370 } )
13711371
1372+ const diffTitle = document . getElementById ( `${ editorId } -title-diff` ) ;
1373+ const diffTag = diffTitle . querySelector ( 'span.diff-tag' ) ;
1374+ const diffLink = diffTitle . querySelector ( 'a.diff-link' ) ;
1375+
13721376 const editor = {
13731377 'getDiffMode' : ( ) => {
13741378 for ( let radio of radios ) {
@@ -1412,6 +1416,15 @@ function initDiffEditor(editorId) {
14121416 if ( selected && selected . dataset . tag ) {
14131417 setDiffTag ( selected . dataset . tag ) ;
14141418 }
1419+
1420+ if ( noDiff ) {
1421+ diffTitle . style . display = 'none' ;
1422+ } else {
1423+ diffTitle . style . display = 'inline' ;
1424+ diffTag . innerText = selected . dataset . tag ;
1425+ diffLink . href = selected . dataset . url ;
1426+ diffLink . innerText = `s${ submitId } ` ;
1427+ }
14151428 } ;
14161429 updateSelect ( parseInt ( select [ 0 ] . value ) , select [ 0 ] . value === "" ) ;
14171430 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