]> hackdaworld.org Git - outofuni/tavern2.git/commitdiff
introduced table components
authorhackbard <hackbard@hackdaworld.org>
Mon, 17 Oct 2016 20:29:05 +0000 (22:29 +0200)
committerhackbard <hackbard@hackdaworld.org>
Mon, 17 Oct 2016 20:29:05 +0000 (22:29 +0200)
lib/table.dart [new file with mode: 0644]
lib/table_service.dart [new file with mode: 0644]
lib/tables_component.css [new file with mode: 0644]
lib/tables_component.dart [new file with mode: 0644]
lib/tables_component.html [new file with mode: 0644]

diff --git a/lib/table.dart b/lib/table.dart
new file mode 100644 (file)
index 0000000..dec2a14
--- /dev/null
@@ -0,0 +1,18 @@
+class Coord {
+       int x;
+       int y;
+
+       Coord(this.x,this.y);
+}
+
+class Table {
+       String id;
+       String name;
+       int num;
+       int room;
+       Coord coord;
+       String type;
+
+       Table(this.id,this.name,this.num,this.room,this.coord,this.type);
+}
+
diff --git a/lib/table_service.dart b/lib/table_service.dart
new file mode 100644 (file)
index 0000000..f73f327
--- /dev/null
@@ -0,0 +1,20 @@
+import 'dart:async';
+import 'dart:convert';
+
+import 'package:angular2/core.dart';
+import 'package:http/browser_client.dart';
+
+import 'db.dart';
+
+import 'table.dart';
+
+@Injectable()
+class TableService {
+       final BrowserClient _http;
+
+       static const _byroom='_design/tables/_view/byroom';
+       static const _bynum='_design/tables/_view/bynum';
+
+       TableService(this._http);
+}
+
diff --git a/lib/tables_component.css b/lib/tables_component.css
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/lib/tables_component.dart b/lib/tables_component.dart
new file mode 100644 (file)
index 0000000..39bc280
--- /dev/null
@@ -0,0 +1,28 @@
+import 'dart:async';
+
+import 'package:angular2/core.dart';
+import 'package:angular2/router.dart';
+
+import 'table.dart';
+import 'table_service.dart';
+
+import 'package:angular2_rbi/directives.dart';
+
+@Component(
+       selector: 'my-tables',
+       templateUrl: 'tables_component.html',
+       styleUrls: const ['tables_component.css'],
+       directives: const [MaterialTextfield,MaterialButton],
+       providers: const [TableService]
+)
+
+class TablesComponent implements OnInit {
+       List<Table> tables;
+       Table selected_table;
+       final TableService _tableSrv;
+       final Router _router;
+
+       TablesComponent(this._tableSrv,this._router);
+
+}
+
diff --git a/lib/tables_component.html b/lib/tables_component.html
new file mode 100644 (file)
index 0000000..e69de29