Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ulakbus
ulakbus-ui
Commits
d33a248c
Commit
d33a248c
authored
Jul 26, 2016
by
Vladimir Baranov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rref #5385. Initial timetable implementation
parent
0d87f831
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
2 deletions
+129
-2
crud_controller.js
app/components/crud/crud_controller.js
+57
-1
crud.html
app/components/crud/templates/crud.html
+2
-1
timetable.html
app/components/crud/templates/timetable.html
+70
-0
No files found.
app/components/crud/crud_controller.js
View file @
d33a248c
...
...
@@ -483,4 +483,60 @@ angular.module('ulakbus.crud', ['schemaForm', 'ui.bootstrap', 'ulakbus.formServi
}
}
};
});
\ No newline at end of file
})
/**
* @memberof ulakbus.crud
* @ngdoc directive
* @name crudTimetableDirective
* @description directive for displaying timetable widget
*/
.
directive
(
"crudTimetableDirective"
,
function
(){
// todo: replace with utils service method
function
groupBy
(
list
,
propName
)
{
return
list
.
reduce
(
function
(
acc
,
item
)
{
(
acc
[
item
[
propName
]]
=
acc
[
item
[
propName
]]
||
[]).
push
(
item
);
return
acc
;
},
{});
};
return
{
templateUrl
:
'components/crud/templates/timetable.html'
,
restrict
:
'E'
,
replace
:
true
,
link
:
function
(
iScope
,
iElem
,
iAtrrs
){
console
.
log
(
"SXF: "
,
iScope
.
ogretim_elemani_zt
);
iScope
.
lecturerList
=
iScope
.
ogretim_elemani_zt
.
ogretim_elemanlari
;
iScope
.
currentLecturer
=
{
key
:
iScope
.
ogretim_elemani_zt
.
oe_key
,
name
:
iScope
.
ogretim_elemani_zt
.
name
,
avatar_url
:
iScope
.
ogretim_elemani_zt
.
avatar_url
,
totalHours
:
iScope
.
ogretim_elemani_zt
.
toplam_ders_saati
};
iScope
.
availableStates
=
[
{
value
:
1
,
name
:
"Uygun"
},
{
value
:
2
,
name
:
"Belirsiz"
},
{
value
:
3
,
name
:
"Meşgul"
}
];
prepareTimetable
(
iScope
.
ogretim_elemani_zt
.
uygunluk_durumu
);
function
prepareTimetable
(
timetable
){
var
grouped
=
groupBy
(
timetable
,
"saat"
);
for
(
var
day
in
grouped
){
var
dayItems
=
grouped
[
day
];
grouped
[
day
]
=
dayItems
.
sort
(
function
(
a
,
b
){
return
a
.
gun
<
b
.
gun
?
-
1
:
1
;
});
}
iScope
.
timetable
=
grouped
;
}
iScope
.
selectLecturer
=
function
(){
}
}
}
});
app/components/crud/templates/crud.html
View file @
d33a248c
...
...
@@ -5,9 +5,10 @@
<crud-show-directive
ng-if=
"object"
></crud-show-directive>
<crud-form-directive
ng-if=
"forms"
></crud-form-directive>
<crud-list-directive
ng-if=
"objects"
></crud-list-directive>
<crud-timetable-directive
ng-if=
"ogretim_elemani_zt"
></crud-timetable-directive>
</div>
<crud-filters
ng-show=
"meta.allow_filters === true"
class=
"col-md-4 filtre"
></crud-filters>
</div>
<div
ng-show=
"show_crud === false"
class=
"crud-mask"
>
<span
class=
"loader"
></span>
</div>
\ No newline at end of file
</div>
app/components/crud/templates/timetable.html
0 → 100644
View file @
d33a248c
<div
class=
"row academician-dashboard dashboard"
>
<div
class=
"col-md-12 course-prg-scheduler"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<div
class=
"panel-title"
>
Course Scheduler Widget
</div>
</div>
<div
class=
"panel-body"
>
<div
class=
"col-xs-3"
>
<!-- required for floating -->
<!-- Nav tabs -->
<ul
class=
"nav nav-tabs tabs-left"
>
<li
ng-repeat=
"lecturer in lecturerList"
ng-click=
"selectLecturer(lecturer)"
ng-class=
"{active: currentLecturer.key == lecturer.key}"
><a>
{{lecturer.name}}
</a></li>
</ul>
</div>
<div
class=
"col-xs-9"
>
<!-- Tab panes -->
<div
class=
"tab-content"
>
<div
class=
"tab-pane active"
id=
"one"
>
<div
class=
"info-header clearfix"
>
<div
class=
"info-wrapper"
>
<img
ng-src=
"{{currentLecturer.avatar_url}}"
class=
"profile-pic"
>
<span
class=
"user-name"
>
{{currentLecturer.name}}
</span>
</div>
<div
class=
"info-wrapper"
>
<div
style=
"margin-top:14px;"
>
<span>
Ders Yükü:
</span>
<span>
{{currentLecturer.totalHours}} saat
</span>
</div>
</div>
</div>
<!-- end of header -->
<div
class=
"table-warning"
>
<span
class=
"glyphicon glyphicon-exclamation-sign"
></span>
Tabloda en az 30 saat uygun olarak işaretlemelisiniz.
</div>
<table
border=
"1"
>
<tbody>
<tr
class=
"headers"
>
<td></td>
<td>
PZT
</td>
<td>
SAL
</td>
<td>
ÇAR
</td>
<td>
PER
</td>
<td>
CUM
</td>
<td>
CMT
</td>
<td>
PAZ
</td>
</tr>
<tr
ng-repeat=
"(time, days) in timetable"
>
<td>
{{time}}
</td>
<td
ng-repeat=
"day in days"
>
<select
ng-model=
"day.durum"
class=
"form-control"
ng-options=
"option.value as option.name for option in availableStates"
>
</select>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- end of panel-body -->
</div>
<!-- end of panel -->
</div>
</div>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment