SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit dc6a16e2 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Template style: app ontology

parent 74ff05a7
No related branches found
No related tags found
No related merge requests found
......@@ -3,16 +3,16 @@
{% load profiles_extras %}
<script>
$(document).ready(function() {
$("#id_A_text").keyup(function() {
$("#id_B_text").val("{{ topic }}");
$("#id_B").val({{ topic.id }});
});
$("#id_B_text").keyup(function() {
$("#id_A_text").val("{{ topic }}");
$("#id_A").val({{ topic.id }});
});
});
$(document).ready(function() {
$("#id_A_text").keyup(function() {
$("#id_B_text").val("{{ topic }}");
$("#id_B").val({{ topic.id }});
});
$("#id_B_text").keyup(function() {
$("#id_A_text").val("{{ topic }}");
$("#id_A").val({{ topic.id }});
});
});
</script>
<div class="card">
......@@ -20,65 +20,65 @@
<ul class="list-inline">
<li class="list-inline-item"><h3>{{ topic }}</h3></li>
{% if perms.scipost.can_manage_ontology %}
<li class="list-inline-item small">
<a href="{% url 'ontology:topic_update' slug=topic.slug %}">Update</a>
</li>
<li class="list-inline-item small">
<a href="{% url 'ontology:topic_update' slug=topic.slug %}">Update</a>
</li>
{% endif %}
</ul>
{% if topic.tags.all %}
<ul class="list list-inline mb-0">
<li class="list-inline-item"><strong>Tags</strong>:</li>
{% for tag in topic.tags.all %}
<li class="list-inline-item">{{ tag }}{% if perms.scipost.can_manage_ontology %} <a href="{% url 'ontology:topic_remove_tag' slug=topic.slug tag_id=tag.id %}"><i class="fa fa-times-circle text-danger"></i></a>{% endif %}</li>
{% endfor %}
{% if perms.scipost.can_manage_ontology %}
<li class="list-inline-item pull-right">
<form class="form-inline" action="{% url 'ontology:topic_add_tag' slug=topic.slug %}" method="post">
<ul class="list-inline">
<li class="list-inline-item">{% csrf_token %}{{ select_tag_form }}</li>
<li class="list-inline-item"><input type="submit" class="form-control btn btn-outline-secondary" value="Add Tag"/></li>
</ul>
</form>
</li>
{% endif %}
</ul>
<ul class="list list-inline mb-0">
<li class="list-inline-item"><strong>Tags</strong>:</li>
{% for tag in topic.tags.all %}
<li class="list-inline-item">{{ tag }}{% if perms.scipost.can_manage_ontology %} <a href="{% url 'ontology:topic_remove_tag' slug=topic.slug tag_id=tag.id %}"><i class="fa fa-times-circle text-danger"></i></a>{% endif %}</li>
{% endfor %}
{% if perms.scipost.can_manage_ontology %}
<li class="list-inline-item pull-right">
<form class="form-inline" action="{% url 'ontology:topic_add_tag' slug=topic.slug %}" method="post">
<ul class="list-inline">
<li class="list-inline-item">{% csrf_token %}{{ select_tag_form }}</li>
<li class="list-inline-item"><input type="submit" class="form-control btn btn-outline-secondary" value="Add Tag"/></li>
</ul>
</form>
</li>
{% endif %}
</ul>
{% endif %}
</div>
<div class="card-body">
{% if relations_asym or topic.relationsym_set.all or perms.scipost.can_manage_ontology %}
<h4>Relations to other Topics</h4>
<div class="row mb-0">
<div class="col-6">
<h5>asymmetric:</h5>
<ul>
{% for rel in relations_asym %}
<li>{% if rel.A != topic %}<a href="{% url 'ontology:topic_details' slug=rel.A.slug %}">{{ rel.A}}</a>{% else %}{{ rel.A }}{% endif %} <em>{{ rel.get_relation_display }}</em> {% if rel.B != topic %}<a href="{% url 'ontology:topic_details' slug=rel.B.slug %}">{{ rel.B }}</a>{% else %}{{ rel.B }}{% endif %} {% if perms.scipost.can_manage_ontology %}<a href="{% url 'ontology:delete_relation_asym' relation_id=rel.id slug=topic.slug %}"><i class="fa fa-times-circle text-danger"></i></a>{% endif %}</li>
{% empty %}
<li>No relations have been defined</li>
{% endfor %}
</ul>
{% if perms.scipost.can_manage_ontology %}
<h5>Add an asymmetric relation:</h5>
<form action = "{% url 'ontology:add_relation_asym' slug=topic.slug %}" method="post">
{% csrf_token %}
{{ add_relation_asym_form }}
<input type="submit" class="btn btn-outline-secondary" value="Add"/>
</form>
{% endif %}
</div>
<div class="col-6">
<h5>symmetric:</h5>
<ul>
{% for rel in topic.relationsym_set.all %}
<li>{% for reltopic in rel.topics.all %}{% if reltopic != topic %}<a href="{% url 'ontology:topic_details' slug=reltopic.slug %}">{{ reltopic }}</a>{% else %}{{ reltopic }}{% endif %}, {% endfor %} <em>{{ rel.get_relation_display }}</em></li>
{% empty %}
<li>No symmetric relations have been defined</li>
{% endfor %}
</ul>
<h4>Relations to other Topics</h4>
<div class="row mb-0">
<div class="col-6">
<h5>asymmetric:</h5>
<ul>
{% for rel in relations_asym %}
<li>{% if rel.A != topic %}<a href="{% url 'ontology:topic_details' slug=rel.A.slug %}">{{ rel.A}}</a>{% else %}{{ rel.A }}{% endif %} <em>{{ rel.get_relation_display }}</em> {% if rel.B != topic %}<a href="{% url 'ontology:topic_details' slug=rel.B.slug %}">{{ rel.B }}</a>{% else %}{{ rel.B }}{% endif %} {% if perms.scipost.can_manage_ontology %}<a href="{% url 'ontology:delete_relation_asym' relation_id=rel.id slug=topic.slug %}"><i class="fa fa-times-circle text-danger"></i></a>{% endif %}</li>
{% empty %}
<li>No relations have been defined</li>
{% endfor %}
</ul>
{% if perms.scipost.can_manage_ontology %}
<h5>Add an asymmetric relation:</h5>
<form action = "{% url 'ontology:add_relation_asym' slug=topic.slug %}" method="post">
{% csrf_token %}
{{ add_relation_asym_form }}
<input type="submit" class="btn btn-outline-secondary" value="Add"/>
</form>
{% endif %}
</div>
<div class="col-6">
<h5>symmetric:</h5>
<ul>
{% for rel in topic.relationsym_set.all %}
<li>{% for reltopic in rel.topics.all %}{% if reltopic != topic %}<a href="{% url 'ontology:topic_details' slug=reltopic.slug %}">{{ reltopic }}</a>{% else %}{{ reltopic }}{% endif %}, {% endfor %} <em>{{ rel.get_relation_display }}</em></li>
{% empty %}
<li>No symmetric relations have been defined</li>
{% endfor %}
</ul>
</div>
</div>
</div>
<hr/>
<hr/>
{% endif %}
<div class="card-columns">
<div class="card">
......@@ -88,13 +88,13 @@
<div class="card-body">
<ul>
{% for pub in topic.publications.all %}
<li>
<a href="{{ pub.get_absolute_url }}">{{ pub.title }}</a>
<br>by {{ pub.author_list }},
<br>{{ pub.citation }}
</li>
<li>
<a href="{{ pub.get_absolute_url }}">{{ pub.title }}</a>
<br>by {{ pub.author_list }},
<br>{{ pub.citation }}
</li>
{% empty %}
<li>No Publication found</li>
<li>No Publication found</li>
{% endfor %}
</ul>
</div>
......@@ -106,13 +106,13 @@
<div class="card-body">
<ul>
{% for sub in topic.submission_set.public_newest.unpublished %}
<li>
<a href="{{ sub.get_absolute_url }}">{{ sub.title }}</a>
<br>by {{ sub.author_list }}
<br>(submitted {{ sub.submission_date|date:"Y-m-d" }} to {{ sub.submitted_to }})
</li>
<li>
<a href="{{ sub.get_absolute_url }}">{{ sub.title }}</a>
<br>by {{ sub.author_list }}
<br>(submitted {{ sub.submission_date|date:"Y-m-d" }} to {{ sub.submitted_to }})
</li>
{% empty %}
<li>No Submission found</li>
<li>No Submission found</li>
{% endfor %}
</ul>
</div>
......@@ -125,13 +125,13 @@
<ul>
{% get_profiles topic.slug as profiles %}
{% for profile in profiles %}
{% if profile.contributor %}
<li><a href="{{ profile.contributor.get_absolute_url }}">{{ profile }}</a></li>
{% else %}
<li>{{ profile }}</li>
{% endif %}
{% if profile.contributor %}
<li><a href="{{ profile.contributor.get_absolute_url }}">{{ profile }}</a></li>
{% else %}
<li>{{ profile }}</li>
{% endif %}
{% empty %}
<li>No Profile found</li>
<li>No Profile found</li>
{% endfor %}
</ul>
</div>
......
{% extends 'scipost/base.html' %}
{% block breadcrumb %}
<div class="breadcrumb-container">
<div class="container">
<nav class="breadcrumb hidden-sm-down">
{% block breadcrumb_items %}
<a href="{% url 'ontology:ontology' %}" class="breadcrumb-item">Ontology</a>
{% endblock %}
</nav>
</div>
<div class="breadcrumb-container">
<div class="container">
<nav class="breadcrumb hidden-sm-down">
{% block breadcrumb_items %}
<a href="{% url 'ontology:ontology' %}" class="breadcrumb-item">Ontology</a>
{% endblock %}
</nav>
</div>
</div>
{% endblock %}
......@@ -3,46 +3,46 @@
{% block pagetitle %}: Ontology{% endblock pagetitle %}
{% block breadcrumb_items %}
{{ block.super }}
<span class="breadcrumb-item">Welcome</span>
{{ block.super }}
<span class="breadcrumb-item">Welcome</span>
{% endblock %}
{% block content %}
<div class="row">
<div class="col-12">
<h3 class="highlight">Ontology</h3>
<ul class="list-inline">
{% if perms.scipost.can_manage_ontology %}
<li class="list-inline-item ml-2 mr-2"><a href="{% url 'ontology:topic_create' %}">Add a Topic</a></li>
{% endif %}
<li class="list-inline-item ml-2 mr-2"><a href="{% url 'ontology:topics' %}">View list of Topics</a></li>
<li class="list-inline-item ml-2 mr-2">{{ select_linked_topic_form }}</li>
</ul>
<p>
Welcome to SciPost's Ontology, which is a curated set of interlinked Topics
pertaining to all of the sciences.
</p>
<p>
Topics and their relations are defined by Editorial-level personnel.
The ontology is used at many levels within SciPost, including but not limited to:
<ul>
<li>identifying the best potential Editors-in-charge for incoming submissions</li>
<li>identifying thematic areas for which the editorial workforce should be increased</li>
<li>providing Editors-in-charge with referee suggestions</li>
<li>giving readers a way to identify interesting published content</li>
<li>assisting our internal metadata- and content-driven engines.</li>
<div class="row">
<div class="col-12">
<h3 class="highlight">Ontology</h3>
<ul class="list-inline">
{% if perms.scipost.can_manage_ontology %}
<li class="list-inline-item ml-2 mr-2"><a href="{% url 'ontology:topic_create' %}">Add a Topic</a></li>
{% endif %}
<li class="list-inline-item ml-2 mr-2"><a href="{% url 'ontology:topics' %}">View list of Topics</a></li>
<li class="list-inline-item ml-2 mr-2">{{ select_linked_topic_form }}</li>
</ul>
</p>
<p>
The Ontology is currently under development.
</p>
<p>
Welcome to SciPost's Ontology, which is a curated set of interlinked Topics
pertaining to all of the sciences.
</p>
<p>
Topics and their relations are defined by Editorial-level personnel.
The ontology is used at many levels within SciPost, including but not limited to:
<ul>
<li>identifying the best potential Editors-in-charge for incoming submissions</li>
<li>identifying thematic areas for which the editorial workforce should be increased</li>
<li>providing Editors-in-charge with referee suggestions</li>
<li>giving readers a way to identify interesting published content</li>
<li>assisting our internal metadata- and content-driven engines.</li>
</ul>
</p>
<p>
The Ontology is currently under development.
</p>
</div>
</div>
</div>
{% endblock content %}
{% block footer_script %}
{{ block.super }}
{{ select_linked_topic_form.media }}
{{ block.super }}
{{ select_linked_topic_form.media }}
{% endblock footer_script %}
......@@ -3,22 +3,22 @@
{% load bootstrap %}
{% block breadcrumb_items %}
{{ block.super }}
<span class="breadcrumb-item"><a href="{% url 'ontology:topics' %}">Topics</a></span>
<span class="breadcrumb-item">{{ topic }}</span>
{{ block.super }}
<span class="breadcrumb-item"><a href="{% url 'ontology:topics' %}">Topics</a></span>
<span class="breadcrumb-item">{{ topic }}</span>
{% endblock %}
{% block pagetitle %}: Topic details{% endblock pagetitle %}
{% block content %}
<div class="row">
<div class="col-12">
{% include 'ontology/_topic_card.html' with topic=topic select_tag_form=select_tag_form %}
<div class="row">
<div class="col-12">
{% include 'ontology/_topic_card.html' with topic=topic select_tag_form=select_tag_form %}
</div>
</div>
</div>
{% endblock content %}
{% block footer_script %}
{{ block.super }}
{{ select_tag_form.media }}
{{ block.super }}
{{ select_tag_form.media }}
{% endblock footer_script %}
......@@ -3,40 +3,40 @@
{% load bootstrap %}
{% block headsup %}
<script>
$(document).ready(function() {
<script>
$(document).ready(function() {
$("#id_name").keyup(function() {
slug_value = this.value.split(" ").join("_");
$("#id_slug").val(slug_value);
});
$("#id_name").keyup(function() {
slug_value = this.value.split(" ").join("_");
$("#id_slug").val(slug_value);
});
});
</script>
});
</script>
{% endblock headsup %}
{% block breadcrumb_items %}
{{ block.super }}
<span class="breadcrumb-item"><a href="{% url 'ontology:topics' %}">Topics</a></span>
<span class="breadcrumb-item">{% if form.instance.id %}Update {{ form.instance }}{% else %}Add new Topic{% endif %}</span>
{{ block.super }}
<span class="breadcrumb-item"><a href="{% url 'ontology:topics' %}">Topics</a></span>
<span class="breadcrumb-item">{% if form.instance.id %}Update {{ form.instance }}{% else %}Add new Topic{% endif %}</span>
{% endblock %}
{% block pagetitle %}: Topics{% endblock pagetitle %}
{% block content %}
<div class="row">
<div class="col-12">
<h4>Please use the following conventions:</h4>
<ul>
<li>Start with a capital letter</li>
<li>Use plural words (<em>e.g.</em> <strong>superconductors</strong> instead of <strong>superconductor</strong>)</li>
<li>If an acronym exists, put it in parentheses at the end (<em>e.g.</em> <strong>Renormalization group (RG)</strong>). <strong class="text-danger">Remove any parentheses from the slug!</strong></li>
<li>Mix equivalent words by using a slash, <em>e.g.</em> <strong>Superconductivity&frasl;superconductors</strong>. <strong class="text-danger">You will similarly need to remove the slash from the slug!</strong></li>
</ul>
<form action="" method="post">
{% csrf_token %}
{{ form|bootstrap }}
<input type="submit" value="Submit" class="btn btn-primary">
<div class="row">
<div class="col-12">
<h4>Please use the following conventions:</h4>
<ul>
<li>Start with a capital letter</li>
<li>Use plural words (<em>e.g.</em> <strong>superconductors</strong> instead of <strong>superconductor</strong>)</li>
<li>If an acronym exists, put it in parentheses at the end (<em>e.g.</em> <strong>Renormalization group (RG)</strong>). <strong class="text-danger">Remove any parentheses from the slug!</strong></li>
<li>Mix equivalent words by using a slash, <em>e.g.</em> <strong>Superconductivity&frasl;superconductors</strong>. <strong class="text-danger">You will similarly need to remove the slash from the slug!</strong></li>
</ul>
<form action="" method="post">
{% csrf_token %}
{{ form|bootstrap }}
<input type="submit" value="Submit" class="btn btn-primary">
</div>
</div>
</div>
{% endblock content %}
......@@ -3,58 +3,58 @@
{% block pagetitle %}: Topics{% endblock pagetitle %}
{% block breadcrumb_items %}
{{ block.super }}
<span class="breadcrumb-item">Topics</span>
{{ block.super }}
<span class="breadcrumb-item">Topics</span>
{% endblock %}
{% block content %}
<div class="row">
<div class="col-12">
<h3 class="highlight">Topics</h3>
<ul>
{% if perms.scipost.can_manage_ontology %}
<li><a href="{% url 'ontology:topic_create' %}">Add a Topic</a></li>
{% endif %}
<li>
<form action="" method="get">
<ul class="list-inline">
<li class="list-inline-item">Filter to Topic name containing:</li>
<li class="list-inline-item">
{{ searchform }}
</li>
<li class="list-inline-item"><input class="btn btn-outline-secondary" type="submit" value="Filter"></li>
</ul>
</form>
</li>
<li>{{ select_linked_topic_form }}</li>
</ul>
<div class="row">
<div class="col-12">
<h3 class="highlight">Topics</h3>
<ul>
{% if perms.scipost.can_manage_ontology %}
<li><a href="{% url 'ontology:topic_create' %}">Add a Topic</a></li>
{% endif %}
<li>
<form action="" method="get">
<ul class="list-inline">
<li class="list-inline-item">Filter to Topic name containing:</li>
<li class="list-inline-item">
{{ searchform }}
</li>
<li class="list-inline-item"><input class="btn btn-outline-secondary" type="submit" value="Filter"></li>
</ul>
</form>
</li>
<li>{{ select_linked_topic_form }}</li>
</ul>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<h3>Topics</h3>
<ul class="list-inline">
{% for topic in object_list %}
<li class="list-inline-item p-1"><a href="{% url 'ontology:topic_details' slug=topic.slug %}">{{ topic }}</a></li>
{% endfor %}
</ul>
{% if is_paginated %}
<div class="row">
<div class="col-12">
{% include 'partials/pagination.html' with page_obj=page_obj %}
</div>
{% endif %}
<h3>Topics</h3>
<ul class="list-inline">
{% for topic in object_list %}
<li class="list-inline-item p-1"><a href="{% url 'ontology:topic_details' slug=topic.slug %}">{{ topic }}</a></li>
{% endfor %}
</ul>
{% if is_paginated %}
<div class="col-12">
{% include 'partials/pagination.html' with page_obj=page_obj %}
</div>
{% endif %}
</div>
</div>
</div>
{% endblock content %}
{% block footer_script %}
{{ block.super }}
{{ select_linked_topic_form.media }}
{{ block.super }}
{{ select_linked_topic_form.media }}
{% endblock footer_script %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment