import_campus.html 5.01 KB
Newer Older
1
{% from 'macros.html' import moderator_delete %}
Andreas Valder's avatar
Andreas Valder committed
2
3
4
5
6
{% extends "base.html" %}
{% block content %}
<div class="panel-group">
	<div class="panel panel-default">
		<div class="panel-heading">
7
			<h1 class="panel-title">Campus-/RWTHonline-Import für <strong>{{course.title}}</strong> <span><a href="{{url_for('course', handle=course.handle)}}" class="btn btn-default" >Zur Veranstaltungsseite</a><span> </h1>
Andreas Valder's avatar
Andreas Valder committed
8
9
		</div>
		<div class="panel-body">
Andreas Valder's avatar
Andreas Valder committed
10
			<div>
11
				<p>Es folgen ein oder mehrere Veranstaltungs-URLs mit dem jeweiligen Veranstaltungstyp. Die Veranstaltungs-URL bekommt man aus dem Campus-System (<a href="https://www.campus.rwth-aachen.de/rwth/all/groups.asp" target="_blank">hier</a>) bzw. bei RWTHonline über die Veranstaltungssuche (<a href="https://online.rwth-aachen.de/RWTHonline/pl/ui/%24ctx/wbSuche.LVSuche" target="_blank">hier</a> oder über Durchklicken im neuen Interface). Der Veranstaltungstyp ist z.B. "Vorlesung" oder "Übung" oder "Praktikum".
Andreas Valder's avatar
Andreas Valder committed
12
				</p>
13
				<form method="post" action="{{url_for('list_import_sources', id=course['id'])}}">
14
15
16
17
					<ul class="list-group row" style="margin-left: 0px; margin-right: 0px;">
						{%for i in import_campus %}
						<li class="list-group-item form-inline row">
							<span class="input-group col-xs-8">
18
								<input class="form-control" type="text" name="campus.{{i.id}}.url" value="{{i.url}}" id="campus-{{i.id}}-url" placeholder="url">
Andreas Valder's avatar
Andreas Valder committed
19
							</span>
20
							<span class="input-group col-xs-2">
21
								<input class="form-control" type="text" name="campus.{{i.id}}.type" value="{{i.type}}" id="campus-{{i.id}}-type" placeholder="type">
Andreas Valder's avatar
Andreas Valder committed
22
							</span>
23
24
25
26
27
28
29
30
31
32
33
34
							<span class="input-group col-xs-1 pull-right">
								<button class="btn btn-default pull-right" onclick="$('#campus-{{i.id}}-url').val('')">
									<span class="glyphicon glyphicon-trash"></span>
								</button>
							</span> 
						</li>
						{%endfor%}
						<li class="list-group-item form-inline row">
							<span class="input-group col-xs-8">
								<input class="form-control" type="text" name="campus.new.url" placeholder="url">
							</span>
							<span class="input-group col-xs-2">
35
								<input class="form-control" type="text" name="campus.new.type" placeholder="type">
36
37
38
39
40
41
							</span>
							<span class="input-group col-xs-1 pull-right">
								<button class="btn btn-default pull-right">
									<span class="glyphicon glyphicon-plus"></span>
								</button>
							</span> 
Andreas Valder's avatar
Andreas Valder committed
42
43
						</li>
					</ul>
44
45
46
47
					<ul class="list-inline pull-right">
						<li><a class="btn btn-default" href="{{url_for('import_from', id=course['id'])}}"><span class="fa fa-refresh" aria-hidden="true" ></span> Campus abfragen</button></a></li>
						<li><button class="btn btn-default" type="submit">Speichern</button></li>
					</ul>
Andreas Valder's avatar
Andreas Valder committed
48
				</form>
Andreas Valder's avatar
Andreas Valder committed
49
			</div>
Andreas Valder's avatar
Andreas Valder committed
50
51
		</div>
	</div>
Andreas Valder's avatar
Andreas Valder committed
52
	<div class="panel panel-default">
53
54
		<div class="panel-heading" style="height:50px">
			<h1 class="panel-title">
55
				Termine im Campus die nicht bei uns sind:
56
				<ul class="list-inline pull-right">
57
					<li><button class="btn btn-default" onclick="$('.newlecture').click(); alert('done');">alle anlegen</button></li>
58
59
				</ul>
			</h1>
Andreas Valder's avatar
Andreas Valder committed
60
61
		</div>
		<ul class="list-group-item">
62
63
64
65
66
67
68
69
70
71
72
73
74
75
			{% for i in newevents|sort(attribute='time') %}
				<li class="list-group-item row">
					<span class="col-xs-3">
						Time: {{i.time}}
					</span>
					<span class="col-xs-2">
						Duration: {{i.duration}}
					</span>
					<span class="col-xs-3">
						Place: {{i.place}}
					</span>
					<span class="col-xs-3">
					</span>
					<span class="pull-right">
76
						<button class="btn btn-default newlecture" onclick="moderator.api.gethttp('{{ url_for('create', table='lectures', course_id=course.id, time=i.time, title=i.title, place=i.place, duration=i.duration) }}')">anlegen</a>
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
					</span>
				</li>
			{% endfor %}
		</ul>
	</div>
	<div class="panel panel-default">
		<div class="panel-heading" style="height:50px">
			<h1 class="panel-title">
				Termine bei uns die nicht im Campus sind:
				<ul class="list-inline pull-right">
					<li><button class="btn btn-default" onclick="deleteall(); alert('done');">alle entfernen</button></li>
					<script>
						function deleteall() {
							var req = {};

							{% for i in deletedlectures|sort(attribute='time') %}
							req['lectures.{{ i.id }}.deleted'] = 1;
							{% endfor %}

							if (confirm('Really delete all lectures that are not in campus?')) {
								moderator.api.set_multi(req,false);
							}
						}
					</script>
				</ul>
			</h1>
		</div>
		<ul class="list-group-item">
			{% for i in deletedlectures|sort(attribute='time') %}
Andreas Valder's avatar
Andreas Valder committed
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
				<li class="list-group-item row">
					<span class="col-xs-3">
						Time: {{i.time}}
					</span>
					<span class="col-xs-2">
						Duration: {{i.duration}}
					</span>
					<span class="col-xs-3">
						Place: {{i.place}}
					</span>
					<span class="col-xs-3">
							<p>
								{{i.comment}}
							</p>
							<p>
								{{i.internal}}
							</p>
					</span>
Andreas Valder's avatar
Andreas Valder committed
124
					<span class="pull-right">
125
						{{ moderator_delete(['lectures',i.id,'deleted']) }}
Andreas Valder's avatar
Andreas Valder committed
126
					</span>
Andreas Valder's avatar
Andreas Valder committed
127
128
129
				</li>
			{% endfor %}
		</ul>
130

Andreas Valder's avatar
Andreas Valder committed
131
	</div>
Andreas Valder's avatar
Andreas Valder committed
132
133
</div>
{% endblock %}