* Had to hack on codemirror, to make line numbers bar resize properly.
<!-- <div class="toolbar">
</div> -->
<div id="summary-view">
- <img class="book-cover" src="{{MEDIA_URL}}images/empty.png">
+ <img class="book-cover" src="{{STATIC_URL}}img/sample_cover.png">
<h2>
<label for="title">Tytuł:</label>
@never_cache
def document_detail(request, name, template_name='wiki/document_details.html'):
+ storage = getstorage()
try:
- document = getstorage().get(name)
+ document = storage.get(name)
except DocumentNotFound:
return http.HttpResponseRedirect(reverse("wiki_create_missing", args=[name]))
def page_text(self, title, revision=None):
"""Read unicode text of a page."""
ctx = self._find_filectx(title, revision)
+
+ if ctx is None:
+ raise DocumentNotFound(title)
+
return ctx.data().decode(self.charset, 'replace'), ctx.filerev()
def page_text_by_tag(self, title, tag):
}
/* wersy */
-.htmlview .strofa .wers_wciety, .htmlview .strofa .wers_wciety[data-wlf-typ =
-'1'] {
+.htmlview .strofa .wers_wciety, .htmlview .strofa .wers_wciety[data-wlf-typ='1'] {
margin-left: 1em;
}
-.htmlview .strofa .wers_wciety[data-wlf-typ =
-'2'] {
+.htmlview .strofa .wers_wciety[data-wlf-typ='2'], .htmlview .strofa .wers_cd {
margin-left: 2em;
}
-.htmlview .strofa .wers_wciety[data-wlf-typ =
-'3'] {
+.htmlview .strofa .wers_wciety[data-wlf-typ='3'] {
margin-left: 3em;
}
-.htmlview .strofa .wers_wciety[data-wlf-typ =
-'4'] {
+.htmlview .strofa .wers_wciety[data-wlf-typ='4'] {
margin-left: 4em;
}
-.htmlview .strofa .wers_wciety[data-wlf-typ =
-'5'] {
+.htmlview .strofa .wers_wciety[data-wlf-typ='5'] {
margin-left: 5em;
}
-.htmlview .strofa .wers_wciety[data-wlf-typ =
-'6'] {
+.htmlview .strofa .wers_wciety[data-wlf-typ='6'] {
margin-left: 6em;
}
margin: 1.5em 0 0;
}
+.htmlview .motto_container {
+ display: inline-block;
+ margin: 1.5em 0 0;
+ clear: right;
+}
+
.htmlview .motto {
text-align: justify;
- font-style: italic;
- margin: 1.5em 0 0;
+ font-style: italic;
}
.htmlview p.motto_podpis {
- font-size: 0.875em;
- text-align: right;
+ position: relative;
+ right: -3em;
+ text-align: right;
}
.htmlview div.fragment {
max-height: 24pt;
margin-left: 0.5em;
overflow: hidden;
+ z-index: 500;
}
-.utwor > .uwaga {
+div[x-node] > .uwaga {
float: none;
padding: 0.5em 1em;
margin: 1em;
max-height: 100%;
}
+.htmlview .annotation-inline-box .uwaga {
+ max-height: 100%;
+}
+
/* Motywy */
/* ======================== */
/* = Footnotes and themes = */
* Przypisy
*/
/* Znaczniki w tekście */
-.htmlview .annotation {
- vertical-align: super;
- text-decoration: none;
- /* font-size: 10px; */
-}
-
.htmlview .annotation:before {
content: "[" counter(main) "]";
counter-increment: main;
+ vertical-align: super;
+ text-decoration: none;
+ font-size: 66%;
}
.htmlview .annotation:hover {
-webkit-border-radius: 10px;
padding: 3px 5px;
text-decoration: none;
- z-index: 1000;
+ z-index: 600;
}
/*
left: 70px;
}
-.edit-button:hover, .edit-button:active, .delete-button:hover, .delete-button:active, .accept-button:hover, .accept-button:active {
+.edit-button:hover, .edit-button:active,
+.delete-button:hover, .delete-button:active,
+.accept-button:hover, .accept-button:active {
/* color: #FFF;*/
background-color: #999;
color: #FFF;
margin: -0.25em;
padding: 0.25em;
border: 1px solid orange;
-}
+}
\ No newline at end of file
#summary-view .book-cover {
float: left;
margin: 1em;
- min-height: 300px;
- min-width: 240px;
+ margin-right: 2em;
- max-height: 300px;
- max-width: 240px;
+ height: 300px;
+ width: 212px;
+
+
+ border: 1px dashed black;
}
#summary-view p {
#summary-view label {
font-weight: bold;
}
+
+#summary-view .book-cover {
+
+}
var win = frame.contentWindow, doc = win.document,
nums = frame.nextSibling, scroller = nums.firstChild;
- var nextNum = 1, barWidth = null;
- function sizeBar() {
- if (!frame.offsetWidth || !win.Editor) {
- for (var cur = frame; cur.parentNode; cur = cur.parentNode) {
- if (cur != document) {
- clearInterval(sizeInterval);
- return;
- }
- }
- }
-
- if (nums.offsetWidth != barWidth) {
- barWidth = nums.offsetWidth;
- nums.style.left = "-" + (frame.parentNode.style.marginLeft = barWidth + "px");
- }
- }
+ var nextNum = 1;
+
function update() {
var diff = 20 + Math.max(doc.body.offsetHeight, frame.offsetHeight) - scroller.offsetHeight;
for (var n = Math.ceil(diff / 10); n > 0; n--) {
}
nums.scrollTop = doc.body.scrollTop || doc.documentElement.scrollTop || 0;
}
- sizeBar();
+
update();
win.addEventHandler(win, "scroll", update);
- win.addEventHandler(win, "resize", update);
- var sizeInterval = setInterval(sizeBar, 500);
+ win.addEventHandler(win, "resize", update);
}
function CodeMirror(place, options) {
$('#loading-overlay').fadeOut();
alert("FAILURE");
}
- });
-
- $(window).resize();
+ });
}; /* end of initialize() */
var initAll = function(a, f) {
},
iframeClass: 'xml-iframe',
textWrapping: true,
- lineNumbers: false,
+ lineNumbers: true,
width: "100%",
tabMode: 'spaces',
indentUnit: 0,
initCallback: function(){
- self.codemirror.grabKeys(function(event) {
+ self.codemirror.grabKeys(function(event) {
if (event.button) {
$(event.button).trigger('click');
event.button = null;
$('.toolbar select').change();
console.log("Initialized CodeMirror");
+
// textarea is no longer needed
$('codemirror_placeholder').remove();
+
old_callback.call(self);
}
});
CodeMirrorPerspective.prototype.freezeState = function() {
};
+
+
CodeMirrorPerspective.prototype.onEnter = function(success, failure) {
$.wiki.Perspective.prototype.onEnter.call(this);
console.log('Entering', this.doc);
this.codemirror.setCode(this.doc.text);
+
+ /* fix line numbers bar */
+ var $nums = $('.CodeMirror-line-numbers');
+ var barWidth = $nums.width();
+
+ $(this.codemirror.frame).css('margin-left', barWidth);
+ $nums.css('left', -barWidth);
+
+ $(this.codemirror.frame.contentWindow).trigger('resize');
if(success) success();
}
-->
<xsl:template match="motto">
<xsl:param name="mixed" />
+ <div class="motto_container">
<div x-editable="true">
<xsl:call-template name="standard-attributes" />
<xsl:apply-templates select="child::node()">
<xsl:with-param name="mixed" select="true()" />
- </xsl:apply-templates>
+ </xsl:apply-templates>
+ </div>
+ <xsl:apply-templates select="following-sibling::*[1][self::motto_podpis]" mode="motto">
+ <xsl:with-param name="mixed" select="true()" />
+ </xsl:apply-templates>
</div>
</xsl:template>
- <xsl:template match="motto_podpis">
+ <!--
+ Catch stand-alone "motto_podpis" and make then render properly.
+ If not, editing will fail :(.
+
+ TODO: Make "motto" & "motto_podpis" one block in edit mode (like strofa)
+ -->
+ <xsl:template match="motto_podpis[not(preceding-sibling::*[1][self::motto])]">
+ <xsl:apply-templates select="." mode="motto">
+ <xsl:with-param name="mixed" select="true()" />
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <xsl:template match="motto_podpis" mode="motto">
<xsl:param name="mixed" />
<p x-editable="true">
<xsl:call-template name="standard-attributes" />
<xsl:with-param name="mixed" select="true()" />
</xsl:apply-templates>
</p>
- </xsl:template>
+ </xsl:template>
+
+ <xsl:template match="motto_podpis" />
+
+
<!--
Tagi obejmujące listę osób poprzedzającą tekst dramatu