course_about.html 6.29 KB
Newer Older
1 2
<%! 
  from django.core.urlresolvers import reverse 
3
  from courseware.courses import course_image_url, get_course_about_section
4
%>
5
<%namespace name='static' file='../static_content.html'/>
6 7 8

<%inherit file="../main.html" />

Matthew Mongeau committed
9
<%block name="js_extra">
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
  % if not registered:
    %if user.is_authenticated():
      ## If the user is authenticated, clicking the enroll button just submits a form
      <script type="text/javascript">
      (function() {
        $(".register").click(function() {
          $("#class_enroll_form").submit();
        });
    
        $(document).delegate('#class_enroll_form', 'ajax:success', function(data, json, xhr) {
          if(json.success) {
            location.href="${reverse('dashboard')}";
          }
        });
      })(this)
      </script>
    %else:
      ## If the user is not authenticated, clicking the enroll button pops up the register
      ## field. We also slip in the registration fields into the login/register fields so
      ## the user is automatically registered after logging in / registering
      <script type="text/javascript">
      (function() {
        $(".register").click(function() {
33 34
          if ($(".login_form .enroll_fieldset").length === 0) {
            $(".login_form").append( $(".enroll_fieldset").first().clone() );
35
          }
36 37
          if ($(".register_form .enroll_fieldset").length === 0) {
            $(".register_form").append( $(".enroll_fieldset").first().clone() );
38 39 40 41 42 43 44
          }
        });
      })(this)
      </script>
    %endif
  %endif

Matthew Mongeau committed
45 46 47
  <script src="${static.url('js/course_info.js')}"></script>
</%block>

48 49 50

<%block name="title"><title>About ${course.number}</title></%block>

51 52 53
<section class="course-info">
  <header class="course-profile">
    <div class="intro-inner-wrapper">
54
      <div class="table">
55 56
      <section class="intro">
        <hgroup>
57
          <h1>${course.number}: ${get_course_about_section(course, "title")}<a href="${reverse('university_profile', args=[course.org])}">${get_course_about_section(course, "university")}</a></h1>
58
        </hgroup>
59 60

        <div class="main-cta">
61
          %if user.is_authenticated():
62
            %if registered:
63
                <span class="register disabled">You are registered for this course (${course.number}).</span>
64
            %else:
65
                <a href="#" class="register">Register for ${course.number}</a>
66
            %endif
67
          %else:
68
            <a href="#signup-modal" class="register" rel="leanModal" data-notice='You must Sign Up or <a href="#login-modal" rel="leanModal">Log In</a> to enroll.'>Register for ${course.number}</a>
69
          %endif
70
        </div>
71

Matthew Mongeau committed
72
      </section>
73
      % if get_course_about_section(course, "video"):
74
      <a href="#video-modal" class="media" rel="leanModal">
75
        <div class="hero">
76
          <img src="${course_image_url(course)}" />
77 78
          <div class="play-intro"></div>
        </div>
79
      </a>
80 81 82 83 84
      %else:
      <div class="media">
        <div class="hero">
          <img src="${course_image_url(course)}" />
        </div>
85
      </div>
86
      % endif
87
    </div>
88
      </div>
89
  </header>
Matthew Mongeau committed
90

91 92 93 94
  <section class="container">
    <section class="details">
      <nav>
        <a href="#" class="active">Overview</a>
95 96 97 98 99
      ##  <a href="#">FAQ</a>
      ##  <a href="#">Requirements</a>
      ##  <a href="#">Text-book</a>
      ##  <a href="#">Syllabus</a>
      ##  <a href="#">Reviews</a>
100
      </nav>
Matthew Mongeau committed
101

102
      <div class="inner-wrapper">
103
        ${get_course_about_section(course, "overview")}
104 105
      </div>
    </section>
106 107 108 109

    <section class="course-sidebar">
      <section class="course-summary">
        <header>
110 111
          <div class="social-sharing">
            <div class="sharing-message">Share with friends and family!</div>
112
            <a href="http://twitter.com/intent/tweet?text=I+just+registered+for+${course.number}+${get_course_about_section(course, 'title')}+through+@edxonline:+http://www.edx.org${reverse('about_course', args=[course.id])}" class="share">
113
              <img src="${static.url('images/social/twitter-sharing.png')}">
114
            </a>
115
            <a href="http://www.facebook.com/EdxOnline" class="share"> <img src="${static.url('images/social/facebook-sharing.png')}">
116
            </a>
117
            <a href="mailto:?subject=Take%20a%20course%20with%20edX%20online&body=I%20just%20registered%20for%20${course.number}%20${get_course_about_section(course, 'title')}%20through%20edX:+http://edx.org/${reverse('about_course', args=[course.id])}" class="share">
118
              <img src="${static.url('images/social/email-sharing.png')}">
119 120
            </a>
          </div>
121
        </header>
122

123
        <ol class="important-dates">
124 125
          <li><div class="icon course-number"></div><p>Course Number</p><span class="course-number">${course.number}</span></li>
          <li><div class="icon start"></div><p>Classes Start</p><span class="start-date">${course.start_date_text}</span></li>
126 127

          ## End date should come from course.xml, but this is a quick hack
128
          % if get_course_about_section(course, "end_date"):
129
            <li><div class="icon end"></div><p>Classes End</p><span class="final-date">${get_course_about_section(course, "end_date")}</span></li>
130 131
          % endif

132
          % if get_course_about_section(course, "effort"):
133
            <li><div class="icon effort"></div><p>Estimated Effort</p><span class="start-date">${get_course_about_section(course, "effort")}</span></li>
134 135
          % endif

136 137
          ##<li><div class="icon length"></div><p>Course Length</p><span class="course-length">15 weeks</span></li>

138
          % if get_course_about_section(course, "prerequisites"):
139
            <li class="prerequisites"><div class="icon prereq"></div><p>Prerequisites</p><span class="start-date">${get_course_about_section(course, "prerequisites")}</span></li>
140
          % endif
141
        </ol>
142 143
      </section>
    </section>
144

145 146
  </section>
</section>
147

148
%if not registered:
149 150 151 152 153 154
  <div style="display: none;">
    <form id="class_enroll_form" method="post" data-remote="true" action="${reverse('change_enrollment')}">
      <fieldset class="enroll_fieldset">
        <input name="course_id" type="hidden" value="${course.id}">
        <input name="enrollment_action" type="hidden" value="enroll">
      </fieldset>
155 156 157 158 159 160 161 162
      <div class="submit">
        <input name="submit" type="submit" value="enroll">
      </div>
    </form>
  </div>
%endif


163
<%include file="../video_modal.html" />