1+ < div class ="alert alert-error " ng-show ="error "> {{errorMessage}}</ div >
2+ < form class ="form-horizontal ">
3+
4+ < div class ="control-group ">
5+ < label class ="control-label " for ="rs_name "> Railway Station Name</ label >
6+
7+ < div class ="controls ">
8+ < input type ="text " id ="rs_name " ng-model ="rs.name "
9+ placeholder ="Railway Name " required min ="2 ">
10+ </ div >
11+ </ div >
12+
13+
14+ < div class ="control-group ">
15+ < label class ="control-label " for ="train_name "> Train Name</ label >
16+
17+ < div class ="controls ">
18+ < input type ="text " id ="train_name " ng-model ="rs.train.name "
19+ placeholder ="Train Name " required min ="2 ">
20+ </ div >
21+ </ div >
22+ < div class ="control-group ">
23+ < label class ="control-label " for ="train_speed "> Speed</ label >
24+
25+ < div class ="controls ">
26+
27+
28+ < input class ="span3 " type ="text " id ="train_speed "
29+ ng-model ="rs.train.speed " placeholder ="Speed " required min ="1 ">
30+ < span class ="add-on "> km/h</ span >
31+ </ div >
32+ </ div >
33+ < div class ="control-group ">
34+ < div class ="controls ">
35+ < label class ="checkbox "> < input type ="checkbox "
36+ ng-model ="rs.train.diesel "> Is Diesel
37+ </ label >
38+ </ div >
39+ < hr />
40+ < div class ="controls ">
41+ < button type ="button " class ="btn btn-primary "
42+ ng-disabled ="!rs.name || !rs.train.speed " ng-hide ="editMode "
43+ ng-click ="addNewRailwayStation(rs) "> Add Railway Station</ button >
44+
45+ < button type ="button " class ="btn btn-primary "
46+ ng-disabled ="!rs.train.name || !rs.train.speed " ng-show ="editMode "
47+ ng-click ="updateRailwayStation(rs) "> Save Railway Station</ button >
48+ < button type ="button " class ="btn " ng-click ="resetRailwayStationForm() "> Reset</ button >
49+ </ div >
50+ </ div >
51+ </ form >
52+ < hr />
53+ < h3 > Railway Stations List</ h3 >
54+ < div class ="alert alert-info " ng-show ="railwaystations.length == 0 "> No Railway Stations found</ div >
55+ < table class ="table table-bordered table-striped " ng-show ="railwaystations.length > 0 ">
56+ < thead >
57+ < tr >
58+ < th style ="text-align: center; width: 25px; "> Id</ th >
59+ < th style ="text-align: center; "> Name</ th >
60+ <!--
61+ <th style="text-align: center;">Speed</th>
62+ <th style="text-align: center;">Diesel</th>
63+ -->
64+ < th style ="text-align: center; "> Action</ th >
65+ </ tr >
66+ </ thead >
67+ < tbody >
68+ < tr ng-repeat ="item in railwaystations | orderBy:predicate ">
69+ < td style ="text-align: center; "> {{item.id}}</ td >
70+ < td > {{item.name}}</ td >
71+
72+
73+ <!-- <td>{{train.speed}}</td>
74+ <td style="text-align: center; width: 20px;"><span
75+ ng-show="train.diesel" class="icon-ok"></span></td> -->
76+
77+ < td style ="width: 100px; text-align: center; ">
78+ < button class ="btn btn-mini btn-danger "
79+ ng-click ="removeRailwayStation(item.id) "> Remove</ button >
80+ < button class ="btn btn-mini btn-success " ng-click ="editRailwayStation(item) "> Edit</ button >
81+ </ td >
82+ </ tr >
83+ </ tbody >
84+ </ table >
85+ < button class ="btn btn-danger " ng-show ="railwaystations.length > 1 "
86+ ng-click ="removeAllRailwayStations() "> Remove All stations</ button >
0 commit comments