Project

General

Profile

« Previous | Next » 

Revision 27715

free text editing of relations (client side)

View differences:

vocabularies.st
65 65
				    	</div>
66 66
				    	<div id="accordionTerm{{\$index}}" class="panel-collapse collapse">
67 67
				      		<div class="panel-body">
68
			      		
69
								<p class="text-muted" ng-hide="term.synonyms">No synonyms</p>
70
								
71
								<table class="table table-bordered" ng-show="term.synonyms">
72
									<th>Synonym</th>
73
									<th>Encoding</th>
74
									<th>Operation</th>
75
									<tr ng-repeat="synonym in term.synonyms">
76
										<td class="col-md-8">{{synonym.term}}</td>
77
										<td class="col-md-4">{{synonym.encoding}}</td>
78
										<td class="col-md-1">
79
											<button type="button" class="btn btn-xs btn-primary" ng-click="showSynonymModal(term, synonym)">
80
												<span class="glyphicon glyphicon-pencil"></span>
81
											</button>
82
											<button type="button" class="btn btn-xs btn-danger" ng-click="deleteSynonym(term, synonym)">
83
												<span class="glyphicon glyphicon-trash"></span>
84
											</button>
85
										</td>
86
									</tr>
87
								</table>
88
								<button class="btn btn-xs btn-primary" type="button" ng-click="showSynonymModal(term, null)">
89
									<span class="glyphicon glyphicon-plus"></span>
90
								</button>
68
				      			<ul class="nav nav-tabs">
69
  									<li class="active"><a href="#accordionTerm{{\$index}}_synonyms" data-toggle="tab">Synonyms</a></li>
70
  									<li><a href="#accordionTerm{{\$index}}_rels" data-toggle="tab">Relations</a></li>
71
  								</ul>
72
				      		
73
			      				<div class="tab-content" style="margin-top:10px;">
74
  									<div class="tab-pane active" id="accordionTerm{{\$index}}_synonyms">
75
										<p class="text-muted" ng-hide="term.synonyms">No synonyms</p>
76
										
77
										<table class="table table-bordered table-striped" ng-show="term.synonyms">
78
											<th>Synonym</th>
79
											<th>Encoding</th>
80
											<th>Operation</th>
81
											<tr ng-repeat="synonym in term.synonyms">
82
												<td class="col-md-8">{{synonym.term}}</td>
83
												<td class="col-md-4">{{synonym.encoding}}</td>
84
												<td class="col-md-1">
85
													<button type="button" class="btn btn-xs btn-primary" ng-click="showSynonymModal(term, synonym)">
86
														<span class="glyphicon glyphicon-pencil"></span>
87
													</button>
88
													<button type="button" class="btn btn-xs btn-danger" ng-click="deleteSynonym(term, synonym)">
89
														<span class="glyphicon glyphicon-trash"></span>
90
													</button>
91
												</td>
92
											</tr>
93
										</table>
94
										<button class="btn btn-xs btn-primary" type="button" ng-click="showSynonymModal(term, null)">
95
											<span class="glyphicon glyphicon-plus"></span>
96
										</button>
97
									</div>
98
									<div class="tab-pane" id="accordionTerm{{\$index}}_rels">
99
										<p class="text-muted" ng-hide="term.relations">No relations</p>
100
										<table class="table table-bordered table-striped" ng-show="term.relations">
101
											<th>Related Term</th>
102
											<th>Relation Type</th>
103
											<th>Operation</th>
104
											<tr ng-repeat="rel in term.relations">
105
												<td class="col-md-8">{{rel.value}}</td>
106
												<td class="col-md-4">{{rel.type}}</td>
107
												<td class="col-md-1">
108
													<button type="button" class="btn btn-xs btn-primary" ng-click="showRelModal(term, rel)">
109
														<span class="glyphicon glyphicon-pencil"></span>
110
													</button>
111
													<button type="button" class="btn btn-xs btn-danger" ng-click="deleteRel(term, rel)">
112
														<span class="glyphicon glyphicon-trash"></span>
113
													</button>
114
												</td>
115
											</tr>
116
										</table>
117
										<button class="btn btn-xs btn-primary" type="button" ng-click="showRelModal(term, null)">
118
											<span class="glyphicon glyphicon-plus"></span>
119
										</button>
120
									
121
									</div>
122
								</div>
91 123
				      		</div>
92 124
				    	</div>
93 125
				  	</div>
......
217 249
				</div>
218 250
			</div>
219 251
		</div>
252

  
253
		<!-- relModal -->
254
		<div class="modal fade" id="relModal" tabindex="-1" role="dialog" aria-labelledby="relModalLabel" aria-hidden="true">
255
			<div class="modal-dialog">
256
				<div class="modal-content">
257
					<div class="modal-header">
258
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
259
						<h4 id="relModalLabel">Relation editor</h4>
260
					</div>
261
					<div class="modal-body">
262
						<form name="relForm" class="form-horizontal" role="form">
263
							<div class="form-group">
264
								<label class="col-sm-4 control-label" for="refterm">Ref. Term</label>
265
							    <div class="col-sm-8">
266
									<span id="refterm" class="form-control" type="text" disabled>{{modalRel.refTerm}}</span>
267
							    </div>
268
							</div>
269
							<div class="form-group" ng-class="{'has-error': !modalRel.value}">
270
								<label class="col-sm-4 control-label" for="term">Related term</label>
271
								<div class="col-sm-8">
272
									<input class="form-control" name="value" type="text" placeholder="new relation" ng-model="modalRel.value">
273
								</div>
274
							</div>
275
							<div class="form-group" ng-class="{'has-error': !modalRel.type}">
276
								<label class="col-sm-4 control-label" for="encoding">Relation type</label>
277
								<div class="col-sm-8">
278
									<input class="form-control" name="type" type="text" placeholder="type" ng-model="modalRel.type">
279
								</div>
280
							</div>
281
						</form>				
282
					</div>
283
					<div class="modal-footer">
284
						<button type="button" class="btn btn-primary" ng-disabled="!(modalRel.type && modalRel.value) " ng-click="editRel()">Save</button>
285
					</div>
286
				</div>
287
			</div>
288
		</div>
289

  
290

  
220 291
		
221 292
	</div>
222 293
} )$

Also available in: Unified diff