${duration ? html`
@@ -1214,7 +1218,13 @@
case 'dashboard_page':
render.dashProjects(getRef('pinned_projects'), pinnedProjects);
// displays recent projects
- render.dashProjects(getRef('project_list'), RIBC.getProjectList().filter(project => !pinnedProjects.includes(project)).reverse())
+ const unpinnedProjects = RIBC.getProjectList().filter(project => !pinnedProjects.includes(project)).reverse()
+ if (unpinnedProjects.length > 0) {
+ getRef('project_list_container').classList.remove('hidden')
+ } else {
+ getRef('project_list_container').classList.add('hidden')
+ }
+ render.dashProjects(getRef('project_list'), unpinnedProjects)
break;
case 'updates_page': {
if (!getRef('updates_page__project_selector').children.length) {
@@ -1702,8 +1712,7 @@
const status = RIBC.getTaskStatus(appState.params.id, appState.params.branch, task)
let applyButton
if (!assignedInterns.includes(myFloID)) {
- const taskRequests = RIBC.getTaskRequests();
- const hasApplied = [...taskRequests, ...sessionTaskRequests].find(({ details }) => {
+ const hasApplied = [...RIBC.getTaskRequests(false), ...sessionTaskRequests].find(({ details }) => {
return `${appState.params.id}_${appState.params.branch}_${task}` === details.taskId
})
applyButton = html`
@@ -2597,8 +2606,7 @@
getRef('intern_apply__task').textContent = RIBC.getAllTasks()[taskId].title
openPopup('apply_for_task_popup', true)
} else if (typeOfUser === 'intern') {
- const taskRequests = RIBC.getTaskRequests();
- const hasApplied = [...taskRequests, ...sessionTaskRequests].find(({ details }) => {
+ const hasApplied = [...RIBC.getTaskRequests(false), ...sessionTaskRequests].find(({ details }) => {
return taskId === details.taskId
})
if (hasApplied) {
@@ -2635,7 +2643,7 @@
} catch (err) {
floGlobals.tempUserTaskRequest = btn.dataset.taskId;
location.hash = '#/sign_in'
- floGlobals.signInNotification = notify('Please login to apply for task.', 'error')
+ floGlobals.signInNotification = notify('Please login to apply for task.')
}
}
@@ -3010,6 +3018,20 @@
}
});
}
+ // detect url within text and convert to link
+ function linkify(inputText) {
+ let replacedText, replacePattern1, replacePattern2, replacePattern3;
+ //URLs starting with http://, https://, or ftp://
+ replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;
+ replacedText = inputText.replace(replacePattern1, '
$1');
+ //URLs starting with "www." (without // before it, or it'd re-link the ones done above).
+ replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim;
+ replacedText = replacedText.replace(replacePattern2, '$1
$2');
+ //Change email addresses to mailto:: links.
+ replacePattern3 = /(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim;
+ replacedText = replacedText.replace(replacePattern3, '
$1');
+ return replacedText;
+ }