Commits

reorx  committed 4669b7f

...go on ING

  • Participants
  • Parent commits 50a4d12

Comments (0)

Files changed (52)

File Reference/__init__.py

Empty file added.

File Reference/__init__.pyc

Binary file added.

File Reference/fn.py

+#coding=utf-8
+import datetime
+date_today = datetime.date.today()
+
+def str_to_date(s):
+    elmt = s.split('-')
+    dy,dm,dd = elmt[0:3]
+    dy = int(dy)
+    dm = int(dm)
+    dd = int(dd)
+    date = datetime.date(dy,dm,dd)
+    return date
+
+def date_to_week(date):
+    s = str(date)
+    a = s.split('-')
+    y,m,d = a[0:3]
+    y = int(y)
+    m = int(m)
+    d = int(d)
+    weekday_oneday = date.weekday()
+    Mon = date + datetime.timedelta(days = -weekday_oneday)
+    Sun = Mon + datetime.timedelta(days = 6)
+    return Mon,Sun
+

File Reference/fn.pyc

Binary file added.

File Reference/objects.py

+#coding=utf-8
+class Words:
+    login = u'签到成功~'
+    came = u'你已经来了呃..'
+    unexist = u'成员不存在'
+    error = u'写入不正确,请重试'
+    logout = u'签出成功~'
+    gone = u'你不是已经走了吗??'
+    uncame = u'你还没签到啊..'
+

File Reference/objects.pyc

Binary file added.

File duty/__init__.pyc

Binary file added.

File duty/admin.pyc

Binary file added.

File duty/getdb.py

 from member.models import Member
 import datetime,time
 
+from zq_onduty.Reference import fn
+
 date_today = datetime.date.today()
 ###############
 #check & create
 def get_dateinfo_all():
     return Dateinfo.objects.all().order_by('date')
 
-def get_dateinfo_duty_thisweek():
-    thisweek_mon = date_today + datetime.timedelta(days = -date_today.weekday())
-    _w = Weekarrange.objects.get(startday=thisweek_mon)
-
-    dateinfo_duty_thisweek = []
-    dateinfo_list = Dateinfo.objects.filter(inarrange=_w).order_by('date')
-    duty_mor_list = []
-    duty_aft_list = []
-    duty_nig_list = []
-
-    for dateinfo in dateinfo_list:
-        __duty = Dutyinfo.objects.filter(date_duty=dateinfo.id)
-        duty_mor_list.append(__duty.filter(cometime__gt='00:00:00').filter(cometime__lt='12:00:00'))
-        duty_aft_list.append(__duty.filter(cometime__gte='12:00:00').filter(cometime__lt='19:00:00'))
-        duty_nig_list.append(__duty.filter(cometime__gte='19:00:00'))
-    for i in range(len(dateinfo_list)):
-        dateinfo_duty_thisweek.append((dateinfo_list[i], duty_mor_list[i], duty_aft_list[i], duty_nig_list[i]))
-    return dateinfo_duty_thisweek
-
 def get_dateinfo_duty_oneweek(date_oneday):
     #[get date]
-    elmt = date_oneday.split('-')
-    dy,dm,dd = elmt[0:3]
-    dy = int(dy)
-    dm = int(dm)
-    dd = int(dd)
-    date_oneday = datetime.date(dy,dm,dd)
+    if type(date_oneday) == str:
+        date_oneday = fn.str_to_day(date_oneday)
     #end [get date]
     oneweek_mon = date_oneday + datetime.timedelta(days = -date_oneday.weekday())
     _w = Weekarrange.objects.get(startday=oneweek_mon)
     duty_mor_list = []
     duty_aft_list = []
     duty_nig_list = []
+    duty_absence_list = []
 
     for dateinfo in dateinfo_list:
         __duty = Dutyinfo.objects.filter(date_duty=dateinfo.id)
         duty_mor_list.append(__duty.filter(cometime__gt='00:00:00').filter(cometime__lt='12:00:00'))
         duty_aft_list.append(__duty.filter(cometime__gte='12:00:00').filter(cometime__lt='19:00:00'))
         duty_nig_list.append(__duty.filter(cometime__gte='19:00:00'))
+        duty_absence_list.append(__duty.filter(if_set=1).filter(if_come=0))
     for i in range(len(dateinfo_list)):
-        dateinfo_duty_oneweek.append((dateinfo_list[i], duty_mor_list[i], duty_aft_list[i], duty_nig_list[i]))
+        dateinfo_duty_oneweek.append((dateinfo_list[i], duty_mor_list[i], duty_aft_list[i], duty_nig_list[i], duty_absence_list[i]))
     return dateinfo_duty_oneweek
 
-    #dateinfo_duty_oneweek = []
-    #dateinfo_list = Dateinfo.objects.filter(inarrange=w).order_by('date')
-    #dutyinfo_list = []
-    #for dateinfo in dateinfo_list:
-        #dutyinfo_list.append(Dutyinfo.objects.filter(date_duty=dateinfo.id))
-    #for i in range(len(dateinfo_list)):
-        #dateinfo_duty_oneweek.append((dateinfo_list[i], dutyinfo_list[i]))
-    #return dateinfo_duty_oneweek
-
 def get_dateinfo_duty_oneday(dd):
     da = Dateinfo.objects.get(date=dd)
     du = Dutyinfo.objects.filter(date_duty=da.id)
             dutyinfo = dutyinfo.get()
             dutyinfo.if_set = 1
             dutyinfo.save()
