IEEE.org     |     IEEE Xplore Digital Library     |     IEEE Standards     |     IEEE Spectrum     |     More Sites

Commit 63d2fd93 authored by Amy Rose's avatar Amy Rose
Browse files

use project sources in project page

parent 1e549719
Pipeline #795 passed with stage
in 3 minutes and 25 seconds
......@@ -31,6 +31,9 @@ subnav:
{% endcomment %}
<h2>About</h2>
<div id="project-about"></div>
<h3>Resources</h3>
<ul id="project-sources"></ul>
<div id="project-owner"></div> <!-- TODO: include for this? -->
<div id="project-services">
......
......@@ -45,6 +45,12 @@ function populate(data) {
const project_about_div = document.getElementById("project-about");
project_about_div.innerText = data["desc"];
const sources_ul = document.getElementById("project-sources");
data["sources"].forEach(source_data => {
const source_li = create_source(source_data);
sources_ul.appendChild(source_li);
});
const project_metrics_div = document.getElementById("project-metrics");
data["embeds"].forEach(embed_data => {
const embed = create_embed(embed_data);
......@@ -55,6 +61,18 @@ function populate(data) {
unhide_div("project-content");
}
function create_source(source_data) {
/* Create the list item */
const source_li = document.createElement("li");
/* Create the link */
const source_a = document.createElement("a");
source_a.setAttribute("href", source_data["url"]);
source_a.innerText = source_data["type"];
/* Put the link in the list item and return it */
source_li.appendChild(source_a);
return source_li;
}
function create_embed(embed_data) {
/* Create the container */
const embed_container = document.createElement("div");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment