Beispiel #1
0
    def FeedTplEdit(self):
        stype = -1
        version = -1
        tpl_id = -1
        if "stype" in request.params:
            stype = int(request.params['stype'])
        if "version" in request.params:
            version = int(request.params['version'])
        if "tpl_id" in request.params:
            tpl_id = int(request.params['tpl_id'])

        ver = self.data_version_.filter_by(stype=stype,
                                           version=version).first()
        if not ver:
            return "参数错误"
        tpl_using = 0
        if tpl_id > 0 and tpl_id == ver.using_tpl_id:
            tpl_using = 1

        return render(
            '/feed-tpl-edit.mako', {
                "stype": stype,
                "version": version,
                "tpl_id": tpl_id,
                "tpl_using": tpl_using,
                "user_right": self.UserRight(request, response)
            })
Beispiel #2
0
    def FeedKeysEdit(self):
        stype = -1
        version = -1
        is_user = 0
        apply_id = 0

        from_tpl_id = 0
        if "stype" in request.params:
            stype = int(request.params['stype'])
            if "version" in request.params:
                version = int(request.params['version'])
                if "apply_id" in request.params and "from_tpl_id" in request.params:
                    apply_id = int(request.params['apply_id'])
                    from_tpl_id = int(request.params['from_tpl_id'])

        if "is_user" in request.params:
            is_user = int(request.params['version'])

        return render(
            '/feed-keys-edit.mako', {
                "stype": stype,
                "user_right": self.UserRight(request, response),
                "version": version,
                "from_tpl_id": from_tpl_id,
                "apply_id": apply_id,
                "is_user": is_user
            })
Beispiel #3
0
  def FeedKeysEdit(self):
    stype = -1
    version = -1
    is_user = 0 
    apply_id = 0 

    from_tpl_id = 0
    if "stype" in request.params:
      stype = int(request.params['stype'])
      if "version" in request.params:
        version = int(request.params['version'])
        if "apply_id" in request.params and "from_tpl_id" in request.params:
          apply_id = int(request.params['apply_id'])
          from_tpl_id = int(request.params['from_tpl_id'])

    if "is_user" in request.params:
      is_user = int(request.params['version'])

    return render('/feed-keys-edit.mako', 
        {"stype" : stype, 
         "user_right" : self.UserRight(request, response),
         "version" : version, 
         "from_tpl_id" : from_tpl_id, 
         "apply_id" : apply_id, 
         "is_user" : is_user})
Beispiel #4
0
 def FeedListView(self):
     list_filter = 0
     if "filter" in request.params:
         list_filter = int(request.params['filter'])
     return render(
         '/feed-list.mako', {
             "user_right": self.UserRight(request, response),
             "list_filter": list_filter
         })
Beispiel #5
0
  def StypeConfigEdit(self):
    stype = -1
    from_version_id = 0
    apply_id = 0
    uid = 0
    if "id" in request.cookies:
      uid = int(request.cookies['id'])

    if "stype" in request.params:
      stype = int(request.params['stype'])
      if "apply_id" in request.params and "from_version_id" in request.params:
        apply_id = int(request.params['apply_id'])
        from_version_id = int(request.params['from_version_id'])

    return render('/feed-config-edit.mako', {"stype" : stype, 
        "user_right" : self.UserRight(request, response), 
        "apply_id" : apply_id, 
        "from_version_id" : from_version_id})
Beispiel #6
0
 def GetStypeConfig(self):
   cfg = self.stype_config_.filter_by(stype=int(request.params['stype'])).first()
   if not cfg:
     cfg = StypeConfig(stype = int(request.params['stype']), 
         weight = 1, 
         type = int(request.params['stype']) / 100, 
         ptype = 0, 
         description = '', 
         push_feed_flags = 0, 
         news_merge_type = 0,
         mini_merge_type = 0,
         update_time_on_merge = 0,
         custom_expr = 0,
         persist_body = 0,
         persist_feeddb = 0,
         lifetime = 0,
         daily_quota = 0,
        
         news_merge_by = '', 
         mini_merge_by = '', 
         source_by = '', 
         psource_by = '', 
         actor_by = '', 
         dispatch_expr = '')
   print cfg.description
   return render('/feed-config.mako', {
       "stype" : cfg.stype, 
       "type" : cfg.type,
       "weight" : cfg.weight,
       "desc" : cfg.description.decode('utf-8'),
       "ptype" : cfg.ptype,
       "save_content" : cfg.is_persist_content,
       "save_feed_db" : cfg.is_persist_feeddb,
       "news_merge_type" : cfg.news_merge_type,
       "mini_merge_type" : cfg.mini_merge_type,
       "push_flags" : cfg.push_flag,
       "custom_expr" : cfg.is_custom_expr,
       "update_time_on_merge" : cfg.is_update_time,
       "lifetime" : cfg.lifetime,
       "daily_quota" : cfg.daily_quota
      }
   )
