Last active
September 11, 2017 21:31
-
-
Save abrahamjuliot/42d4e68ca4f1a2afbe54cfe867b9f724 to your computer and use it in GitHub Desktop.
Pug/Mustache Faculty Template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//--------------Variables------------- | |
- | |
first = '', | |
last = '', | |
position = '', | |
office = '', | |
phone = '', | |
websiteURL = '', | |
invite = '', | |
degrees = [ | |
'' | |
], | |
specialization = [ | |
'' | |
], | |
awards = [ | |
'' | |
], | |
research = [ | |
'' | |
], | |
publications = [ | |
'' | |
], | |
focus = '', | |
programs = [ | |
'' | |
] | |
//-------compiled variables--------- | |
fullName = first+' '+last, | |
email = first.toLowerCase() | |
+ "." | |
+ last.toLowerCase() | |
+ "@ucr.edu"; | |
//- Template - YOU NO TOUCH! | |
// Directory Card | |
.research-group.slide-right | |
span.group-title Research Group | |
br | |
#{`div`}(id='group-'+last.toLowerCase()) | |
if invite | |
br | |
| #{invite} | |
.card | |
h4 | |
// image ratio is 2x3 (160x240 and 400x600) | |
img(src='/faculty/photos/'+last.toLowerCase()+'_160x240.jpg', alt=fullName, width='80') | |
a(href='/faculty/'+last.toLowerCase()+'.html') #{fullName} | |
em | |
br | |
| #{position} | |
p | |
strong | |
if office | |
| #{office} | |
else | |
| Environmental Sciences | |
br | |
| University of California, Riverside | |
br | |
| Riverside, CA 92521 | |
if phone | |
br | |
| Telephone: #{phone} | |
br | |
| E-mail: | |
a(href='mailto:'+email) #{email} | |
p | |
each area, index in specialization | |
if index+1 != specialization.length | |
| #{area}; | |
else | |
| #{area} | |
// Profile Page | |
script#template(type='text/html'). | |
// <![CDATA[ | |
{{#ensc-department}} | |
{{##{last.toLowerCase()}} | |
{{#profilePage}} | |
{{#program}} | |
<li><a href="/graduate/profiles/{{profilePage}}.html">{{name}}</a> - {{position}}, {{program}} Program</li> | |
{{/program}} | |
{{^program}} | |
<li><a href="/graduate/profiles/{{profilePage}}.html">{{name}}</a> - {{position}}</li> | |
{{/program}} | |
{{/profilePage}} | |
{{^profilePage}} | |
{{#program}} | |
<li>{{name}} - {{position}}, {{program}} Program</li> | |
{{/program}} | |
{{^program}} | |
<li>{{name}} - {{position}}</li> | |
{{/program}} | |
{{/profilePage}} | |
{{/#{last.toLowerCase()}}} | |
{{/ensc-department}} | |
// ]]> | |
h3 | |
| #{fullName} | |
img.img_R(src='/faculty/photos/'+last.toLowerCase()+'_400x600.jpg', alt=fullName, width='200') | |
h4 #{position} | |
ul.tight | |
if office | |
li Office: #{office} | |
else | |
li Office: TBA | |
if phone | |
li Phone: #{phone} | |
else | |
li Phone: TBA | |
li | |
a(href='mailto:'+email) #{email} | |
if websiteURL | |
li | |
a(href=websiteURL) #{websiteURL.replace(/(^\w+:|^)\/\//, '')} | |
h4 Academic Degrees: | |
ul.tight | |
each degree in degrees | |
li= degree | |
if awards | |
h4 Selected Awards: | |
ul.tight | |
each award in awards | |
li= award | |
h4 Specialization: | |
ul.tight | |
each area in specialization | |
li= area | |
if invite | |
h4 Research Group: | |
p #{invite} | |
// research group content is generated and updated from /script/ensc_data.js | |
ul#ensc-list.tight | |
else | |
//h4 Research Group: | |
// research group content is generated and updated from /script/ensc_data.js | |
//ul#ensc-list.tight | |
h4 Current Research: | |
ul.tight | |
each area in research | |
li= area | |
h4 Selected Publications: | |
ul.tight | |
each pub in publications | |
li= pub | |
h4 Courses Taught: | |
ul.tight | |
li TBD | |
h4 Graduate Program Affiliations and Research Focus Areas: | |
ul.tight | |
li | |
h5 Research Focus Areas | |
ul.tight | |
li #{focus} | |
li | |
h5 Program | |
ul.tight | |
each program in programs | |
li= program | |
script(type='text/javascript', src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js') | |
script(type='text/javascript', src='http://cdnjs.cloudflare.com/ajax/libs/mustache.js/2.1.2/mustache.js') | |
script(type='text/javascript', src='/script/ensc_data.js') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment