Commit 9ec8c993 by David Ormsbee

Merge pull request #209 from MITx/dormsbee/uni_profile

Dormsbee/uni profile
parents a70e026e c5d23b27
......@@ -51,4 +51,8 @@ class CourseDescriptor(SequenceDescriptor):
@property
def wiki_namespace(self):
return self.location.course
\ No newline at end of file
return self.location.course
@property
def org(self):
return self.location.org
\ No newline at end of file
......@@ -272,3 +272,19 @@ def enroll(request, course_id):
enrollment, created = CourseEnrollment.objects.get_or_create(user=user, course_id=course.id)
return redirect(reverse('dashboard'))
def university_profile(request, org_id):
all_courses = modulestore().get_courses()
valid_org_ids = set(c.org for c in all_courses)
if org_id not in valid_org_ids:
raise Http404("University Profile not found for {0}".format(org_id))
# Only grab courses for this org...
courses=[c for c in all_courses if c.org == org_id]
context = dict(courses=courses, org_id=org_id)
template_file = "university_profile/{0}.html".format(org_id).lower()
return render_to_response(template_file, context)
......@@ -23,7 +23,7 @@
<p>${get_course_about_section(course, 'short_description')}</p>
</div>
<div class="bottom">
<a href="#" class="university">${get_course_about_section(course, 'university')}</a>
<a href="${reverse('university_profile', args=[course.org])}" class="university">${get_course_about_section(course, 'university')}</a>
<span class="start-date">${course.start_date_text}</span>
</div>
</section>
......
......@@ -41,7 +41,6 @@
</div>
</a>
</div>
</header>
......@@ -52,7 +51,7 @@
<section class="university-partners">
<ol class="partners">
<li class="partner mit">
<a href="/university_profile">
<a href="${reverse('university_profile', args=['MITx'])}">
<img src="${static.url('images/mit.png')}" />
<div class="name">
<span>MITx</span>
......@@ -60,7 +59,7 @@
</a>
</li>
<li class="partner">
<a href="/university_profile">
<a href="${reverse('university_profile', args=['HarvardX'])}">
<img src="${static.url('images/harvard.png')}" />
<div class="name">
<span>HarvardX</span>
......@@ -68,7 +67,7 @@
</a>
</li>
<li class="partner">
<a href="/university_profile">
<a href="${reverse('university_profile', args=['BerkeleyX'])}">
<img src="${static.url('images/berkeley.png')}" />
<div class="name">
<span>BerkeleyX</span>
......
......@@ -14,15 +14,15 @@
<div class="intro-inner-wrapper">
<section class="intro">
<hgroup>
<h1>${course.number}: ${get_course_about_section(course, "title")}</h1><h2><a href="#">${get_course_about_section(course, "university")}</a></h2>
<h1>${course.number}: ${get_course_about_section(course, "title")}</h1><h2><a href="${reverse('university_profile', args=[course.org])}">${get_course_about_section(course, "university")}</a></h2>
</hgroup>
<div class="main-cta">
%if user.is_authenticated():
%if registered:
<span class="register disabled">Registered</span>
<span class="register disabled">Registered for ${course.number}</span>
%else:
<a href="${reverse('enroll', args=[course.id])}" class="register">Register</a>
<a href="${reverse('enroll', args=[course.id])}" class="register">Register for ${course.number}</a>
%endif
%else:
<a href="#signup-modal" class="register" rel="leanModal" data-notice="You must register in order to enroll">Register</a>
......
<%inherit file="../main.html" />
<%namespace name='static' file='../static_content.html'/>
<section class="find-courses">
<%block name="university_header"/>
<br/>
<section class="container">
<section class="message left">
<article>
<%block name="university_description" />
</article>
</section>
<section class="courses">
%for course in courses:
<%include file="../course.html" args="course=course" />
%endfor
</section>
</section>
</section>
<%inherit file="base.html" />
<%namespace name='static' file='../static_content.html'/>
<%block name="university_header">
<header class="search" style="background: url('/static/images/berkeley_fountain_2025x550.jpg')">
<div class="inner-wrapper university-search">
<hgroup>
<div class="logo">
<img src="${static.url('images/berkeley.png')}" />
</div>
<h1>BerkeleyX</h1>
</hgroup>
</div>
</header>
</%block>
<%block name="university_description">
<p>The University of California, Berkeley was chartered in 1868 and its flagship campus — envisioned as a "City of Learning" — was established at Berkeley, on San Francisco Bay. Berkeley Faculty consists of 1,582 fulltime and 500 part-time faculty members dispersed among more than 130 academic departments and more than 80 interdisciplinary research units. 28 Nobel prizes have been awarded to Berkeley Alumni. There are 8 Nobel Laureates, 32 MacArthur Fellows, and 4 Pulitzer Prize winners among the current faculty.</p>
</%block>
${parent.body()}
<%inherit file="base.html" />
<%namespace name='static' file='../static_content.html'/>
<%block name="university_header">
<header class="search" style="background: url('/static/images/about_harvard_page_2025x550.jpg')">
<div class="inner-wrapper university-search">
<hgroup>
<div class="logo">
<img src="${static.url('images/harvard.png')}" />
</div>
<h1>HarvardX</h1>
</hgroup>
</div>
</header>
</%block>
<%block name="university_description">
<p>Harvard University is devoted to excellence in teaching, learning, and research, and to developing leaders in many disciplines who make a difference globally. Harvard faculty are engaged with teaching and research to push the boundaries of human knowledge. For students who are excited to investigate the biggest issues of the 21st century, Harvard offers an unparalleled student experience and a generous financial aid program, with over $160 million awarded to more than 60% of our undergraduate students. The University has twelve degree-granting Schools in addition to the Radcliffe Institute for Advanced Study, offering a truly global education.</p>
<p>Established in 1636, Harvard is the oldest institution of higher education in the United States. The University, which is based in Cambridge and Boston, Massachusetts, has an enrollment of over 20,000 degree candidates, including undergraduate, graduate, and professional students. Harvard has more than 360,000 alumni around the world.</p>
</%block>
${parent.body()}
<%inherit file="base.html" />
<%namespace name='static' file='../static_content.html'/>
<%block name="university_header">
<header class="search" style="background: url('/static/images/shot-5-large.jpg')">
<div class="inner-wrapper university-search">
<hgroup>
<div class="logo">
<img src="${static.url('images/mit.png')}" />
</div>
<h1>MITx</h1>
</hgroup>
</div>
</header>
</%block>
<%block name="university_description">
<p>The Massachusetts Institute of Technology — a coeducational, privately endowed research university founded in 1861 — is dedicated to advancing knowledge and educating students in science, technology, and other areas of scholarship that will best serve the nation and the world in the 21st century. The Institute has close to 1,000 faculty and 10,000 undergraduate and graduate students. It is organized into five Schools: Architecture and Urban Planning; Engineering; Humanities, Arts, and Social Sciences; Sloan School of Management; and Science.</p>
<p>MIT's commitment to innovation has led to a host of scientific breakthroughs and technological advances. Seventy-eight MIT alumni, faculty, researchers and staff have won Nobel Prizes.</p>
<p>Current areas of research and education include neuroscience and the study of the brain and mind, bioengineering, cancer, energy, the environment and sustainable development, information sciences and technology, new media, financial technology, and entrepreneurship.</p>
</%block>
${parent.body()}
......@@ -74,11 +74,7 @@ urlpatterns = ('',
{'template': 'honor.html'}, name="honor"),
#Temporarily static, for testing
url(r'^university_profile$', 'static_template_view.views.render',
{'template': 'university_profile.html'}, name="university_profile"),
url(r'^university_profile/(?P<org_id>[^/]+)$', 'courseware.views.university_profile', name="university_profile"),
#TODO: Convert these pages to the new edX layout
# 'tos.html',
......
Markdown is supported
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