Beispiel #7
0
 def GetStypeConfig(self):
     cfg = self.stype_config_.filter_by(
         stype=int(request.params['stype'])).first()
     if not cfg:
         cfg = StypeConfig(stype=int(request.params['stype']),
                           weight=1,
                           type=int(request.params['stype']) / 100,
                           ptype=0,
                           description='',
                           push_feed_flags=0,
                           news_merge_type=0,
                           mini_merge_type=0,
                           update_time_on_merge=0,
                           custom_expr=0,
                           persist_body=0,
                           persist_feeddb=0,
                           lifetime=0,
                           daily_quota=0,
                           news_merge_by='',
                           mini_merge_by='',
                           source_by='',
                           psource_by='',
                           actor_by='',
                           dispatch_expr='')
     print cfg.description
     return render(
         '/feed-config.mako', {
             "stype": cfg.stype,
             "type": cfg.type,
             "weight": cfg.weight,
             "desc": cfg.description.decode('utf-8'),
             "ptype": cfg.ptype,
             "save_content": cfg.is_persist_content,
             "save_feed_db": cfg.is_persist_feeddb,
             "news_merge_type": cfg.news_merge_type,
             "mini_merge_type": cfg.mini_merge_type,
             "push_flags": cfg.push_flag,
             "custom_expr": cfg.is_custom_expr,
             "update_time_on_merge": cfg.is_update_time,
             "lifetime": cfg.lifetime,
             "daily_quota": cfg.daily_quota
         })
Beispiel #8
0
    def StypeConfigEdit(self):
        stype = -1
        from_version_id = 0
        apply_id = 0
        uid = 0
        if "id" in request.cookies:
            uid = int(request.cookies['id'])

        if "stype" in request.params:
            stype = int(request.params['stype'])
            if "apply_id" in request.params and "from_version_id" in request.params:
                apply_id = int(request.params['apply_id'])
                from_version_id = int(request.params['from_version_id'])

        return render(
            '/feed-config-edit.mako', {
                "stype": stype,
                "user_right": self.UserRight(request, response),
                "apply_id": apply_id,
                "from_version_id": from_version_id
            })
Beispiel #9
0
  def FeedTplEdit(self):
    stype = -1
    version = -1
    tpl_id = -1
    if "stype" in request.params:
      stype = int(request.params['stype'])
    if "version" in request.params:
      version = int(request.params['version'])
    if "tpl_id" in request.params:
      tpl_id = int(request.params['tpl_id'])

    ver = self.data_version_.filter_by(stype = stype, version = version).first()
    if not ver:
      return "参数错误"
    tpl_using = 0
    if tpl_id > 0 and tpl_id == ver.using_tpl_id:
      tpl_using = 1

    return render('/feed-tpl-edit.mako', {"stype" : stype, 
        "version" : version, "tpl_id" : tpl_id, "tpl_using" : tpl_using,
        "user_right" : self.UserRight(request, response)})
Beispiel #10
0
  def StypeConfigCreate(self):
    apply_id = 0
    if "apply_id" in request.params:
      apply_id = int(request.params['apply_id'])

    return render('/feed-config-create.mako', {"apply_id" : apply_id})
Beispiel #11
0
 def FeedListView(self):
   list_filter = 0
   if "filter" in request.params:
     list_filter = int(request.params['filter'])
   return render('/feed-list.mako', {"user_right" : self.UserRight(request, response), "list_filter" : list_filter})
Beispiel #12
0
 def ApplyNewFeed(self):
     return render('/apply-new-feed.mako')
Beispiel #13
0
 def ApplyPublish(self):
   return render('/apply-publish.mako')
Beispiel #14
0
 def ApplyNewTpl(self):
   return render('/apply-new-tpl.mako')
Beispiel #15
0
 def ApplyNewFeed(self):
   return render('/apply-new-feed.mako')
Beispiel #16
0
    def StypeConfigCreate(self):
        apply_id = 0
        if "apply_id" in request.params:
            apply_id = int(request.params['apply_id'])

        return render('/feed-config-create.mako', {"apply_id": apply_id})
Beispiel #17
0
 def UserApply(self):
     return render('/user-apply.mako')
Beispiel #18
0
 def ApplyPublish(self):
     return render('/apply-publish.mako')
Beispiel #19
0
 def ApplyRollback(self):
     return render('/apply-rollback.mako')
Beispiel #20
0
 def ApplyNewTpl(self):
     return render('/apply-new-tpl.mako')
Beispiel #21
0
 def ApplyNewVersion(self):
     return render('/apply-new-version.mako')
Beispiel #22
0
 def UserApply(self):
   return render('/user-apply.mako')
Beispiel #23
0
 def UserApplyList(self):
   return render('/user-apply-list.mako')
Beispiel #24
0
 def ApplyNewFeedList(self):
   return render('/apply-new-feed-list.mako')
Beispiel #25
0
 def ApplyNewVersion(self):
   return render('/apply-new-version.mako')
Beispiel #26
0
 def ApplyNewTplList(self):
   return render('/apply-new-tpl-list.mako')
Beispiel #27
0
 def ApplyRollback(self):
   return render('/apply-rollback.mako')
Beispiel #28
0
 def ApplyPublishList(self):
     return render('/apply-publish-list.mako')
Beispiel #29
0
 def ApplyNewFeedList(self):
     return render('/apply-new-feed-list.mako')
Beispiel #30
0
 def UserApplyList(self):
     return render('/user-apply-list.mako')
Beispiel #31
0
 def ApplyNewVersionList(self):
     return render('/apply-new-version-list.mako')
Beispiel #32
0
 def ApplyNewTplList(self):
     return render('/apply-new-tpl-list.mako')
Beispiel #33
0
 def ApplyNewVersionList(self):
   return render('/apply-new-version-list.mako')
Beispiel #34
0
 def ApplyPublishList(self):
   return render('/apply-publish-list.mako')
Beispiel #35
0
 def ApplyRollbackList(self):
   return render('/apply-rollback-list.mako')
Beispiel #36
0
 def ApplyRollbackList(self):
     return render('/apply-rollback-list.mako')