Skip to content

Commit

Permalink
intermediate results
Browse files Browse the repository at this point in the history
  • Loading branch information
Elblinator committed Oct 1, 2024
1 parent 9ed7fc4 commit 2a588d1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,26 @@
}
}

.amendment-nr {
.amendment-nr-n-icon {
display: block;
//display: flex;
//align-items: center;
//justify-content: flex-start;
//border: 1px solid black;
position: relative;
left: -40px;
bottom:-30px
bottom: 12px;
height: 0;
margin-top: 45px;

.amendment-nr {
position: relative;
bottom: 3px;
font-style: italic;
background-color: rgb(224, 224, 224);
}
}

.os-linebreak {
display: none !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2005,6 +2005,7 @@ export class MotionDiffService {
firstLine: change.getLineFrom()
});
let diff = this.diff(oldText, change.getChangeNewText());
//console.log(diff);

// If an insertion makes the line longer than the line length limit, we need two line breaking runs:
// - First, for the official line numbers, ignoring insertions (that's been done some lines before)
Expand All @@ -2022,6 +2023,7 @@ export class MotionDiffService {
DomHelpers.addCSSClassToFirstTag(origBeginning, `merge-before`) + diff.substring(origBeginning.length);
}

//console.log(diff);
return diff;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ export class MotionFormatService {

let lastLineTo = -1;
for (let i = 0; i < changesToShow.length; i++) {
console.log(`First amendment line number`, changesToShow[i].getLineTo())
console.log(`lastLineTo`, lastLineTo)
console.log(changesToShow[i].getLineTo() > lastLineTo)
console.log(text)
if (changesToShow[i].getLineTo() > lastLineTo) {
text.push(
this.diffService.extractMotionLineRange(
Expand All @@ -239,26 +243,29 @@ export class MotionFormatService {
)
);
}
text.push(`<div class="amendment-nr">`);
if (this.hasCollissions(changesToShow[0], changesToShow)) {
text.push(`<span class="amendment-nr-n-icon">`);
if (this.hasCollissions(changesToShow[i], changesToShow)) {
text.push(`<mat-icon class="margin-right-10">warning</mat-icon>`);
}
const current_text = changesToShow[i];
if (`amend_nr` in current_text) {
text.push(`<span>`, current_text.amend_nr);
if (current_text.amend_nr === `` && !this.hasCollissions(changesToShow[0], changesToShow)) {
text.push(`<span class="amendment-nr">`, current_text.amend_nr);
if (current_text.amend_nr === ``) {
text.push(`Amendment`);
}
text.push(`</span></div>`);
text.push(`:</span></span>`);
}
//console.log(`I am tat the start again`);
//console.log(text);
text.push(this.diffService.getChangeDiff(motionText, changesToShow[i], lineLength, highlightedLine));
lastLineTo = changesToShow[i].getLineTo();
console.log(`outside if `);
//console.log(text);
}

text.push(
this.diffService.getTextRemainderAfterLastChange(motionText, changesToShow, lineLength, highlightedLine)
);
//console.log(text, text.join(``));
return text.join(``);
};

Expand Down

0 comments on commit 2a588d1

Please sign in to comment.