fnp
/
redakcja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
52c41c2
)
Maint
master
author
Radek Czajka
<radekczajka@wolnelektury.pl>
Wed, 25 Nov 2026 09:58:33 +0000
(10:58 +0100)
committer
Radek Czajka
<radekczajka@wolnelektury.pl>
Wed, 25 Nov 2026 09:58:33 +0000
(10:58 +0100)
Dockerfile
patch
|
blob
|
history
src/cover/tests.py
patch
|
blob
|
history
src/documents/templates/documents/book_text.html
patch
|
blob
|
history
src/redakcja/context_processors.py
patch
|
blob
|
history
src/redakcja/settings/defaults.py
patch
|
blob
|
history
src/redakcja/static/js/wiki/view_editor_wysiwyg.js
patch
|
blob
|
history
src/redakcja/static/js/wiki/view_properties.js
patch
|
blob
|
history
src/redakcja/static/js/wiki/wikiapi.js
patch
|
blob
|
history
src/redakcja/static/js/wiki/xslt.js
patch
|
blob
|
history
src/redakcja/templates/base.html
patch
|
blob
|
history
diff --git
a/Dockerfile
b/Dockerfile
index
c62efe4
..
e4fcb80
100644
(file)
--- a/
Dockerfile
+++ b/
Dockerfile
@@
-54,11
+54,11
@@
ARG GID=8200
COPY scripts/nginx.conf /etc/nginx/conf.d/default.conf
RUN addgroup -g $GID app && addgroup nginx app
COPY scripts/nginx.conf /etc/nginx/conf.d/default.conf
RUN addgroup -g $GID app && addgroup nginx app
-COPY --from=static-builder /app/
src
/static /app/var/static
+COPY --from=static-builder /app/
var
/static /app/var/static
FROM prod-base AS prod
FROM prod-base AS prod
-COPY --from=static-builder /app/
src/static/staticfiles.json /app/src
/static/staticfiles.json
+COPY --from=static-builder /app/
var/static/staticfiles.json /app/var
/static/staticfiles.json
diff --git
a/src/cover/tests.py
b/src/cover/tests.py
index
5436100
..
910b0df
100644
(file)
--- a/
src/cover/tests.py
+++ b/
src/cover/tests.py
@@
-126,13
+126,13
@@
class CoverPreviewTest(TestCase):
def test_preview_from_bad_xml(self):
response = self.client.post('/cover/preview/', data={"xml": ''})
self.assertEqual(response.status_code, 200)
def test_preview_from_bad_xml(self):
response = self.client.post('/cover/preview/', data={"xml": ''})
self.assertEqual(response.status_code, 200)
- self.assertEqual(response.content, b'/
media/
static/img/sample_cover.png')
+ self.assertEqual(response.content, b'/static/img/sample_cover.png')
@patch('cover.views.make_cover')
def test_preview_from_minimal_xml(self, make_cover):
response = self.client.post('/cover/preview/', data={"xml": SAMPLE_XML})
self.assertEqual(response.status_code, 200)
@patch('cover.views.make_cover')
def test_preview_from_minimal_xml(self, make_cover):
response = self.client.post('/cover/preview/', data={"xml": SAMPLE_XML})
self.assertEqual(response.status_code, 200)
- self.assertIn(b'/media/
dynamic/
cover/preview/', response.content)
+ self.assertIn(b'/media/cover/preview/', response.content)
def test_bad_book(self):
response = self.client.get('/cover/preview/test/')
def test_bad_book(self):
response = self.client.get('/cover/preview/test/')
@@
-221,4
+221,4
@@
class TestCover(TestCase):
def test_image_file(self):
response = self.client.get('/cover/image/1/file/')
def test_image_file(self):
response = self.client.get('/cover/image/1/file/')
- self.assertRegex(response['Location'], r'^/media/
dynamic/
cover/image/')
+ self.assertRegex(response['Location'], r'^/media/cover/image/')
diff --git
a/src/documents/templates/documents/book_text.html
b/src/documents/templates/documents/book_text.html
index
a88aad5
..
c17c1da
100644
(file)
--- a/
src/documents/templates/documents/book_text.html
+++ b/
src/documents/templates/documents/book_text.html
@@
-21,7
+21,7
@@
</ul>
</div>
<div id="header">
</ul>
</div>
<div id="header">
- <a href="/"><img src="/
media/
static/img/logo-220.png" alt="Wolne Lektury" /></a>
+ <a href="/"><img src="/static/img/logo-220.png" alt="Wolne Lektury" /></a>
</div>
{{ html|safe }}
</body>
</div>
{{ html|safe }}
</body>
diff --git
a/src/redakcja/context_processors.py
b/src/redakcja/context_processors.py
index
e750fd2
..
1eba280
100644
(file)
--- a/
src/redakcja/context_processors.py
+++ b/
src/redakcja/context_processors.py
@@
-4,17
+4,7
@@
def settings(request):
from django.conf import settings
def settings(request):
from django.conf import settings
- if settings.SHOW_APP_VERSION:
- import subprocess
- process = subprocess.Popen(["git", "show", "--oneline"], stdout=subprocess.PIPE)
- data, _err = process.communicate()
- # get app version
- VERSION = data.splitlines()[0].split()[0]
- else:
- VERSION = ''
-
return {
'MEDIA_URL': settings.MEDIA_URL,
'STATIC_URL': settings.STATIC_URL,
return {
'MEDIA_URL': settings.MEDIA_URL,
'STATIC_URL': settings.STATIC_URL,
- 'APP_VERSION': VERSION,
}
}
diff --git
a/src/redakcja/settings/defaults.py
b/src/redakcja/settings/defaults.py
index
11edc51
..
2be9aa5
100644
(file)
--- a/
src/redakcja/settings/defaults.py
+++ b/
src/redakcja/settings/defaults.py
@@
-3,8
+3,6
@@
#
import os
#
import os
-PROJECT_ROOT = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))
-
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
@@
-46,25
+44,21
@@
USE_L10N = True
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
-MEDIA_ROOT =
PROJECT_ROOT + '/media/dynamic
'
-STATIC_ROOT =
PROJECT_ROOT + '/../static/
'
-CATALOGUE_REPO_PATH =
MEDIA_ROOT + '/repo
'
-CATALOGUE_IMAGE_REPO_PATH =
MEDIA_ROOT + '/imgrepo
'
+MEDIA_ROOT =
'/app/var/media
'
+STATIC_ROOT =
'/app/var/static
'
+CATALOGUE_REPO_PATH =
'/app/var/dvcs
'
+CATALOGUE_IMAGE_REPO_PATH =
'/app/var/dvcs-img
'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
-MEDIA_URL = '/media/
dynamic/
'
-STATIC_URL = '/
media/
static/'
+MEDIA_URL = '/media/'
+STATIC_URL = '/static/'
SESSION_COOKIE_NAME = "redakcja_sessionid"
IMAGE_DIR = 'images/'
SESSION_COOKIE_NAME = "redakcja_sessionid"
IMAGE_DIR = 'images/'
-BROKER_URL = 'django://'
-
-SHOW_APP_VERSION = False
-
CAS_SERVER_URL = None
CAS_APPLY_ATTRIBUTES_TO_USER = True
CAS_RENAME_ATTRIBUTES = {
CAS_SERVER_URL = None
CAS_APPLY_ATTRIBUTES_TO_USER = True
CAS_RENAME_ATTRIBUTES = {
diff --git
a/src/redakcja/static/js/wiki/view_editor_wysiwyg.js
b/src/redakcja/static/js/wiki/view_editor_wysiwyg.js
index
afd8108
..
1c9f2ed
100644
(file)
--- a/
src/redakcja/static/js/wiki/view_editor_wysiwyg.js
+++ b/
src/redakcja/static/js/wiki/view_editor_wysiwyg.js
@@
-763,7
+763,6
@@
let self = this;
xml2html({
xml: this.doc.text,
let self = this;
xml2html({
xml: this.doc.text,
- base: this.doc.getBase(),
success: function(element){
var htmlView = $('#html-view');
success: function(element){
var htmlView = $('#html-view');
diff --git
a/src/redakcja/static/js/wiki/view_properties.js
b/src/redakcja/static/js/wiki/view_properties.js
index
6ae6e57
..
be027e0
100644
(file)
--- a/
src/redakcja/static/js/wiki/view_properties.js
+++ b/
src/redakcja/static/js/wiki/view_properties.js
@@
-1,8
+1,5
@@
(function($){
(function($){
- let w = function() {};
- w = console.log;
-
const elementDefs = {
"ilustr": {
"attributes": [
const elementDefs = {
"ilustr": {
"attributes": [
@@
-89,17
+86,11
@@
html2text({
element: self.$edited[0],
success: function(xml) {
html2text({
element: self.$edited[0],
success: function(xml) {
- w(222)
let $xmlelem = $($.parseXML(xml));
let $xmlelem = $($.parseXML(xml));
- w(333, $xmlelem)
- w($input.data('property'), $input.val());
$xmlelem.contents().attr($input.data('property'), inputval);
$xmlelem.contents().attr($input.data('property'), inputval);
- w(444, $xmlelem)
let newxml = (new XMLSerializer()).serializeToString($xmlelem[0]);
let newxml = (new XMLSerializer()).serializeToString($xmlelem[0]);
- w(555, newxml)
xml2html({
xml: newxml,
xml2html({
xml: newxml,
- base: self.doc.getBase(),
success: function(html) {
let htmlElem = $(html);
self.$edited.replaceWith(htmlElem);
success: function(html) {
let htmlElem = $(html);
self.$edited.replaceWith(htmlElem);
diff --git
a/src/redakcja/static/js/wiki/wikiapi.js
b/src/redakcja/static/js/wiki/wikiapi.js
index
5675913
..
a420e3b
100644
(file)
--- a/
src/redakcja/static/js/wiki/wikiapi.js
+++ b/
src/redakcja/static/js/wiki/wikiapi.js
@@
-546,11
+546,6
@@
text = $.trim(text.replace(/\s{2,}/g, ' '));
return text.length;
}
text = $.trim(text.replace(/\s{2,}/g, ' '));
return text.length;
}
-
- /* Temporary workaround for relative images. */
- getBase() {
- return '/media/dynamic/images/' + this.galleryLink + '/';
- }
}
$.wikiapi.WikiDocument = WikiDocument;
}
$.wikiapi.WikiDocument = WikiDocument;
diff --git
a/src/redakcja/static/js/wiki/xslt.js
b/src/redakcja/static/js/wiki/xslt.js
index
922a3ba
..
00854a7
100644
(file)
--- a/
src/redakcja/static/js/wiki/xslt.js
+++ b/
src/redakcja/static/js/wiki/xslt.js
@@
-60,17
+60,10
@@
function xml2html(options) {
source.text('');
options.error(error.text(), source_text);
} else {
source.text('');
options.error(error.text(), source_text);
} else {
- let galleryUrl = new URL(
- options.base,
- window.location.href
- );
$("img", $(doc.childNodes)).each(function() {
$(this).attr(
'src',
$("img", $(doc.childNodes)).each(function() {
$(this).attr(
'src',
- new URL(
- $(this).attr('src'),
- galleryUrl
- )
+ $(this).attr('src'),
);
})
);
})
diff --git
a/src/redakcja/templates/base.html
b/src/redakcja/templates/base.html
index
01fb09b
..
e212e89
100644
(file)
--- a/
src/redakcja/templates/base.html
+++ b/
src/redakcja/templates/base.html
@@
-19,7
+19,6
@@
</div>
</div>
</div>
</div>
- <!-- version: {{ APP_VERSION }} -->
{% block maincontent %} {% endblock %}
<script
src="https://code.jquery.com/jquery-1.9.1.min.js"
{% block maincontent %} {% endblock %}
<script
src="https://code.jquery.com/jquery-1.9.1.min.js"