+            print 'saved'
         else:
             dutyinfo = Dutyinfo(
                 date_duty=d,

File duty/getdb.pyc

Binary file added.

File duty/models.pyc

Binary file added.

File duty/query/__init__.py

Empty file added.

File duty/query/check.py

+#coding=utf-8
+from zq_onduty.duty.models import Dutyinfo,Dateinfo,Weekarrange
+from zq_onduty.member.models import Member
+
+from zq_onduty.Reference import fn
+
+import datetime,time
+date_today = datetime.date.today()
+
+def c_c_dateinfo(d,__w):
+    check = Dateinfo.objects.filter(date=d)
+    if not check:
+        create = Dateinfo(date=d,log='-',inarrange=__w)
+        create.save()
+    return Dateinfo.objects.get(date=d)
+
+def c_c_weekarrange(oneday):
+    monday = oneday + datetime.timedelta(days = -oneday.weekday())
+    check_week = Weekarrange.objects.filter(startday = monday)
+    if not check_week:
+        weekarrange_query = Weekarrange(startday = monday)
+        weekarrange_query.save()

File duty/query/get.py

+#coding=utf-8
+from zq_onduty.duty.models import Dutyinfo,Dateinfo,Weekarrange
+from zq_onduty.member.models import Member
+
+from zq_onduty.Reference import fn
+
+import datetime,time
+date_today = datetime.date.today()
+
+def get_come_today():
+    date_today = datetime.date.today()
+    d = Dateinfo.objects.get(date=date_today)
+    duty_list = Dutyinfo.objects.filter(date_duty=d, cometime__isnull=False)
+    mem_list = []
+    for _d in duty_list:
+        mem_list.append((Member.objects.get(name=_d.name_member), _d.gotime))
+    return mem_list
+
+def get_come_all():
+    return Dutyinfo.objects.all()
+
+def get_come_certain():
+    #yeah~~
+    date_c= '2010-11-09'
+    return Dutyinfo.objects.filter(date_duty=date_c)
+
+def get_dateinfo_all():
+    return Dateinfo.objects.all().order_by('date')
+
+def get_dateinfo_duty_oneweek(date_oneday):
+    #[get date]
+    if type(date_oneday) == str:
+        date_oneday = fn.str_to_day(date_oneday)
+    #end [get date]
+    oneweek_mon = date_oneday + datetime.timedelta(days = -date_oneday.weekday())
+    _w = Weekarrange.objects.get(startday=oneweek_mon)
+
+    dateinfo_duty_oneweek = []
+    dateinfo_list = Dateinfo.objects.filter(inarrange=_w).order_by('date')
+    duty_mor_list = []
+    duty_aft_list = []
+    duty_nig_list = []
+    duty_absence_list = []
+
+    for dateinfo in dateinfo_list:
+        __duty = Dutyinfo.objects.filter(date_duty=dateinfo.id)
+        duty_mor_list.append(__duty.filter(cometime__gt='00:00:00').filter(cometime__lt='12:00:00'))
+        duty_aft_list.append(__duty.filter(cometime__gte='12:00:00').filter(cometime__lt='19:00:00'))
+        duty_nig_list.append(__duty.filter(cometime__gte='19:00:00'))
+        duty_absence_list.append(__duty.filter(if_set=1).filter(if_come=0))
+    for i in range(len(dateinfo_list)):
+        dateinfo_duty_oneweek.append((dateinfo_list[i], duty_mor_list[i], duty_aft_list[i], duty_nig_list[i], duty_absence_list[i]))
+    return dateinfo_duty_oneweek
+
+def get_dateinfo_duty_oneday(dd):
+    da = Dateinfo.objects.get(date=dd)
+    du = Dutyinfo.objects.filter(date_duty=da.id)
+    #tmd哥也会封装类了
+    class x:
+        week = (da.date.weekday() + 1)
+        date = da.date
+        duty = du
+        log = da.log
+        id = da.id
+    dateinfo_duty_today = x
+    return dateinfo_duty_today
+######
+#week
+######
+def get_mem_inarrange_oneday(d):
+    _d = Dateinfo.objects.get(date=d)
+    if _d.come_set == None:
+        return ''
+    elif _d.come_set == '':
+        return ''
+    else:
+        mem = _d.come_set.split('-')
+        __m = []
+        for m in mem:
+            __m.append(Member.objects.get(id=int(m)))
+        return __m
+
+def get_oneweek(oneday):
+    c_c_weekarrange(oneday) #ensure week
+    ###args
+    mon = oneday + datetime.timedelta(days = -oneday.weekday())
+    _w = Weekarrange.objects.get(startday=mon)
+    ###
+    week_list = []
+    for i in range(7): #get week's info 
+        d = mon + datetime.timedelta(days = i)
+        week_list.append(c_c_dateinfo(d,_w))
+    mem_list = []
+    for j in range(7): #get member arrange
+        d = mon + datetime.timedelta(days = j)
+        mem_list.append(get_mem_inarrange_oneday(d))
+    week_mem_list = []
+    for k in range(7): #append member with week's info
+        week_mem_list.append((week_list[k], mem_list[k]))
+    return week_mem_list

File duty/query/set.py

+#coding=utf-8
+from zq_onduty.duty.models import Dutyinfo,Dateinfo,Weekarrange
+from zq_onduty.member.models import Member
+
+from zq_onduty.Reference import fn
+
+import datetime,time
+date_today = datetime.date.today()
+
+def set_date_shouldcome(d,m):
+    dateinfo = Dateinfo.objects.get(date=d)
+    dateinfo.come_set = m
+    dateinfo.save()
+    print dateinfo.come_set
+
+def set_duty_shouldcome(d,m):
+    if m == '':
+        print 'null'
+    elif m == None:
+        print 'none'
+    else:
+        d = Dateinfo.objects.get(date=d)
+        name_member = Member.objects.get(id=int(m))
+        name_member = name_member.name
+        print name_member
+        dutyinfo = Dutyinfo.objects.filter(date_duty=d).filter(name_member=name_member)
+        if dutyinfo:
+            dutyinfo = dutyinfo.get()
+            dutyinfo.if_set = 1
+            dutyinfo.save()
+            print 'saved'
+        else:
+            dutyinfo = Dutyinfo(
+                date_duty=d,
+                name_member=name_member,
+                if_set=1,
+            )
+            dutyinfo.save()

File duty/reference/__init__.py

Empty file removed.

File duty/reference/fn.py

-#coding=utf-8
-import datetime
-date_today = datetime.date.today()
-
-def str_to_date(s):
-    elmt = s.split('-')
-    dy,dm,dd = elmt[0:3]
-    dy = int(dy)
-    dm = int(dm)
-    dd = int(dd)
-    date = datetime.date(dy,dm,dd)
-    return date

File duty/reference/objects.py

-#coding=utf-8
-class Words:
-    login = u'签到成功~'
-    came = u'你已经来了呃..'
-    unexist = u'成员不存在'
-    error = u'写入不正确,请重试'
-    logout = u'签出成功~'
-    gone = u'你不是已经走了吗??'
-    uncame = u'你还没签到啊..'
-

File duty/urls/__init__.pyc

Binary file added.

File duty/urls/arrange.py

 from zq_onduty.duty.views import arrange
 
 urlpatterns = patterns('',
-    (r'^list/', arrange.week_oneweek),
-    (r'^list_oneweek/', arrange.week_oneweek_ajax),
-    (r'^set_week_info/', arrange.setWeekInfo),
-    (r'^member_select/', arrange.memberSelect),
-    (r'^member_submit/', arrange.memberSubmit),
-    (r'^next/',arrange.week_next),
+    (r'^$', arrange.oneweek),
+    (r'^list/', arrange.oneweek),
+    (r'^list_oneweek/', arrange.oneweek_block),
+    (r'^set_week_info/', arrange.set_info),
+    (r'^member_select/', arrange.member_select),
+    (r'^member_submit/', arrange.member_submit),
+    (r'^next/',arrange.next),
 )

File duty/urls/arrange.pyc

Binary file added.

File duty/urls/record.py

 
 #/duty/  #classified by Model ?
 urlpatterns = patterns('',
-    (r'^memberCome/', record.memberCome),
-    (r'^memberGo/', record.memberGo),
+    (r'^member_come/', record.memberCome),
+    (r'^member_go/', record.memberGo),
+    (r'^$', record.duty_list_main),
     (r'^list/', record.duty_list_main),
     (r'^list_oneweek/', record.duty_list_oneweek),
     (r'^list_oneday/', record.duty_list_oneday),
-    (r'^setDateLog/', record.setDateLog),
+    (r'^set_log/', record.set_log),
 )

File duty/urls/record.pyc

Binary file added.

File duty/views/__init__.pyc

Binary file added.

File duty/views/arrange.py

 
 from zq_onduty.duty.models import Dutyinfo,Dateinfo,Weekarrange
 from zq_onduty.member.models import Member
+#from zq_onduty.duty import getdb as getdb_duty
+#from zq_onduty.member import getdb as getdb_member
 from zq_onduty.duty import getdb as getdb_duty
 from zq_onduty.member import getdb as getdb_member
 
 import datetime
 date_today = datetime.date.today()
 
-from zq_onduty.duty.reference import fn  #function used
-from zq_onduty.duty.reference.objects import Words  #class used
+from zq_onduty.Reference import fn  #function used
+from zq_onduty.Reference.objects import Words  #class used
 
-def week_oneweek(request):
+def oneweek(request):
     if request.GET.get('date') == None:
         thisweek_mon = date_today + datetime.timedelta(days = -date_today.weekday())
         w = Weekarrange.objects.get(startday=thisweek_mon)
         week_mem_list = getdb_duty.get_oneweek(date_today)
 
-        return render_to_response('week/list.html',{
+        return render_to_response('arrange/list.html',{
                 'week_mem_list' : week_mem_list,
                 'week_info' : w,
                 'date_server' : date_today,
             context_instance=RequestContext(request)
         )
 
-def week_oneweek_ajax(request):
+def oneweek_block(request):
     oneday_str = request.GET.get('date')
     ###
     oneday_date = fn.str_to_date(oneday_str)
         w = w.get()
         week_mem_list = getdb_duty.get_oneweek(oneday_date)
 
-        t = get_template('week/week_block.html')
+        t = get_template('arrange/week_block.html')
         c = Context({
                 'week_mem_list' : week_mem_list,
                 'week_info' : w,
     else:
         return HttpResponse('sorry, nothing')
 
-def setWeekInfo(request):
+def set_info(request):
     varId = int(request.GET.get('id'))
     varV = request.GET.get('v')
     varElmt = request.GET.get('elmt')
     w.save()
     return HttpResponse(x + ' 已更改.周')
 
-def setDateLog(request):
-    varId = int(request.GET.get('id'))
-    varLog = request.GET.get('log')
-    print 'setDateLog'
-    d = Dateinfo.objects.get(id=varId)
-    d.log = varLog
-    d.save()
-    print d.log
-    return HttpResponse('日志 已更改.日')
-
-def week_next(request):
+def next(request):
     date_ofnextweek = datetime.date.today() + datetime.timedelta(days=7)
     week_mem_list = getdb_duty.get_oneweek(date_ofnextweek)
 
     d = date_ofnextweek
     m = d + datetime.timedelta(days = -d.weekday())
     w = Weekarrange.objects.get(startday = m)
-    t = get_template('week/week_block.html')
+    t = get_template('arrange/week_block.html')
     c = Context({
             'week_mem_list' : week_mem_list,
             'week_info' : w,
 #######################
 #member select
 #######################
-def memberSelect(request):
+def member_select(request):
     d = request.GET.get('date')
-    t = get_template('week/member_block.html')
+    t = get_template('arrange/member_block.html')
     dpmt_mem_list = getdb_member.get_mem_by_dpmt_all()
     memShouldComeList = getdb_duty.get_mem_inarrange_oneday(d)
     c = Context({
         })
     return HttpResponse(t.render(c))
 
-def memberSubmit(request):
+def member_submit(request):
     date = request.GET.get('date')
     mem = request.GET.get('mem')
     #清空之

File duty/views/arrange.pyc

Binary file added.

File duty/views/record.py

 import datetime
 date_today = datetime.date.today()
 
-from zq_onduty.duty.reference import fn  #function used
-from zq_onduty.duty.reference.objects import Words  #class used
+from zq_onduty.Reference import fn  #function used
+from zq_onduty.Reference.objects import Words  #class used
 
 def memberCome(request):
     n_member = request.POST.get('name')
 ###############################
 @permission_required('duty.can_read')
 def duty_list_main(request):
-    dateinfo_duty_thisweek_list = getdb_duty.get_dateinfo_duty_thisweek()
+    dateinfo_duty_thisweek_list = getdb_duty.get_dateinfo_duty_oneweek(date_today)
     dateinfo_duty_today = getdb_duty.get_dateinfo_duty_oneday(date_today)
 
-    return render_to_response('duty/list.html',{
+    return render_to_response('record/list.html',{
         'd' : dateinfo_duty_today,
         'dateinfo_duty_week_list' : dateinfo_duty_thisweek_list,
         'date_server' : date_today,
 def duty_list_oneweek(request):
     oneday_str = request.GET.get("date")
     dateinfo_duty_oneweek_list = getdb_duty.get_dateinfo_duty_oneweek(oneday_str)
-    t = get_template('duty/week_block.html')
+    t = get_template('record/week_block.html')
     c = Context({
         'dateinfo_duty_week_list' : dateinfo_duty_oneweek_list,
         }
 def duty_list_oneday(request):
     oneday_str = request.GET.get("date")
     dateinfo_duty_oneday = getdb_duty.get_dateinfo_duty_oneday(oneday_str)
-    t = get_template('duty/day_block.html')
+    t = get_template('record/day_block.html')
     c = Context({
         'd' : dateinfo_duty_oneday,
         }
     print 'oneday'
     return HttpResponse(t.render(c))
 
-def setDateLog(request):
+def set_log(request):
     varId = int(request.GET.get('id'))
     varLog = request.GET.get('log')
     print 'setDateLog'

File duty/views/record.pyc

Binary file added.

File static/css/duty_list.css

-/*general*/
-/*layout*/
-#list_day {}
-#list_week {}
-
-/*main*/
-.listTitle {
-    padding: 10 0 2 6;
-    border-bottom: 3px solid #61cde2;
-    width: 80px;
-    font-size: 18px; font-weight: bold;
-    color: #333;
-}
-.listContainer {
-    font-size: 12px;
-    margin: 10px;
-}
-    .dutyContainer {
-        border-left: 0px solid #555;
-        width: 350px;float: left; overflow: hidden;
-        margin: 0 0 5 0;padding: 5 0 0 30;
-        position: relative;
-        background: url('/static/img/bg_duty_period.png') repeat-y;
-    }
-    .dutyPeriod {
-        position: absolute;left: 0px;top: 0px;
-        width: 17px;height: 40px;
-        padding: 3 0 0 3;
-        color: white;font-size: 13px;font-weight: bold;
-        background: #555;
-        text-decoration: none;
-    }
-        .dutyMem {
-            font-weight: bold;
-            border-bottom: 1px solid; border-left: 1px solid;
-            width: 330px;height: 30px;float: left;
-            margin: 0 0 8 0;
-        }
-            .memName {
-                float: left; width: 45px;
-                border-top: 1px solid; border-right: 1px solid;
-                text-align: center;
-                margin: 0 5 0 0;
-            }
-            .memInfo {
-                float: left; width: 250px;
-                font-size: 12px;
-            }
-                .memInfoUp { }
-                .memInfoDown { }
-                    .infoTitle {
-                        margin: 0 5 0 0;
-                        font-weight: 100;
-                        color: #888;
-                    }
-                    .infoContent {
-                        margin: 0 10 0 0;
-                        font-weight: 100;
-                        color: #333;
-                    }
-
-/*color*/
-.color_member11 {
-    color: #a2ef00;
-}
-.color_member10 {
-    color: #ffde00;
-}
-.color_member01 {
-    color: #ea0037;
-}
-/*border*/
-.lightBorder {
-    border-color: #ccc;
-}
-/*special*/
-.nobody {
-    text-decoration: line-through;
-}

File static/css/record.css

+/*general*/
+/*layout*/
+#list_day {}
+#list_week {}
+
+/*main*/
+.listTitle {
+    padding: 10 0 2 6;
+    border-bottom: 3px solid #61cde2;
+    width: 80px;
+    font-size: 18px; font-weight: bold;
+    color: #333;
+}
+.listContainer {
+    font-size: 12px;
+    margin: 10px;
+}
+    .dutyContainer {
+        border-left: 0px solid #555;
+        width: 350px;float: left; overflow: hidden;
+        margin: 0 0 5 0;padding: 5 0 0 30;
+        position: relative;
+        background: url('/static/img/bg_duty_period.png') repeat-y;
+    }
+    .dutyPeriod {
+        position: absolute;left: 0px;top: 0px;
+        width: 17px;height: 40px;
+        padding: 3 0 0 3;
+        color: white;font-size: 13px;font-weight: bold;
+        background: #555;
+        text-decoration: none;
+    }
+        .dutyMem {
+            font-weight: bold;
+            border-bottom: 1px solid; border-left: 1px solid;
+            width: 330px;height: 30px;float: left;
+            margin: 0 0 8 0;
+        }
+        .dutyMem_ab {
+            font-weight: bold;
+            border-bottom: 1px solid; border-left: 1px solid;
+            width: 50px;height: 20px;float: left;
+            margin: 0 0 8 0;
+        }
+            .memName {
+                float: left; width: 45px;
+                border-top: 1px solid; border-right: 1px solid;
+                text-align: center;
+                margin: 0 5 0 0;
+            }
+            .memInfo {
+                float: left; width: 250px;
+                font-size: 12px;
+            }
+                .memInfoUp { }
+                .memInfoDown { }
+                    .infoTitle {
+                        margin: 0 5 0 0;
+                        font-weight: 100;
+                        color: #888;
+                    }
+                    .infoContent {
+                        margin: 0 10 0 0;
+                        font-weight: 100;
+                        color: #333;
+                    }
+
+/*color*/
+.color_member11 {
+    color: #a2ef00;
+}
+.color_member10 {
+    color: #ffde00;
+}
+.color_member01 {
+    color: #ea0037;
+}
+/*border*/
+.lightBorder {
+    border-color: #ccc;
+}
+/*special*/
+.nobody {
+    text-decoration: line-through;
+}

File static/js/arrange_list.js

+function hideBoard() { $('#m-b-content').hide(); }
+
+$(document).ready(function(){
+    hideBoard();
+    $('#datepicker_frame').DatePicker({
+        flat: true,
+        date: '{{ date_server|date:"Y-m-d" }}',
+        starts: 1,
+        onChange: function(formated, dates){
+            $('#m-b-head').html(formated);
+            //jquery中可以调用普通函数啊
+            //var url_week = '/arrange/list_oneweek/?date='+formated;
+            //$('#week').load(url_week);
+            $.ajax({
+                type:'GET',
+                url:'/arrange/list_oneweek/',
+                data:'date='+formated,
+                success: function(html) {
+                    $('#week').html(html);
+                    $.fancybox.hideActivity();
+                }
+            });
+            $.fancybox.showActivity();
+        }
+    });
+
+    $('#nextweek').click(function() {
+        var url = '/arrange/next/';
+        $.get(url,function(html){
+            $('#week').html(html);
+            $.fancybox.hideActivity();
+        })
+        $.fancybox.showActivity();
+    });
+});

File static/js/changeLog.js

-var DOM_ONCLICK; //Global
-var DATE_ID; //Global
-
-//change log
-function setLog(id,date) {
-    DATE_ID = id; //Global
-    var dom_id = '#log_'+id;
-    DOM_ONCLICK = $(dom_id); //Global
-    //
-    var h = $('#m-b-head');
-    var c = $('#m-b-content');
-    h.html(date);
-    c.val(DOM_ONCLICK.html()).css({display:'inline'}).focus();
-}
-
-function submitContent() {
-    var log = $('#m-b-content').val();
-    $.ajax({
-        type: 'GET',
-        url: '/record/setDateLog/',
-        data: 'id='+DATE_ID+'&log='+log,
-        success: function(status) {
-            DOM_ONCLICK.html(log)
-            chgStatus_noclock(status);
-        }
-    });
-}
-//calendar
-function oneWeek(date) {
-    $.ajax({
-        type: 'GET',
-        url: '/record/list_oneweek/',
-        data: 'date='+date,
-        success: function(html) {
-            $('#list_week').html(html);
-            heightRelay(); //function in duty_list.js
-        },
-        error: function() {
-            chgStatus_noclock('此周无记录');
-        }
-    });
-}
-
-function oneDay(date) {
-    $.ajax({
-        type: 'GET',
-        url: '/record/list_oneday/',
-        data: 'date='+date,
-        success: function(html) {
-            $('#list_day').html(html);
-            heightRelay(); //function in duty_list.js
-            setStatus(date);
-        },
-        //error: function() {
-        //}
-    });
-}
-
-/*a block of orign ajax...
-var ajax = new XMLHttpRequest(); //set ajax
-var url = "/duty/list_oneweek/?date=" + date;
-ajax.open("GET", url, true);
-ajax.send(null);
-ajax.onreadystatechange = function() {
-    if (ajax.readyState == 4 && ajax.status == 200){
-        document.getElementById("week_list").innerHTML = ajax.responseText;
-        heightRelay();
-    }else if (ajax.status == 500){
-        document.getElementById("status").innerHTML = '无记录';
-    }
-}
-*/

File static/js/change_arrangement.js

+function setOnboard(val) {
+    sqlid = val.getAttribute('sqlid'); //global
+
+    var title = val.getAttribute('title');
+    clickposition = val; //global
+    if (title == 'log'){
+        sendwhat = 'log';
+    }else if (title == 'datelog'){
+        sendwhat = 'datelog';
+    }else if (title == 'name'){
+        sendwhat = 'name';
+    }
+    var h = document.getElementById("m-b-head");
+    var c = document.getElementById("m-b-content");
+    h.innerHTML = title;
+    c.value = val.innerHTML;
+
+    c.style.display = 'inline';
+    c.focus();
+}
+
+function submitContent(b) {
+    var ajax = new XMLHttpRequest(); //set ajax
+    if (sendwhat == 'name' || sendwhat == 'log'){
+        changeWeekInfo(b);
+    }else if (sendwhat == 'datelog'){
+        changeDatelog(b);
+    }
+
+    clickposition.innerHTML = b.value;
+    hideBoard();
+}
+
+function changeWeekInfo(b) {
+    var ajax = new XMLHttpRequest();
+    var url = "/arrange/set_week_info/?id=" + sqlid + "&v=" + b.value + "&elmt=" + sendwhat;
+    ajax.open("GET", url, true);
+    ajax.send(null);
+    ajax.onreadystatechange = function(){
+        if (ajax.readyState == 4 && ajax.status == 200)
+        document.getElementById("m-b-head").innerHTML = ajax.responseText;
+    }
+}
+
+function changeDatelog(b) {
+    var ajax = new XMLHttpRequest(); //set ajax
+    var url = "/record/setDateLog/?id=" + sqlid + "&log=" + b.value;
+    ajax.open("GET", url, true);
+    ajax.send(null);
+    ajax.onreadystatechange = function() {
+        if (ajax.readyState == 4 && ajax.status == 200)
+        document.getElementById("m-b-head").innerHTML = ajax.responseText;
+    }
+}
+//member select
+var date_selectmember;
+var datepickerDOM;
+function setBoard(b) {
+    //set global var
+    date_selectmember = b.getAttribute('dateofit');
+    //change Board
+    //var d = $('#datepicker_frame');
+    //d.DatePickerHide().hide();
+    datepickerDOM = $('#datepicker_container');
+    var c = $('#modify-board');
+    c.css("width", "300px").css("height", "400px").css("z-index", "6");
+    //ajax request
+    var ajax = new XMLHttpRequest(); //set ajax
+    var url = "/arrange/member_select/?date="+date_selectmember;
+    ajax.open("GET", url, true);
+    ajax.send(null);
+    var html;
+    ajax.onreadystatechange = function() {
+        if (ajax.readyState == 4 && ajax.status == 200){
+            document.getElementById('modify-board').innerHTML = ajax.responseText;
+            //define event
+            $('.box').hide();
+            $('a[class*="tab"]').click(function() {
+                var dpmt = $(this).attr('dpmt');
+                dpmtid = '#memof' + dpmt;
+                $('.box').hide();
+                $(dpmtid).show(); //show .box
+                $('a[class*="tab"]').removeClass('active'); //reset color
+                $(this).addClass('active'); //add color
+                return false;
+            });
+            $('.box').eq(0).show();
+            //alt by arrangeed
+            $(function(){
+                $('h1').html('arrange');
+            });
+        }
+    }
+    //end
+}

File static/js/change_log.js

+var DOM_ONCLICK; //Global
+var DATE_ID; //Global
+
+//change log
+function setLog(id,date) {
+    DATE_ID = id; //Global
+    var dom_id = '#log_'+id;
+    DOM_ONCLICK = $(dom_id); //Global
+    //
+    var h = $('#m-b-head');
+    var c = $('#m-b-content');
+    h.html(date);
+    c.val(DOM_ONCLICK.html()).css({display:'inline'}).focus();
+}
+
+function submitContent() {
+    var log = $('#m-b-content').val();
+    $.ajax({
+        type: 'GET',
+        url: '/record/set_log/',
+        data: 'id='+DATE_ID+'&log='+log,
+        success: function(status) {
+            DOM_ONCLICK.html(log)
+            chgStatus_noclock(status);
+        }
+    });
+}
+//calendar
+function oneWeek(date) {
+    $.ajax({
+        type: 'GET',
+        url: '/record/list_oneweek/',
+        data: 'date='+date,
+        success: function(html) {
+            $('#list_week').html(html);
+            heightRelay(); //function in duty_list.js
+        },
+        error: function() {
+            chgStatus_noclock('此周无记录');
+        }
+    });
+}
+
+function oneDay(date) {
+    $.ajax({
+        type: 'GET',
+        url: '/record/list_oneday/',
+        data: 'date='+date,
+        success: function(html) {
+            $('#list_day').html(html);
+            heightRelay(); //function in duty_list.js
+            setStatus(date);
+        },
+        //error: function() {
+        //}
+    });
+}
+
+/*a block of orign ajax...
+var ajax = new XMLHttpRequest(); //set ajax
+var url = "/duty/list_oneweek/?date=" + date;
+ajax.open("GET", url, true);
+ajax.send(null);
+ajax.onreadystatechange = function() {
+    if (ajax.readyState == 4 && ajax.status == 200){
+        document.getElementById("week_list").innerHTML = ajax.responseText;
+        heightRelay();
+    }else if (ajax.status == 500){
+        document.getElementById("status").innerHTML = '无记录';
+    }
+}
+*/

File static/js/change_weekinfo.js

-function setOnboard(val) {
-    sqlid = val.getAttribute('sqlid'); //global
-
-    var title = val.getAttribute('title');
-    clickposition = val; //global
-    if (title == 'log'){
-        sendwhat = 'log';
-    }else if (title == 'datelog'){
-        sendwhat = 'datelog';
-    }else if (title == 'name'){
-        sendwhat = 'name';
-    }
-    var h = document.getElementById("m-b-head");
-    var c = document.getElementById("m-b-content");
-    h.innerHTML = title;
-    c.value = val.innerHTML;
-
-    c.style.display = 'inline';
-    c.focus();
-}
-
-function submitContent(b) {
-    var ajax = new XMLHttpRequest(); //set ajax
-    if (sendwhat == 'name' || sendwhat == 'log'){
-        changeWeekInfo(b);
-    }else if (sendwhat == 'datelog'){
-        changeDatelog(b);
-    }
-
-    clickposition.innerHTML = b.value;
-    hideBoard();
-}
-
-function changeWeekInfo(b) {
-    var ajax = new XMLHttpRequest();
-    var url = "/arrange/set_week_info/?id=" + sqlid + "&v=" + b.value + "&elmt=" + sendwhat;
-    ajax.open("GET", url, true);
-    ajax.send(null);
-    ajax.onreadystatechange = function(){
-        if (ajax.readyState == 4 && ajax.status == 200)
-        document.getElementById("m-b-head").innerHTML = ajax.responseText;
-    }
-}
-
-function changeDatelog(b) {
-    var ajax = new XMLHttpRequest(); //set ajax
-    var url = "/record/setDateLog/?id=" + sqlid + "&log=" + b.value;
-    ajax.open("GET", url, true);
-    ajax.send(null);
-    ajax.onreadystatechange = function() {
-        if (ajax.readyState == 4 && ajax.status == 200)
-        document.getElementById("m-b-head").innerHTML = ajax.responseText;
-    }
-}
-//member select
-var date_selectmember;
-var datepickerDOM;
-function setBoard(b) {
-    //set global var
-    date_selectmember = b.getAttribute('dateofit');
-    //change Board
-    //var d = $('#datepicker_frame');
-    //d.DatePickerHide().hide();
-    datepickerDOM = $('#datepicker_container');
-    var c = $('#modify-board');
-    c.css("width", "300px").css("height", "400px").css("z-index", "6");
-    //ajax request
-    var ajax = new XMLHttpRequest(); //set ajax
-    var url = "/arrange/member_select/?date="+date_selectmember;
-    ajax.open("GET", url, true);
-    ajax.send(null);
-    var html;
-    ajax.onreadystatechange = function() {
-        if (ajax.readyState == 4 && ajax.status == 200){
-            document.getElementById('modify-board').innerHTML = ajax.responseText;
-            //define event
-            $('.box').hide();
-            $('a[class*="tab"]').click(function() {
-                var dpmt = $(this).attr('dpmt');
-                dpmtid = '#memof' + dpmt;
-                $('.box').hide();
-                $(dpmtid).show(); //show .box
-                $('a[class*="tab"]').removeClass('active'); //reset color
-                $(this).addClass('active'); //add color
-                return false;
-            });
-            $('.box').eq(0).show();
-            //alt by arrangeed
-            $(function(){
-                $('h1').html('arrange');
-            });
-        }
-    }
-    //end
-}

File static/js/duty_list.js

-//function used
-function hideBoard() { 
-    $('#m-b-head').html('Modify Board');
-    $("#m-b-content").hide();
-}
-
-//JS_relay
-function heightRelay() {
-    var x = [];
-    x = $('.dutyContainer');
-    var len = x.length;
-    for (var i=0;i<len;i++){
-        if (x.eq(i).children().length == 1){
-            x.eq(i).css({height: '30px'}).append('<div class=nobody>木有人</div>');
-        }
-    }
-}
-
-$(document).ready(function() {
-    heightRelay();
-    hideBoard();
-    $('#datepicker_frame').DatePicker({
-        flat: true,
-        //date: '2010-12-09',
-        date: '{{ date_server|date:"Y-m-d" }}',
-        starts: 1,
-        onChange: function(formated, dates){
-            oneWeek(formated);
-            oneDay(formated);
-        }
-    });
-});

File static/js/login-and-logout.js

         //ajax及其中success与之后语句响应顺序 some quest...
         $.ajax({
             type: 'POST',
-            url: '/record/memberCome/',
+            url: '/record/member_come/',
             data: 'name='+n+'&password='+p,
             success: function(status){
                 chgStatus(status);
         //ajax及其中success与之后语句响应顺序 some quest...
         $.ajax({
             type: 'POST',
-            url: '/record/memberGo/',
+            url: '/record/member_go/',
             data: 'name='+n+'&password='+p,
             success: function(status){
                 //$('#status').html(status).fadeOut('slow').fadeIn('slow');

File static/js/record.js

+//function used
+function hideBoard() { 
+    $('#m-b-head').html('Modify Board');
+    $("#m-b-content").hide();
+}
+
+//JS_relay
+function heightRelay() {
+    var x = [];
+    x = $('.dutyContainer');
+    var len = x.length;
+    for (var i=0;i<len;i++){
+        if (x.eq(i).children().length == 1){
+            x.eq(i).css({height: '30px'}).append('<div class=nobody>木有人</div>');
+        }
+    }
+}
+
+$(document).ready(function() {
+    heightRelay();
+    hideBoard();
+    $('#datepicker_frame').DatePicker({
+        flat: true,
+        //date: '2010-12-09',
+        date: '{{ date_server|date:"Y-m-d" }}',
+        starts: 1,
+        onChange: function(formated, dates){
+            oneWeek(formated);
+            oneDay(formated);
+        }
+    });
+});

File tag_zqonduty/templatetags/filter_extra.py

 
 @register.filter
 def judgetime(timeget):
-    s = timeget.strftime('%H%M%S')
-    i = int(s)
-    if i < 000002:
-        style = 'on'
+    if timeget == None:
+        style = '没来'
     else:
-        style = 'off'
+        s = timeget.strftime('%H%M%S')
+        i = int(s)
+        if i < 000002:
+            style = 'on'
+        else:
+            style = 'off'
     return style
 judgetime.is_safe = True
 
 @register.filter
 def judgetimeOnlygo(timeget):
-    s = timeget.strftime('%H%M%S')
-    i = int(s)
-    if i < 000002:
-        style = '还没走..'
+    if timeget == None:
+        style = '没来'
     else:
-        style = timeget
+        s = timeget.strftime('%H%M%S')
+        i = int(s)
+        if i < 000002:
+            style = '还没走..'
+        else:
+            style = timeget
     return style
 judgetime.is_safe = True
 

File tag_zqonduty/templatetags/filter_extra.pyc

Binary file modified.

File templates/arrange/list.html

+{% extends 'base.html' %}
+
+{% block title %}
+{% endblock %}
+
+{% block head_extra %}
+    <!--CSS: week show--> <link rel="stylesheet" type="text/css" href="/static/css/week.css" />
+    <!--CSS-plugin: datepicker--> <link rel="stylesheet" type="text/css" href="/static/css/jquery_datepicker.css" />
+    <!--CSS:member select--> <link type="text/css" rel="stylesheet" href="/static/css/week_memberselect.css" />
+    <!--CSS: modify-board--> <link rel="stylesheet" type="text/css" href="/static/css/modify-board.css" />
+
+    <!--JS:arrange--> <script type="text/javascript" src="/static/js/arrange_list.js"></script>
+
+    <!--JS-plugin:datepicker--> <script type="text/javascript" src="/static/js/jquery_datepicker.js"></script>
+    <!--JS:--> <script type="text/javascript" src="/static/js/change_arrangement.js"></script>
+    <!--JS:member select--> <script src="/static/js/board_selectmember.js"></script>
+{% endblock %}
+
+{% block container %}
+{% include 'include/modify-board-date.html' %}
+
+<div id=week>
+    <div id=week_list>
+        <table cellspacing=0>
+            <tr>
+                <td width=35 class="titleTop">星期</td><td width=80 class="titleTop">日期</td><td width=300 class="titleTop">人员安排</td><td width=60 class="titleTop">备注</td>
+            </tr>
+        </table>
+        <table cellspacing=5>
+        {% for dateinfo,mem_list in week_mem_list %}
+            <tr>
+                <td width=20 class="tdContent tdWeek"> {{ forloop.counter }} </td>
+                <td width=80 class=tdContent>{{ dateinfo.date|date:"Y/m/d" }}</td>
+                <td width=290 style="text-align:left;border-left: 10px solid #555">
+                    <a id="arrangeButton"
+                        dateofit="{{ dateinfo.date|date:"Y-m-d" }}"
+                        onClick="setBoard(this);";
+                    >重新安排</a>
+                    <div id=memsContainer>
+                    {% for mem in mem_list %}
+                        <span class="nameBlock">{{ mem.name}}</span>
+                    {% endfor %}
+                    </div>
+                </td>
+                <td id="week_list_datelog" class="tdContent tdLog" width="50"
+                    sqlid="{{ dateinfo.id }}"
+                    title="datelog"
+                    onClick="setOnboard(this);" 
+                >{{ dateinfo.log }}</td>
+            </tr>
+        {% endfor %}
+        </table>
+    </div>
+
+    <div id=week_info>
+        <div id=week_info_name_title class="titleTop">负责人</div>
+        <div id=week_info_name class="tdContent">
+            <div id="week_info_name_{{ week_info.id }}" 
+                style="width:90px;height:320px;position:relative;left:4;top:7;" 
+                sqlid="{{ week_info.id }}"
+                title="name"
+                onClick="setOnboard(this);" 
+            >{{ week_info.name_manager }}</div>
+        </div>
+        <div id=week_info_log_title class="titleTop">备注</div>
+        <div id=week_info_log class="tdContent">
+            <div id="week_info_log_{{ week_info.id }}" 
+                style="width:90px;height:320px;position:relative;left:4;top:7;" 
+                sqlid="{{ week_info.id }}"
+                title="log"
+                onClick="setOnboard(this);" 
+            >{{ week_info.log }}</div>
+        </div>
+    </div>
+</div>
+<a id="nextweek" class="bigButton" style="width: 100;margin-top: 20px">安排下周</a>
+
+{% endblock %}

File templates/arrange/member_block.html

+<div id=selectmember_container>
+    <div id=m-b-head>modify board</div>
+    <div id=memberSelect>
+        <div id=dpmts>
+        {% for dpmt,mem_list in dpmt_mem_list %}
+            <a class="tab" dpmt="{{ dpmt.name }}" id="to{{ dpmt.name }}" href="">{{ dpmt.name }}</a>
+        {% endfor %}
+        </div>
+        
+        <div id=mems>
+        {% for dpmt,mem_list in dpmt_mem_list %}
+            <div id="memof{{ dpmt.name }}" class="box">
+                {% for mem in mem_list %}
+                <a class="member" id="member{{ mem.id }}" memberId="{{ mem.id }}" onClick="selectMember(this);return 0;" selected="false">{{ mem.name }}</a>
+                {% endfor %}
+            </div>
+        {% endfor %}
+        </div>
+    </div>
+
+    <div id=memberSelected>
+    </div>
+    <a onClick="generateMem()" class="submitMem">Upppp</a>
+</div>

File templates/arrange/week_block.html

+
+    <div id=week_list>
+        <table cellspacing=0>
+            <tr>
+                <td width=35 class="titleTop">星期</td><td width=80 class="titleTop">日期</td><td width=300 class="titleTop">人员安排</td><td width=60 class="titleTop">备注</td>
+            </tr>
+        </table>
+        <table cellspacing=5>
+        {% for dateinfo,mem_list in week_mem_list %}
+            <tr>
+                <td width=20 class="tdContent tdWeek"> {{ forloop.counter }} </td>
+                <td width=80 class=tdContent>{{ dateinfo.date|date:"Y/m/d" }}</td>
+                <td width=290 style="text-align:left;border-left: 10px solid #555">
+                    <a id="arrangeButton"
+                        dateofit="{{ dateinfo.date|date:"Y-m-d" }}"
+                        onClick="setBoard(this);";
+                    >重新安排</a>
+                    <div id=memsContainer>
+                    {% for mem in mem_list %}
+                        <span class="nameBlock">{{ mem.name}}</span>
+                    {% endfor %}
+                    </div>
+                </td>
+                <td id="week_list_datelog" class="tdContent tdLog" width="50"
+                    sqlid="{{ dateinfo.id }}"
+                    title="datelog"
+                    onClick="setOnboard(this);" 
+                >{{ dateinfo.log }}</td>
+            </tr>
+        {% endfor %}
+        </table>
+    </div>
+
+    <div id=week_info>
+        <div id=week_info_name_title class="titleTop">负责人</div>
+        <div id=week_info_name class="tdContent">
+            <div id="week_info_name_{{ week_info.id }}" 
+                style="width:90px;height:320px;position:relative;left:4;top:7;" 
+                sqlid="{{ week_info.id }}"
+                title="name"
+                onClick="setOnboard(this);" 
+            >{{ week_info.name_manager }}</div>
+        </div>
+        <div id=week_info_log_title class="titleTop">备注</div>
+        <div id=week_info_log class="tdContent">
+            <div id="week_info_log_{{ week_info.id }}" 
+                style="width:90px;height:320px;position:relative;left:4;top:7;" 
+                sqlid="{{ week_info.id }}"
+                title="log"
+                onClick="setOnboard(this);" 
+            >{{ week_info.log }}</div>
+        </div>
+    </div>

File templates/duty/day_block.html

-{% load filter_extra %}
-
-<div class=listTitle>今日</div>
-<div class="listContainer">
-<table cellspacing="0">
-    <tr>
-        <td class="tableHead" width=40>星期</td>
-        <td class="tableHead" width=80>日期</td>
-        <td class="tableHead" width=380>值班签到情况</td>
-        <td class="tableHead" width=70>日志</td>
-    </tr>
-</table>
-<table cellspacing=5>
-    <tr>
-        <td class=tdWeek width="30">....{{ d.week }}....</td>
-        <td class=tdDate>{{ d.date|date:'Y|m|d' }}</td>
-        <td class=tdDuty>
-            <div class=tdDuty>
-            <div class=dutyContainer>
-                <div class="dutyPeriod">全天</div>
-                {% for dutyinfo in d.duty %}
-                <div class="dutyMem lightBorder">
-                    <div class="memName lightBorder color_member{{ dutyinfo.if_come }}{{ dutyinfo.if_set }}">{{ dutyinfo.name_member }}</div>
-                    <div class="memInfo memInfoUp">
-                        <span class="infoTitle">来时</span><span class="infoContent">{{ dutyinfo.cometime }}</span>
-                        <span class="infoTitle">去时</span><span class="infoContent">{{ dutyinfo.gotime|judgetimeOnlygo }}</span>
-                    </div>
-                    <div class="memInfo memInfoDown">
-                        <span class="infoTitle">登入IP</span><span class="infoContent">{{ dutyinfo.ip_login }}</span>
-                        <span class="infoTitle">登出IP</span><span class="infoContent">{{ dutyinfo.ip_logout }}{{ dutyinfo. }}</span>
-                    </div>
-                </div>
-                {% endfor %}
-            </div>
-        </td>
-        <td class="tdLog" 
-            id="log_{{ d.id }}" 
-            word-wrap="break-word"
-            width="60"
-            onClick="setLog({{ d.id }},'{{ d.date|date:"Y-m-d" }}')"
-        >{{ d.log }}</td>
-</table>
-</div>

File templates/duty/list.html

-{% extends 'base.html' %}
-
-{% load filter_extra %}
-
-{% block title %}
-{% endblock %}
-
-{% block head_extra %}
-    <!---->
-    <!--CSS: duty show--> <link rel="stylesheet" type="text/css" href="/static/css/duty_list.css" />
-    <!--CSS: list table--> <link rel="stylesheet" type="text/css" href="/static/css/listTable.css" />
-    <!--CSS-plugin: datepicker--> <link rel="stylesheet" type="text/css" href="/static/css/jquery_datepicker.css" />
-    <!--CSS: modify-board--> <link rel="stylesheet" type="text/css" href="/static/css/modify-board.css" />
-
-    <!--JS-plugin: datepicker--> <script type="text/javascript" src="/static/js/jquery_datepicker.js"></script>
-    <!--JS: duty show--> <script type="text/javascript" src="/static/js/duty_list.js"></script>
-    <!--JS: change log--> <script type="text/javascript" src="/static/js/changeLog.js"></script>
-
-    <script>
-    </script>
-{% endblock %}
-
-{% block container %}
-
-{% include 'include/modify-board-date.html' %}
-
-<div id=list_day>
-    <!--[day block]-->
-    {% include 'duty/day_block.html' %}
-    <!--END [day block]-->
-</div>
-<div id=list_week>
-    <!--[week block]-->
-    {% include 'duty/week_block.html' %}
-    <!--END [week_block]-->
-</div>
-
-{% endblock %}

File templates/duty/week_block.html

-{% load filter_extra %}
-
-<div class=listTitle>周</div>
-<div class="listContainer">
-<table cellspacing="0">
-    <tr>
-        <td class="tableHead" width=40>星期</td>
-        <td class="tableHead" width=80>日期</td>
-        <td class="tableHead" width=380>值班签到情况</td>
-        <td class="tableHead" width=70>日志</td>
-    </tr>
-</table>
-<table cellspacing=5>
-    {% for dateinfo,duty_mor_list,duty_aft_list,duty_nig_list in dateinfo_duty_week_list %}
-    <tr>
-        <td class=tdWeek width="30">....{{ forloop.counter }}....</td>
-        <td class=tdDate>{{ dateinfo.date|date:'Y|m|d' }}</td>
-        <td class=tdDuty>
-            <div class=tdDuty>
-            <div class=dutyContainer>
-                <div class="dutyPeriod">上午</div>
-                {% for dutyinfo in duty_mor_list %}
-                <div class="dutyMem lightBorder">
-                    <div class="memName lightBorder color_member{{ dutyinfo.if_come }}{{ dutyinfo.if_set }}">{{ dutyinfo.name_member }}</div>
-                    <div class="memInfo memInfoUp">
-                        <span class="infoTitle">来时</span><span class="infoContent">{{ dutyinfo.cometime }}</span>
-                        <span class="infoTitle">去时</span><span class="infoContent">{{ dutyinfo.gotime|judgetimeOnlygo }}</span>
-                    </div>
-                    <div class="memInfo memInfoDown">
-                        <span class="infoTitle">登入IP</span><span class="infoContent">{{ dutyinfo.ip_login }}</span>
-                        <span class="infoTitle">登出IP</span><span class="infoContent">{{ dutyinfo.ip_logout }}{{ dutyinfo. }}</span>
-                    </div>
-                </div>
-                {% endfor %}
-            </div>
-            <div class=dutyContainer>
-                <div class="dutyPeriod">下午</div>
-                {% for dutyinfo in duty_aft_list %}
-                <div class="dutyMem lightBorder">
-                    <div class="memName lightBorder color_member{{ dutyinfo.if_come }}{{ dutyinfo.if_set }}">{{ dutyinfo.name_member }}</div>
-                    <div class="memInfo memInfoUp">
-                        <span class="infoTitle">来时</span><span class="infoContent">{{ dutyinfo.cometime }}</span>
-                        <span class="infoTitle">去时</span><span class="infoContent">{{ dutyinfo.gotime|judgetimeOnlygo }}</span>
-                    </div>
-                    <div class="memInfo memInfoDown">
-                        <span class="infoTitle">登入IP</span><span class="infoContent">{{ dutyinfo.ip_login }}</span>
-                        <span class="infoTitle">登出IP</span><span class="infoContent">{{ dutyinfo.ip_logout }}{{ dutyinfo. }}</span>
-                    </div>
-                </div>
-                {% endfor %}
-            </div>
-            <div class=dutyContainer>
-                <div class="dutyPeriod">晚上</div>
-                {% for dutyinfo in duty_nig_list %}
-                <div class="dutyMem lightBorder">
-                    <div class="memName lightBorder color_member{{ dutyinfo.if_come }}{{ dutyinfo.if_set }}">{{ dutyinfo.name_member }}</div>
-                    <div class="memInfo memInfoUp">
-                        <span class="infoTitle">来时</span><span class="infoContent">{{ dutyinfo.cometime }}</span>
-                        <span class="infoTitle">去时</span><span class="infoContent">{{ dutyinfo.gotime|judgetimeOnlygo }}</span>
-                    </div>
-                    <div class="memInfo memInfoDown">
-                        <span class="infoTitle">登入IP</span><span class="infoContent">{{ dutyinfo.ip_login }}</span>
-                        <span class="infoTitle">登出IP</span><span class="infoContent">{{ dutyinfo.ip_logout }}{{ dutyinfo. }}</span>
-                    </div>
-                </div>
-                {% endfor %}
-            </div>
-        </div>
-        </td>
-        <td class="tdLog" 
-            id="log_{{ dateinfo.id }}" 
-            word-wrap="break-word"
-            width="60"
-            onClick="setLog({{ dateinfo.id }},'{{ dateinfo.date|date:"Y-m-d" }}')"
-        >{{ dateinfo.log }}</td>
-    </tr>
-    {% endfor %}
-</table>
-</div>
-<!--END [week_block]-->

File templates/record/day_block.html

+{% load filter_extra %}
+
+<div class=listTitle>今日</div>
+<div class="listContainer">
+<table cellspacing="0">
+    <tr>
+        <td class="tableHead" width=40>星期</td>
+        <td class="tableHead" width=80>日期</td>
+        <td class="tableHead" width=380>值班签到情况</td>
+        <td class="tableHead" width=70>日志</td>
+    </tr>
+</table>
+<table cellspacing=5>
+    <tr>
+        <td class=tdWeek width="30">....{{ d.week }}....</td>
+        <td class=tdDate>{{ d.date|date:'Y|m|d' }}</td>
+        <td class=tdDuty>
+            <div class=tdDuty>
+            <div class=dutyContainer>
+                <div class="dutyPeriod">全天</div>
+                {% for dutyinfo in d.duty %}
+                <div class="dutyMem lightBorder">
+                    <div class="memName lightBorder color_member{{ dutyinfo.if_come }}{{ dutyinfo.if_set }}">{{ dutyinfo.name_member }}</div>
+                    <div class="memInfo memInfoUp">
+                        <span class="infoTitle">来时</span><span class="infoContent">{{ dutyinfo.cometime }}</span>
+                        <span class="infoTitle">去时</span><span class="infoContent">{{ dutyinfo.gotime|judgetimeOnlygo }}</span>
+                    </div>
+                    <div class="memInfo memInfoDown">
+                        <span class="infoTitle">登入IP</span><span class="infoContent">{{ dutyinfo.ip_login }}</span>
+                        <span class="infoTitle">登出IP</span><span class="infoContent">{{ dutyinfo.ip_logout }}{{ dutyinfo. }}</span>
+                    </div>
+                </div>
+                {% endfor %}
+            </div>
+        </td>
+        <td class="tdLog" 
+            id="log_{{ d.id }}" 
+            word-wrap="break-word"
+            width="60"
+            onClick="setLog({{ d.id }},'{{ d.date|date:"Y-m-d" }}')"
+        >{{ d.log }}</td>
+</table>
+</div>

File templates/record/list.html

+{% extends 'base.html' %}
+
+{% load filter_extra %}
+
+{% block title %}
+{% endblock %}
+
+{% block head_extra %}
+    <!---->
+    <!--CSS: record--> <link rel="stylesheet" type="text/css" href="/static/css/record.css" />
+    <!--CSS: list table--> <link rel="stylesheet" type="text/css" href="/static/css/listTable.css" />
+    <!--CSS-plugin: datepicker--> <link rel="stylesheet" type="text/css" href="/static/css/jquery_datepicker.css" />
+    <!--CSS: modify-board--> <link rel="stylesheet" type="text/css" href="/static/css/modify-board.css" />
+
+    <!--JS-plugin: datepicker--> <script type="text/javascript" src="/static/js/jquery_datepicker.js"></script>
+    <!--JS: duty show--> <script type="text/javascript" src="/static/js/record.js"></script>
+    <!--JS: change log--> <script type="text/javascript" src="/static/js/change_log.js"></script>
+
+    <script>
+    </script>
+{% endblock %}
+
+{% block container %}
+
+{% include 'include/modify-board-date.html' %}
+
+<div id=list_day>
+    <!--[day block]-->
+    {% include 'record/day_block.html' %}
+    <!--END [day block]-->
+</div>
+<div id=list_week>
+    <!--[week block]-->
+    {% include 'record/week_block.html' %}
+    <!--END [week_block]-->
+</div>
+
+{% endblock %}

File templates/record/week_block.html

+{% load filter_extra %}
+
+<div class=listTitle>周</div>
+<div class="listContainer">
+<table cellspacing="0">
+    <tr>
+        <td class="tableHead" width=40>星期</td>
+        <td class="tableHead" width=80>日期</td>
+        <td class="tableHead" width=380>值班签到情况</td>
+        <td class="tableHead" width=70>日志</td>
+    </tr>
+</table>
+<table cellspacing=5>
+    {% for dateinfo,duty_mor_list,duty_aft_list,duty_nig_list,duty_absence_list in dateinfo_duty_week_list %}
+    <tr>
+        <td class=tdWeek width="30">....{{ forloop.counter }}....</td>
+        <td class=tdDate>{{ dateinfo.date|date:'Y|m|d' }}</td>
+        <td class=tdDuty>
+            <div class=tdDuty>
+            <div class=dutyContainer>
+                <div class="dutyPeriod">上午</div>
+                {% for dutyinfo in duty_mor_list %}
+                <div class="dutyMem lightBorder">
+                    <div class="memName lightBorder color_member{{ dutyinfo.if_come }}{{ dutyinfo.if_set }}">{{ dutyinfo.name_member }}</div>
+                    <div class="memInfo memInfoUp">
+                        <span class="infoTitle">来时</span><span class="infoContent">{{ dutyinfo.cometime }}</span>
+                        <span class="infoTitle">去时</span><span class="infoContent">{{ dutyinfo.gotime|judgetimeOnlygo }}</span>
+                    </div>
+                    <div class="memInfo memInfoDown">
+                        <span class="infoTitle">登入IP</span><span class="infoContent">{{ dutyinfo.ip_login }}</span>
+                        <span class="infoTitle">登出IP</span><span class="infoContent">{{ dutyinfo.ip_logout }}{{ dutyinfo. }}</span>
+                    </div>
+                </div>
+                {% endfor %}
+            </div>
+            <div class=dutyContainer>
+                <div class="dutyPeriod">下午</div>
+                {% for dutyinfo in duty_aft_list %}
+                <div class="dutyMem lightBorder">
+                    <div class="memName lightBorder color_member{{ dutyinfo.if_come }}{{ dutyinfo.if_set }}">{{ dutyinfo.name_member }}</div>
+                    <div class="memInfo memInfoUp">
+                        <span class="infoTitle">来时</span><span class="infoContent">{{ dutyinfo.cometime }}</span>
+                        <span class="infoTitle">去时</span><span class="infoContent">{{ dutyinfo.gotime|judgetimeOnlygo }}</span>
+                    </div>
+                    <div class="memInfo memInfoDown">
+                        <span class="infoTitle">登入IP</span><span class="infoContent">{{ dutyinfo.ip_login }}</span>
+                        <span class="infoTitle">登出IP</span><span class="infoContent">{{ dutyinfo.ip_logout }}{{ dutyinfo. }}</span>
+                    </div>
+                </div>
+                {% endfor %}
+            </div>
+            <div class=dutyContainer>
+                <div class="dutyPeriod">晚上</div>
+                {% for dutyinfo in duty_nig_list %}
+                <div class="dutyMem lightBorder">
+                    <div class="memName lightBorder color_member{{ dutyinfo.if_come }}{{ dutyinfo.if_set }}">{{ dutyinfo.name_member }}</div>
+                    <div class="memInfo memInfoUp">
+                        <span class="infoTitle">来时</span><span class="infoContent">{{ dutyinfo.cometime }}</span>
+                        <span class="infoTitle">去时</span><span class="infoContent">{{ dutyinfo.gotime|judgetimeOnlygo }}</span>
+                    </div>
+                    <div class="memInfo memInfoDown">
+                        <span class="infoTitle">登入IP</span><span class="infoContent">{{ dutyinfo.ip_login }}</span>
+                        <span class="infoTitle">登出IP</span><span class="infoContent">{{ dutyinfo.ip_logout }}{{ dutyinfo. }}</span>
+                    </div>
+                </div>
+                {% endfor %}
+            </div>
+            <div class=dutyContainer>
+                <div class="dutyPeriod">缺席</div>
+                {% for dutyinfo in duty_absence_list %}
+                <div class="dutyMem_ab lightBorder">
+                    <div class="memName lightBorder color_member{{ dutyinfo.if_come }}{{ dutyinfo.if_set }}">{{ dutyinfo.name_member }}</div>
+                </div>
+                {% endfor %}
+            </div>
+        </div>
+        </td>
+        <td class="tdLog" 
+            id="log_{{ dateinfo.id }}" 
+            word-wrap="break-word"
+            width="60"
+            onClick="setLog({{ dateinfo.id }},'{{ dateinfo.date|date:"Y-m-d" }}')"
+        >{{ dateinfo.log }}</td>
+    </tr>
+    {% endfor %}
+</table>
+</div>
+<!--END [week_block]-->

File templates/week/list.html

-{% extends 'base.html' %}
-
-{% block title %}
-{% endblock %}
-
-{% block head_extra %}
-    <!--CSS: week show--> <link rel="stylesheet" type="text/css" href="/static/css/week.css" />
-    <!--CSS-plugin: datepicker--> <link rel="stylesheet" type="text/css" href="/static/css/datepicker.css" />
-    <!--CSS:member select--> <link type="text/css" rel="stylesheet" href="/static/css/week_memberselect.css" />
-    <!--CSS: modify-board--> <link rel="stylesheet" type="text/css" href="/static/css/modify-board.css" />
-
-    <!--JS-plugin:datepicker--> <script type="text/javascript" src="/static/js/datepicker.js"></script>
-    <!--JS:--> <script type="text/javascript" src="/static/js/change_weekinfo.js"></script>
-    <!--JS:member select--> <script src="/static/js/board_selectmember.js"></script>
-
-    <script> //hide board
-        function hideBoard() { $('#m-b-content').hide(); }//document.getElementById("m-b-content").style.display = 'none'; }
-    </script>
-{% endblock %}
-
-{% block container %}
-{% include 'include/modify-board-date.html' %}
-
-<div id=week>
-    <div id=week_list>
-        <table cellspacing=0>
-            <tr>
-                <td width=35 class="titleTop">星期</td><td width=80 class="titleTop">日期</td><td width=300 class="titleTop">人员安排</td><td width=60 class="titleTop">备注</td>
-            </tr>
-        </table>
-        <table cellspacing=5>
-        {% for dateinfo,mem_list in week_mem_list %}
-            <tr>
-                <td width=20 class="tdContent tdWeek"> {{ forloop.counter }} </td>
-                <td width=80 class=tdContent>{{ dateinfo.date|date:"Y/m/d" }}</td>
-                <td width=290 style="text-align:left;border-left: 10px solid #555">
-                    <a id="arrangeButton"
-                        dateofit="{{ dateinfo.date|date:"Y-m-d" }}"
-                        onClick="setBoard(this);";
-                    >重新安排</a>
-                    <div id=memsContainer>
-                    {% for mem in mem_list %}
-                        <span class="nameBlock">{{ mem.name}}</span>
-                    {% endfor %}
-                    </div>
-                </td>
-                <td id="week_list_datelog" class="tdContent tdLog" width="50"
-                    sqlid="{{ dateinfo.id }}"
-                    title="datelog"
-                    onClick="setOnboard(this);" 
-                >{{ dateinfo.log }}</td>
-            </tr>
-        {% endfor %}
-        </table>
-    </div>
-
-    <div id=week_info>
-        <div id=week_info_name_title class="titleTop">负责人</div>
-        <div id=week_info_name class="tdContent">
-            <div id="week_info_name_{{ week_info.id }}" 
-                style="width:90px;height:320px;position:relative;left:4;top:7;" 
-                sqlid="{{ week_info.id }}"
-                title="name"
-                onClick="setOnboard(this);" 
-            >{{ week_info.name_manager }}</div>
-        </div>
-        <div id=week_info_log_title class="titleTop">备注</div>
-        <div id=week_info_log class="tdContent">
-            <div id="week_info_log_{{ week_info.id }}" 
-                style="width:90px;height:320px;position:relative;left:4;top:7;" 
-                sqlid="{{ week_info.id }}"
-                title="log"
-                onClick="setOnboard(this);" 
-            >{{ week_info.log }}</div>
-        </div>
-    </div>
-</div>
-<a id="nextweek" class="bigButton" style="width: 100;margin-top: 20px">安排下周</a>
-
-<script>
-    hideBoard();
-    $('#datepicker_frame').DatePicker({
-        flat: true,
-        date: '{{ date_server|date:"Y-m-d" }}',
-        starts: 1,
-        onChange: function(formated, dates){
-            $('#m-b-head').html(formated);
-            //jquery中可以调用普通函数啊
-            var url_week = '/week/list_oneweek/?date='+formated;
-            $('#week').load(url_week);
-        }
-    });
-
-    $('#nextweek').click(function() {
-        var url_week = '/week/next/';
-        $('#week').load(url_week);
-    });
-</script>
-{% endblock %}

File templates/week/member_block.html

-<div id=selectmember_container>
-    <div id=m-b-head>modify board</div>
-    <div id=memberSelect>
-        <div id=dpmts>
-        {% for dpmt,mem_list in dpmt_mem_list %}
-            <a class="tab" dpmt="{{ dpmt.name }}" id="to{{ dpmt.name }}" href="">{{ dpmt.name }}</a>
-        {% endfor %}
-        </div>
-        
-        <div id=mems>
-        {% for dpmt,mem_list in dpmt_mem_list %}
-            <div id="memof{{ dpmt.name }}" class="box">
-                {% for mem in mem_list %}
-                <a class="member" id="member{{ mem.id }}" memberId="{{ mem.id }}" onClick="selectMember(this);return 0;" selected="false">{{ mem.name }}</a>
-                {% endfor %}
-            </div>
-        {% endfor %}
-        </div>
-    </div>
-
-    <div id=memberSelected>
-    </div>
-    <a onClick="generateMem()" class="submitMem">Upppp</a>
-</div>

File templates/week/week_block.html

-
-    <div id=week_list>
-        <table cellspacing=0>
-            <tr>
-                <td width=35 class="titleTop">星期</td><td width=80 class="titleTop">日期</td><td width=300 class="titleTop">人员安排</td><td width=60 class="titleTop">备注</td>
-            </tr>
-        </table>
-        <table cellspacing=5>
-        {% for dateinfo,mem_list in week_mem_list %}
-            <tr>
-                <td width=20 class="tdContent tdWeek"> {{ forloop.counter }} </td>
-                <td width=80 class=tdContent>{{ dateinfo.date|date:"Y/m/d" }}</td>
-                <td width=290 style="text-align:left;border-left: 10px solid #555">
-                    <a id="arrangeButton"
-                        dateofit="{{ dateinfo.date|date:"Y-m-d" }}"
-                        onClick="setBoard(this);";
-                    >重新安排</a>
-                    <div id=memsContainer>
-                    {% for mem in mem_list %}
-                        <span class="nameBlock">{{ mem.name}}</span>
-                    {% endfor %}
-                    </div>
-                </td>
-                <td id="week_list_datelog" class="tdContent tdLog" width="50"
-                    sqlid="{{ dateinfo.id }}"
-                    title="datelog"
-                    onClick="setOnboard(this);" 
-                >{{ dateinfo.log }}</td>
-            </tr>
-        {% endfor %}
-        </table>
-    </div>
-
-    <div id=week_info>
-        <div id=week_info_name_title class="titleTop">负责人</div>
-        <div id=week_info_name class="tdContent">
-            <div id="week_info_name_{{ week_info.id }}" 
-                style="width:90px;height:320px;position:relative;left:4;top:7;" 
-                sqlid="{{ week_info.id }}"
-                title="name"
-                onClick="setOnboard(this);" 
-            >{{ week_info.name_manager }}</div>
-        </div>
-        <div id=week_info_log_title class="titleTop">备注</div>
-        <div id=week_info_log class="tdContent">
-            <div id="week_info_log_{{ week_info.id }}" 
-                style="width:90px;height:320px;position:relative;left:4;top:7;" 
-                sqlid="{{ week_info.id }}"
-                title="log"
-                onClick="setOnboard(this);" 
-            >{{ week_info.log }}</div>
-        </div>
-    </div>