Commits

Sergio Berlotto committed 2288284

Nova static url e ajustes para funcionar em subdiretorios

  • Participants
  • Parent commits 07705b2

Comments (0)

Files changed (4)

File static/css/layout.css

 body{
-    background-image: url('/static/img/bg.jpg');
+    background-image: url('../img/bg.jpg');
 }
 
 #uploader-collumn{
     width: 32px;
     height: 32px;
     float: right;
-    background-image: url('/static/img/code.png');
+    background-image: url('../img/code.png');
     background-position: 0px 0px;
     background-repeat: no-repeat;
 }
     height: 32px;
     float: left;
     margin-right: 5px;
-    background-image: url('/static/img/play2.png');
+    background-image: url('../img/play2.png');
     background-position: 0px 0px;
     background-repeat: no-repeat;
 }
     height: 32px;
     float: right;
     margin-right: 5px;
-    background-image: url('/static/img/poster.png');
+    background-image: url('../img/poster.png');
     background-position: 0px 0px;
     background-repeat: no-repeat;
 }
     height: 32px;
     float: right;
     margin-right: 5px;
-    background-image: url('/static/img/delete.png');
+    background-image: url('../img/delete.png');
     background-position: 0px 0px;
     background-repeat: no-repeat;
 }

File templates/index.html

 <html lang="pt-br">
     <head>
-        <link href="/static/ui/css/ui-lightness/jquery-ui-1.8.21.custom.css" rel="stylesheet" type="text/css">
+        <link href="{{url_for('static', filename='ui/css/ui-lightness/jquery-ui-1.8.21.custom.css')}}" rel="stylesheet" type="text/css">
             
-        <script type="text/javascript" src="/static/ui/js/jquery-1.7.2.min.js"></script>
-        <script type="text/javascript" src="/static/ui/js/jquery-ui-1.8.21.custom.min.js"></script>
+        <script type="text/javascript" src="{{url_for('static', filename='ui/js/jquery-1.7.2.min.js')}}"></script>
+        <script type="text/javascript" src="{{url_for('static', filename='ui/js/jquery-ui-1.8.21.custom.min.js')}}"></script>
         
-        <script type="text/javascript" src="/static/js/jquery.snippet.min.js"></script>
-        <script type="text/javascript" src="/static/js/jquery.easy-confirm-dialog.js"></script>
+        <script type="text/javascript" src="{{url_for('static', filename='js/jquery.snippet.min.js')}}"></script>
+        <script type="text/javascript" src="{{url_for('static', filename='js/jquery.easy-confirm-dialog.js')}}"></script>
         <!--
         HTML 5 Upload template based on :
         http://www.matlus.com/html5-file-upload-with-progress/
         -->
         
-        <link href="/static/css/uploader.css" rel="stylesheet" type="text/css">
-        <link href="/static/css/layout.css" rel="stylesheet" type="text/css">
+        <link href="{{url_for('static', filename='css/uploader.css')}}" rel="stylesheet" type="text/css">
+        <link href="{{url_for('static', filename='css/layout.css')}}" rel="stylesheet" type="text/css">
             
-        <link href="/static/css/jquery.snippet.min.css" rel="stylesheet" type="text/css">
+        <link href="{{url_for('static', filename='css/jquery.snippet.min.css')}}" rel="stylesheet" type="text/css">
         
         <script type="text/javascript">
         var bytesUploaded = 0;
                 $('a#icon-code').click(function(){
                     //alert('clicado ' + $(this).attr('filename'));
                     $('#divSnippet').attr('title','Copie o codigo para seu site');
-                    $('#divSnippet').load('/snippet/' + $(this).attr('filename'), function(){
+                    $('#divSnippet').load('snippet/' + $(this).attr('filename'), function(){
                         $('#divSnippet').dialog({
                             modal: true,
                             width: 900,
                 $('a#icon-play').click(function(){
                     //alert('clicado ' + $(this).attr('filename'));
                     $('#divSnippet').attr('title','Veja o video');
-                    $('#divSnippet').load('/play/' + $(this).attr('filename'));
+                    $('#divSnippet').load('play/' + $(this).attr('filename'));
                     $('#divSnippet').dialog({
                         modal: true,
                         width: 800,
                 $('a#icon-poster').click(function(){
                     //alert('clicado ' + $(this).attr('filename'));
                     $('#divSnippet').attr('title','Poster do video');
-                    $('#divSnippet').load('/poster/view/' + $(this).attr('filename'));
+                    $('#divSnippet').load('poster/view/' + $(this).attr('filename'));
                     $('#divSnippet').dialog({
                         modal: true,
                         width: 640,

File templates/login.html

 <html>
     <head>
         <title>Uploader de Vídeos</title>
-        <link href="/static/css/layout.css" rel="stylesheet" type="text/css">
+        <link href="{{url_for('static',filename='css/layout.css')}}" rel="stylesheet" type="text/css">
     </head>
     <body>
         <div class=page>
 except:
     pass
 
-app = Flask(__name__)
+app = Flask(__name__, static_path = '/upvideos_static', static_url_path = '/upvideos_static')
 app.config['UPLOAD_FOLDER'] = UPLOADED_FILES_DEST
 app.config['URL'] = APP_URL
 app.config['SECRET_KEY'] = SECRET_KEY
     return redirect('/')
 
 if __name__ == "__main__":
-    app.run(debug=False, port=APP_PORT, host=APP_HOST)
+    app.run(debug=True, port=APP_PORT, host=APP_HOST)