Browse Source

use website url_base scheme/protocol instead of http

Guénaël Muller 6 years ago
parent
commit
bc1937ae61

+ 3 - 0
tracim/tracim/controllers/workspace.py View File

22
 
22
 
23
 from tracim.model.serializers import Context, CTX, DictLikeClass
23
 from tracim.model.serializers import Context, CTX, DictLikeClass
24
 
24
 
25
+from urllib.parse import urlparse
25
 
26
 
26
 class UserWorkspaceRestController(TIMRestController):
27
 class UserWorkspaceRestController(TIMRestController):
27
 
28
 
101
 
102
 
102
         dictified_workspace = Context(CTX.WORKSPACE).toDict(workspace, 'workspace')
103
         dictified_workspace = Context(CTX.WORKSPACE).toDict(workspace, 'workspace')
103
         webdav_url = CFG.get_instance().WSGIDAV_CLIENT_BASE_URL
104
         webdav_url = CFG.get_instance().WSGIDAV_CLIENT_BASE_URL
105
+        website_protocol = urlparse(CFG.get_instance().WEBSITE_BASE_URL).scheme
104
 
106
 
105
         return DictLikeClass(
107
         return DictLikeClass(
106
             result=dictified_workspace,
108
             result=dictified_workspace,
107
             fake_api=fake_api,
109
             fake_api=fake_api,
108
             webdav_url=webdav_url,
110
             webdav_url=webdav_url,
111
+            website_protocol = website_protocol,
109
             show_deleted=show_deleted,
112
             show_deleted=show_deleted,
110
             show_archived=show_archived,
113
             show_archived=show_archived,
111
         )
114
         )

+ 1 - 1
tracim/tracim/templates/workspace/getone.mak View File

129
             <div class="col-md-6">
129
             <div class="col-md-6">
130
                 <div class="input-group">
130
                 <div class="input-group">
131
                     <span class="input-group-addon" style="width: 8em;"><i class="fa fa-fw fa-windows"></i> Windows</span>
131
                     <span class="input-group-addon" style="width: 8em;"><i class="fa fa-fw fa-windows"></i> Windows</span>
132
-                    <div class="form-control webdavconfig__input">http://${webdav_url}</div>
132
+                    <div class="form-control webdavconfig__input">${website_protocol}://${webdav_url}</div>
133
                 </div>
133
                 </div>
134
                 <p></p>
134
                 <p></p>
135
                 <div class="input-group">
135
                 <div class="input-group">