Exemplo n.º 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)
            })
Exemplo n.º 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
            })
Exemplo n.º 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})
Exemplo n.º 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
         })
Exemplo n.º 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})
Exemplo n.º 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
      }
   )
Exemplo n.º 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
         })
Exemplo n.º 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
            })
Exemplo n.º 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)})
Exemplo n.º 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})
Exemplo n.º 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})
Exemplo n.º 12
0
 def ApplyNewFeed(self):
     return render('/apply-new-feed.mako')
Exemplo n.º 13
0
 def ApplyPublish(self):
   return render('/apply-publish.mako')
Exemplo n.º 14
0
 def ApplyNewTpl(self):
   return render('/apply-new-tpl.mako')
Exemplo n.º 15
0
 def ApplyNewFeed(self):
   return render('/apply-new-feed.mako')
Exemplo n.º 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})
Exemplo n.º 17
0
 def UserApply(self):
     return render('/user-apply.mako')
Exemplo n.º 18
0
 def ApplyPublish(self):
     return render('/apply-publish.mako')
Exemplo n.º 19
0
 def ApplyRollback(self):
     return render('/apply-rollback.mako')
Exemplo n.º 20
0
 def ApplyNewTpl(self):
     return render('/apply-new-tpl.mako')
Exemplo n.º 21
0
 def ApplyNewVersion(self):
     return render('/apply-new-version.mako')
Exemplo n.º 22
0
 def UserApply(self):
   return render('/user-apply.mako')
Exemplo n.º 23
0
 def UserApplyList(self):
   return render('/user-apply-list.mako')
Exemplo n.º 24
0
 def ApplyNewFeedList(self):
   return render('/apply-new-feed-list.mako')
Exemplo n.º 25
0
 def ApplyNewVersion(self):
   return render('/apply-new-version.mako')
Exemplo n.º 26
0
 def ApplyNewTplList(self):
   return render('/apply-new-tpl-list.mako')
Exemplo n.º 27
0
 def ApplyRollback(self):
   return render('/apply-rollback.mako')
Exemplo n.º 28
0
 def ApplyPublishList(self):
     return render('/apply-publish-list.mako')
Exemplo n.º 29
0
 def ApplyNewFeedList(self):
     return render('/apply-new-feed-list.mako')
Exemplo n.º 30
0
 def UserApplyList(self):
     return render('/user-apply-list.mako')
Exemplo n.º 31
0
 def ApplyNewVersionList(self):
     return render('/apply-new-version-list.mako')
Exemplo n.º 32
0
 def ApplyNewTplList(self):
     return render('/apply-new-tpl-list.mako')
Exemplo n.º 33
0
 def ApplyNewVersionList(self):
   return render('/apply-new-version-list.mako')
Exemplo n.º 34
0
 def ApplyPublishList(self):
   return render('/apply-publish-list.mako')
Exemplo n.º 35
0
 def ApplyRollbackList(self):
   return render('/apply-rollback-list.mako')
Exemplo n.º 36
0
 def ApplyRollbackList(self):
     return render('/apply-rollback-list.mako')