-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
209 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>{{ _resource.resourceNode.name ~ '.pdf' }}</title> | ||
{% stylesheets debug=false filter='lessphp' output='bundles/icapwiki/css/pdf.css' | ||
"@IcapWikiBundle/Resources/views/less/pdf.less" | ||
%} | ||
<link rel="stylesheet" type="text/css" href="{{ app.request.getSchemeAndHttpHost() ~ asset_url }}"/> | ||
{% endstylesheets %} | ||
</head> | ||
<body> | ||
<div class="page-header"> | ||
<h1>{{ _resource.resourceNode.name }}</h1> | ||
</div> | ||
{% if tree is not empty and tree[0] is not empty and tree[0].activeContribution.text is not empty%} | ||
<div> | ||
{{ tree[0].activeContribution.text|raw }} | ||
</div> | ||
{% endif %} | ||
|
||
{% if tree is not empty and tree[0] is not empty and tree[0].__children is not empty %} | ||
<div class="pdf-contents"> | ||
<div class="pdf-contents-inner well"> | ||
<div class="pdf-contents-title"> | ||
{{ 'wiki_contents'|trans({},'icap_wiki') }} | ||
</div> | ||
{% include "IcapWikiBundle:Wiki:wikiContents.pdf.twig" with {'sections' : tree[0].__children, 'isAdmin' : isAdmin, 'delimeter' : '.', 'rootId' : tree[0].id } %} | ||
</div> | ||
<div class="clearfix"></div> | ||
</div> | ||
<div class="wiki-sections"> | ||
{% include "IcapWikiBundle:Wiki:wikiSections.pdf.twig" with {'sections' : tree[0].__children, 'wikiId' : _resource.id, 'isAdmin' : isAdmin, 'wikiMode' : _resource.mode, 'user' : user } %} | ||
</div> | ||
{% endif %} | ||
</body> | ||
</html> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{% macro wiki_contents_pdf(sections, isAdmin, delimeter, prefix) %} | ||
{% for section in sections %} | ||
{% if section.visible %} | ||
<li id="li-{{ section.id }}"> | ||
<a href="#section-{{section.id}}"> | ||
{{prefix ~ loop.index}} {{ section.activeContribution.title }} | ||
</a> | ||
<ul id="ul-{{ section.id }}" class="no-bullet-list"> | ||
{% if section.__children is not empty %} | ||
{{ _self.wiki_contents_pdf(section.__children, isAdmin, delimeter, prefix ~ loop.index ~ delimeter) }} | ||
{% endif %} | ||
</ul> | ||
</li> | ||
{% endif %} | ||
{% endfor %} | ||
{% endmacro %} | ||
|
||
<ul id="wiki-contents-list" class="no-bullet-list"> | ||
{{ _self.wiki_contents_pdf(sections, isAdmin, delimeter, "") }} | ||
</ul> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% macro wiki_sections_pdf(sections, isAdmin, wikiId, wikiMode, user) %} | ||
{% for section in sections %} | ||
{% if section.deleted is empty and section.visible %} | ||
{% set level = section.level + 1 %} | ||
{% set fontsize = 0 %} | ||
{% if level > 4 %} | ||
{% set level = 4 %} | ||
{% endif %} | ||
<li id="section-{{section.id}}" class="section-title"> | ||
<div class="{{level>2?"subsection-header":"page-header"}}"> | ||
<h{{level}}>{{section.activeContribution.title}}</h{{level}}> | ||
</div> | ||
<div id="wst-{{ section.id }}" class="wiki-section-text">{{section.activeContribution.text|preg_replace("/src=\"\\/\\//","src=\"http://")|preg_replace("/src=\"\\//","src=\""~app.request.getSchemeAndHttpHost()~"/")|raw}}</div> | ||
{% if section.__children is not empty %} | ||
<ul class="no-bullet-list"> | ||
{{ _self.wiki_sections_pdf(section.__children, isAdmin, wikiId, wikiMode, user) }} | ||
</ul> | ||
{% endif %} | ||
</li> | ||
{% endif %} | ||
{% endfor %} | ||
{% endmacro %} | ||
|
||
<ul id="wiki-sections-list" class="no-bullet-list"> | ||
{{ _self.wiki_sections_pdf(sections, isAdmin, wikiId, wikiMode, user) }} | ||
</ul> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
html, body{ | ||
font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; | ||
font-size: 12px; | ||
} | ||
h1, h2, h3, h4, h5, h6{margin: 10px 0; font-weight: 500;} | ||
h1{ | ||
font-size: 20px; | ||
} | ||
|
||
h2{ | ||
font-size: 16px; | ||
} | ||
|
||
h3{ | ||
font-size: 14px; | ||
} | ||
|
||
h4{ | ||
font-size: 12px; | ||
} | ||
|
||
a{ | ||
color: #2a6496; | ||
} | ||
|
||
ul{ | ||
ul{margin-left: 10px;} | ||
display: block; | ||
margin-left: 0px; | ||
padding-left: 0px; | ||
} | ||
|
||
table{ | ||
border-color: #ccc; | ||
border-width: 0 0 1px 1px; | ||
border-style: solid; | ||
border-spacing: 0px; | ||
border-collapse: separate; | ||
td, th{ | ||
border-width: 1px 1px 0 0; | ||
border-style: solid; | ||
margin: 0; | ||
padding: 4px; | ||
border-color: #ccc; | ||
} | ||
} | ||
|
||
div.pdf-contents{ | ||
div.pdf-contents-inner{ | ||
float:left; | ||
border: 1px solid #e3e3e3; | ||
padding: 10px; | ||
min-width: 200px; | ||
} | ||
} | ||
|
||
ul.no-bullet-list{ | ||
list-style: none; | ||
} | ||
|
||
.page-header{ | ||
border-bottom: 1px solid #eeeeee; | ||
} | ||
|
||
.subsection-header{ | ||
border-bottom: 1px dashed #eeeeee; | ||
} | ||
|
||
.clearfix, .clearfix::after{clear:both;} |