Ejemplo n.º 1
0
    def GET(self):
        authuser()
        all_data=m_article_class(web.session.Session.user)
        n=all_data[0]
        class_res=all_data[1].list()
        html="<table id='atc_list_table' border='1' cellspacing='0' >"
        for i in range(n):
            html+="<tr><td width='5%'>"+str(class_res[i]['v_id'])+"</td><td width='85%'>"+mysql_to_str(class_res[i]['class_title'])+"</td>"
            html+="<td width='5%'><form action='/admin/manager/article/class/delete/"+str(class_res[i]['class_id'])+"/' method='POST'/><input type='submit'  onclick='delfirm()' value='删除'/></form></td>"
            html+="<td width='5%'><form action='/admin/manager/article/class/edit/"+str(class_res[i]['class_id'])+"/' method='GET'/><input type='submit' value='修改'/></form></td></tr>"

        html+="<tr ><td  id='addclass' colspan='4' align='center'><input type='button' value='添加新分类' onclick='add_newclass()'/></td></tr>"
        html+="</table>"
        return render.menu('',context=html)
Ejemplo n.º 2
0
    def GET(self):
        authuser()
        class_data=m_article_class(web.session.Session.user)
        n=class_data[0]
        class_res=class_data[1].list()
        wenzhang='''
        <form action='/admin/manager/article/publish/' method='POST'/>
        &nbsp;标题:<input type="text" name="atc_title"/>分类:
        '''
        wenzhang+="<select name='atc_type'>"
        for i in range(class_data[0]):
            wenzhang+="<option value ="+str(class_res[i]['class_id'])+">"+mysql_to_str(class_res[i]['class_title'])+"</option>"

        wenzhang+="</select>"
        wenzhang+='''
        <script type="text/javascript" src="/static/public/editor/nicEdit.js"></script>
        <script type="text/javascript">
            bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
        </script>
        <textarea id="area_atc"  name="area_atc">
        </textarea>
        <input type='submit' id="atc_tj" value='发表'/></form>
        '''
        return render.menu('',context=wenzhang)