Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ckanext-odsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Transparenzportal
ckanext-odsh
Commits
0ff8d6ac
Commit
0ff8d6ac
authored
5 years ago
by
Rainer Herzog
Browse files
Options
Downloads
Plain Diff
Merge branch 'sprint11' of
ssh://ssh.bitbucket.dataport.de:7999/odsh/ckanext-odsh
into sprint11
parents
31d56a0b
a36df119
Branches
Branches containing commit
Tags
sprint11_2
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ckanext/odsh/helpers.py
+10
-0
10 additions, 0 deletions
ckanext/odsh/helpers.py
ckanext/odsh/plugin.py
+2
-1
2 additions, 1 deletion
ckanext/odsh/plugin.py
ckanext/odsh/templates/package/snippets/resource_item.html
+2
-2
2 additions, 2 deletions
ckanext/odsh/templates/package/snippets/resource_item.html
with
14 additions
and
3 deletions
ckanext/odsh/helpers.py
+
10
−
0
View file @
0ff8d6ac
...
...
@@ -13,6 +13,8 @@ import urllib
import
hashlib
import
re
from
ckan.common
import
request
from
urlparse
import
urlsplit
,
urlunsplit
get_action
=
logic
.
get_action
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -215,3 +217,11 @@ def odsh_has_more_facets(facet, limit=None, exclude_active=False):
def
odsh_public_url
():
return
config
.
get
(
'
ckanext.odsh.public_url
'
)
def
odsh_public_resource_url
(
res
):
home
=
config
.
get
(
'
ckanext.odsh.public_url
'
)
if
res
.
get
(
'
url_type
'
,
None
)
==
'
upload
'
and
'
url
'
in
res
:
f
=
urlsplit
(
res
[
'
url
'
])
return
urlunsplit
((
0
,
0
,
f
[
2
],
f
[
3
],
f
[
4
]))
else
:
return
res
[
'
url
'
]
This diff is collapsed.
Click to expand it.
ckanext/odsh/plugin.py
+
2
−
1
View file @
0ff8d6ac
...
...
@@ -289,7 +289,8 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm
'
odsh_tracking_id
'
:
odsh_helpers
.
odsh_tracking_id
,
'
odsh_tracking_url
'
:
odsh_helpers
.
odsh_tracking_url
,
'
odsh_has_more_facets
'
:
odsh_helpers
.
odsh_has_more_facets
,
'
odsh_public_url
'
:
odsh_helpers
.
odsh_public_url
'
odsh_public_url
'
:
odsh_helpers
.
odsh_public_url
,
'
odsh_public_resource_url
'
:
odsh_helpers
.
odsh_public_resource_url
}
def
after_map
(
self
,
map
):
...
...
This diff is collapsed.
Click to expand it.
ckanext/odsh/templates/package/snippets/resource_item.html
+
2
−
2
View file @
0ff8d6ac
{% set url_action = 'resource_edit' if url_is_edit and can_edit else 'resource_read' %}
{% set url = h.url_for(controller='package', action=url_action, id=pkg.name, resource_id=res.id) %}
{
% set download =
res
.
ur
l or url %
}
{% set
res_details
= h.odsh_
get
_resource_
details(res.id)
%}
{
# hack for correcting slave url if
res
o
ur
ce was uploaded #
}
{% set
download
= h.odsh_
public
_resource_
url(res) or ulr
%}
<li
class=
"resource-item"
data-id=
"{{ res.id }}"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment