Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
osp
tools.ethertoff
Commits
bec1a5e0
Commit
bec1a5e0
authored
Nov 19, 2019
by
gijs
Browse files
Should fix
#14
, but by moving it into a setting to allow for different behaviour per installation.
parent
a699ee87
Changes
4
Hide whitespace changes
Inline
Side-by-side
ethertoff/templates/manage-tree.html
View file @
bec1a5e0
...
...
@@ -16,7 +16,7 @@
{% endfor %}
{% for pad in tree.pads %}
<li>
<a
data-uid=
"{{ pad.display_slug }}"
href=
"{% url 'pad
-read
' mode=
'r'
slug=pad.display_slug %}"
class=
"pad-link"
>
<a
data-uid=
"{{ pad.display_slug }}"
href=
"{% url 'pad' mode=
PAD_OPEN_MODE
slug=pad.display_slug %}"
class=
"pad-link"
>
{{ pad.display_slug|stripPath:folderPath|dewikify }}
{% if pad.is_public %}(public){% endif %}
</a>
...
...
ethertoff/urls.py
View file @
bec1a5e0
...
...
@@ -35,8 +35,10 @@ urlpatterns = [
re_path
(
r
'^public/(?P<pk>\d+)/$'
,
views
.
padPublic
,
name
=
'pad-public'
),
re_path
(
r
'^private/(?P<pk>\d+)/$'
,
views
.
padPrivate
,
name
=
'pad-private'
),
re_path
(
r
'(?P<mode>[r|s|p])/(?P<slug>[^/]+)$'
,
views
.
pad_read
,
name
=
'pad-read'
),
re_path
(
r
'(?P<mode>[r|s|p])/(?P<slug>[^/]+)$'
,
views
.
pad_read
,
name
=
'pad'
),
re_path
(
r
'(?P<mode>[w])/(?P<slug>[^/]+)$'
,
views
.
pad
,
name
=
'pad'
),
#re_path(r'r/(?P<slug>[^/]+)$', views.pad, name='pad-read'),
#re_path(r's/(?P<slug>[^/]+)$', views.pad, name='pad-slide'),
#re_path(r'p/(?P<slug>[^/]+)$', views.pad, name='pad-print'),
re_path
(
r
'w/(?P<slug>[^/]+)$'
,
views
.
pad
,
name
=
'pad-write'
)
,
re_path
(
r
'w/(?P<slug>[^/]+)$'
,
views
.
pad
,
name
=
'pad-write'
)
]
ethertoff/views.py
View file @
bec1a5e0
...
...
@@ -348,7 +348,7 @@ def padPrivate(request, pk):
con
)
def
pad
(
request
,
pk
=
None
,
slug
=
None
):
def
pad
(
request
,
pk
=
None
,
slug
=
None
,
mode
=
None
):
if
slug
:
pad
=
get_object_or_404
(
Pad
,
display_slug
=
slug
)
else
:
...
...
@@ -713,7 +713,14 @@ def manage(request, path=[]):
folders
.
sort
(
key
=
str
.
lower
)
return
render
(
request
,
"manage-tree.html"
,
{
'tree'
:
tree
,
'folderPath'
:
path
,
'crumbs'
:
crumbs
,
'folders'
:
folders
,
'folderPathString'
:
'/'
.
join
(
path
)
if
path
else
None
})
return
render
(
request
,
"manage-tree.html"
,
{
'tree'
:
tree
,
'folderPath'
:
path
,
'crumbs'
:
crumbs
,
'folders'
:
folders
,
'folderPathString'
:
'/'
.
join
(
path
)
if
path
else
None
,
'PAD_OPEN_MODE'
:
settings
.
TREE_PAD_OPEN_MODE
})
def
all
(
request
):
if
request
.
user
.
is_authenticated
:
...
...
my_project/settings.py
View file @
bec1a5e0
...
...
@@ -128,7 +128,6 @@ USE_TZ = True
STATIC_URL
=
'/static/'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://example.com/media/", "http://media.example.com/"
...
...
@@ -157,3 +156,5 @@ except NameError:
pass
API_LOCAL_URL
=
None
TREE_PAD_OPEN_MODE
=
'w'
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment