Skip to content

Commit

Permalink
Remove affiliation from dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpost committed Jan 9, 2025
1 parent eb5a2bb commit aee1994
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 35 deletions.
18 changes: 3 additions & 15 deletions bin/process_bulk_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def _parse_metadata_changes(self, issue_body):
"first": "Carolyn Jane",
"last": "Anderson",
"id": "carolyn-anderson",
"affiliation": ""
}
],
"abstract": "..."
Expand Down Expand Up @@ -161,17 +160,9 @@ def _apply_changes_to_xml(self, xml_repo_path, anthology_id, changes):
"author", attrib=attrib, parent=paper_node, sibling=prev_sibling
)
prev_sibling = author_node
if "first" in author:
first_node = make_simple_element("first", parent=author_node)
first_node.text = author["first"]
if "last" in author:
last_node = make_simple_element("last", parent=author_node)
last_node.text = author["last"]
if "affiliation" in author and author["affiliation"]:
affiliation_node = make_simple_element(
"affiliation", parent=author_node
)
affiliation_node.text = author["affiliation"]
for key in ["first", "last", "affiliation", "variant"]:
if key in author and author[key]:
make_simple_element(key, text=author[key], parent=author_node)

return tree

Expand Down Expand Up @@ -217,9 +208,6 @@ def process_metadata_issues(

# Create new branch
ref = self.local_repo.create_head(new_branch_name, base_branch)
# ref = self.local_repo.create_git_ref(
# ref=f"refs/heads/{new_branch_name}", sha=base_branch.commit.sha
# )
print(f"Created branch {new_branch_name} from {base_branch}", file=sys.stderr)

# store the current branch
Expand Down
25 changes: 5 additions & 20 deletions hugo/layouts/papers/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
first: "{{ .first }}",
last: "{{ .last }}",
id: "{{ .id }}",
affiliation: "{{ .affiliation }}"
},
{{ end }}
],
Expand All @@ -100,7 +99,7 @@
const container = document.getElementById("authorsContainer");
container.innerHTML = "";
paper_params.authors.forEach((author, idx) => {
container.appendChild(createAuthorRow(author.first, author.last, author.id, author.affiliation));
container.appendChild(createAuthorRow(author.first, author.last, author.id));
});

const modal = new bootstrap.Modal(document.getElementById('metadataModal'));
Expand Down Expand Up @@ -142,7 +141,7 @@
draggedElement = null;
});

function createAuthorRow(first, last, id, affiliation) {
function createAuthorRow(first, last, id) {
// Create the container for the entire row
const row = document.createElement('div');
row.className = 'row g-0 g-lg-2 mb-2 author-row align-items-center';
Expand All @@ -164,7 +163,7 @@

// First name column
const firstNameCol = document.createElement('div');
firstNameCol.className = 'col-10 col-lg-3';
firstNameCol.className = 'col-10 col-lg-4';

const firstName = document.createElement('input');
firstName.type = 'text';
Expand All @@ -177,7 +176,7 @@

// Last name column
const lastNameCol = document.createElement('div');
lastNameCol.className = 'col-12 col-lg-3 mt-2 mt-lg-0';
lastNameCol.className = 'col-10 col-lg-4 mt-2 mt-lg-0';

const lastName = document.createElement('input');
lastName.type = 'text';
Expand All @@ -193,18 +192,6 @@
idInput.value = id;
lastNameCol.appendChild(idInput);

// Affiliation column
const affCol = document.createElement('div');
affCol.className = 'col-10 col-lg-3 mt-2 mt-lg-0';

const affInput = document.createElement('input');
affInput.type = 'text';
affInput.placeholder = 'Affiliation';
affInput.className = 'form-control';
affInput.value = affiliation;

affCol.appendChild(affInput);

// Delete button column
const delCol = document.createElement('div');
delCol.className = 'col-auto ms-lg-auto text-end';
Expand All @@ -221,7 +208,6 @@
row.appendChild(grabberCol);
row.appendChild(firstNameCol);
row.appendChild(lastNameCol);
row.appendChild(affCol);
row.appendChild(delCol);

return row;
Expand Down Expand Up @@ -275,7 +261,6 @@
"first": inputs[0].value,
"last": inputs[1].value,
"id": inputs[2].value,
"affiliation": inputs[3].value
});
});

Expand Down Expand Up @@ -363,7 +348,7 @@ <h5 class="modal-title">Correct Metadata for <span id="paperIdSpan"></span></h5>
<input type="text" class="form-control" id="paperTitle">
</div>
<label class="form-label">Authors</label>
<small id="authorTitleHelp" class="form-text text-muted">Adjust author names, affiliations, and list order to match the PDF.</small>
<small id="authorTitleHelp" class="form-text text-muted">Adjust author names and order to match the PDF.</small>
<div id="authorsContainer" class="px-3" ondrop="dropAuthor(event)" ondragover="allowDrop(event)"></div>
<button type="button" class="btn btn-secondary btn-sm mb-3" onclick="addAuthor()">Add Author</button>

Expand Down

0 comments on commit aee1994

Please sign in to comment.