mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-06 08:14:25 +00:00
'carded' the templates page, top search area still needs doing
This commit is contained in:
parent
a20b46c786
commit
a4b02558dc
5 changed files with 94 additions and 93 deletions
|
@ -7,7 +7,7 @@ module.exports = TemplatesWebController =
|
||||||
renderTemplatesIndexPage: (req, res)->
|
renderTemplatesIndexPage: (req, res)->
|
||||||
logger.log "rendering index page of templates"
|
logger.log "rendering index page of templates"
|
||||||
TemplatesWebController._getDataFromTemplatesApi "/user/#{req.params.user_id}", (err, data)->
|
TemplatesWebController._getDataFromTemplatesApi "/user/#{req.params.user_id}", (err, data)->
|
||||||
if err?
|
if err? or !data?
|
||||||
logger.err err:err, "something went wrong in renderTemplatesIndexPage"
|
logger.err err:err, "something went wrong in renderTemplatesIndexPage"
|
||||||
return res.send 500
|
return res.send 500
|
||||||
data.title = "LaTeX Templates"
|
data.title = "LaTeX Templates"
|
||||||
|
@ -17,10 +17,10 @@ module.exports = TemplatesWebController =
|
||||||
{user_id, tag_name, template_name} = req.params
|
{user_id, tag_name, template_name} = req.params
|
||||||
logger.log user_id:user_id, tag_name:tag_name, template_name:template_name, "rendering latex template page"
|
logger.log user_id:user_id, tag_name:tag_name, template_name:template_name, "rendering latex template page"
|
||||||
TemplatesWebController._getDataFromTemplatesApi "/user/#{user_id}/tag/#{tag_name}/template/#{template_name}", (err, data)->
|
TemplatesWebController._getDataFromTemplatesApi "/user/#{user_id}/tag/#{tag_name}/template/#{template_name}", (err, data)->
|
||||||
if err?
|
if err? or !data?
|
||||||
logger.err err:err, user_id:user_id, tag_name:tag_name, template_name:template_name, "something went wrong in renerTemplateInTag"
|
logger.err err:err, user_id:user_id, tag_name:tag_name, template_name:template_name, "something went wrong in renerTemplateInTag"
|
||||||
return res.send 500
|
return res.send 500
|
||||||
data.title = data.template.name
|
data.title = data?.template?.name
|
||||||
res.render "templates/template", data
|
res.render "templates/template", data
|
||||||
|
|
||||||
tagOrCanonicalPage: (req, res)->
|
tagOrCanonicalPage: (req, res)->
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
extends ../layout
|
extends ../layout
|
||||||
|
|
||||||
block content
|
block content
|
||||||
|
.content.content-alt
|
||||||
.page-header.template-page-header
|
|
||||||
.container
|
.container
|
||||||
.row
|
.row.template-page-header
|
||||||
|
|
||||||
.col-md-2
|
.col-md-2
|
||||||
h1 Templates
|
h2
|
||||||
|
a(href="/templates") Templates
|
||||||
.col-md-8(ng-controller="SearchController")
|
.col-md-8(ng-controller="SearchController")
|
||||||
form.project-search.form-horizontal(role="form")
|
form.project-search.form-horizontal(role="form")
|
||||||
.form-group.has-feedback.has-feedback-left.col-md-12
|
.form-group.has-feedback.has-feedback-left.col-md-12
|
||||||
|
@ -20,7 +21,7 @@ block content
|
||||||
ul.unstyled
|
ul.unstyled
|
||||||
li(ng-repeat='hit in hits')
|
li(ng-repeat='hit in hits')
|
||||||
.thumbnail.searchResult
|
.thumbnail.searchResult
|
||||||
.row-fluid
|
.row
|
||||||
a(ng-href='{{hit.url}}')
|
a(ng-href='{{hit.url}}')
|
||||||
.col-md-3
|
.col-md-3
|
||||||
img(ng-src='{{hit.image_url}}')
|
img(ng-src='{{hit.image_url}}')
|
||||||
|
@ -31,27 +32,25 @@ block content
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.row
|
||||||
|
-each tag in tags
|
||||||
|
-if(tag.totalNumberOfTemplates > 0)
|
||||||
|
.page-header.col-md-12
|
||||||
|
h2
|
||||||
|
a(href=tag.tagPagePath) #{tag.name}
|
||||||
|
.row
|
||||||
|
-each template in tag.exampleTemplates
|
||||||
|
.col-md-3.template-thumbnail
|
||||||
|
a(href=template.templatePagePath ? template.templatePagePath : template.canonicalUrl).thumbnail
|
||||||
|
//- img(src=template.thumbnailUrl)
|
||||||
|
img(src="https://d1hk1zhcb5hn6i.cloudfront.net/52fb8c6f34a287a85245b493/v/0/pdf-converted-cache/style-thumbnail")
|
||||||
|
div.caption
|
||||||
|
h3.txt-middle #{template.name}
|
||||||
|
|
||||||
.container
|
-if(tag.totalNumberOfTemplates > 4)
|
||||||
-each tag in tags
|
.row-fluid
|
||||||
-if(tag.totalNumberOfTemplates > 0)
|
.col-md-6.offset3.more-templates
|
||||||
.page-header.col-md-12
|
a(href=tag.tagPagePath) View all #{tag.totalNumberOfTemplates} #{tag.name} templates »
|
||||||
h2
|
|
||||||
a(href=tag.tagPagePath) #{tag.name}
|
|
||||||
.col-md-12
|
|
||||||
.row-fluid
|
|
||||||
-each template in tag.exampleTemplates
|
|
||||||
.col-md-3.template-thumbnail
|
|
||||||
a(href=template.templatePagePath ? template.templatePagePath : template.canonicalUrl).thumbnail
|
|
||||||
//- img(src=template.thumbnailUrl)
|
|
||||||
img(src="https://d1hk1zhcb5hn6i.cloudfront.net/52fb8c1f33621a613683ecad/v/0/pdf-converted-cache/style-thumbnail")
|
|
||||||
div.caption
|
|
||||||
h3.txt-middle #{template.name}
|
|
||||||
|
|
||||||
-if(tag.totalNumberOfTemplates > 4)
|
|
||||||
.row-fluid
|
|
||||||
.col-md-6.offset3.more-templates
|
|
||||||
a(href=tag.tagPagePath) View all #{tag.totalNumberOfTemplates} #{tag.name} templates »
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,16 @@ block content
|
||||||
.container
|
.container
|
||||||
.row
|
.row
|
||||||
.page-header
|
.page-header
|
||||||
h2
|
h2
|
||||||
a(href=tag.tagPagePath) #{tag.name}
|
a(href="/templates") Templates
|
||||||
|
| ›
|
||||||
|
a(href=tag.tagPagePath) #{tag.name}
|
||||||
|
.row
|
||||||
-each template in templates
|
-each template in templates
|
||||||
a(href=template.templatePagePath || template.canonicalUrl)
|
a(href=template.templatePagePath || template.canonicalUrl)
|
||||||
.span3
|
.col-md-3.template-thumbnail
|
||||||
.template-thumbnail.thumbnail
|
a(href=template.templatePagePath ? template.templatePagePath : template.canonicalUrl).thumbnail
|
||||||
img(src=template.thumbnailUrl)
|
//- img(src=template.thumbnailUrl)
|
||||||
h3.txt-middle #{template.name}
|
img(src="https://d1hk1zhcb5hn6i.cloudfront.net/52fb8c6f34a287a85245b493/v/0/pdf-converted-cache/style-thumbnail")
|
||||||
|
div.caption
|
||||||
|
h3 #{template.name}
|
||||||
|
|
|
@ -11,61 +11,58 @@ block content
|
||||||
a(href=tag.tagPagePath) #{tag.name}
|
a(href=tag.tagPagePath) #{tag.name}
|
||||||
| ›
|
| ›
|
||||||
| #{template.name}
|
| #{template.name}
|
||||||
.container.txt-lefty
|
.row
|
||||||
.row-fluid()
|
.col-md-6
|
||||||
.col-md-6
|
.entry
|
||||||
.entry
|
.row
|
||||||
.row-fluid
|
.col-md-12
|
||||||
.col-md-12
|
a(href=template.pdfUrl)
|
||||||
a(href=template.pdfUrl)
|
//img(src="#{template.previewUrl}")
|
||||||
//img(src="#{template.previewUrl}")
|
img(src="https://d1hk1zhcb5hn6i.cloudfront.net/52fb89a333621a613683ec95/v/1/pdf-converted-cache/style-preview")
|
||||||
img(src="https://d1hk1zhcb5hn6i.cloudfront.net/52fb89a333621a613683ec95/v/1/pdf-converted-cache/style-preview")
|
|
||||||
|
|
||||||
.col-md-6
|
.col-md-6
|
||||||
.card
|
.template-details-section
|
||||||
h3 About
|
h3 About
|
||||||
div !{template.description}
|
div !{template.description}
|
||||||
div(ng-controller="openInSlController")
|
div(ng-controller="openInSlController")
|
||||||
a.btn.btn-primary.btn-large(href=template.open_in_sharelatex_url, ng-click='open()', ng-disabled="isDisabled", rel='nofollow') {{openInSlText}}
|
a.btn.btn-primary.btn-large(href=template.open_in_sharelatex_url, ng-click='open()', ng-disabled="isDisabled", rel='nofollow') {{openInSlText}}
|
||||||
|
|
|
|
||||||
|
|
||||||
a.btn.btn-default(
|
a.btn.btn-default(
|
||||||
href=template.zipUrl,
|
href=template.zipUrl,
|
||||||
rel='nofollow',
|
rel='nofollow',
|
||||||
ng-click='downloadZip()',
|
ng-click='downloadZip()',
|
||||||
data-toggle="tooltip",
|
data-toggle="tooltip",
|
||||||
data-placement="bottom",
|
data-placement="bottom",
|
||||||
title="",
|
title="",
|
||||||
data-original-title="Download .zip File"
|
data-original-title="Download .zip File"
|
||||||
)
|
)
|
||||||
|
|
||||||
i.fa.fa-cloud-download
|
i.fa.fa-cloud-download
|
||||||
|
.template-details-section.social_buttons
|
||||||
|
.addthis_toolbox.addthis_default_style.addthis_32x32_style
|
||||||
|
a.addthis_button_facebook
|
||||||
|
a.addthis_button_twitter
|
||||||
|
a.addthis_button_google_plusone_share
|
||||||
|
a.addthis_button_compact
|
||||||
|
script(type='text/javascript', src='//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-517c16586439faa7')
|
||||||
|
|
||||||
.social_buttons
|
h3 Comment
|
||||||
.addthis_toolbox.addthis_default_style.addthis_32x32_style
|
#disqus_thread
|
||||||
a.addthis_button_facebook
|
script(type='text/javascript').
|
||||||
a.addthis_button_twitter
|
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
||||||
a.addthis_button_google_plusone_share
|
var disqus_shortname = 'sharelatextemplates'; // required: replace example with your forum shortname
|
||||||
a.addthis_button_compact
|
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||||
script(type='text/javascript', src='//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-517c16586439faa7')
|
(function() {
|
||||||
div
|
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||||
.card
|
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||||
h3 Comment
|
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||||
#disqus_thread
|
})();
|
||||||
script(type='text/javascript').
|
noscript
|
||||||
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
| Please enable JavaScript to view the
|
||||||
var disqus_shortname = 'sharelatextemplates'; // required: replace example with your forum shortname
|
a(href='http://disqus.com/?ref_noscript') comments powered by Disqus.
|
||||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
a.dsq-brlink(href='http://disqus.com')
|
||||||
(function() {
|
| comments powered by
|
||||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
span.logo-disqus Disqus
|
||||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
|
||||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
|
||||||
})();
|
|
||||||
noscript
|
|
||||||
| Please enable JavaScript to view the
|
|
||||||
a(href='http://disqus.com/?ref_noscript') comments powered by Disqus.
|
|
||||||
a.dsq-brlink(href='http://disqus.com')
|
|
||||||
| comments powered by
|
|
||||||
span.logo-disqus Disqus
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
.template-page-header {
|
.template-page-header {
|
||||||
background: @gray-lightest;
|
|
||||||
border-top: 1px solid @gray-lightest;
|
|
||||||
margin: 0;
|
|
||||||
padding-top: unit(@line-height-base,rem);
|
padding-top: unit(@line-height-base,rem);
|
||||||
h1 {
|
h1, h2 {
|
||||||
color: @gray-dark;
|
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
margin-right: @line-height-base * 5;
|
margin-right: @line-height-base * 5;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
@ -22,11 +18,12 @@
|
||||||
padding:0px;
|
padding:0px;
|
||||||
h3 {
|
h3 {
|
||||||
color:@link-color;
|
color:@link-color;
|
||||||
|
margin: 10px 0px 10px 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.caption {
|
.caption {
|
||||||
background: @gray-lightest;
|
background: lighten(@gray-lightest, 3%);
|
||||||
border-top: 1px solid #ddd;
|
border-top: 1px solid #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,4 +36,8 @@
|
||||||
.sample-template {
|
.sample-template {
|
||||||
-webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.3);
|
-webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.3);
|
||||||
box-shadow: 0 2px 4px rgba(0,0,0,0.3);
|
box-shadow: 0 2px 4px rgba(0,0,0,0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.template-details-section {
|
||||||
|
padding-bottom: 20px;
|
||||||
}
|
}
|
Loading…
Reference in a new issue