Selaa lähdekoodia

whitespace + css + missing bootstrap

David 9 vuotta sitten
vanhempi
commit
eba52b20f9

+ 28 - 1
back/web.py

@@ -2,8 +2,14 @@
 import json
 import urllib
 import datetime
+import os
+
 from db import db
-from flask import Flask, jsonify, request
+from flask import Flask, jsonify, request, send_file
+
+from wand.image import Image
+from wand.drawing import Drawing 
+from wand.color import Color
 
 app = Flask(__name__)
 PORT = 8981
@@ -55,5 +61,26 @@ def confirm(_hash, pedidoid):
 	d.confirm(_hash, pedidoid)
 	return "{}"
 
+@app.route(BASE_PATH + '/image/<_hash>')
+def image(_hash):
+	filename = '/var/www/pedido/back/images/%s.png' % _hash
+	if not os.path.isfile(filename) or True:
+		c=d.client(_hash)
+		draw = Drawing()
+		with Image(width=300,height=150,background=Color('#2A3A49')) as img:
+			with Image(filename="/var/www/pedido/back/images/logo.png") as logo:
+				img.composite(logo, left=int(img.width/2-logo.width/2), top=int(img.height/2-logo.height/2))
+
+			draw.fill_color = Color('white')
+			draw.gravity = "north"
+			draw.text(0,10, "Pedido")
+
+			draw.gravity = "south"
+			draw.text(0,10, c["nombre"] + " " + c["apellido"])
+
+			draw(img)
+			img.save(filename=filename)
+	return send_file(filename, mimetype='image/png')
+
 if __name__ == '__main__':
 	app.run(host="0.0.0.0",port=PORT, debug=True)

+ 1 - 1
controllers/editPedidoCtrl.js

@@ -1,4 +1,4 @@
-app.controller('editPedidoCtrl', function ($scope, $http, $routeParams, notify, $location, $timeout, editing) {
+app.controller('editPedidoCtrl', function ($scope, $http, $routeParams, notify, $location, $timeout, editing, pedidosService) {
 	$scope.cero=true;
 	$scope.total=0;
 	$scope.observaciones="";

+ 3 - 1
controllers/facturaCtrl.js

@@ -30,7 +30,9 @@ app.controller('facturaCtrl', function ($scope, $http, $routeParams, $location,
 		$scope.modalInstance = $uibModal.open({
 			templateUrl: 'confirmModal.tmpl.html',
 			scope: $scope,
-			id: id
+			id: id,
+			ariaLabelledBy: 'modal-title',
+	        ariaDescribedBy: 'modal-body',
 		});
 	};
 

+ 0 - 2
css/style.css

@@ -8,8 +8,6 @@ body,html{
 .no-disponible { color: #ccc; }
 .low { color: #c22;display:block;font-size:smaller; }
 
-.modal-content { position:fixed !important; left: 5%; right: 5%; width: 90%; top: 5%; height: 90%; }
-.modal-content > .ng-scope { background-color:white; }
 .column { width:50%; float:left;}
 div > .column::after{clear:both;}
 

+ 1 - 1
index.html

@@ -10,7 +10,7 @@
 	<link rel="styleSheet" href="/js/angular-notify/dist/angular-notify.css"/>
 	
 	<script type="text/javascript" src="/js/angular.min.js"></script>
-	<script type="text/javascript" src="/js/ui-bootstrap-custom-tpls-2.4.0.min.js"></script>
+	<script type="text/javascript" src="/js/ui-bootstrap-tpls-2.4.0.min.js"></script>
 	<script type="text/javascript" src="/js/angular-route.min.js"></script>
 	<script type="text/javascript" src="/js/angular-notify/dist/angular-notify.js"></script>
 	<script type="text/javascript" src="/app.js"></script>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 7 - 0
js/ui-bootstrap-custom-tpls-2.4.0.min.js


BIN
logo.png


+ 7 - 8
views/main.html

@@ -46,15 +46,14 @@
 	</div>
 </div>
 
-<script type="text/ng-template" id="confirmModal.tmpl.html">
-    <div class="modal-header">
-        <h3>Confirmar</h3>
-    </div>   
-
-    <div class="modal-body">
-        <p>Seguro?</p>
-    </div>
+<script type="text/ng-template" id="confirmModal.tmpl.html" class="modal">
+   	<div class="modal-header">
+   	    <h3>Confirmar</h3>
+   	</div>   
 
+   	<div class="modal-body">
+   	    <p>Seguro?</p>
+   	</div>
     <div class="modal-footer">
         <button type="button" class="btn btn-default" ng-click="closeModal()" data-dismiss="modal">No</button>
         <button type="button" class="btn btn-primary" ng-click="confirm()">Confirmar</button>