Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 7 additions & 3 deletions site/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,20 @@
html += '<div class="modal-lesson' + (userComplete ? ' user-done' : '') + '">';
html += '<span class="modal-lesson-status ' + statusClass + '"' + (userComplete ? ' title="You completed this lesson"' : '') + '></span>';
if (l.url) {
html += '<a href="' + l.url + '" target="_blank" rel="noopener">' + escapeHtml(l.name) + '</a>';
if (lessonPath) {
html += '<a href="lesson.html?path=' + lessonPath + '">' + escapeHtml(l.name) + '</a>';
Comment thread
mrdankuta marked this conversation as resolved.
Outdated
} else {
html += '<a href="' + l.url + '" target="_blank" rel="noopener">' + escapeHtml(l.name) + '</a>';
}
} else {
html += '<a>' + escapeHtml(l.name) + '</a>';
}
Comment thread
mrdankuta marked this conversation as resolved.
html += '<span class="modal-lesson-type" data-type="' + escapeHtml(l.type) + '"' + (l.combines ? ' title="Combines: ' + escapeHtml(l.combines) + '"' : '') + '>' + escapeHtml(l.type) + '</span>';
html += '<span class="modal-lesson-lang">' + escapeHtml(l.lang) + '</span>';

var actionHtml = '';
if ((l.status === 'complete' || userComplete) && lessonPath) {
actionHtml = '<a href="lesson.html?path=' + lessonPath + '" class="modal-lesson-read">' + (userComplete ? 'Review' : 'Read') + '</a>';
if (l.url && lessonPath) {
actionHtml = '<a href="' + l.url + '" target="_blank" rel="noopener" class="modal-lesson-read modal-lesson-github" title="View source on GitHub">GitHub</a>';
}
var toggleHtml = '';
if (hasProgress && lessonPath) {
Expand Down
23 changes: 21 additions & 2 deletions site/catalog.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,17 @@
font-size: 1.1rem;
}

.catalog-github-link {
font-size: 0.75rem;
text-decoration: none;
opacity: 0.5;
transition: opacity 0.15s;
}

.catalog-github-link:hover {
opacity: 1;
}

@media (max-width: 768px) {
.catalog-page {
padding: 80px 0 48px;
Expand Down Expand Up @@ -348,14 +359,16 @@ <h1>Lesson Catalog</h1>

for (var j = 0; j < p.lessons.length; j++) {
var l = p.lessons[j];
var pathMatch = l.url ? l.url.match(/(phases\/[^/]+\/[^/]+)\/?$/) : null;
allRows.push({
phase: p.id,
phaseName: p.name,
name: l.name,
type: l.type,
lang: l.lang,
status: l.status,
url: l.url || ''
url: l.url || '',
lessonPath: pathMatch ? pathMatch[1] : ''
});
}
}
Expand Down Expand Up @@ -425,7 +438,13 @@ <h1>Lesson Catalog</h1>
var r = rows[i];
html += '<tr>';
html += '<td><span class="catalog-phase-label">' + String(r.phase).padStart(2, '0') + '</span></td>';
if (r.url) {
if (r.lessonPath) {
html += '<td><a href="lesson.html?path=' + r.lessonPath + '">' + escapeHtml(r.name) + '</a>';
Comment thread
mrdankuta marked this conversation as resolved.
Outdated
if (r.url) {
html += ' <a href="' + r.url + '" target="_blank" rel="noopener" class="catalog-github-link" title="View source on GitHub">↗</a>';
Comment thread
mrdankuta marked this conversation as resolved.
Outdated
}
html += '</td>';
} else if (r.url) {
html += '<td><a href="' + r.url + '" target="_blank" rel="noopener">' + escapeHtml(r.name) + '</a></td>';
} else {
html += '<td>' + escapeHtml(r.name) + '</td>';
Expand Down
13 changes: 13 additions & 0 deletions site/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,19 @@ p.dropcap::first-letter {
border-bottom: 1px solid var(--blueprint);
}

.modal-lesson .modal-lesson-github {
font-size: 0.68rem;
color: var(--ink-mute);
opacity: 0.6;
transition: opacity 0.15s, color 0.15s;
}

.modal-lesson .modal-lesson-github:hover {
opacity: 1;
color: var(--blueprint);
border-color: var(--rule-soft);
}

.modal-lesson-read-placeholder {
display: inline-block;
width: 64px;
Expand Down