From b8d2276de7ec485cb24aed44d517d39f4c1e792d Mon Sep 17 00:00:00 2001
From: Greg Price <gprice@edx.org>
Date: Thu, 16 May 2013 13:57:34 -0400
Subject: [PATCH] Remove dashboard links for unstarted courses

If a course is not started, the course image and title on the dashboard link
to the course about page. Because the LMS course about pages do not exist
(i.e. 404) with the marketing site enabled, we simply do not use a link if
the course has not started.
---
 lms/static/sass/multicourse/_dashboard.scss |  2 +-
 lms/templates/dashboard.html                | 23 ++++++++++++++-------
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/lms/static/sass/multicourse/_dashboard.scss b/lms/static/sass/multicourse/_dashboard.scss
index 5e7f59138c4..cc54b9b2421 100644
--- a/lms/static/sass/multicourse/_dashboard.scss
+++ b/lms/static/sass/multicourse/_dashboard.scss
@@ -327,7 +327,7 @@
             color: $lighter-base-font-color;
           }
 
-          h3 a {
+          h3 a, h3 span {
             display: block;
             margin-bottom: 10px;
             font-family: $sans-serif;
diff --git a/lms/templates/dashboard.html b/lms/templates/dashboard.html
index 0bf66872fc5..75c0cafabd2 100644
--- a/lms/templates/dashboard.html
+++ b/lms/templates/dashboard.html
@@ -194,17 +194,20 @@
 
         <article class="my-course">
           <%
-          if has_access(user, course, 'load'):
             course_target = reverse('info', args=[course.id])
-          else:
-            course_target = reverse('about_course', args=[course.id])
           %>
 
 
 
-          <a href="${course_target}" class="cover">
-            <img src="${course_image_url(course)}" />
-          </a>
+          % if course.id in show_courseware_links_for:
+            <a href="${course_target}" class="cover">
+              <img src="${course_image_url(course)}" />
+            </a>
+          % else:
+            <div class="cover">
+              <img src="${course_image_url(course)}" />
+            </div>
+          % endif
 
           <section class="info">
             <hgroup>
@@ -218,7 +221,13 @@
               % endif
               </p>
               <h2 class="university">${get_course_about_section(course, 'university')}</h2>
-              <h3><a href="${course_target}">${course.number} ${course.display_name_with_default}</a></h3>
+              <h3>
+                % if course.id in show_courseware_links_for:
+                  <a href="${course_target}">${course.number} ${course.display_name_with_default}</a>
+                % else:
+                  <span>${course.number} ${course.display_name_with_default}</span>
+                % endif
+              </h3>
             </hgroup>
 
             <%
-- 
GitLab