Commits

Chao Yang  committed 0a9245e Draft

fix

  • Participants
  • Parent commits 10a5fee
  • Branches yangchao_20120604_task

Comments (0)

Files changed (5)

File config/privilege.py

 PRIVILEGE_FEED_IMPORT = 1
 PRIVILEGE_TAG = 2
 PRIVILEGE_VPS = 3
-PRIVILEGE_LIBRARIAN = 4
 
+PRIVILEGE_LIBRARIAN = 5
 
+

File ctrl/zsite/po_task.py

         address = self.get_argument('address','')
         end_time = ymdhm2minute(
             self.get_argument('end_time',0), 
-            self.get_argument('end_hour',0),
-            self.get_argument('end_minute',0),
+            self.get_argument('end_time_hour',0),
+            self.get_argument('end_time_minute',0),
         )
         cost = self.get_argument('cost',0) 
         price = int(self.get_argument('price',0))

File htm/ctrl/zsite/po_task/index.htm

 
 <div>人数上限 <input name="limit" value="1" type="text"> 留空表示不限制</div>
 </div>
-<div>截止日期 <script>select_future("end_time", ${end_time or 0})</script> 可以不设置</div>
+<div>截止日期 <script>select_future("end_time", ${end_time or 0},${end_time_hour or 0},${end_time_minute or 0})</script> 可以不设置</div>
 <span class="btnw"><button type="submit">创建任务</button></span>
 </%htm:form>
 

File model/privilege.py

 # -*- coding: utf-8 -*-
 import _env
 from config import PRIVILEGE_ADMIN, PRIVILEGE_SUPER 
-from config.privilege import PRIVILEGE_FEED_IMPORT, PRIVILEGE_TAG, PRIVILEGE_VPS
+from config.privilege import PRIVILEGE_FEED_IMPORT, PRIVILEGE_TAG, PRIVILEGE_VPS, PRIVILEGE_LIBRARIAN
 
 PRIVILEGE_DICT = {
     PRIVILEGE_FEED_IMPORT:'/feed_import',
     PRIVILEGE_TAG:'/tag',
     PRIVILEGE_VPS:'/vps',
+    PRIVILEGE_LIBRARIAN:'/book'
 }
 
 PRIVILEGE_CN = {
     PRIVILEGE_FEED_IMPORT:"热文推荐",
     PRIVILEGE_TAG:"标签标注",
     PRIVILEGE_VPS:"虚拟主机",
+    PRIVILEGE_LIBRARIAN:"借阅"
 }
 
 PRIVILEGE_ADMIN_DICT = dict(PRIVILEGE_ADMIN)

File static/js/date.js

 function select_future(id, value){
     var date=new Date(), year=date.getFullYear();
     select_date(id, value, year, year+128)
+    var date=new Date(), today=new Date();
+    date.setDate(date.getDate() + 5)
+    var year=today.getFullYear(), month=today.getMonth()+1;
+
+    select_date(id, value, year+100, year-1, true,
+        function(year_val, month_val){
+            if(year_val==year&&month_val==month){
+                return today.getDay()
+            }
+            return 1
+    },true);
+
+    var prefix='#'+id, year_elem=$(prefix+"_year"), month_elem=$(prefix+"_month"), day_elem=$(prefix+"_day");
+
+    year_elem.change(function(){
+        var r=[],val=this.value-0,i=1;
+        if(val==year){
+            i = date.getMonth()+1
+        }
+        for(;i<13;++i){
+            r.push('<option value="'+i+'">'+i+'</option>')
+        }
+        if(!value){
+            month_elem.html(r.join('')).change()
+        }
+    }).change()
+    if(!value){
+        year_elem.val(date.getFullYear()).change()
+        month_elem.val(date.getMonth()+1).change()
+        day_elem.val(date.getDate()).change()
+    }
+    $(prefix+"_hour").val(hour||12)
+    $(prefix+"_minute").val(minute||30)
+
 }