-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dependabot/github_actions/github/codeql-ac…
…tion-3
- Loading branch information
Showing
13 changed files
with
119 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,17 @@ | ||
name: Lint | ||
name: Ruff | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
ruff: | ||
name: ruff | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
cache: 'pip' | ||
- run: | | ||
python -m pip install --upgrade pip | ||
pip install ruff | ||
- name: Run Ruff | ||
run: | | ||
ruff djangocms_versioning tests | ||
- uses: actions/checkout@v4 | ||
|
||
- run: python -Im pip install --user ruff | ||
|
||
- name: Run ruff | ||
run: ruff --output-format=github djangocms_versioning tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ jobs: | |
run: coverage run setup.py test | ||
|
||
- name: Upload Coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
uses: codecov/codecov-action@v4 | ||
|
||
postgres: | ||
runs-on: ubuntu-latest | ||
|
@@ -83,7 +83,7 @@ jobs: | |
DATABASE_URL: postgres://postgres:[email protected]/postgres | ||
|
||
- name: Upload Coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
uses: codecov/codecov-action@v4 | ||
|
||
mysql: | ||
runs-on: ubuntu-latest | ||
|
@@ -127,7 +127,7 @@ jobs: | |
DATABASE_URL: mysql://[email protected]/djangocms_test | ||
|
||
- name: Upload Coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
uses: codecov/codecov-action@v4 | ||
|
||
cms-develop-sqlite: | ||
runs-on: ${{ matrix.os }} | ||
|
@@ -161,7 +161,7 @@ jobs: | |
run: coverage run setup.py test | ||
|
||
- name: Upload Coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
uses: codecov/codecov-action@v4 | ||
|
||
sqlite-django-main: | ||
runs-on: ubuntu-latest | ||
|
@@ -197,4 +197,4 @@ jobs: | |
run: coverage run setup.py test | ||
|
||
- name: Upload Coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
uses: codecov/codecov-action@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -207,6 +207,3 @@ ins.cms-diff img { | |
.cms-select::-ms-expand { | ||
opacity: 0; | ||
} | ||
input.button.revert-button { | ||
margin: 5px; | ||
} |
21 changes: 21 additions & 0 deletions
21
djangocms_versioning/static/djangocms_versioning/js/admin/versioning-actions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
(function () { | ||
"use strict"; | ||
|
||
function closeSideFrame() { | ||
try { | ||
window.top.CMS.API.Sideframe.close(); | ||
} catch (err) {} | ||
} | ||
|
||
document.addEventListener('DOMContentLoaded', function () { | ||
document.querySelectorAll('form.js-close-sideframe').forEach(el => { | ||
el.addEventListener("submit", (ev) => { | ||
ev.preventDefault(); | ||
closeSideFrame(); | ||
const form = window.top.document.body.appendChild(ev.target); | ||
form.style.display = 'none'; | ||
form.submit(); | ||
}); | ||
}); | ||
}); | ||
})(); |
37 changes: 37 additions & 0 deletions
37
djangocms_versioning/static/djangocms_versioning/js/versioning.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
(function() { | ||
var firstChecked, lastChecked; | ||
|
||
function handleVersionSelection(event) { | ||
if (firstChecked instanceof HTMLInputElement && firstChecked.checked) { | ||
firstChecked.checked = false; | ||
firstChecked.closest('tr').classList.remove('selected'); | ||
firstChecked = lastChecked; | ||
} | ||
if (event.target instanceof HTMLInputElement) { | ||
if (event.target.checked) { | ||
firstChecked = lastChecked; | ||
lastChecked = event.target; | ||
} else if (firstChecked === event.target) { | ||
firstChecked = null; | ||
} else { | ||
lastChecked = null; | ||
} | ||
} | ||
} | ||
|
||
document.addEventListener('DOMContentLoaded', function(){ | ||
var selectedVersions = document.querySelectorAll('#result_list input[type="checkbox"].action-select'); | ||
var selectElement = document.querySelector('#changelist-form select[name="action"]'); | ||
if (selectElement instanceof HTMLSelectElement) { | ||
for (var i = 0; i < selectElement.options.length; i++) { | ||
if (selectElement.options[i].value && selectElement.options[i].value !== 'compare_versions') { | ||
// for future safety: do not restrict on two selected versions, since there might be other actions | ||
return; | ||
} | ||
} | ||
} | ||
selectedVersions.forEach(function(selectedVersion){ | ||
selectedVersion.addEventListener('change', handleVersionSelection); | ||
}); | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters