Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added author-award table for venues (closes #713) #848

Merged
merged 1 commit into from
Oct 14, 2019
Merged
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
13 changes: 13 additions & 0 deletions scholia/app/templates/venue.html
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,14 @@
ORDER BY DESC(?count)
`

authorAwardsSparql = `
SELECT DISTINCT ?author ?authorLabel ?award ?awardLabel WHERE {
?item wdt:P1433 wd:{{ q }} ;
wdt:P50 ?author .
?author wdt:P166 ?award .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I extended this with some more languages. Maybe the service labeling should be parametrized.

}
`

$(document).ready(function() {
sparqlToDataTable(recentlyPublishedWorksSparql, "#recently-published-works");
Expand All @@ -252,6 +260,7 @@
sparqlToDataTable(genderDistributionSparql, "#gender-distribution");
sparqlToDataTable(authorshipsGenderDistributionSparql,
"#authorships-gender-distribution");
sparqlToDataTable(authorAwardsSparql, "#author-awards");
});
</script>

Expand Down Expand Up @@ -352,5 +361,9 @@ <h3>Authorships</h3>
<table class="table table-hover" id="authorships-gender-distribution"></table>


<h2 id="AuthorAwards">Author Awards</h2>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering whether there should be a space in "AuthorAwards"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's just the id of the header, right? The text itself has a space.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. On the other hand, I do not know if it is a good idea to have spaces in the ids (as I have been doing in the past). Do you know if one can run into problems with that? Maybe it is better with a dash?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay. I never used spaces in ids.
Just found this for example: "HTML 5 is even more permissive, saying only that an id must contain at least one character and may not contain any space characters."

So I guess it's better to remove spaces. It doesn't really matter if it's author-awards or AuthorAwards or authorAwards but I would try to stick to one naming convention.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the lookup. Maybe we should convert the spaces to a dash and lowercase when the word is not the first, e.g., "Author-awards". I hope that does not collide with the table-id.


<table class="table table-hover" id="author-awards"></table>

{% endblock %}