Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions app/reviews/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,11 @@ def api_configuration(request: HttpRequest, pk: int) -> JsonResponse:
}
)


def fetch_diff(request):
url = request.GET.get("url")
if not url:
return JsonResponse(
{
"error": "Missing 'url' parameter"
}, status=400)
return JsonResponse({"error": "Missing 'url' parameter"}, status=400)

cached_html = cache.get(url)
if cached_html:
Expand Down
2 changes: 1 addition & 1 deletion app/static/css/bulma.0.9.4.min.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions app/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}

.large-checkbox {
transform: scale(2);
transform: scale(2);
transform-origin: center;
margin-right: 5px;
}
margin-right: 5px;
}
12 changes: 6 additions & 6 deletions app/static/reviews/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ createApp({

const hasMorePages = computed(() => filteredPages.value.length > pageDisplayLimit);

function saveDiffsToLocalStorage() {
function saveDiffsToLocalStorage() {
localStorage.setItem('showDiffsSetting', !state.diffs.showDiffs);
}

Expand Down Expand Up @@ -577,7 +577,7 @@ createApp({
*/

async function showDiff(page) {

page.revisions.forEach(async (revision)=> {
state.diffs.loadingDiff[revision.revid] = true;
// when running autoreview all
Expand Down Expand Up @@ -609,13 +609,13 @@ createApp({
if (link) {
const relativeHref = link.getAttribute('href');
const domainUrl = "//fi.wikipedia.org";

if (relativeHref && relativeHref.startsWith('/w/')) {
link.setAttribute('href', `${domainUrl}${relativeHref}`);
}
}
const updatedHtml = doc.body.innerHTML;

const updatedHtml = doc.body.innerHTML;
state.diffs.diffHtml[revision.revid] = updatedHtml;

} catch (error) {
Expand All @@ -624,7 +624,7 @@ createApp({
state.diffs.loadingDiff[revision.revid] = false;
}

})
})
}

watch(
Expand Down
12 changes: 6 additions & 6 deletions app/templates/reviews/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ <h2 class="title is-4">Pending pages</h2>
<div class="show-diff-checkbox">
<input
class="large-checkbox"
type="checkbox"
id="showdiff"
name="showdiff"
type="checkbox"
id="showdiff"
name="showdiff"
v-model="state.diffs.showDiffs"
@change="saveDiffsToLocalStorage"
>
Expand Down Expand Up @@ -173,9 +173,9 @@ <h2 class="title is-4">Pending pages</h2>
<div class="show-diff-checkbox">
<input
class="large-checkbox"
type="checkbox"
id="showPagediff"
name="showPagediff"
type="checkbox"
id="showPagediff"
name="showPagediff"
v-model="state.diffs.showDiffsByPage[page.pageid]"
>
<label for="showPagediff">Show Diffs</label>
Expand Down
2 changes: 1 addition & 1 deletion app/user-config.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
usernames['meta']['meta'] = 'WIKIMEDIA_USERNAME'
usernames["meta"]["meta"] = "WIKIMEDIA_USERNAME"