diff --git a/conf/config.json b/conf/config.json index 48d4d359..b4660d2f 100644 --- a/conf/config.json +++ b/conf/config.json @@ -4,7 +4,7 @@ /* 上传图片配置项 */ "imageActionName": "uploadimage", /* 执行上传图片的action名称 */ "imageFieldName": "upfile", /* upfile提交的图片表单名称 */ - "imageMaxSize": 2048000, /* 上传大小限制,单位B */ + "imageMaxSize": 20480000, /* 上传大小限制,单位B */ "imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 上传图片格式显示 */ "imageCompressEnable": true, /* 是否压缩图片,默认是true */ "imageCompressBorder": 800, /* 图片压缩最长边限制 */ @@ -68,7 +68,8 @@ ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid", ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso", - ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml" + ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml", + ".dwg",".dgn" ], /* 上传文件格式显示 */ /* 列出指定目录下的图片 */ diff --git a/controllers/article.go b/controllers/article.go index 6f096338..91f9ef72 100644 --- a/controllers/article.go +++ b/controllers/article.go @@ -7,6 +7,7 @@ import ( "github.com/astaxie/beego/httplib" "time" // "os" + "regexp" "strconv" "strings" // "path" @@ -201,6 +202,72 @@ func (c *ArticleController) GetArticle() { projurls = "/" + strings.Replace(proj.ParentIdPath, "-", "/", -1) + "/" + strconv.FormatInt(proj.Id, 10) } + //上一篇和下一篇 + //根据项目id取得所有成果 + products, err := models.GetProducts(proj.Id) + if err != nil { + beego.Error(err) + } + + // Attachslice := make([]AttachmentLink, 0) + Articles := make([]*models.Article, 0) + for _, w := range products { + //取到每个成果的附件(模态框打开);pdf、文章——新窗口打开 + //循环成果 + //每个成果取到所有附件 + //一个附件则直接打开/下载;2个以上则打开模态框 + //取得文章 + Articles1, err := models.GetArticles(w.Id) + if err != nil { + beego.Error(err) + } + Articles = append(Articles, Articles1...) + } + + // count := len(Articles) + // count1 := strconv.Itoa(count) + // count2, err := strconv.ParseInt(count1, 10, 64) + // if err != nil { + // beego.Error(err) + // } + + // if p == "" {//这里是用于在页面打开pdf附件的时候,显示地址是/pdf?id=628,id是附件id + // var p1 string + for i, v := range Articles { + if v.Id == idNum { //idnumb是附件的id + // p1 = strconv.Itoa(i + 1) + // PdfLink = Url + "/" + v.FileName + //上一篇 + if i > 0 { + c.Data["NextArticleId"] = strconv.FormatInt(Articles[i-1].Id, 10) + //由文章id取得prodtitle + //查出成果编号,名称和作者 + articleprod, err := models.GetProd(Articles[i-1].ProductId) + if err != nil { + beego.Error(err) + } + c.Data["NextArticleTitle"] = articleprod.Title + c.Data["Next"] = true + } else { + c.Data["Next"] = false + } + if i < len(Articles)-1 { + c.Data["PreArticleId"] = strconv.FormatInt(Articles[i+1].Id, 10) + //由文章id取得prodtitle + //查出成果编号,名称和作者 + articleprod, err := models.GetProd(Articles[i+1].ProductId) + if err != nil { + beego.Error(err) + } + c.Data["PreArticleTitle"] = articleprod.Title + c.Data["Pre"] = true + } else { + c.Data["Pre"] = false + } + break + } + } + // if e.Enforce(useridstring, projurls+"/", "POST", ".1") { // c.Data["RoleAdd"] = "true" // } else { @@ -217,9 +284,21 @@ func (c *ArticleController) GetArticle() { c.Data["RoleDelete"] = "false" } // c.Data["productid"] = prod.Uid//文章作者id + u := c.Ctx.Input.UserAgent() + matched, err := regexp.MatchString("AppleWebKit.*Mobile.*", u) + if err != nil { + beego.Error(err) + } + if matched == true { + // beego.Info("移动端~") + c.TplName = "marticle.tpl" + } else { + // beego.Info("电脑端!") + c.TplName = "article.tpl" + } c.Data["article"] = Article c.Data["product"] = prod - c.TplName = "article.tpl" + } //向某个侧栏id下添加文章 @@ -244,153 +323,163 @@ func (c *ArticleController) AddArticle() { var news string var cid int64 - _, role := checkprodRole(c.Ctx) - if role == 1 { - // id := c.Ctx.Input.Param(":id") - pid := c.Input().Get("pid") - code := c.Input().Get("code") - title := c.Input().Get("title") - subtext := c.Input().Get("subtext") - label := c.Input().Get("label") - principal := c.Input().Get("principal") - content := c.Input().Get("content") - // c.Data["Id"] = id - // beego.Info(subtext) - //id转成64为 - pidNum, err := strconv.ParseInt(pid, 10, 64) - if err != nil { - beego.Error(err) - } - //根据项目id添加成果code, title, label, principal, content string, projectid int64 - Id, err := models.AddProduct(code, title, label, principal, "", user.Id, pidNum) - if err != nil { - beego.Error(err) - } + // _, role := checkprodRole(c.Ctx) + // if role == 1 { + // id := c.Ctx.Input.Param(":id") + pid := c.Input().Get("pid") + code := c.Input().Get("code") + title := c.Input().Get("title") + subtext := c.Input().Get("subtext") + label := c.Input().Get("label") + principal := c.Input().Get("principal") + relevancy := c.Input().Get("relevancy") + content := c.Input().Get("content") + // c.Data["Id"] = id + // beego.Info(subtext) + //id转成64为 + pidNum, err := strconv.ParseInt(pid, 10, 64) + if err != nil { + beego.Error(err) + } + //根据项目id添加成果code, title, label, principal, content string, projectid int64 + Id, err := models.AddProduct(code, title, label, principal, "", user.Id, pidNum) + if err != nil { + beego.Error(err) + } - //成果写入postmerit表,准备提交merit********* - Number, Name, DesignStage, Section, err := GetProjTitleNumber(pidNum) + //*****添加成果关联信息 + if relevancy != "" { + _, err = models.AddRelevancy(Id, relevancy) if err != nil { beego.Error(err) } - catalog.ProjectNumber = Number - catalog.ProjectName = Name - catalog.DesignStage = DesignStage - catalog.Section = Section - - catalog.Tnumber = code - catalog.Name = title - catalog.Count = 1 - catalog.Drawn = meritbasic.Nickname - catalog.Designd = meritbasic.Nickname - catalog.Author = meritbasic.Username - catalog.Drawnratio = 0.4 - catalog.Designdratio = 0.4 - - const lll = "2006-01-02" - convdate := time.Now().Format(lll) - t1, err := time.Parse(lll, convdate) //这里t1要是用t1:=就不是前面那个t1了 - if err != nil { - beego.Error(err) - } - catalog.Datestring = convdate - catalog.Date = t1 + } + //*****添加成果关联信息结束 - catalog.Created = time.Now() //.Add(+time.Duration(hours) * time.Hour) - catalog.Updated = time.Now() //.Add(+time.Duration(hours) * time.Hour) + //成果写入postmerit表,准备提交merit********* + Number, Name, DesignStage, Section, err := GetProjTitleNumber(pidNum) + if err != nil { + beego.Error(err) + } + catalog.ProjectNumber = Number + catalog.ProjectName = Name + catalog.DesignStage = DesignStage + catalog.Section = Section - catalog.Complex = 1 - catalog.State = 0 - //生成提交merit的清单结束******************* + catalog.Tnumber = code + catalog.Name = title + catalog.Count = 1 + catalog.Drawn = meritbasic.Nickname + catalog.Designd = meritbasic.Nickname + catalog.Author = meritbasic.Username + catalog.Drawnratio = 0.4 + catalog.Designdratio = 0.4 + + const lll = "2006-01-02" + convdate := time.Now().Format(lll) + t1, err := time.Parse(lll, convdate) //这里t1要是用t1:=就不是前面那个t1了 + if err != nil { + beego.Error(err) + } + catalog.Datestring = convdate + catalog.Date = t1 + + catalog.Created = time.Now() //.Add(+time.Duration(hours) * time.Hour) + catalog.Updated = time.Now() //.Add(+time.Duration(hours) * time.Hour) - //将文章添加到成果id下 - aid, err := models.AddArticle(subtext, content, Id) + catalog.Complex = 1 + catalog.State = 0 + //生成提交merit的清单结束******************* + + //将文章添加到成果id下 + aid, err := models.AddArticle(subtext, content, Id) + if err != nil { + beego.Error(err) + } else { + //生成提交merit的清单******************* + cid, err, news = models.AddPostMerit(catalog) if err != nil { beego.Error(err) } else { - //生成提交merit的清单******************* - cid, err, news = models.AddPostMerit(catalog) + link1 := "/project/product/article/" + strconv.FormatInt(aid, 10) //附件链接地址 + _, err = models.AddCatalogLink(cid, link1) if err != nil { beego.Error(err) - } else { - link1 := "/project/product/article/" + strconv.FormatInt(aid, 10) //附件链接地址 - _, err = models.AddCatalogLink(cid, link1) - if err != nil { - beego.Error(err) - } - data := news - c.Ctx.WriteString(data) } - //生成提交merit的清单结束******************* - c.Data["json"] = "ok" - c.ServeJSON() + data := news + c.Ctx.WriteString(data) } - } else { - route := c.Ctx.Request.URL.String() - c.Data["Url"] = route - c.Redirect("/roleerr?url="+route, 302) - // c.Redirect("/roleerr", 302) - return + //生成提交merit的清单结束******************* + c.Data["json"] = "ok" + c.ServeJSON() } + // } else { + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // c.Redirect("/roleerr", 302) + // return + // } } //向成果id下添加文章——这个没用,上面那个已经包含了 func (c *ArticleController) AddProdArticle() { - _, role := checkprodRole(c.Ctx) - if role == 1 { - // id := c.Ctx.Input.Param(":id") - pid := c.Input().Get("pid") - subtext := c.Input().Get("subtext") - content := c.Input().Get("content") - //id转成64为 - pidNum, err := strconv.ParseInt(pid, 10, 64) - if err != nil { - beego.Error(err) - } - //将文章添加到成果id下 - _, err = models.AddArticle(subtext, content, pidNum) - if err != nil { - beego.Error(err) - } else { - c.Data["json"] = "ok" - c.ServeJSON() - } + // _, role := checkprodRole(c.Ctx) + // if role == 1 { + // id := c.Ctx.Input.Param(":id") + pid := c.Input().Get("pid") + subtext := c.Input().Get("subtext") + content := c.Input().Get("content") + //id转成64为 + pidNum, err := strconv.ParseInt(pid, 10, 64) + if err != nil { + beego.Error(err) + } + //将文章添加到成果id下 + _, err = models.AddArticle(subtext, content, pidNum) + if err != nil { + beego.Error(err) } else { - route := c.Ctx.Request.URL.String() - c.Data["Url"] = route - c.Redirect("/roleerr?url="+route, 302) - // c.Redirect("/roleerr", 302) - return + c.Data["json"] = "ok" + c.ServeJSON() } + // } else { + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // // c.Redirect("/roleerr", 302) + // return + // } } //编辑 成果id func (c *ArticleController) UpdateArticle() { - _, role := checkprodRole(c.Ctx) - if role == 1 { - // id := c.Ctx.Input.Param(":id") - pid := c.Input().Get("pid") - subtext := c.Input().Get("subtext") - content := c.Input().Get("content") - //id转成64为 - pidNum, err := strconv.ParseInt(pid, 10, 64) - if err != nil { - beego.Error(err) - } - //将文章添加到成果id下 - err = models.UpdateArticle(pidNum, subtext, content) - if err != nil { - beego.Error(err) - } else { - c.Data["json"] = "ok" - c.ServeJSON() - } + // _, role := checkprodRole(c.Ctx) + // if role == 1 { + // id := c.Ctx.Input.Param(":id") + pid := c.Input().Get("pid") + subtext := c.Input().Get("subtext") + content := c.Input().Get("content") + //id转成64为 + pidNum, err := strconv.ParseInt(pid, 10, 64) + if err != nil { + beego.Error(err) + } + //将文章添加到成果id下 + err = models.UpdateArticle(pidNum, subtext, content) + if err != nil { + beego.Error(err) } else { - route := c.Ctx.Request.URL.String() - c.Data["Url"] = route - c.Redirect("/roleerr?url="+route, 302) - // c.Redirect("/roleerr", 302) - return + c.Data["json"] = "ok" + c.ServeJSON() } + // } else { + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // // c.Redirect("/roleerr", 302) + // return + // } } //根据文章id删除文章_没删除文章中的图片 diff --git a/controllers/attachment.go b/controllers/attachment.go index c76838fd..b5082c15 100644 --- a/controllers/attachment.go +++ b/controllers/attachment.go @@ -51,9 +51,9 @@ func (c *AttachController) GetAttachments() { beego.Error(err) } // beego.Info(Url) - } else { + } //else { - } + //} //根据成果id取得所有附件 Attachments, err := models.GetAttachments(idNum) if err != nil { @@ -261,7 +261,7 @@ func (c *AttachController) GetPdfs() { if err != nil { beego.Error(err) } - beego.Info(Url) + // beego.Info(Url) } else { } @@ -612,237 +612,237 @@ func (c *AttachController) AddAttachment2() { var news string var cid int64 - _, role := checkprodRole(c.Ctx) - if role == 1 { - //解析表单 - pid := c.Input().Get("pid") - // beego.Info(pid) - //pid转成64为 - pidNum, err := strconv.ParseInt(pid, 10, 64) - if err != nil { - beego.Error(err) - } - prodcode := c.Input().Get("prodcode") //和上面那个区别仅仅在此处而已 - prodname := c.Input().Get("prodname") - prodlabel := c.Input().Get("prodlabel") - prodprincipal := c.Input().Get("prodprincipal") - size := c.Input().Get("size") - filesize, err := strconv.ParseInt(size, 10, 64) - if err != nil { - beego.Error(err) - } - filesize = filesize / 1000.0 - // proj, err := models.GetProj(pidNum) - // if err != nil { - // beego.Error(err) - // } - //根据proj的Id - Url, DiskDirectory, err := GetUrlPath(pidNum) + // _, role := checkprodRole(c.Ctx) + // if role == 1 { + //解析表单 + pid := c.Input().Get("pid") + // beego.Info(pid) + //pid转成64为 + pidNum, err := strconv.ParseInt(pid, 10, 64) + if err != nil { + beego.Error(err) + } + prodcode := c.Input().Get("prodcode") //和上面那个区别仅仅在此处而已 + prodname := c.Input().Get("prodname") + prodlabel := c.Input().Get("prodlabel") + prodprincipal := c.Input().Get("prodprincipal") + size := c.Input().Get("size") + filesize, err := strconv.ParseInt(size, 10, 64) + if err != nil { + beego.Error(err) + } + filesize = filesize / 1000.0 + // proj, err := models.GetProj(pidNum) + // if err != nil { + // beego.Error(err) + // } + //根据proj的Id + Url, DiskDirectory, err := GetUrlPath(pidNum) + if err != nil { + beego.Error(err) + } + Number, Name, DesignStage, Section, err := GetProjTitleNumber(pidNum) + if err != nil { + beego.Error(err) + } + catalog.ProjectNumber = Number + catalog.ProjectName = Name + catalog.DesignStage = DesignStage + catalog.Section = Section + + //获取上传的文件 + _, h, err := c.GetFile("file") + if err != nil { + beego.Error(err) + } + var path, attachment string + // var filesize int64 + if h != nil { + //保存附件 + attachment = h.Filename + path = DiskDirectory + "\\" + h.Filename + // f.Close()// 关闭上传的文件,不然的话会出现临时文件不能清除的情况 + //存入成果数据库 + //如果编号重复,则不写入,值返回Id值。 + //根据id添加成果code, title, label, principal, content string, projectid int64 + prodId, err := models.AddProduct(prodcode, prodname, prodlabel, prodprincipal, "", user.Id, pidNum) if err != nil { beego.Error(err) } - Number, Name, DesignStage, Section, err := GetProjTitleNumber(pidNum) + + //成果写入postmerit表,准备提交merit********* + catalog.Tnumber = prodcode + catalog.Name = prodname + catalog.Count = 1 + catalog.Drawn = meritbasic.Nickname + catalog.Designd = meritbasic.Nickname + catalog.Author = meritbasic.Username + catalog.Drawnratio = 0.4 + catalog.Designdratio = 0.4 + + const lll = "2006-01-02" + convdate := time.Now().Format(lll) + t1, err := time.Parse(lll, convdate) //这里t1要是用t1:=就不是前面那个t1了 if err != nil { beego.Error(err) } - catalog.ProjectNumber = Number - catalog.ProjectName = Name - catalog.DesignStage = DesignStage - catalog.Section = Section + catalog.Datestring = convdate + catalog.Date = t1 + + catalog.Created = time.Now() //.Add(+time.Duration(hours) * time.Hour) + catalog.Updated = time.Now() //.Add(+time.Duration(hours) * time.Hour) - //获取上传的文件 - _, h, err := c.GetFile("file") + catalog.Complex = 1 + catalog.State = 0 + cid, err, news = models.AddPostMerit(catalog) if err != nil { beego.Error(err) - } - var path, attachment string - // var filesize int64 - if h != nil { - //保存附件 - attachment = h.Filename - path = DiskDirectory + "\\" + h.Filename - // f.Close()// 关闭上传的文件,不然的话会出现临时文件不能清除的情况 - //存入成果数据库 - //如果编号重复,则不写入,值返回Id值。 - //根据id添加成果code, title, label, principal, content string, projectid int64 - prodId, err := models.AddProduct(prodcode, prodname, prodlabel, prodprincipal, "", user.Id, pidNum) - if err != nil { - beego.Error(err) - } - - //成果写入postmerit表,准备提交merit********* - catalog.Tnumber = prodcode - catalog.Name = prodname - catalog.Count = 1 - catalog.Drawn = meritbasic.Nickname - catalog.Designd = meritbasic.Nickname - catalog.Author = meritbasic.Username - catalog.Drawnratio = 0.4 - catalog.Designdratio = 0.4 - - const lll = "2006-01-02" - convdate := time.Now().Format(lll) - t1, err := time.Parse(lll, convdate) //这里t1要是用t1:=就不是前面那个t1了 + } else { + link1 := Url + "/" + attachment //附件链接地址 + _, err = models.AddCatalogLink(cid, link1) if err != nil { beego.Error(err) } - catalog.Datestring = convdate - catalog.Date = t1 - - catalog.Created = time.Now() //.Add(+time.Duration(hours) * time.Hour) - catalog.Updated = time.Now() //.Add(+time.Duration(hours) * time.Hour) + data := news + c.Ctx.WriteString(data) + } + //生成提交merit的清单结束******************* - catalog.Complex = 1 - catalog.State = 0 - cid, err, news = models.AddPostMerit(catalog) + //把成果id作为附件的parentid,把附件的名称等信息存入附件数据库 + //如果附件名称相同,则覆盖上传,但数据库不追加 + _, err = models.AddAttachment(attachment, filesize, 0, prodId) + if err != nil { + beego.Error(err) + } else { + err = c.SaveToFile("file", path) //.Join("attachment", attachment)) //存文件 WaterMark(path) //给文件加水印 if err != nil { beego.Error(err) - } else { - link1 := Url + "/" + attachment //附件链接地址 - _, err = models.AddCatalogLink(cid, link1) - if err != nil { - beego.Error(err) - } - data := news - c.Ctx.WriteString(data) - } - //生成提交merit的清单结束******************* - - //把成果id作为附件的parentid,把附件的名称等信息存入附件数据库 - //如果附件名称相同,则覆盖上传,但数据库不追加 - _, err = models.AddAttachment(attachment, filesize, 0, prodId) - if err != nil { - beego.Error(err) - } else { - err = c.SaveToFile("file", path) //.Join("attachment", attachment)) //存文件 WaterMark(path) //给文件加水印 - if err != nil { - beego.Error(err) - } - c.Data["json"] = map[string]interface{}{"state": "SUCCESS", "title": attachment, "original": attachment, "url": Url + "/" + attachment} - c.ServeJSON() } + c.Data["json"] = map[string]interface{}{"state": "SUCCESS", "title": attachment, "original": attachment, "url": Url + "/" + attachment} + c.ServeJSON() } - } else { - route := c.Ctx.Request.URL.String() - c.Data["Url"] = route - c.Redirect("/roleerr?url="+route, 302) - // c.Redirect("/roleerr", 302) - return } + // } else { + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // // c.Redirect("/roleerr", 302) + // return + // } } //向一个成果id下追加附件 func (c *AttachController) UpdateAttachment() { - _, role := checkprodRole(c.Ctx) - if role == 1 { - //解析表单 - pid := c.Input().Get("pid") - size := c.Input().Get("size") - filesize, err := strconv.ParseInt(size, 10, 64) + // _, role := checkprodRole(c.Ctx) + // if role == 1 { + //解析表单 + pid := c.Input().Get("pid") + size := c.Input().Get("size") + filesize, err := strconv.ParseInt(size, 10, 64) + if err != nil { + beego.Error(err) + } + filesize = filesize / 1000.0 + // beego.Info(pid) + //pid转成64为 + pidNum, err := strconv.ParseInt(pid, 10, 64) + if err != nil { + beego.Error(err) + } + + prod, err := models.GetProd(pidNum) + if err != nil { + beego.Error(err) + } + //根据proj的Id + Url, DiskDirectory, err := GetUrlPath(prod.ProjectId) + if err != nil { + beego.Error(err) + } + //获取上传的文件 + _, h, err := c.GetFile("file") + if err != nil { + beego.Error(err) + } + var path, attachment string + // var filesize int64 + if h != nil { + //保存附件 + attachment = h.Filename + path = DiskDirectory + "\\" + h.Filename // 关闭上传的文件,不然的话会出现临时文件不能清除的情况 + // filesize, _ = FileSize(path) + // filesize = filesize / 1000.0 + //把成果id作为附件的parentid,把附件的名称等信息存入附件数据库 + //如果附件名称相同,则覆盖上传,但数据库不追加 + _, err = models.AddAttachment(attachment, filesize, 0, pidNum) if err != nil { beego.Error(err) + } else { + err = c.SaveToFile("file", path) //.Join("attachment", attachment)) //存文件 WaterMark(path) //给文件加水印 + if err != nil { + beego.Error(err) + } + c.Data["json"] = map[string]interface{}{"state": "SUCCESS", "title": attachment, "original": attachment, "url": Url + "/" + attachment} + c.ServeJSON() } - filesize = filesize / 1000.0 - // beego.Info(pid) - //pid转成64为 - pidNum, err := strconv.ParseInt(pid, 10, 64) + } + // } else { + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // // c.Redirect("/roleerr", 302) + // return + // } +} + +//删除附件——这个用于针对删除一个附件 +func (c *AttachController) DeleteAttachment() { + // _, role := checkprodRole(c.Ctx) + // if role == 1 { + //解析表单 + ids := c.GetString("ids") + array := strings.Split(ids, ",") + for _, v := range array { + // pid = strconv.FormatInt(v1, 10) + //id转成64位 + idNum, err := strconv.ParseInt(v, 10, 64) if err != nil { beego.Error(err) } - - prod, err := models.GetProd(pidNum) + //取得附件的成果id——再取得成果的项目目录id——再取得路径 + attach, err := models.GetAttachbyId(idNum) if err != nil { beego.Error(err) } - //根据proj的Id - Url, DiskDirectory, err := GetUrlPath(prod.ProjectId) + prod, err := models.GetProd(attach.ProductId) if err != nil { beego.Error(err) } - //获取上传的文件 - _, h, err := c.GetFile("file") + //根据proj的id + _, DiskDirectory, err := GetUrlPath(prod.ProjectId) if err != nil { beego.Error(err) - } - var path, attachment string - // var filesize int64 - if h != nil { - //保存附件 - attachment = h.Filename - path = DiskDirectory + "\\" + h.Filename // 关闭上传的文件,不然的话会出现临时文件不能清除的情况 - // filesize, _ = FileSize(path) - // filesize = filesize / 1000.0 - //把成果id作为附件的parentid,把附件的名称等信息存入附件数据库 - //如果附件名称相同,则覆盖上传,但数据库不追加 - _, err = models.AddAttachment(attachment, filesize, 0, pidNum) - if err != nil { - beego.Error(err) - } else { - err = c.SaveToFile("file", path) //.Join("attachment", attachment)) //存文件 WaterMark(path) //给文件加水印 - if err != nil { - beego.Error(err) - } - c.Data["json"] = map[string]interface{}{"state": "SUCCESS", "title": attachment, "original": attachment, "url": Url + "/" + attachment} - c.ServeJSON() - } - } - } else { - route := c.Ctx.Request.URL.String() - c.Data["Url"] = route - c.Redirect("/roleerr?url="+route, 302) - // c.Redirect("/roleerr", 302) - return - } -} - -//删除附件——这个用于针对删除一个附件 -func (c *AttachController) DeleteAttachment() { - _, role := checkprodRole(c.Ctx) - if role == 1 { - //解析表单 - ids := c.GetString("ids") - array := strings.Split(ids, ",") - for _, v := range array { - // pid = strconv.FormatInt(v1, 10) - //id转成64位 - idNum, err := strconv.ParseInt(v, 10, 64) - if err != nil { - beego.Error(err) - } - //取得附件的成果id——再取得成果的项目目录id——再取得路径 - attach, err := models.GetAttachbyId(idNum) + } else { + path := DiskDirectory + "\\" + attach.FileName + err = os.Remove(path) if err != nil { beego.Error(err) } - prod, err := models.GetProd(attach.ProductId) + err = models.DeleteAttachment(idNum) if err != nil { beego.Error(err) } - //根据proj的id - _, DiskDirectory, err := GetUrlPath(prod.ProjectId) - if err != nil { - beego.Error(err) - } else { - path := DiskDirectory + "\\" + attach.FileName - err = os.Remove(path) - if err != nil { - beego.Error(err) - } - err = models.DeleteAttachment(idNum) - if err != nil { - beego.Error(err) - } - } } - c.Data["json"] = "ok" - c.ServeJSON() - } else { - route := c.Ctx.Request.URL.String() - c.Data["Url"] = route - c.Redirect("/roleerr?url="+route, 302) - // c.Redirect("/roleerr", 302) - return } + c.Data["json"] = "ok" + c.ServeJSON() + // } else { + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // // c.Redirect("/roleerr", 302) + // return + // } } // 下载附件——这个仅是测试 diff --git a/controllers/product.go b/controllers/product.go index 568c60dd..dad9e524 100644 --- a/controllers/product.go +++ b/controllers/product.go @@ -25,6 +25,7 @@ type ProductLink struct { Code string Title string Label string + Relevancy []models.Relevancy Uid int64 Principal string ProjectId int64 @@ -102,13 +103,13 @@ func (c *ProdController) GetProjProd() { c.Data["Uid"] = user.Id // userrole = user.Role useridstring = strconv.FormatInt(user.Id, 10) - } else { - // userrole = 5 - // route := c.Ctx.Request.URL.String() - // c.Data["Url"] = route - // c.Redirect("/roleerr?url="+route, 302) - // return - } + } //else { + // userrole = 5 + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // return + //} //2.取得侧栏目录路径——路由id //2.1 根据id取得路由 var projurls string @@ -278,6 +279,51 @@ func (c *ProdController) GetProducts() { } linkarr[0].Articlecontent = Articleslice Articleslice = make([]ArticleContent, 0) + + //取得关联 + relevancies, err := models.GetRelevancy(w.Id) + if err != nil { + beego.Error(err) + } + relevancies1 := make([]models.Relevancy, 0) + if len(relevancies) > 0 { + for _, tt := range relevancies { + relevancies2 := make([]models.Relevancy, 1) + relevancies2[0].Relevancy = tt.Relevancy + relevancies1 = append(relevancies1, relevancies2...) + } + linkarr[0].Relevancy = relevancies1 + relevancies1 = make([]models.Relevancy, 0) + } else if len(relevancies) == 0 { + //循环所有relevancies,以,号分割,如果相等prodcode,则返回 + relevancies3, err := models.GetAllRelevancies() + if err != nil { + beego.Error(err) + } + // if len(relevancies)>0{} + for _, vv := range relevancies3 { + array := strings.Split(vv.Relevancy, ",") + // beego.Info(array) + for _, ww := range array { + if ww == w.Code { + relevancies2 := make([]models.Relevancy, 1) + // v.ProductId查出prodcode + prod, err := models.GetProd(vv.ProductId) + if err != nil { + beego.Error(err) + } else { + // beego.Info(ww) //20171228 + // beego.Info(prod.Code) //20171231 + relevancies2[0].Relevancy = prod.Code + relevancies1 = append(relevancies1, relevancies2...) + } + break + } + } + } + linkarr[0].Relevancy = relevancies1 + // relevancies1 = make([]models.Relevancy, 0) + } link = append(link, linkarr...) } @@ -612,111 +658,111 @@ func (c *ProdController) AddProduct() { //编辑成果信息 func (c *ProdController) UpdateProduct() { - _, role := checkprodRole(c.Ctx) - if role == 1 { - id := c.Input().Get("pid") - code := c.Input().Get("code") - title := c.Input().Get("title") - label := c.Input().Get("label") - principal := c.Input().Get("principal") + // _, role := checkprodRole(c.Ctx) + // if role == 1 { + id := c.Input().Get("pid") + code := c.Input().Get("code") + title := c.Input().Get("title") + label := c.Input().Get("label") + principal := c.Input().Get("principal") - //id转成64为 - idNum, err := strconv.ParseInt(id, 10, 64) + //id转成64为 + idNum, err := strconv.ParseInt(id, 10, 64) + if err != nil { + beego.Error(err) + } + //根据id添加成果code, title, label, principal, content string, projectid int64 + err = models.UpdateProduct(idNum, code, title, label, principal) + if err != nil { + beego.Error(err) + } + c.Data["json"] = "ok" + c.ServeJSON() + // } else { + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // // c.Redirect("/roleerr", 302) + // return + // } +} + +//删除成果,包含成果里的附件。删除附件用attachment中的 +func (c *ProdController) DeleteProduct() { + // _, role := checkprodRole(c.Ctx) + // if role == 1 { + ids := c.GetString("ids") + array := strings.Split(ids, ",") + for _, v := range array { + // pid = strconv.FormatInt(v1, 10) + //id转成64位 + idNum, err := strconv.ParseInt(v, 10, 64) if err != nil { beego.Error(err) } - //根据id添加成果code, title, label, principal, content string, projectid int64 - err = models.UpdateProduct(idNum, code, title, label, principal) + //循环删除成果 + //根据成果id取得所有附件 + attachments, err := models.GetAttachments(idNum) if err != nil { beego.Error(err) } - c.Data["json"] = "ok" - c.ServeJSON() - } else { - route := c.Ctx.Request.URL.String() - c.Data["Url"] = route - c.Redirect("/roleerr?url="+route, 302) - // c.Redirect("/roleerr", 302) - return - } -} - -//删除成果,包含成果里的附件。删除附件用attachment中的 -func (c *ProdController) DeleteProduct() { - _, role := checkprodRole(c.Ctx) - if role == 1 { - ids := c.GetString("ids") - array := strings.Split(ids, ",") - for _, v := range array { - // pid = strconv.FormatInt(v1, 10) - //id转成64位 - idNum, err := strconv.ParseInt(v, 10, 64) + for _, w := range attachments { + //取得附件的成果id——再取得成果的项目目录id——再取得路径 + attach, err := models.GetAttachbyId(w.Id) if err != nil { beego.Error(err) } - //循环删除成果 - //根据成果id取得所有附件 - attachments, err := models.GetAttachments(idNum) + prod, err := models.GetProd(attach.ProductId) if err != nil { beego.Error(err) } - for _, w := range attachments { - //取得附件的成果id——再取得成果的项目目录id——再取得路径 - attach, err := models.GetAttachbyId(w.Id) - if err != nil { - beego.Error(err) - } - prod, err := models.GetProd(attach.ProductId) - if err != nil { - beego.Error(err) - } - //根据proj的id - _, DiskDirectory, err := GetUrlPath(prod.ProjectId) + //根据proj的id + _, DiskDirectory, err := GetUrlPath(prod.ProjectId) + if err != nil { + beego.Error(err) + } else { + path := DiskDirectory + "\\" + attach.FileName + //删除附件 + err = os.Remove(path) if err != nil { beego.Error(err) - } else { - path := DiskDirectory + "\\" + attach.FileName - //删除附件 - err = os.Remove(path) - if err != nil { - beego.Error(err) - } - //删除附件数据表 - err = models.DeleteAttachment(w.Id) - if err != nil { - beego.Error(err) - } } - } - //删除文章,文章中的图片无法删除 - //取得成果id下所有文章 - articles, err := models.GetArticles(idNum) - if err != nil { - beego.Error(err) - } - //删除文章表 - for _, z := range articles { - //删除文章数据表 - err = models.DeleteArticle(z.Id) + //删除附件数据表 + err = models.DeleteAttachment(w.Id) if err != nil { beego.Error(err) } } - err = models.DeleteProduct(idNum) //删除成果数据表 + } + //删除文章,文章中的图片无法删除 + //取得成果id下所有文章 + articles, err := models.GetArticles(idNum) + if err != nil { + beego.Error(err) + } + //删除文章表 + for _, z := range articles { + //删除文章数据表 + err = models.DeleteArticle(z.Id) if err != nil { beego.Error(err) - } else { - c.Data["json"] = "ok" - c.ServeJSON() } } - } else { - route := c.Ctx.Request.URL.String() - c.Data["Url"] = route - c.Redirect("/roleerr?url="+route, 302) - // c.Redirect("/roleerr", 302) - return + err = models.DeleteProduct(idNum) //删除成果数据表 + if err != nil { + beego.Error(err) + } else { + c.Data["json"] = "ok" + c.ServeJSON() + } } + // } else { + // route := c.Ctx.Request.URL.String() + // c.Data["Url"] = route + // c.Redirect("/roleerr?url="+route, 302) + // // c.Redirect("/roleerr", 302) + // return + // } } func checkprodRole(ctx *context.Context) (uname string, role int) { @@ -731,7 +777,11 @@ func checkprodRole(ctx *context.Context) (uname string, role int) { if err != nil { beego.Error(err) } - userrole = user.Role + if user.Role == 0 { + userrole = 4 + } else { + userrole = user.Role + } } else { userrole = 5 uname = ctx.Input.IP() diff --git a/controllers/project.go b/controllers/project.go index e3c2fdbe..0bc1996b 100644 --- a/controllers/project.go +++ b/controllers/project.go @@ -859,7 +859,7 @@ func (c *ProjController) AddCalendar() { start := c.Input().Get("start") end := c.Input().Get("end") color := c.Input().Get("color") - url := "/" + c.Input().Get("url") + url := c.Input().Get("url") //"/" + allday1 := c.Input().Get("allday") var allday bool if allday1 == "true" { @@ -967,7 +967,7 @@ func (c *ProjController) UpdateCalendar() { start := c.Input().Get("start") end := c.Input().Get("end") color := c.Input().Get("color") - url := "/" + c.Input().Get("url") + url := c.Input().Get("url") //"/" + memorabilia1 := c.Input().Get("memorabilia") var memorabilia bool if memorabilia1 == "true" { diff --git a/controllers/roleControllers.go b/controllers/roleControllers.go index d2e3b7c2..b22aaf6b 100644 --- a/controllers/roleControllers.go +++ b/controllers/roleControllers.go @@ -4,9 +4,11 @@ import ( // "encoding/json" m "engineercms/models" "github.com/astaxie/beego" + "github.com/astaxie/beego/orm" "github.com/casbin/beego-orm-adapter" "github.com/casbin/casbin" _ "github.com/mattn/go-sqlite3" + "path" "regexp" "strconv" "strings" @@ -40,6 +42,17 @@ type Tree struct { Nodes []Tree `json:"nodes"` } +// type CasbinRule struct { +// Id int +// PType string +// V0 string +// V1 string +// V2 string +// V3 string +// V4 string +// V5 string +// } + // type RoleController struct { // models models.RoleModel // } @@ -206,7 +219,7 @@ func (c *RoleController) Get() { // if err != nil { // beego.Error(err) // } - //查出用户的角色,处于勾选状态 + //查出用户的角色,处于勾选状态,来自casbin\rbac_api.go userroles := e.GetRolesForUser(id) userrole := make([]Userrole, 0) var level string @@ -382,6 +395,7 @@ func (c *RoleController) UserRole() { // beego.Info(rule) // e.AddPolicy(uid, v1) e.AddGroupingPolicy(uid, v1) + //应该用AddRoleForUser() // rule = make([]string, 0) } // a.SavePolicy(e.GetModel())//autosave默认是true @@ -488,6 +502,7 @@ func (c *RoleController) RolePermission() { // beego.Info(action) // beego.Info(suf) success = e.AddPolicy(v1, projurl, action, suf) + //这里应该用AddPermissionForUser(),来自casbin\rbac_api.go } } } @@ -529,6 +544,43 @@ func highest(nodeid, nodesid []string, i int) (nodesid1 []string, err error) { return nodesid, err } +//查询角色所具有的权限对应的项目目录 +func (c *RoleController) GetRolePermission() { + roleid := c.GetString("roleid") //角色id + action := c.GetString("action") + projectid := c.GetString("projectid") + beego.Info(roleid) + beego.Info(action) + beego.Info(projectid) + myRes := e.GetPermissionsForUser(roleid) + beego.Info(myRes) + // 2018/01/03 21:42:15 [I] [roleControllers.go:543] [[1 /25001/* POST .*] [1 /25001 + // /* PUT .*] [1 /25001/* DELETE .*] [1 /25001/* GET .*] [1 /25001/25003/* GET (?i: + // PDF)] [1 /25001/25002/25013/* GET (?i:PDF)] [1 /25001/25002/25012/* GET (?i:PDF) + // ] [1 /25001/25002/25011/* GET (?i:PDF)] [1 /25001/* GET (?i:PDF)] [1 /25001/2500 + // 4/* POST .*]] + // Permissions, err := models.GetPermissions(roleid,projectid,action) + // if err != nil { + // beego.Error(err) + // } + var paths []beegoormadapter.CasbinRule + o := orm.NewOrm() + qs := o.QueryTable("casbin_rule") + _, err := qs.Filter("PType", "p").Filter("v0", roleid).Filter("v1__contains", "/"+projectid+"/").Filter("v2", action).All(&paths) + if err != nil { + beego.Error(err) + } + // beego.Info(paths) + var projids []string + for _, v1 := range paths { + projid := strings.Replace(v1.V1, "/*", "", -1) + projids = append(projids, path.Base(projid)) + } + beego.Info(projids) + c.Data["json"] = projids + c.ServeJSON() +} + // swagger:operation POST /v1/auth/role/delete RoleController RoleController // // 删除角色信息 diff --git a/controllers/ueditor.go b/controllers/ueditor.go index 1cd215b5..817bf0bd 100644 --- a/controllers/ueditor.go +++ b/controllers/ueditor.go @@ -54,7 +54,7 @@ type UploadimageUE struct { func (c *UeditorController) ControllerUE() { op := c.Input().Get("action") - // key := c.Input().Get("key") //这里进行判断各个页面,如果是addtopic,如果是addcategory + key := c.Input().Get("key") //这里进行判断各个页面,如果是addtopic,如果是addcategory switch op { case "config": //这里还是要优化成conf/config.json // $CONFIG = json_decode(preg_replace("/\/\*[\s\S]+?\*\//", "", file_get_contents("config.json")), true); @@ -109,54 +109,81 @@ func (c *UeditorController) ControllerUE() { // c.Data["json"] = r // c.ServeJSON() case "uploadimage", "uploadfile", "uploadvideo": - //解析表单 - pid := c.Input().Get("pid") - beego.Info(pid) - //pid转成64为 - pidNum, err := strconv.ParseInt(pid, 10, 64) - if err != nil { - beego.Error(err) - } - //根据proj的parentIdpath - Url, DiskDirectory, err := GetUrlPath(pidNum) - if err != nil { - beego.Error(err) - } - beego.Info(DiskDirectory) - //获取上传的文件 - _, h, err := c.GetFile("upfile") - if err != nil { - beego.Error(err) - } - fileSuffix := path.Ext(h.Filename) - // random_name - newname := strconv.FormatInt(time.Now().UnixNano(), 10) + fileSuffix // + "_" + filename - // err = ioutil.WriteFile(path1+newname+".jpg", ddd, 0666) //buffer输出到jpg文件中(不做处理,直接写到文件) - // if err != nil { - // beego.Error(err) - // } - year, month, _ := time.Now().Date() - err = os.MkdirAll(DiskDirectory+"\\"+strconv.Itoa(year)+month.String()+"\\", 0777) //..代表本当前exe文件目录的上级,.表示当前目录,没有.表示盘的根目录 - if err != nil { - beego.Error(err) - } - var path string - var filesize int64 - if h != nil { - //保存附件 - path = DiskDirectory + "\\" + strconv.Itoa(year) + month.String() + "\\" + newname - Url = "/" + Url + "/" + strconv.Itoa(year) + month.String() + "/" - err = c.SaveToFile("upfile", path) //.Join("attachment", attachment)) //存文件 WaterMark(path) //给文件加水印 + switch key { + case "wiki": //添加wiki + //保存上传的图片 + _, h, err := c.GetFile("upfile") + if err != nil { + beego.Error(err) + } + var filesize int64 + fileSuffix := path.Ext(h.Filename) + newname := strconv.FormatInt(time.Now().UnixNano(), 10) + fileSuffix // + "_" + filename + year, month, _ := time.Now().Date() + err = os.MkdirAll(".\\attachment\\wiki\\"+strconv.Itoa(year)+month.String()+"\\", 0777) //..代表本当前exe文件目录的上级,.表示当前目录,没有.表示盘的根目录 if err != nil { beego.Error(err) } - filesize, _ = FileSize(path) + path1 := ".\\attachment\\wiki\\" + strconv.Itoa(year) + month.String() + "\\" + newname //h.Filename + Url := "/attachment/wiki/" + strconv.Itoa(year) + month.String() + "/" + err = c.SaveToFile("upfile", path1) //.Join("attachment", attachment)) //存文件 WaterMark(path) //给文件加水印 + if err != nil { + beego.Error(err) + } + filesize, _ = FileSize(path1) filesize = filesize / 1000.0 c.Data["json"] = map[string]interface{}{"state": "SUCCESS", "url": Url + newname, "title": h.Filename, "original": h.Filename} c.ServeJSON() - } else { - c.Data["json"] = map[string]interface{}{"state": "ERROR", "url": "", "title": "", "original": ""} - c.ServeJSON() + default: + //解析表单 + pid := c.Input().Get("pid") + beego.Info(pid) + //pid转成64为 + pidNum, err := strconv.ParseInt(pid, 10, 64) + if err != nil { + beego.Error(err) + } + //根据proj的parentIdpath + Url, DiskDirectory, err := GetUrlPath(pidNum) + if err != nil { + beego.Error(err) + } + beego.Info(DiskDirectory) + //获取上传的文件 + _, h, err := c.GetFile("upfile") + if err != nil { + beego.Error(err) + } + fileSuffix := path.Ext(h.Filename) + // random_name + newname := strconv.FormatInt(time.Now().UnixNano(), 10) + fileSuffix // + "_" + filename + // err = ioutil.WriteFile(path1+newname+".jpg", ddd, 0666) //buffer输出到jpg文件中(不做处理,直接写到文件) + // if err != nil { + // beego.Error(err) + // } + year, month, _ := time.Now().Date() + err = os.MkdirAll(DiskDirectory+"\\"+strconv.Itoa(year)+month.String()+"\\", 0777) //..代表本当前exe文件目录的上级,.表示当前目录,没有.表示盘的根目录 + if err != nil { + beego.Error(err) + } + var path string + var filesize int64 + if h != nil { + //保存附件 + path = DiskDirectory + "\\" + strconv.Itoa(year) + month.String() + "\\" + newname + Url = "/" + Url + "/" + strconv.Itoa(year) + month.String() + "/" + err = c.SaveToFile("upfile", path) //.Join("attachment", attachment)) //存文件 WaterMark(path) //给文件加水印 + if err != nil { + beego.Error(err) + } + filesize, _ = FileSize(path) + filesize = filesize / 1000.0 + c.Data["json"] = map[string]interface{}{"state": "SUCCESS", "url": Url + newname, "title": h.Filename, "original": h.Filename} + c.ServeJSON() + } else { + c.Data["json"] = map[string]interface{}{"state": "ERROR", "url": "", "title": "", "original": ""} + c.ServeJSON() + } } case "uploadscrawl": number := c.Input().Get("number") diff --git a/controllers/user.go b/controllers/user.go index baca2760..ba48039b 100644 --- a/controllers/user.go +++ b/controllers/user.go @@ -195,6 +195,7 @@ func (c *UserController) View() { c.TplName = "admin_user_view.tpl" } +//添加用户 func (c *UserController) AddUser() { // u := m.User{} // if err := c.ParseForm(&u); err != nil { @@ -205,11 +206,18 @@ func (c *UserController) AddUser() { user.Username = c.Input().Get("username") user.Nickname = c.Input().Get("nickname") + Pwd1 := c.Input().Get("password") md5Ctx := md5.New() - md5Ctx.Write([]byte(c.Input().Get("password"))) + md5Ctx.Write([]byte(Pwd1)) cipherStr := md5Ctx.Sum(nil) user.Password = hex.EncodeToString(cipherStr) - user.Repassword = c.Input().Get("repassword") + // user.Repassword = c.Input().Get("repassword") + // Pwd1=c.Input().Get("password") + // md5Ctx := md5.New() + // md5Ctx.Write([]byte(Pwd1)) + // cipherStr := md5Ctx.Sum(nil) + // user.Password = hex.EncodeToString(cipherStr) + user.Email = c.Input().Get("email") user.Department = c.Input().Get("department") user.Secoffice = c.Input().Get("secoffice") diff --git a/controllers/wiki.go b/controllers/wiki.go index 68d9a37d..7a94bb50 100644 --- a/controllers/wiki.go +++ b/controllers/wiki.go @@ -188,6 +188,14 @@ func (c *WikiController) AddWiki() { // uname, _ := checkprodRole(c.Ctx) //login里的 // rolename, _ = strconv.Atoi(role) // c.Data["Uname"] = uname + if role > 4 { //&& uname != category.Author + // port := strconv.Itoa(c.Ctx.Input.Port())//c.Ctx.Input.Site() + ":" + port + + route := c.Ctx.Request.URL.String() + c.Data["Url"] = route + c.Redirect("/roleerr?url="+route, 302) + // c.Redirect("/roleerr", 302) + return + } _, err := models.AddWikiOne(title, content, username) if err != nil { beego.Error(err) diff --git a/document/casbin.docx b/document/casbin.docx new file mode 100644 index 00000000..08814547 Binary files /dev/null and b/document/casbin.docx differ diff --git "a/document/\345\210\251\347\224\250EngineerCMS\346\211\223\351\200\240\350\256\276\344\273\243\350\265\204\346\226\231\347\256\241\347\220\206\345\271\263\345\217\260.docx" "b/document/\345\210\251\347\224\250EngineerCMS\346\211\223\351\200\240\350\256\276\344\273\243\350\265\204\346\226\231\347\256\241\347\220\206\345\271\263\345\217\260.docx" new file mode 100644 index 00000000..73bc64cd Binary files /dev/null and "b/document/\345\210\251\347\224\250EngineerCMS\346\211\223\351\200\240\350\256\276\344\273\243\350\265\204\346\226\231\347\256\241\347\220\206\345\271\263\345\217\260.docx" differ diff --git a/models/ArticModel.go b/models/ArticModel.go index 49dd6ecf..756685ac 100644 --- a/models/ArticModel.go +++ b/models/ArticModel.go @@ -14,6 +14,7 @@ type Article struct { Subtext string `orm:"sie(20)"` Content string `orm:"sie(5000)"` ProductId int64 `orm:"null"` + Views int64 `orm:"default(0)"` Created time.Time `orm:"auto_now_add;type(datetime)"` Updated time.Time `orm:"auto_now_add;type(datetime)"` } @@ -92,12 +93,20 @@ func GetArticles(pid int64) (Articles []*Article, err error) { } //根据文章id取得文章 -func GetArticle(id int64) (Artic Article, err error) { +func GetArticle(id int64) (Artic *Article, err error) { o := orm.NewOrm() + article := new(Article) qs := o.QueryTable("Article") //这个表名AchievementTopic需要用驼峰式, - err = qs.Filter("id", id).One(&Artic) + err = qs.Filter("id", id).One(article) if err != nil { return Artic, err } - return Artic, err + + article.Views++ + _, err = o.Update(article) + if err != nil { + return article, err + } + + return article, err } diff --git a/models/ProdModel.go b/models/ProdModel.go index fa8cb5c2..f5f9b8d9 100644 --- a/models/ProdModel.go +++ b/models/ProdModel.go @@ -127,7 +127,7 @@ func GetProjProducts(id int64) (products []*Product, err error) { projects := make([]*Project, 0) cond := orm.NewCondition() - cond1 := cond.Or("Id", id).Or("ParentIdPath__contains", idstring) + cond1 := cond.Or("Id", id).Or("ParentIdPath__contains", idstring+"-").Or("ParentId", id) o := orm.NewOrm() //先查出所有项目parent id path中包含id的数据 qs := o.QueryTable("Project") diff --git a/models/ProjModel.go b/models/ProjModel.go index 4a524b05..253d66ad 100644 --- a/models/ProjModel.go +++ b/models/ProjModel.go @@ -175,15 +175,37 @@ func GetProj(id int64) (proj Project, err error) { // } // return proj, err // } + //根据id查出所有子孙,用ParentIdPath //逻辑错误:110-210-310包含了10???? +//20180107完美解决这个问题。同ProdModel.go中GetProjProducts一致 +//通过Id为projid,查出本级 +//parentid是projid,查出二级 +//parentidpath包含projid-,查出三级,以及往下 +//差点按照无闻的视频,将parentidpath存成$id1#$id2#$id3# +//存:parentidpath="$"+id1+"#" +//查:__contains,"$"+id1+"#" +//取:stings.replace(stings.replace(parentidpath,"#",","-1),"$",""-1) +//输出:strings.split(上面的,",") func GetProjectsbyPid(id int64) (projects []*Project, err error) { + idstring := strconv.FormatInt(id, 10) + cond := orm.NewCondition() + cond1 := cond.Or("Id", id).Or("ParentIdPath__contains", idstring+"-").Or("ParentId", id) o := orm.NewOrm() + //先查出所有项目parent id path中包含id的数据 qs := o.QueryTable("Project") - _, err = qs.Filter("ParentIdPath__contains", id).All(&projects) + qs = qs.SetCond(cond1) + + _, err = qs.All(&projects) if err != nil { return nil, err } + + // qs := o.QueryTable("Project") + // _, err = qs.Filter("ParentIdPath__contains", id).All(&projects) + // if err != nil { + // return nil, err + // } return projects, err } diff --git a/models/RelevancyModel.go b/models/RelevancyModel.go new file mode 100644 index 00000000..da8eaee3 --- /dev/null +++ b/models/RelevancyModel.go @@ -0,0 +1,68 @@ +package models + +import ( + "github.com/astaxie/beego/orm" + _ "github.com/mattn/go-sqlite3" + // "strconv" + // "fmt" + // "strings" + "time" +) + +type Relevancy struct { + Id int64 `form:"-"` + ProductId int64 `orm:"null"` //编号 + Relevancy string `orm:"null"` //标签 + Created time.Time `orm:"null","auto_now_add;type(datetime)"` + Updated time.Time `orm:"null","auto_now_add;type(datetime)"` +} + +func init() { + orm.RegisterModel(new(Relevancy)) //, new(Article) + // orm.RegisterDriver("sqlite", orm.DRSqlite) + // orm.RegisterDataBase("default", "sqlite3", "database/engineer.db", 10) +} + +//添加项目 +func AddRelevancy(prodid int64, relevancy string) (id int64, err error) { + o := orm.NewOrm() + //关闭写同步 + o.Raw("PRAGMA synchronous = OFF; ", 0, 0, 0).Exec() + // var project Project + // if pid == "" { + relev := &Relevancy{ + ProductId: prodid, + Relevancy: relevancy, + Created: time.Now(), + Updated: time.Now(), + } + id, err = o.Insert(relev) + if err != nil { + return 0, err + } + return id, nil +} + +//根据成果id取得关联文件 +//根据成果编号,取得关联文件编号 +func GetRelevancy(prodid int64) (relevancies []*Relevancy, err error) { + o := orm.NewOrm() + qs := o.QueryTable("Relevancy") + // relevancies1 := make([]*Relevancy, 0) + _, err = qs.Filter("ProductId", prodid).All(&relevancies) + if err != nil { + return nil, err + } + return relevancies, err +} + +func GetAllRelevancies() (relevancies []*Relevancy, err error) { + o := orm.NewOrm() + qs := o.QueryTable("Relevancy") + // relevancies1 := make([]*Relevancy, 0) + _, err = qs.All(&relevancies) + if err != nil { + return nil, err + } + return relevancies, err +} diff --git a/models/RoleModel.go b/models/RoleModel.go index ba44a30f..85ede692 100644 --- a/models/RoleModel.go +++ b/models/RoleModel.go @@ -12,6 +12,8 @@ import ( "github.com/astaxie/beego/orm" // "github.com/astaxie/beego/validation" // . "github.com/beego/admin/src/lib" + // "github.com/casbin/beego-orm-adapter" + // "github.com/casbin/casbin" ) //用户表 @@ -162,3 +164,14 @@ func DeleteUserRole(uid, rid int64) error { // } return err } + +//由角色id、action和项目id,取得所有的路径 +// func GetPermissions(roleid, projectid, action) (paths []*CasbinRule, err error) { +// o := orm.NewOrm() +// qs := o.QueryTable("casbin_rule") +// _, err = qs.Filter("PType", "p").Filter("v0", roleid).Filter("v1__contains", projectid).Filter("v2", action).All(&paths) +// if err != nil { +// return nil, err +// } +// return roles, err +// } diff --git a/routers/router.go b/routers/router.go index f9037778..55a1ec19 100644 --- a/routers/router.go +++ b/routers/router.go @@ -147,6 +147,8 @@ func init() { beego.Router("/admin/role/userrole", &controllers.RoleController{}, "post:UserRole") //添加角色权限 beego.Router("/admin/role/permission", &controllers.RoleController{}, "post:RolePermission") + //查询角色权限 + beego.Router("/admin/role/getpermission", &controllers.RoleController{}, "get:GetRolePermission") //meritbasic表格数据填充 beego.Router("/admin/merit/meritbasic", &controllers.AdminController{}, "*:MeritBasic") diff --git a/static/css/common.css b/static/css/common.css index 7f49320b..92c4860c 100644 --- a/static/css/common.css +++ b/static/css/common.css @@ -92,7 +92,7 @@ label { } @font-face { font-family: "iconfont"; - src: url('/static/fonts/iconfont.eot?1573b42e3f0'), url('/static/fonts/iconfont.eot?&1573b42e3f0#iefix') format('embedded-opentype'), url('/static/fonts/iconfont.woff?1573b42e3f0') format('woff'), url('/static/fonts/iconfont.ttf?1573b42e3f0') format('truetype'), url('/static/fonts/iconfont.svg?1573b42e3f0#iconfont') format('svg') ; + src: url('/static/fonts/iconfont.eot?1512613120761'), url('/static/fonts/iconfont.eot?&1512613120761#iefix') format('embedded-opentype'), url('/static/fonts/iconfont.woff?1512613120761') format('woff'), url('/static/fonts/iconfont.ttf?1512613120761') format('truetype'), url('/static/fonts/iconfont.svg?1512613120761#iconfont') format('svg') ; } .iconfont { font-family: "iconfont" !important; @@ -114,5 +114,3 @@ label { :-ms-input-placeholder { color: #dfdfdf; } - -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbW1vbi5zdHlsIiwiY29tbW9uLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0VBQ0UsVUFBQTtFQUNBLFdBQUE7RUFDQSx3Q0FBQTtDQ3dCRDtBRHZCRDtFQUNFLGtCQUFBO0NDeUJEO0FEeEJEO0VBQ0UsbUJBQUE7Q0MwQkQ7QUR6QkQ7RUFDRSxrQkFBQTtDQzJCRDtBRDFCRDs7Ozs7OztFQUNFLGlCQUFBO0VBQ0EsVUFBQTtFQUNBLFdBQUE7Q0NrQ0Q7QURqQ0Q7UUNtQ1E7QURqQ1I7RUFDRSxvQkFBQTtFQUNBLHdDQUFBO0VBQ0EsY0FBQTtDQ21DRDtBRGpDRDtFQUNFLGFBQUE7RUFDQSxjQUFBO0NDbUNEO0FEbENEOztFQUNFLG1CQUFBO0NDcUNEO0FEcENEO0VBQ0UsY0FBQTtDQ3NDRDtBRHJDRDtFQUNFLGNBQUE7RUFDQSxzQkFBQTtFQUNBLFlBQUE7Q0N1Q0Q7QUR0Q0M7OztFQUNFLHNCQUFBO0NDMENIO0FEeENDO0VBQ0UsYUFBQTtFQUNBLFVBQUE7RUFDQSxtQkFBQTtFQUNBLGVBQUE7RUFDQSxZQUFBO0NDMENIO0FEekNEOzs7RUFDRSxpQkFBQTtFQUNBLG9CQUFBO0NDNkNEO0FENUNEO0VBQ0Usb0JBQUE7Q0M4Q0Q7QUQ3Q0Q7RUFDRSx3QkFBQTtFQUNBLDZVQUFBO0NDK0NEO0FENUNEO0VBQ0UsbUNBQUE7RUFDQSxnQkFBQTtFQUNBLG1CQUFBO0VBQ0Esb0NBQUE7RUFDQSxpQ0FBQTtFQUNBLG1DQUFBO0NDOENEO0FENUNEO0VBQ0UsZUFBQTtDQzhDRDtBRDdDRDtFQUNFLGVBQUE7Q0MrQ0Q7QUQ5Q0Q7RUFDRSxlQUFBO0NDZ0REO0FEL0NEO0VBQ0UsZUFBQTtDQ2lERCIsImZpbGUiOiJjb21tb24uY3NzIiwic291cmNlc0NvbnRlbnQiOlsiYm9keSxoMSxoMixoMyxoNCxoNSxoNix1bCxsaSxvbCxkbCxkdCxkZCxwLHNwYW4sb2JqZWN0LGlmcmFtZSxwcmUsYSxhYmJyLGNpdGUsaW5wdXQsc2VsZWN0LGlucHV0LG9wdGlvblxyXG4gIG1hcmdpbiAwXHJcbiAgcGFkZGluZyAwXHJcbiAgZm9udC1mYW1pbHkgJ0FyaWFsJywnTWljcm9zb2Z0IFlhSGVpJ1xyXG5oMVxyXG4gIGZvbnQtc2l6ZSAwLjlyZW1cclxuaDJcclxuICBmb250LXNpemUgMC43NXJlbVxyXG5oM1xyXG4gIGZvbnQtc2l6ZSAwLjZyZW1cclxudWwsbGksb2wsZGwsZGQsZHQsZm9ybVxyXG4gIGxpc3Qtc3R5bGUgbm9uZVxyXG4gIG1hcmdpbiAwXHJcbiAgcGFkZGluZyAwXHJcbi8qaHRtbFxyXG4gIDEwMCUqL1xyXG5ib2R5XHJcbiAgYmFja2dyb3VuZCAjZjBmMGYwXHJcbiAgZm9udC1mYW1pbHkgJ0FyaWFsJywnTWljcm9zb2Z0IFlhSGVpJ1xyXG4gIGZvbnQgaW5oZXJpdFxyXG4gIC8vaGVpZ2h0IDEwMCVcclxuaW1nXHJcbiAgYm9yZGVyIG5vbmVcclxuICBvdXRsaW5lIG5vbmVcclxuZW0saVxyXG4gIGZvbnQtc3R5bGUgbm9ybWFsXHJcbmlucHV0XHJcbiAgb3V0bGluZSBub25lXHJcbmFcclxuICBvdXRsaW5lIG5vbmVcclxuICB0ZXh0LWRlY29yYXRpb24gbm9uZVxyXG4gIGNvbG9yICMzMzNcclxuICAmOmhvdmVyLCY6YWN0aXZlLCZ2aXNpdGVkXHJcbiAgICB0ZXh0LWRlY29yYXRpb24gbm9uZVxyXG4uY2xlYXJmaXhcclxuICAmOmFmdGVyXHJcbiAgICBjb250ZW50ICcuJ1xyXG4gICAgaGVpZ2h0IDBcclxuICAgIHZpc2liaWxpdHkgaGlkZGVuXHJcbiAgICBkaXNwbGF5IGJsb2NrXHJcbiAgICBjbGVhciBib3RoXHJcbmRkLGR0LGRsXHJcbiAgbGluZS1oZWlnaHQgMS4yXHJcbiAgZm9udC13ZWlnaHQgbm9ybWFsXHJcbmxhYmVsXHJcbiAgZm9udC13ZWlnaHQgbm9ybWFsXHJcbkBmb250LWZhY2VcclxuICBmb250LWZhbWlseTogXCJpY29uZm9udFwiXHJcbiAgc3JjOiB1cmwoJy4uL2ZvbnRzL2ljb25mb250LmVvdCcpLHVybCgnLi4vZm9udHMvaWNvbmZvbnQuZW90PyNpZWZpeCcpIGZvcm1hdCgnZW1iZWRkZWQtb3BlbnR5cGUnKSx1cmwoJy4uL2ZvbnRzL2ljb25mb250LndvZmYnKSBmb3JtYXQoJ3dvZmYnKSx1cmwoJy4uL2ZvbnRzL2ljb25mb250LnR0ZicpIGZvcm1hdCgndHJ1ZXR5cGUnKSx1cmwoJy4uL2ZvbnRzL2ljb25mb250LnN2ZyNpY29uZm9udCcpIGZvcm1hdCgnc3ZnJykgLyogaU9TIDQuMS0gKi9cclxuXHJcblxyXG4uaWNvbmZvbnRcclxuICBmb250LWZhbWlseTpcImljb25mb250XCIgIWltcG9ydGFudFxyXG4gIGZvbnQtc2l6ZToxNnB4XHJcbiAgZm9udC1zdHlsZTpub3JtYWxcclxuICAtd2Via2l0LWZvbnQtc21vb3RoaW5nOiBhbnRpYWxpYXNlZFxyXG4gIC13ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6IDAuMnB4XHJcbiAgLW1vei1vc3gtZm9udC1zbW9vdGhpbmc6IGdyYXlzY2FsZVxyXG5cclxuOjotd2Via2l0LWlucHV0LXBsYWNlaG9sZGVyXHJcbiAgY29sb3IgI2RmZGZkZlxyXG46LW1vei1wbGFjZWhvbGRlclxyXG4gIGNvbG9yICNkZmRmZGZcclxuOjotbW96LWlucHV0LXBsYWNlaG9sZGVyXHJcbiAgY29sb3IgI2RmZGZkZlxyXG46LW1zLWlucHV0LXBsYWNlaG9sZGVyXHJcbiAgY29sb3IgI2RmZGZkZiIsImJvZHksXG5oMSxcbmgyLFxuaDMsXG5oNCxcbmg1LFxuaDYsXG51bCxcbmxpLFxub2wsXG5kbCxcbmR0LFxuZGQsXG5wLFxuc3Bhbixcbm9iamVjdCxcbmlmcmFtZSxcbnByZSxcbmEsXG5hYmJyLFxuY2l0ZSxcbmlucHV0LFxuc2VsZWN0LFxub3B0aW9uIHtcbiAgbWFyZ2luOiAwO1xuICBwYWRkaW5nOiAwO1xuICBmb250LWZhbWlseTogJ0FyaWFsJywgJ01pY3Jvc29mdCBZYUhlaSc7XG59XG5oMSB7XG4gIGZvbnQtc2l6ZTogMC45cmVtO1xufVxuaDIge1xuICBmb250LXNpemU6IDAuNzVyZW07XG59XG5oMyB7XG4gIGZvbnQtc2l6ZTogMC42cmVtO1xufVxudWwsXG5saSxcbm9sLFxuZGwsXG5kZCxcbmR0LFxuZm9ybSB7XG4gIGxpc3Qtc3R5bGU6IG5vbmU7XG4gIG1hcmdpbjogMDtcbiAgcGFkZGluZzogMDtcbn1cbi8qaHRtbFxuICAxMDAlKi9cbmJvZHkge1xuICBiYWNrZ3JvdW5kOiAjZjBmMGYwO1xuICBmb250LWZhbWlseTogJ0FyaWFsJywgJ01pY3Jvc29mdCBZYUhlaSc7XG4gIGZvbnQ6IGluaGVyaXQ7XG59XG5pbWcge1xuICBib3JkZXI6IG5vbmU7XG4gIG91dGxpbmU6IG5vbmU7XG59XG5lbSxcbmkge1xuICBmb250LXN0eWxlOiBub3JtYWw7XG59XG5pbnB1dCB7XG4gIG91dGxpbmU6IG5vbmU7XG59XG5hIHtcbiAgb3V0bGluZTogbm9uZTtcbiAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xuICBjb2xvcjogIzMzMztcbn1cbmE6aG92ZXIsXG5hOmFjdGl2ZSxcbmF2aXNpdGVkIHtcbiAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xufVxuLmNsZWFyZml4OmFmdGVyIHtcbiAgY29udGVudDogJy4nO1xuICBoZWlnaHQ6IDA7XG4gIHZpc2liaWxpdHk6IGhpZGRlbjtcbiAgZGlzcGxheTogYmxvY2s7XG4gIGNsZWFyOiBib3RoO1xufVxuZGQsXG5kdCxcbmRsIHtcbiAgbGluZS1oZWlnaHQ6IDEuMjtcbiAgZm9udC13ZWlnaHQ6IG5vcm1hbDtcbn1cbmxhYmVsIHtcbiAgZm9udC13ZWlnaHQ6IG5vcm1hbDtcbn1cbkBmb250LWZhY2Uge1xuICBmb250LWZhbWlseTogXCJpY29uZm9udFwiO1xuICBzcmM6IHVybChcIi4uL2ZvbnRzL2ljb25mb250LmVvdFwiKSwgdXJsKFwiLi4vZm9udHMvaWNvbmZvbnQuZW90PyNpZWZpeFwiKSBmb3JtYXQoJ2VtYmVkZGVkLW9wZW50eXBlJyksIHVybChcIi4uL2ZvbnRzL2ljb25mb250LndvZmZcIikgZm9ybWF0KCd3b2ZmJyksIHVybChcIi4uL2ZvbnRzL2ljb25mb250LnR0ZlwiKSBmb3JtYXQoJ3RydWV0eXBlJyksIHVybChcIi4uL2ZvbnRzL2ljb25mb250LnN2ZyNpY29uZm9udFwiKSBmb3JtYXQoJ3N2ZycpIC8qIGlPUyA0LjEtICovO1xufVxuLmljb25mb250IHtcbiAgZm9udC1mYW1pbHk6IFwiaWNvbmZvbnRcIiAhaW1wb3J0YW50O1xuICBmb250LXNpemU6IDE2cHg7XG4gIGZvbnQtc3R5bGU6IG5vcm1hbDtcbiAgLXdlYmtpdC1mb250LXNtb290aGluZzogYW50aWFsaWFzZWQ7XG4gIC13ZWJraXQtdGV4dC1zdHJva2Utd2lkdGg6IDAuMnB4O1xuICAtbW96LW9zeC1mb250LXNtb290aGluZzogZ3JheXNjYWxlO1xufVxuOjotd2Via2l0LWlucHV0LXBsYWNlaG9sZGVyIHtcbiAgY29sb3I6ICNkZmRmZGY7XG59XG46LW1vei1wbGFjZWhvbGRlciB7XG4gIGNvbG9yOiAjZGZkZmRmO1xufVxuOjotbW96LWlucHV0LXBsYWNlaG9sZGVyIHtcbiAgY29sb3I6ICNkZmRmZGY7XG59XG46LW1zLWlucHV0LXBsYWNlaG9sZGVyIHtcbiAgY29sb3I6ICNkZmRmZGY7XG59XG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0= */ \ No newline at end of file diff --git a/static/css/csdn_blog_detail.min.css b/static/css/csdn_blog_detail.min.css new file mode 100644 index 00000000..1dd80aa5 --- /dev/null +++ b/static/css/csdn_blog_detail.min.css @@ -0,0 +1 @@ +@charset "utf-8";.commentform li,li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}.commentform ul{clear:both;font:400 12px/24px Arial,Helvetica,sans-serif}.commentform .left{float:left;display:block;width:80px}.commentform .right{display:block;margin-left:90px}.commentform textarea{padding:5px;border:1px solid #ddd;color:#555;font:400 14px/24px Arial,Helvetica,sans-serif}#lang_list{width:388px;background-color:#FFF;border:1px solid #ccc;font-size:12px}#lang_list a{display:inline-block;cursor:pointer;border-right:1px solid #ccc;border-bottom:1px solid #ccc;padding:0 5px;text-align:center;float:left}#lang_list a:hover{background-color:#666;color:#fff}.long_name{width:70px}.duan_name{width:25px}.zhong_name{width:48px}.commentform li,.commentform ul{margin:0}.hljs{display:block;padding:.5em;background:#fff;color:#000}.hljs-comment,.hljs-comment *,.hljs-javadoc,.hljs-template_comment{color:#800}.clojure .hljs-built_in,.hljs-keyword,.hljs-list .hljs-title,.hljs-request,.hljs-status,.hljs-tag .hljs-title,.hljs-winutils,.http .hljs-title,.method,.nginx .hljs-title,.setting .hljs-value,.tex .hljs-command{color:#008}.hljs-envvar,.tex .hljs-special{color:#660}.apache .hljs-cbracket,.coffeescript .hljs-attribute,.hljs-attr_selector,.hljs-cdata,.hljs-date,.hljs-filter .hljs-argument,.hljs-regexp,.hljs-string,.hljs-tag .hljs-value{color:#080}.clojure .hljs-attribute,.css .hljs-function,.css .hljs-value .hljs-number,.hljs-decorator,.hljs-hexcolor,.hljs-literal,.hljs-number,.hljs-pi,.hljs-prompt,.hljs-rules .hljs-value,.hljs-shebang,.hljs-sub .hljs-identifier,.hljs-symbol,.hljs-tag,.hljs-tag .hljs-keyword,.ini .hljs-title,.ruby .hljs-symbol .hljs-string{color:#066}.clojure .hljs-title,.haskell .hljs-type,.hljs-built_in,.hljs-class .hljs-id,.hljs-class .hljs-title,.hljs-doctype,.hljs-javadoctag,.hljs-params,.hljs-phpdoc,.hljs-tag .hljs-attribute,.hljs-typename,.hljs-variable,.hljs-yardoctag,.setting,.smalltalk .hljs-class{color:#606}.css .hljs-tag,.hljs-pseudo,.hljs-rules .hljs-property,.hljs-subst{color:#000}.css .hljs-class,.css .hljs-id{color:#9b703f}.hljs-value .hljs-important{color:#f70;font-weight:700}.hljs-rules .hljs-keyword{color:#c5af75}.apache .hljs-sqbracket,.hljs-annotation,.nginx .hljs-built_in{color:#9b859d}.hljs-pragma,.hljs-preprocessor,.hljs-preprocessor *{color:#444}.tex .hljs-formula{background-color:#eee;font-style:italic}.diff .hljs-header,.hljs-chunk{color:grey;font-weight:700}.diff .hljs-change{background-color:#bccff9}.hljs-addition{background-color:#baeeba}.hljs-deletion{background-color:#ffc8bd}.hljs-comment .hljs-yardoctag{font-weight:700}.markdown_views{font-family:'microsoft yahei';font-size:16px;color:#3f3f3f}.markdown_views *{box-sizing:border-box}.markdown_views h1,.markdown_views h2,.markdown_views h3,.markdown_views h4,.markdown_views h5,.markdown_views h6{font-family:inherit;font-weight:300;line-height:1.1;color:inherit;margin:.8em 0;text-align:start}.markdown_views h1{font-size:2.6em}.markdown_views h2{font-size:2.15em}.markdown_views h3{font-size:1.7em}.markdown_views h4{font-size:1.25em}.markdown_views h5{font-size:1em}.markdown_views h6{font-size:.8em}.markdown_views a{color:#4fa1db}.markdown_views blockquote,.markdown_views p,.markdown_views pre,.markdown_views pre.prettyprint{margin:0 0 1.7em;line-height:170%}.markdown_views dl,.markdown_views ol,.markdown_views p,.markdown_views ul{line-height:170%;margin-bottom:1.7em}.markdown_views img{margin-top:15px;margin-bottom:15px}.markdown_views hr{margin:2em 0;border:0;border-top:1px solid rgba(128,128,128,.1)}.markdown_views dt{font-weight:700}.markdown_views abbr[data-original-title],.markdown_views abbr[title]{cursor:help;border-bottom:1px dotted #999}.markdown_views .initialism{font-size:90%;text-transform:uppercase}.markdown_views blockquote{padding:15px 20px;border-left:10px solid rgba(128,128,128,.075);background-color:rgba(128,128,128,.05);border-radius:0 5px 5px 0}.markdown_views blockquote p{line-height:1.5;font-size:1em;color:#6f6f6f}.markdown_views blockquote p:last-child{margin-bottom:0}.markdown_views blockquote .small,.markdown_views blockquote small{display:block;line-height:1.45;color:#999}.markdown_views blockquote .small:before,.markdown_views blockquote small:before{content:"— "}.markdown_views blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid rgba(128,128,128,.075);border-left:0}.markdown_views blockquote.pull-right .small,.markdown_views blockquote.pull-right p,.markdown_views blockquote.pull-right small{text-align:right}.markdown_views blockquote.pull-right .small:before,.markdown_views blockquote.pull-right small:before{content:""}.markdown_views blockquote.pull-right .small:after,.markdown_views blockquote.pull-right small:after{content:" —"}.markdown_views blockquote:after,.markdown_views blockquote:before{content:""}.markdown_views address{margin-bottom:21px;font-style:normal;line-height:1.45}.markdown_views code,.markdown_views kbd,.markdown_views pre,.markdown_views samp{font-family:"Source Code Pro",monospace}.markdown_views code{padding:2px 4px;font-size:90%;color:#3f3f3f;background-color:rgba(128,128,128,.075);white-space:nowrap;border-radius:0}.markdown_views pre{display:block;padding:10px;margin:0 0 10.5px;font-size:14px;line-height:1.45;word-break:break-all;word-wrap:break-word;color:#333;background-color:rgba(128,128,128,.05);border:1px solid rgba(128,128,128,.075);border-radius:0}.markdown_views pre code{overflow-x:auto;padding:0;font-size:90%;color:inherit;white-space:pre;word-wrap:normal;background-color:transparent;border-radius:0}.markdown_views .pre-scrollable{max-height:340px;overflow-y:scroll}.markdown_views .flow-chart,.markdown_views .sequence-diagram{text-align:center;margin-bottom:1.1em}.markdown_views table{width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0;border:1px solid #eee}.markdown_views table td,.markdown_views table th{padding:8px;line-height:20px;vertical-align:top;border:1px solid #eee}.category_l img,.category_l span,.similar_list li a,.similar_list li em,.subItem_l li a,.subItem_l li em{vertical-align:middle}.article_manage,.category{border-bottom:solid 1px #ededed}.markdown_views .prettyprint{padding:5px 5px 5px 60px;position:relative;overflow-y:hidden;overflow-x:auto;white-space:nowrap}.markdown_views .prettyprint .pre-numbering{position:absolute;width:50px;background-color:#eee;top:0;left:0;margin:0;padding:6px 0 40px;border-right:1px solid #ddd;list-style:none;text-align:right}.markdown_views .prettyprint .pre-numbering li{padding:0 5px;list-style:none;margin-left:0}.markdown_views em{font-style:italic}.article_manage{color:#999;font:400 12px/22px Arial;text-align:right;margin:0 -20px;padding:0 20px 5px;overflow:hidden}.article_manage span{margin:0 5px}.article_manage .link_postdate{margin:0 5px 0 0}.article_manage .link_view{padding:0 0 0 14px;background:url(../../../images/ico_view.png) left center no-repeat}.article_manage .link_comments{padding:0 0 0 14px;background:url(../../../images/ico_comm.png) left center no-repeat}.article_manage .link_categories{float:left}.list_view{margin:0 20px;padding:5px 0}.list_view .article_title{display:inline;float:left;height:30px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0!important;font:400 14px/30px Arial!important}.list_view .article_title:after{content:"..."}.list_view .article_title h1,.list_view .article_title h3{font:400 12px/30px Arial!important}.category_l,.category_r{font-size:14px;float:left}.category_r .subItem_t .J_close,.category_r em,.similar_c_t label em,.similar_list li em{font-style:normal}.list_view .article_manage{display:inline;float:right;padding:0!important;line-height:30px!important;text-align:right!important;white-space:nowrap}.list_view .article_description{display:none!important}.article_l span a,.category_l,.category_l span,.category_r,.category_r label{display:inline-block}.list_view .article_manage span{margin:0!important}.article_l{width:100%;float:left}.article_l span a{margin-right:10px}.article_r .fa{font-weight:400}.category{margin:0 -20px;padding:5px 20px}.category_l{color:#333;width:70px;line-height:28px}.category_r{color:#df3434;width:90%}.category_r .subItem_t .J_close{float:right;line-height:42px;font-weight:400;font-size:16px;color:#ccc}.category_r label{margin-left:15px;cursor:pointer;line-height:28px;position:relative}.category_r label .fa{color:#999}.subItem,.subItem .subItem_l li a{color:#333}.category_r label .fa-caret-up{display:none;transform:all 2.2s}.subItem{display:none;position:absolute;top:46px;left:-10px;width:400px;max-height:400px;border:1px solid #dcdcdc;background:#fff;box-shadow:5px 0 10px #dcdcdc;z-index:9999}.subItem:after{position:absolute;width:10px;height:10px;display:block;content:'';top:-10px;left:20px;background:url(../images/triangle.png) no-repeat}.subItem_t{height:42px;line-height:42px;border-bottom:solid 1px #dcdcdc;padding:0 20px 0 15px;color:#999}.category_r .subItem_t .fa-close{float:right;line-height:42px;font-weight:400;font-size:16px;color:#ccc}.subItem_l{max-height:358px;overflow-y:auto;list-style:none;padding:0;margin:0}.similar_article,.subItem_l li a{overflow:hidden}.subItem .subItem_l li{height:52px;line-height:52px;border-bottom:solid 1px #eee;padding:0 20px}.subItem_l li em{display:inline-block;margin-right:10px}.subItem_l li a{display:inline-block;width:95%;text-overflow:ellipsis;white-space:nowrap;font-size:14px;color:#333}.similar_article h4{font-size:16px;color:#333}.similar_c{border:1px solid #bbb}.similar_c_t{line-height:45px;border-bottom:solid 1px #dcdcdc}.similar_c_t label{display:inline-block;margin-left:25px;font-size:16px;color:#666}.similar_c_t .similar_cur{font-weight:700}.fl{float:left}.fr{float:right}.similar_wrap{background:#fcfcfc;max-height:180px;overflow-y:auto;padding:10px 20px}.similar_list{width:48%;list-style:none;margin:0;padding:0}.similar_list li{list-style:none;line-height:30px;height:30px;overflow:hidden;text-overflow:ellipsis}.similar_list li em{display:inline-block;margin-right:10px}.similar_list li a{display:inline-block;max-width:276px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#333}.similar_list li a:hover{color:#fe0000}.similar_list li label,.similar_list li span{font-size:12px;color:#bbb;display:inline-block;margin-left:9px}.similar_list li label b,.similar_list li label i{font-weight:400;font-style:normal}.similar_list li label b{margin-left:5px}.MoreArticle{clear:both;display:block;height:35px;line-height:35px;background:#fcfcfc;font-size:12px;color:#666;text-align:center}.MoreArticle:hover{background:#f2f2f2}.bog_copyright{padding:20px 0}.copyright_p{height:14px;line-height:14px;border-left:solid 3px #e41c1e;padding-left:10px;color:#666;font-size:14px}.mod_zhuanjia_dianping{background-color:#fffdf5;font-size:12px;color:#656565;margin-top:80px;border-top:1px solid #fbf5dd;border-bottom:1px solid #fbf5dd}.mod_zhuanjia_dianping li,.mod_zhuanjia_dianping ul{padding:0;margin:0;list-style:none}.mod_zhuanjia_dianping img{border:none}.mod_zhuanjia_dianping .dianping_title{height:40px;line-height:40px;border-bottom:2px solid #ccc}.mod_zhuanjia_dianping .dianping_title .dianping_title_left{float:left;border-bottom:2px solid #cb0000;font-size:16px}.mod_zhuanjia_dianping .dianping_title .dianping_title_right{float:right;font-size:14px;color:#656565;font-weight:400}.mod_zhuanjia_dianping .dianping_title .dianping_title_right .red{color:#cb0000;padding:0 5px}.mod_zhuanjia_dianping .dianping_title .dianping_title_right img{padding-right:5px;vertical-align:-2px}.mod_zhuanjia_dianping .dianping_content{overflow:hidden;max-height:800px;height:240px}.mod_zhuanjia_dianping .dianping_content .dianping_content_list{padding:20px 0;width:100%;float:left;border-top:1px dashed #dedcdd}.mod_zhuanjia_dianping .dianping_content .dianping_content_list_left{width:40px;float:left;margin-left:-100%;margin-top:20px}.mod_zhuanjia_dianping .dianping_content .dianping_content_list_left .name{color:#000;text-align:center;margin-top:10px;width:40px;display:inline-block}.mod_zhuanjia_dianping .dianping_content .dianping_content_list .dianping_content_list_right{margin-left:40px;padding-left:20px}.mod_zhuanjia_dianping .dianping_content .dianping_content_list .dianping_content_list_right .time{color:#7795a5}.mod_zhuanjia_dianping .dianping_content .dianping_content_list .dianping_content_list_right .time .time_desc{padding:0 5px}.mod_zhuanjia_dianping .dianping_content .dianping_content_list .dianping_content_list_right .dianping_content_list_right_content{margin-top:10px;line-height:18px}.mod_zhuanjia_dianping .dianping_content .dianping_content_list .dianping_content_list_right .time img{vertical-align:-2px}.mod_zhuanjia_dianping .more{text-align:center;position:relative;width:100%}.mod_zhuanjia_dianping .more img{position:relative;bottom:-20px;cursor:pointer}.mod_more_detail{font-size:12px;color:#333;margin-top:50px;border:1px solid #e8e8e8}.mod_more_detail li,.mod_more_detail ul{padding:0;margin:0;list-style:none;height:24px;line-height:24px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mod_more_detail li a{color:#333}.mod_more_detail .mod_more_detail_title{height:40px;line-height:40px;background-color:#f1f1f1;text-indent:10px}.mod_more_detail .mod_more_detail_title .mod_more_detail_left{float:left;font-size:16px;color:#000}.mod_more_detail .mod_more_detail_content{overflow:hidden;padding:20px 0}.mod_more_detail .mod_more_detail_content .mod_more_detail_content_left{float:left;padding:0 20px;border-right:1px solid #e8e8e8;width:50%;box-sizing:border-box}.mod_more_detail .mod_more_detail_content .mod_more_detail_content_right{float:left;padding:0 20px;width:50%;box-sizing:border-box}.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.clo,.opn,.pun{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.kwd,.tag,.typ{font-weight:700}.str{color:#060}.kwd{color:#006}.com{color:#600;font-style:italic}.typ{color:#404}.lit{color:#044}.clo,.opn,.pun{color:#440}.tag{color:#006}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:0 solid #888}ol.linenums{margin-top:0;margin-bottom:0}.dp-highlighter,.prettyprint{position:relative;overflow-y:hidden;overflow-x:auto}.pad_bot{padding-bottom:45px!important}.save_code{display:none;position:absolute;height:60px;right:30px;top:5px;font-size:14px;color:#fff;cursor:pointer;z-index:2}#mask_code{display:none;position:fixed;width:100%;height:100%;left:0;top:0;background:rgba(0,0,0,.3);z-index:990}.gist_edit{display:none;position:absolute;left:50%;top:50%;width:505px;height:330px;margin:-165px 0 0 -252px;z-index:9999}.save_snippets .tit,.save_snippets .tit h3,.save_snippets .tit span{height:45px;line-height:45px;box-sizing:border-box}.save_snippets{clear:both;overflow:hidden;background:#fff;border:1px solid #dddcdd;font-size:14px;font-family:"Microsoft YaHei";box-sizing:border-box}.save_snippets .tit{clear:both;overflow:hidden;border-bottom:1px solid #dddcdd;padding:0 20px}.save_snippets .tit h3{float:left;font-weight:400;font-size:16px;padding:0;margin:0}.gist_edit_list{padding:0;box-sizing:border-box;width:100%}.save_snippets .tit span{display:block;float:right;color:#999}.save_snippets .tit span a,.save_snippets .tit span a:active,.save_snippets .tit span a:hover,.save_snippets .tit span a:link,.save_snippets .tit span a:visited{color:#00f;text-decoration:underline}.save_snippets .con_form{clear:both;overflow:hidden;padding-top:20px;box-sizing:border-box}.save_snippets .con_form .gist_edit_list li{clear:both;overflow:hidden;min-height:32px;margin-bottom:20px;list-style:none;box-sizing:border-box}.save_snippets .con_form .gist_edit_list li span.red{display:block;float:left;line-height:36px;height:32px;color:red;padding-right:10px;margin-left:20px;box-sizing:border-box}.save_snippets .con_form .gist_edit_list li span.txt{display:block;float:left;height:32px;line-height:32px;padding-right:20px}.insertTag,.save_snippets .con_form .gist_edit_list li .form-input{height:30px}#divSearchTags,.save_snippets .con_form .gist_edit_list li .form-input{width:398px;border:1px solid #dddcdd;background:#fafafa;padding:0 10px;float:left;color:#666;box-sizing:border-box;font-family:"Microsoft YaHei"}#divSearchTags{margin-left:2px;text-align:left}#divSearchTags .label span{color:#666}.insertTag{width:208px;color:#666;background:0 0;border:none;box-sizing:border-box}#divSearchTags .blog_tag{display:block;float:left;margin:7px 10px 7px 0;padding:0 5px;background:#f3f3f3;color:#666;border-radius:10px;box-sizing:border-box}#divSearchTags .blog_tag span{display:block;float:left}#divSearchTags .label a{color:#666;margin-left:8px;box-sizing:border-box}.save_snippets .con_form .gist_edit_list li .form-textarea{float:left;width:398px;height:60px;font-size:12px;border:1px solid #dddcdd;background:#fafafa;padding:3px 10px;color:#666;font-family:"Microsoft YaHei";box-sizing:border-box}.save_snippets .bottom-bar{clear:both;overflow:hidden;border-top:1px solid #dddcdd;padding:17px 20px}.save_snippets .bottom-bar .btn-submit{border:1px solid #888;background:#f0f0f0;border-radius:2px;border-left:0;border-top:0;width:45px;height:20px;text-align:center;line-height:20px;float:right;margin-left:7px;font-size:12px;font-family:"Microsoft YaHei";color:#333}.file_holder .file_content.code table.lines pre.line_numbers{width:40px!important}.pop_CA_cover{position:fixed;left:0;top:0;width:100%;height:100%;z-index:10000000}.pop.pop_CA{position:fixed;left:50%;top:50%;margin-left:-325px;margin-top:-179px;width:650px;background:#fff;border:1px solid #cecece;box-shadow:0 0 10px 0 #cecece;z-index:10000001}.pop .CA_header{height:50px;line-height:50px;padding:0 20px;border-bottom:1px solid #cecece;position:relative;text-align:left;font-size:16px;color:#333}.pop .CA_header .cancel_icon{display:block;width:15px;height:15px;position:absolute;right:16px;top:18px;background:url(../images/cancel_icon.png) center no-repeat;cursor:pointer}.pop .CA_header .cancel_icon:hover{opacity:.8} \ No newline at end of file diff --git a/static/css/csdn_style.css b/static/css/csdn_style.css new file mode 100644 index 00000000..36c6add7 --- /dev/null +++ b/static/css/csdn_style.css @@ -0,0 +1,1128 @@ +@import url("/static/css/csdnarticlecommon.css"); +.interact .attented{background:url(/static/img/btn_attented2.gif) no-repeat 0 0;} +html, +h1, +h2, +h3, +h4, +h5, +h6, +p { + margin: 0; + padding: 0; +} +body { + margin: 0; + font-family: 'microsoft yahei'; +} +body .pub_footerall { + border-top-color: #a7b9c4; +} +body .csdn-toolbar .container { + width:96%!important; + min-width: 980px; + max-width: 1256px; +} +body a { + text-decoration: none; +} +body > a > img { + position: absolute; + left: 50%; +} +#header:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#header .header { + width:96%; + min-width: 980px; + max-width: 1256px; + margin: 0 auto; +} +.side ul, +.article_next_prev ul, +#navigator ul { + padding: 0; +} +.side ul li, +.article_next_prev ul li, +#navigator ul li { + list-style: none; +} +#navigator { + margin-top: -45px; +} +#navigator .navigator { + width: 1265px; + margin: 0 auto; + padding: 0 0 15px 0; +} +#navigator .navigator:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#navigator ul { + float: right; + margin: 0; + padding: 0; +} +#navigator ul:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#navigator ul li { + float: left; + border: 1px solid #ccc; + width: 88px; + height: 26px; + margin-left: 10px; + line-height: 26px; + font-size: 12px; + text-align: center; + background: #fff; +} +#navigator ul li a { + color: #666; + text-decoration: none; +} +#navigator ul li a img { + vertical-align: text-bottom; + margin-right: 6px; +} +#body { + width:96%; + min-width: 980px; + max-width: 1256px; + margin: 0 auto; + font-size: 12px; + margin-bottom: 40px; +} +#body:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +.panel_head, +.blog-ass-articl dt { + font-weight: bold; +} +#side { + float: left; + margin-right: 12px; + width: 270px; + margin: 0 auto; + margin-right: -280px; +} +#side .panel { + border: 1px solid #fff; + margin-bottom: 9px; + background: #fff; +} +#side .panel_head { + background: #f5f5f5; + height: 29px; + line-height: 29px; + padding-left: 11px; + color: #333; +} +#side .panel_body { + padding: 15px 16px 17px; + word-break: break-all; +} +#side .panel_body iframe { + max-width: 240px; +} +#side .panel_body hr { + height: 0px; + border: 0; + border-bottom: 1px dotted #eee; +} +#side .panel_body .list_closed, +#side .panel_body .list_opended { + display: inline-block; + color: #666; + padding-right: 20px; + background: url("/static/img/icon-arrow.png") no-repeat right bottom; + cursor: pointer; +} +#side .panel_body .list_opended { + background-position: right top; +} +#side div[id^=custom_column] ul.panel_body ul { + line-height: 2em; +} +#side div[id^=custom_column] ul.panel_body ul * { + text-decoration: none; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(1) { + color: #35904a; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(1) * { + color: #35904a; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(2) { + color: #2880d2; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(2) * { + color: #2880d2; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(3) { + color: #b020ab; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(3) * { + color: #b020ab; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(4) { + color: #22a57d; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(4) * { + color: #22a57d; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(5) { + color: #c81622; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(5) * { + color: #c81622; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(6) { + color: #fc9b18; +} +#side div[id^=custom_column] ul.panel_body ul li:nth-child(6) * { + color: #fc9b18; +} +#side .profile { + padding-top: 29px; + padding-bottom: 5px; +} +#side .profile #blog_userface { + text-align: center; +} +#side .profile #blog_userface a { + display: inline-block; +} +#side .profile #blog_userface .user_name { + color: #666; + font: 16px/20px 'microsoft yahei'; + text-decoration: none; +} +#side .profile #blog_userface span { + display: block; + margin: 15px 0; +} +#side .profile .interact { + text-align: center; + padding-bottom: 15px; + margin-bottom: 7px; +} +#side .profile .interact a { + background-color: #999; + background-repeat: no-repeat; + display: inline-block; + margin-left: 6px; + width: 50px; + height: 25px; + line-height: 25px; + color: #fff !important; + text-align: center; + padding-left: 18px; + text-decoration: none; +} +#side .profile .interact .attent { + background-image: url("/static/img/skin-attent.png"); + background-position: 15px center; +} +#side .profile .interact .attent:after { + content: "关注"; +} +#side .profile .interact .letter { + background-image: url("/static/img/skin-email.png"); + background-position: 8px center; +} +#side .profile .interact .letter:after { + content: "发私信"; +} +#side .profile #blog_medal { + margin-bottom: 10px; +} +#side .profile #blog_medal .ico_expert { + margin: 0 auto 10px auto; +} +#side .profile #blog_medal a { + width: 21px; + margin-right: 10px; +} +#side .profile #blog_medal a img{ + width: 21px; +} +#side .profile #blog_rank { + padding: 4px; + border-bottom: 1px dashed #ccc; + margin-bottom: 13px; +} +#side .profile #blog_rank li { + margin-bottom: 11px; +} +#side .profile #blog_statistics:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#side .profile #blog_statistics li { + float: left; + width: 114px; + color: #333; + margin-bottom: 12px; +} +#side .profile #blog_statistics li span { + color: #666; +} +#side #panel_Search { + position: relative; +} +#side #panel_Search .blogsearch { + width: 192px; + border: 1px solid #ccc; + padding: 7px 30px 7px 7px; +} +#side #panel_Search #btnSubmit { + border: 0; + background: url("/static/img/skin-search.png") no-repeat center; + position: absolute; + width: 20px; + height: 20px; + top: 50px; + right: 30px; + text-indent: -100px; + cursor: pointer; +} +#side #panel_Search #btnSubmit:hover { + opacity: 0.7; +} +#side #panel_Category { + color: #000; +} +#side #panel_Category ul { + margin-bottom: -9px; +} +#side #panel_Category #sp_column { + margin-bottom: -11px; +} +#side #panel_Category img { + border: 1px solid #ccc; +} +#side #panel_Category table { + margin-bottom: 11px; +} +#side #panel_Category p { + padding-top: 16px; + padding-bottom: 8px; +} +#side #panel_Category li { + margin-bottom: 9px; +} +#side #panel_Category li span { + margin-left: 8px; +} +#side #archive_list { + color: #000; +} +#side #archive_list ul { + margin-bottom: -8px; +} +#side #archive_list li { + margin-bottom: 8px; +} +#side #archive_list a { + margin-right: 8px; +} +#side #archive_list .list_closed { + color: #666; + margin-top: 17px; +} +#side #hotarticls, +#side #hotarticls2, +#side #newcomments { + color: #666; +} +#side #hotarticls ul, +#side #hotarticls2 ul, +#side #newcomments ul { + margin-bottom: -8px; +} +#side #hotarticls li, +#side #hotarticls2 li, +#side #newcomments li { + margin-bottom: 8px; +} +#side #hotarticls li span, +#side #hotarticls2 li span, +#side #newcomments li span { + margin-left: 10px; +} +#side #newcomments a { + margin-right: 9px; +} +.itemlist li a { + width: 170px; + text-overflow: ellipsis; +} +#main { + float: right; + width: 100%; + padding-left: 280px; + box-sizing:border-box; +} +#main .main{ + width: 100%; + overflow: hidden; + background-color: #fff; +} +#main .ad_class { + border: 0 !important; + padding: 10px; + clear: both; + overflow: hidden; + background: #fff; +} +#main .ad_class .notice { + background: #fffce7 url("/static/img/skin-light.png") no-repeat 8px center; + border: 1px dashed #f8cc7e; + padding: 5px 0 5px 23px; + width: 100%; + max-width: 931px; + box-sizing: border-box; +} +#main .details, +#main .list_item_new { + padding: 20px 20px 35px; + background: #fff; +} +#main .article_title { + margin-bottom: 21px; +} +#main .article_title .ico { + display: inline-block; + vertical-align: middle; + width: 19px; + height: 19px; + margin-right: 10px; +} +#main .article_title .ico_type_Repost { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: -50px 0px; +} +#main .article_title .ico_type_Translated { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: -25px 0; +} +#main .article_title .ico_type_Original { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: 0px 0; +} +#main .article_title h1 { + display: inline-block; + vertical-align: middle; + font-size: 18px; +} +#main .article_title h1 a { + color: #000; +} +#main .contents .article_title h1 { + font-size: 12px; +} +#main .article_manage { + margin-bottom: 10px; + text-align: right; + color: #999; +} +#main .article_manage a { + color: #33a5ba; +} +#main .article_manage span { + margin-right: 16px; +} +#main .article_manage .link_categories { + float: left; + margin-right: 0; +} +#main .article_manage .link_view, +#main .article_manage .link_comments, +#main .article_manage .link_collect, +#main .article_manage .link_report { + display: inline-block; +} +#main .article_manage .link_view { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: 0 -25px; + padding-left: 24px; +} +#main .article_manage .link_comments { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: 0 -43px; + padding-left: 17px; +} +#main .article_manage .link_collect { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: 0 -62px; + padding-left: 17px; +} +#main .article_manage .link_report { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: 0 -81px; + padding-left: 17px; +} +#main .tag2box { + padding-bottom: 20px; +} +#main .tag2box a { + background: #eee; + display: inline-block; + padding: 4px 10px; + margin-right: 10px; + border: 1px solid #eee; + border-radius: 10px; + color: #369; +} +#main .article_content { + margin: 35px 0; + font-size: 15px; + color: #555; + line-height: 35px; +} +#main .article_content p > img { + max-width: 602px; + height: auto; +} +#main .article_content a { + color: #0c89cf; +} +#main .article_content .dp-highlighter { + border-color: #ccc; + overflow: hidden; +} +#main .article_next_prev span { + width: 51px; + height: 26px; + line-height: 26px; + display: inline-block; + color: #fff; + padding-left: 27px; + margin-right: 7px; + background: #999; +} +#main .article_next_prev a { + text-decoration: none; + color: #333; +} +#main .article_next_prev .prev_article { + margin-bottom: 3px; +} +#main .article_next_prev .prev_article span { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: 8px -111px; + margin-right: 7px; +} +#main .article_next_prev .next_article span { + background-image: url("/static/img/skin-type-icon.png"); + background-repeat: no-repeat; + background-position: 8px -140px; + margin-right: 7px; +} +#main .article_next_prev li:hover span { + background-color: #3d84b0; +} +#main .article_next_prev li:hover a { + color: #3d84b0; +} +#main #digg { + text-align: center; + margin-top: 44px; +} +#main #digg .digg { + display: inline-block; + width: 72px; + font-size: 27px; + color: #fff; + cursor: pointer; + margin: 0; + vertical-align: middle; + padding: 7px 0; +} +#main #digg .digg dt { + margin-bottom: 4px; +} +#main #digg .digg dd { + font-size: 15px; + overflow: hidden; + margin: 0; +} +#main #digg #btnDigg { + background: #f90; +} +#main #digg #btnBury { + background: #ff7900; +} +#main #digg .digg_disable { + background: #999 !important; +} +#main .blog-associat-tag { + background: #f5f5f5; + padding: 25px 20px 10px; + clear: both; + color: #333; + margin: 0; +} +#main .blog-associat-tag:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#main .blog-associat-tag dt, +#main .blog-associat-tag dd { + float: left; + margin: 0; +} +#main .blog-associat-tag dt { + font-size: 14px; + margin-right: 19px; +} +#main .blog-associat-tag .blog-tage-red { + background: #e7e7e7; + display: inline-block; + height: 20px; + line-height: 20px; + padding: 0 14px; + border-radius: 10px; + color: #333; + text-decoration: none; +} +#main .blog-ass-articl { + background: #f5f5f5; + margin: 0; + padding: 0 20px 20px; +} +#main .blog-ass-articl:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#main .blog-ass-articl dt { + font-size: 14px; + height: 35px; + line-height: 35px; + margin: 0 0 15px; + border-bottom: 2px solid #ccc; +} +#main .blog-ass-articl dt span { + border-bottom: 2px #c00 solid; + height: 35px; + display: inline-block; +} +#main .blog-ass-articl dd { + margin-left: 0; + float: left; + width: 47%; + height: 23px; + line-height: 23px; + padding-left: 10px; + margin-right: 9px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + background: none !important; + position: relative; +} +#main .blog-ass-articl dd:before { + content: ''; + position: absolute; + left: 0; + top: 10px; + width: 3px; + height: 3px; + background: #3d84b0; +} +#main .blog-ass-articl dd a { + text-decoration: none; + color: #000; +} +#main #ad_cen { + padding-top: 15px; + padding-bottom: 13px; + padding-left: 29px; + padding-right: 38px; + margin-bottom: 11px; + background: #fff; +} +#main .comment_class { + background: #fff; + padding: 20px 30px; +} +#main .comment_class .panel_head { + border-bottom: 2px solid #ccc; + font-size: 14px; +} +#main .comment_class .panel_head > span { + display: inline-block; + border-bottom: 2px solid #c00; + padding-bottom: 7px; + margin-bottom: -2px; +} +#main .comment_class #comment_list { + margin: 20px 0px; +} +#main .comment_class #comment_list dl { + position: relative; + border-top: 1px solid #ccc; + margin: 0; + padding-top: 16px; +} +#main .comment_class #comment_list dl:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#main .comment_class #comment_list dl:first-child { + margin-top: -24px; + border-top: 0; +} +#main .comment_class #comment_list dl > dt { + float: right; + color: #999; +} +#main .comment_class #comment_list dl > dd { + float: left; +} +#main .comment_class #comment_list .username { + position: absolute; + left: 47px; + color: #3d84b0; + text-decoration: none; + font-size: 14px; +} +#main .comment_class #comment_list .comment_userface { + margin-right: 7px; + margin-left: 0; + margin-bottom: 16px; +} +#main .comment_class #comment_list .comment_head .reply, +#main .comment_class #comment_list .comment_head .quote, +#main .comment_class #comment_list .comment_head .report, +#main .comment_class #comment_list .comment_head .delete { + display: inline-block; + padding-left: 17px; + color: #999; + text-decoration: none; + margin-left: 10px; +} +#main .comment_class #comment_list .comment_head .reply { + background-image: url("/static/img/skin-comment-icon.png"); + background-repeat: no-repeat; + background-position: 0 3px; +} +#main .comment_class #comment_list .comment_head .quote { + background-image: url("/static/img/skin-comment-icon.png"); + background-repeat: no-repeat; + background-position: 0 -13px; +} +#main .comment_class #comment_list .comment_head .report { + background-image: url("/static/img/skin-comment-icon.png"); + background-repeat: no-repeat; + background-position: 0 -31px; +} +#main .comment_class #comment_list .comment_head .delete { + background-image: url("/static/img/skin-comment-icon.png"); + background-repeat: no-repeat; + background-position: 0 -50px; +} +#main .comment_class #comment_list .comment_body { + margin: 25px 0 0; + width: 57%; + word-break: break-all; + word-wrap: break-all; + font-size: #333; + padding-bottom: 16px; +} +#main .comment_class #comment_list .comment_reply { + clear: both; + float: right; + border-top: 1px solid #ccc; + padding-top: 16px; + width: 95%; +} +#main .comment_class #comment_list .comment_reply .username { + left: 48px; +} +#main .comment_class #comment_list .comment_reply .comment_body { + width: 50%; +} +#main #comment_form .commentform > ul { + margin: 0 0 0 29px; +} +#main #comment_form .panel_head { + border-bottom: 2px solid #ccc; + line-height: 30px; + margin-bottom: 15px; + position: relative; +} +#main #comment_form .panel_head:after { + content: ""; + height: 2px; + width: 60px; + position: absolute; + background: #c00; + left: 0; + bottom: -2px; +} +#main #comment_form .comment_btn { + margin: 5px 10px 10px 90px; + font-size: 14px; + padding: 5px 40px; +} +#main #comment_form .guest_link { + background: #f5f5f5; + height: 41px; + line-height: 41px; + color: #333; + margin: 15px -30px; + padding-left: 29px; +} +#main #comment_form .guest_link a { + color: #3d84b0; + text-decoration: none; +} +#main #comment_form .comment_content { + min-width: 90%; + max-height: 120px; +} +#main .announce { + color: #999; +} +#main .tag_list { + margin: 11px 0 0; + padding: 20px 30px; +} +#main .tag_list h5 { + background: #fff; + border-bottom: 2px solid #ccc; + line-height: normal; + height: auto; + padding: 0; + color: #333; +} +#main .tag_list h5 > a { + display: inline-block; + border-bottom: 2px solid #c00; + padding-bottom: 9px; + margin-bottom: -2px; + text-decoration: none; + font-size: 14px; +} +#main .tag_list .classify { + margin: 0; + padding: 2px 0 0; +} +#main .tag_list .classify a { + display: inline-block; + text-decoration: none; + color: #3d84b0; + margin-top: 12px; + margin-right: 25px; +} +#main .list_item_new .list_item { + border-bottom: 1px dashed #ddd; + margin: 0 10px; + padding: 20px 0 15px 0; + font-family: 'microsoft yahei'; +} +#main .list_item_new .list_item .article_title { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +#main .list_item_new .list_item h1 { + font-weight: normal; +} +#main .list_item_new .list_item .article_description { + font: 14px/24px 'microsoft yahei'; + margin: -10px 0 10px 0; + color: #666; +} +#main .list_item_new .list_item.list_view { + padding: 10px 0; + position: relative; + height: 25px; +} +#main .list_item_new .list_item.list_view .article_title { + width: 760px; +} +#main .list_item_new .list_item.list_view .article_title, +#main .list_item_new .list_item.list_view .article_manage { + white-space: nowrap; + overflow: hidden; +} +#main .list_item_new .list_item.list_view .article_manage { + top: 15px; + right: -20px; + width: 120px; + position: absolute; +} +#main .pagelist { + margin: 20px auto; + text-align: center; + font: 12px/20px 'microsoft yahei'; +} +#main .pagelist > * { + margin: 0 2px; +} +#main .pagelist span { + color: #666; + margin-right: 10px; +} +#main .pagelist a { + border: solid 1px #dbe5ee; + color: #333; + text-decoration: none; + padding: 2px 8px; +} +#main .pagelist strong, +#main .pagelist a:hover { + background: #07519a; + color: #fff; + padding: 2px 8px; + border: 1px solid #07519a; +} +#main #d-top { + position: fixed; + left: 50%; + margin-left: 640px; +} +#main #d-top a { + display: block; + margin: 1px 0; +} +#main .tag_list h5 > a, +#main .blog-ass-articl dt span, +#main .comment_class .panel_head > span { + border-bottom-color: #3d84b0; +} +#main #comment_form .panel_head:after { + background: #3d84b0; +} +body { + background: url("/static/img/bg-yellow.png") repeat; +} +#header { + background: url("/static/img/title-yellow.png") no-repeat center -201px; + height: 145px; + color: #fff; +} +#header h2 { + padding: 32px 0 0 0; + margin: 0; +} +#header h2 a { + color: #454545; + font: bold 24px/40px 'microsoft yahei'; +} +#header h3 { + padding: 0 0 0 0; + font: 14px/20px 'microsoft yahei'; + max-height: 21px; + overflow: hidden; + margin: 0; + color: #666; +} +#navigator { + margin-top: -45px; +} +#navigator .navigator { + width:96%; + min-width: 980px; + max-width: 1256px; + margin: 0 auto; + background: #454545; + padding: 10px; + box-sizing:border-box; +} +#navigator .navigator:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#navigator ul { + float: right; + margin: 0; + padding: 0; +} +#navigator ul:after { + content: '.'; + clear: both; + height: 0; + display: block; + visibility: hidden; +} +#navigator ul li { + float: left; + border: 1px solid #ccc; + width: 88px; + height: 26px; + margin-left: 10px; + line-height: 26px; + font-size: 12px; + text-align: center; + background: #fff; +} +#navigator ul li a { + color: #666; + text-decoration: none; +} +#navigator ul li a img { + vertical-align: text-bottom; + margin-right: 6px; +} +#side .panel { + border: 1px solid #ccc; +} +#side .panel a:link, +#side .panel a:visited { + color: #c88326; +} +#side .panel a:hover { + color: #e63; +} +#main .article_manage a { + color: #c88326; +} +#main .article_next_prev li:hover span { + background-color: #c88326; +} +#main .article_next_prev li:hover a { + color: #c88326; +} +#main .article_next_prev #btnDigg { + background: #f90; +} +#main .article_next_prev #btnBury { + background: #ff7900; +} +#main .details { + border: 1px solid #ccc; + border-bottom: 0; +} +#main .blog-associat-tag, +#main .blog-ass-articl, +#main #ad_cen { + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; +} +#main #ad_cen { + border-bottom: 1px solid #ccc; +} +#main .comment_class, +#main .tag_list { + border: 1px solid #ccc; +} +#main .comment_head .username { + color: #c88326 !important; +} +#main .comment_head a:hover { + color: #c88326 !important; +} +#main .comment_head a:hover.reply, +#main .comment_head a:hover.quote, +#main .comment_head a:hover.report, +#main .comment_head a:hover.delete { + background-image: url("/static/img/skin-comment-icon-yellow.png") !important; +} +#main .article_manage a { + color: #c88326; +} +#main .article_manage .link_comments, +#main .article_manage .link_collect, +#main .article_manage .link_report { + background-image: url("/static/img/skin-type-icon-yellow.png") !important; +} +#main .tag_list .classify a, +#main .guest_link a { + color: #c88326 !important; +} +#main .blog-ass-articl dd:before { + background: #c88326; +} +#main .tag_list h5 > a, +#main .blog-ass-articl dt span, +#main .comment_class .panel_head > span { + border-bottom-color: #c88326; +} +#main #comment_form .panel_head:after { + background: #c88326; +} + +/*2016.11.02 modifed by liwz*/ +#article_content img{ + max-width:100%; + max-height:100%; +} +#article_content p img{ + max-width:100%; + max-height:100%; +} + +#article_content p span img{ + max-width:100%; + max-height:100%; +} +/* 新加搜索样式 */ +.search_con{ + display: none; + border-bottom: 1px solid #DDDDDD; + margin-left: 30px; + margin-right: 30px; + font-size: 16px; + color: #666666; + padding: 16px 0; +} +.search_con #return_icon{ + width: 8px; + height: 8px; + color: #DDDDDD; + cursor: pointer; + fill:#DDDDDD; +} +.search_con #return_icon:hover{ + fill: #C92027; +} +.search_text{ + color: #333333; + +} \ No newline at end of file diff --git a/static/css/csdnarticlecommon.css b/static/css/csdnarticlecommon.css new file mode 100644 index 00000000..2e4e3637 --- /dev/null +++ b/static/css/csdnarticlecommon.css @@ -0,0 +1,116 @@ +body,form,h1,h2,h3,h4{margin:0px;padding:0px;} +.side li{list-style:none;} +.side ul{margin:0px;padding:0px;} +img{border:none;} +pre{white-space:pre-wrap; white-space:-moz-pre-wrap; white-space:-pre-wrap; white-space:-o-pre-wrap; word-wrap:break-word; } + +.share_buttons{float:right; width:170px; margin:5px 0; font:normal 12px/24px Arial, Helvetica, sans-serif; text-align:right;} +.share_buttons span{display:inline-block; line-height:30px; font-weight:bold; color:green; vertical-align:middle;} +.share_buttons a{display:inline-block; width:25px; height:30px; background-position: 0px 5px; cursor:pointer; vertical-align:middle;} +.share_douban{background-image:url(/static/img/ico_douban.gif)} +.share_renren{background-image:url(/static/img/ico_renren.gif)} +.share_sina{background:url(/static/img/ico_sina.gif) no-repeat center center;} +.share_qq{background:url(/static/img/ico_qq.gif) no-repeat center center;} + +.article_description { text-indent:2em;} +.list_opended { background-image: url(/static/img/dir_arr.gif); background-repeat: no-repeat; background-position: 0px 7px; } +.list_opended:hover { background-repeat: no-repeat; background-position: 0px -15px; } +.list_closed { background-image: url(/static/img/dir_arr.gif); background-repeat: no-repeat; background-position: 0px -45px; } +.list_closed:hover { background-repeat: no-repeat; background-position: 0px -69px; } + +/* comment style */ +.comment_item{margin:2px 10px; font:normal 12px/26px Arial, Helvetica, sans-serif;} +.comment_item fieldset{border:solid 1px; font:normal 12px/26px Arial, Helvetica, sans-serif;} +.comment_reply{margin-left:50px;} + +.comment_list{clear: both; } +.comment_list dl{clear: both; display: block; overflow: hidden; } +.comment_item .user{} +.comment_item_reply{ margin-left: 50px; } +.comment_userface{ float: left; margin: 4px; } +.comment_userface img { width:40px; height:40px; } +.comment_body{margin-left: 50px; line-height: 20px; padding: 5px; min-height:35px;} + +.commentform{/*padding:0 0 20px 0;*/} +.commentform ul{clear: both; margin:0 20px 5px 20px; /*overflow: hidden;*/ font:normal 12px/24px Arial, Helvetica, sans-serif;} +.commentform .left{float: left; display: block; width:80px;} +.commentform .right{display: block; margin-left:90px;} +.commentform textarea{padding:5px; border:solid 1px #ddd; color:#555; font:normal 14px/24px Arial, Helvetica, sans-serif;} + +.guest_link{ background-color:#f5f5f5; border:solid 1px #ccc; margin:10px; padding:10px;font-size:12px;} +#lang_list{ background-color: #FFFFFF; border:solid 1px #ccc;font-size:12px;} +#lang_list a { display: inline-block; cursor: pointer; border-right: 1px solid #ccc; padding: 0px 5px; text-align: center; float: left;} +#lang_list a:hover { background-color:#666; color:#fff;} + +a.cmt_btn { background-position:left top; background-repeat:no-repeat; overflow:hidden; display:inline-block; width:16px; height:16px; padding:1px; margin-bottom:-5px; _margin-bottom:4px; text-indent:-2000px; } +a.cmt_btn:hover { border:solid 1px #ccc; padding:0px; } +a.reply{ background-image:url(/static/img/ico_reply.png);} +a.quote{ background-image:url(/static/img/ico_quote.png);} +a.report{ background-image:url(/static/img/ico_report.png);} +a.delete{ background-image:url(/static/img/ico_del.png);} + + +#report_dialog{ position:absolute; left:30%; right:33%; top:33%; z-index:99;} +#panel_report{ background:#fff; border: solid 1px #DDD; width:440px; padding:8px 8px 20px 8px; + border-radius: 5px; -moz-border-radius: 5px;-webkit-border-radius:5px;} +#panel_report .pop_table {line-height:20px; margin:10px 0 0 12px;} +#panel_report th,#panel_report td{padding:4px 0; vertical-align:top;} +#panel_report th{text-align:right; font-weight:normal;} +#panel_report h3{ line-height:60px; } +#report_other_content { height:16px; padding:0px; border:solid 1px #999; } +#btnSubmitReport{border:0px;} + +/*锟斤拷锟斤拷勋锟斤拷*/ +#bms_box { display:block; margin-top:4px; padding: 14px 4px 4px 0; border-top: dashed 1px #ccc; text-align:left; } +#bms_box img { margin-left:6px; cursor:pointer; } +.medal_intro { display:block; *display:inline-block; position:absolute; z-index:10; width:274px; padding:16px; _padding-top:26px; ;background-color: #fff;font-family:'微软雅黑'; + position: absolute; + text-align: center; + width: 252px; + min-height: 100px; + background-color: #fff; + border: 2px #DDDDDD solid; + box-shadow: 0px 2px 2px rgba(0,0,0,0.1); + left: -55px; + top: 33px; + z-index: 100; + vertical-align: top; + padding: 20px; +} + +.medal_intro:after{content:"."; display:block; height:0; clear:both; visibility:hidden;} +.medal_intro dl{margin: 0} +.medal_intro dt{float:left;margin-right: 18px;} +.medal_intro dd{float:left; margin:0; text-align:left;width:180px; + color: #666666; + line-height: 18px;} +.medal_intro dd strong{display:block; padding-bottom:10px; color:#004279;font-size: 18px;} + +#sp_column img { border:solid 1px #ccc; } +#sp_column p { margin:0px; padding:6px 0px; } + +/*锟斤拷注锟斤拷ç§é”Ÿæ–¤æ‹·*/ +.interact{padding:0 0 15px 0; text-align:center;} +.interact .attent, +.interact .attented, +.interact .letter{display:inline-block; width:59px; height:20px; overflow:hidden; cursor:pointer;} +.interact .attent{background:url(/static/img/btn_attent.gif) no-repeat 0 0;} +.interact .attented{background:url(/static/img/btn_attented.gif) no-repeat 0 0;} +.interact .letter{margin:0 10px 0 0; background:url(/static/img/btn_sendletter.gif) no-repeat 0 0;} + +.panel_body li span { padding-left:6px;position: relative} +.itemlist li a { display:inline-block; white-space:nowrap; width:130px; height:15px; overflow:hidden; } +.itemlist li span { display:inline-block; height:14px; float:right; _margin-top:-18px; } +#newcomments .itemlist li a { width:98%; } +#newcomments .itemlist li a.user_name { display:inline; width:auto; } + +#side #blog_userface a { color:#333; } + +#d-top {position:fixed; float:right; z-index:10; right:10px; bottom:10px;} +#d-top img { width:42px; filter:alpha(opcity=30); -moz-opacity:0.3; -khtml-opacity:0.3; opacity:0.3; } +#d-top a:hover img { filter:alpha(opcity=100); -moz-opacity:1; -khtml-opacity:1; opacity:1; } + +.article_next_prev { margin-top:30px; } +.tag2box { margin:10px 0;} +.tag2box a { display:inline-block; padding:4px 10px; line-height:100%; margin-right:10px; border:solid 1px #eee; background-color:#eee; border-radius:10px;} + diff --git a/static/css/main.css b/static/css/main.css index 4777d8d5..ad6f75b5 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -1,12 +1,12 @@ .blog_top { - height: 3rem; + height: 2rem; background: #fff; position: relative; box-shadow: 2px 4px 7px #dcdcdc; } .blog_top .blog_top_t { text-align: center; - line-height: 3rem; + line-height: 2rem; font-size: 0.85rem; color: #333; } @@ -15,7 +15,7 @@ position: absolute; top: 0.6rem; font-size: 0.8rem; - color: #be0000; + color: #000; cursor: pointer; font-family: '微软雅黑'; } @@ -35,14 +35,14 @@ display: none; width: 100%; position: absolute; - bottom: -3.3rem; + bottom: -2.3rem; padding: 0.5rem; background: #f0f0f0; } .search input { width: 100%; display: block; - height: 2.3rem; + height: 1.3rem; border-style: solid; border-width: 0.025rem; border-color: #cdcdcd; @@ -339,8 +339,7 @@ } .personal dt a img, .personal dt img img { - width: 2.5rem; - height: 2.5rem; + width: 1rem; } .personal dt .per_user { margin-left: 0.5rem; @@ -352,6 +351,9 @@ width: 0.35rem; height: 0.5rem; } +.personal dt .zhuanjia{ + width: 1rem; +} .personal dt .exit, .personal dt .attention { position: absolute; @@ -520,11 +522,11 @@ padding: 0 0.5rem; } .blog_article .blog_article_c .article_t { - font-size: 0.7rem; - color: #333; - padding: 0.5rem 0 0.3rem; - line-height: 1.2; - word-break: break-all; + font-size: 0.8rem; + color: #333; + padding: 0.5rem 0 0.3rem; + line-height: 1.2rem; + word-break: break-all; } .blog_article .blog_article_c .date, .blog_article .blog_article_c .category_p { @@ -716,35 +718,88 @@ pre { border-bottom: solid 0.05rem #ddd; padding-left: 0.5rem; } +.isArticle{ + border-bottom-style: none; + background-color: #f0f0f0; + text-align: center; + font-size: 18px; + color: #333333; + padding-top: .5rem; + height: 2rem; +} .my_hot_article { background: #fff; margin-bottom: 0.5rem; - border-top: solid 0.05rem #dcdcdc; + /* border-top: solid 0.05rem #dcdcdc; */ border-bottom: solid 0.05rem #dcdcdc; } .my_hot_article:last-child { margin-bottom: 2rem; } .my_hot_article .hot_article { - padding: 0 0.5rem; + /* padding: 0 0.5rem; */ } .my_hot_article .hot_article li { - height: 1.6rem; - line-height: 1.6rem; + padding: 0 0.5rem; + /* height: 1.6rem; */ + /* line-height: 1.6rem; */ font-size: 0.6rem; color: #666; border-bottom: solid 0.05rem #ddd; } .my_hot_article .hot_article li:last-child { - border-bottom: none; + /* border-bottom: none; */ } .my_hot_article .hot_article li a { display: inline-block; width: 100%; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; + /* white-space: nowrap; */ + /* text-overflow: ellipsis; */ + /* overflow: hidden; */ color: #666; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + line-height: 1.6rem; + font-size: 0.6rem; + color: #333333; + margin-bottom: 0.3rem; +} +.my_hot_article .hot_article li .userinfo{ + margin-bottom: 0.6rem; +} +.my_hot_article .hot_article li .userinfo span i{ + vertical-align: middle; + margin-right: 8px; +} +.my_hot_article .hot_article li .userinfo .username img{ + width: 1rem; + height: 1rem; + border-radius: 0.5rem; +} +.my_hot_article .hot_article li .userinfo .username .name{ + font-size: 12px; + color: #333333; +} +.my_hot_article .hot_article li .userinfo .time, +.my_hot_article .hot_article li .userinfo .read{ + font-size: 12px; + color: #999999; +} +.my_hot_article .showMore{ + height: 1.7rem; + width: 7.7rem; + margin-left: auto; + margin-right: auto; + margin: 0.68rem auto; + text-align: center; + border: solid 0.05rem #C92027; + +} +.my_hot_article .showMore a{ + color: #C92027; + font-size: 16px; } .blog_handle { width: 100%; @@ -1026,7 +1081,7 @@ pre { } .main_list { width: 100%; - margin: 3.5rem 0 0; + margin: 2.5rem 0 0; } .search_no { padding: 4rem 0; @@ -1052,6 +1107,32 @@ pre { .file_holder .file_content .code .lines .line_numbers { width: 40px !important; } +/* */ +.readall_box{ + position: relative; +} +.readall_box .read_more_btn{ + text-align: center; + font-size: 0.7rem; + height: 1.7rem; + line-height: 1.7rem; + width: 7.7rem; + margin-left: auto; + margin-right: auto; + margin: 0.68rem auto; + text-align: center; + border: solid 0.05rem #C92027; + color: #C92027; +} +.readall_box .read_more_mask{ + position: absolute; + width: 100%; + height: 3rem; + top: -3rem; + background: -moz-linear-gradient(bottom,rgba(255,255,255,0.7),rgba(255,255,255,0)); + background: -webkit-gradient(linear,0 top,0 bottom,from(rgba(255,255,255,0.7)),to(#fff)); + background: -o-linear-gradient(bottom,rgba(255,255,255,0.7),rgba(255,255,255,0)); +} .MathJax .math>span:last-child{ color: #fff;} /*.blog_article .blog_article_c .article_c{ width: 100%; background-color: #fff; overflow: auto;}*/ .MathJax_Display{ overflow-x: auto; overflow-y: hidden;} diff --git a/static/img/bg-yellow.png b/static/img/bg-yellow.png new file mode 100644 index 00000000..85946a57 Binary files /dev/null and b/static/img/bg-yellow.png differ diff --git a/static/img/fancy.png b/static/img/fancy.png new file mode 100644 index 00000000..29f2390e Binary files /dev/null and b/static/img/fancy.png differ diff --git a/static/img/go.jpg b/static/img/go.jpg new file mode 100644 index 00000000..5a94000d Binary files /dev/null and b/static/img/go.jpg differ diff --git a/static/img/icon-arrow.png b/static/img/icon-arrow.png new file mode 100644 index 00000000..3846d682 Binary files /dev/null and b/static/img/icon-arrow.png differ diff --git a/static/img/iconfont-fudongxiangshang.png b/static/img/iconfont-fudongxiangshang.png new file mode 100644 index 00000000..bdc2839a Binary files /dev/null and b/static/img/iconfont-fudongxiangshang.png differ diff --git a/static/img/iconfont-youjiantou.png b/static/img/iconfont-youjiantou.png new file mode 100644 index 00000000..06d21d61 Binary files /dev/null and b/static/img/iconfont-youjiantou.png differ diff --git a/static/img/icons_0_16.png b/static/img/icons_0_16.png new file mode 100644 index 00000000..960adc73 Binary files /dev/null and b/static/img/icons_0_16.png differ diff --git a/static/img/skin-attent.png b/static/img/skin-attent.png new file mode 100644 index 00000000..afd60ef1 Binary files /dev/null and b/static/img/skin-attent.png differ diff --git a/static/img/skin-email.png b/static/img/skin-email.png new file mode 100644 index 00000000..c4e16b70 Binary files /dev/null and b/static/img/skin-email.png differ diff --git a/static/img/skin-light.png b/static/img/skin-light.png new file mode 100644 index 00000000..c93ad338 Binary files /dev/null and b/static/img/skin-light.png differ diff --git a/static/img/skin-search.png b/static/img/skin-search.png new file mode 100644 index 00000000..5c0473d9 Binary files /dev/null and b/static/img/skin-search.png differ diff --git a/static/img/skin-type-icon-yellow.png b/static/img/skin-type-icon-yellow.png new file mode 100644 index 00000000..2bb2170e Binary files /dev/null and b/static/img/skin-type-icon-yellow.png differ diff --git a/static/img/skin-type-icon.png b/static/img/skin-type-icon.png new file mode 100644 index 00000000..ec349ff2 Binary files /dev/null and b/static/img/skin-type-icon.png differ diff --git a/static/img/title-yellow.png b/static/img/title-yellow.png new file mode 100644 index 00000000..e6d02197 Binary files /dev/null and b/static/img/title-yellow.png differ diff --git a/static/js/details_mobile.js b/static/js/details_mobile.js new file mode 100644 index 00000000..d5858d16 --- /dev/null +++ b/static/js/details_mobile.js @@ -0,0 +1,190 @@ +/* +*created by liwz 2015/11/5 +* +*/ + +$(function(){ + //搜索展开隐藏功能 + // var searchFn = (function() + // { + // var oSearch = $("#search_J"), + // oSearchC = $("#search_c_J"), + // oClose = $(".icon_close"); + + // oSearch.on("click",function() + // { + // oSearchC.slideToggle(); + // }); + // oClose.on("click",function() + // { + // oSearchC.slideUp(); + // }); + // })(); +// var readMore = (function(){ +// var widHeight = $(window).height(); +// var artHeight = $('.article_c').height(); +// if(artHeight>(widHeight*2)){ +// $('.article_c').height(widHeight*2-285).css({'overflow':'hidden'}); +// var article_show = true; +// $('.read_more_btn').on('click',bindRead_more); +// }else{ +// article_show = true; +// $('.article_c').removeClass('article_Hide'); +// $('.readall_box').hide().addClass('readall_box_nobg'); +// } +// function bindRead_more(){ +// if(!article_show){ +// $('.article_c').height(widHeight*2).css({'overflow':'hidden'}); +// $('.readall_box').show().removeClass('readall_box_nobg'); +// article_show = true; +// }else{ +// $('.article_c').height("").css({'overflow':'hidden'}); +// $('.readall_box').show().addClass('readall_box_nobg'); +// $('.readall_box').hide().addClass('readall_box_nobg'); +// article_show = false; +// } +// } +// })() + //点击按钮左侧菜单弹出及隐藏 + // var leftNavFn = (function() + // { + // var oMenuBtn = $("#menu_J"), + // oLeftNav = $(".leftNav"), + // oMask = $("#mask"), + // winH = $(window).height(); + // oMenuBtn.on('click',function() + // { + // if(!oLeftNav.is(":animated")) + // { + // oLeftNav.animate({'left':0},500); + // //var oMask = $('
'); + // oMask.show(); + // $('body').css({ + // 'height':winH, + // 'overflow-y':'hidden' + // }); //屏蔽滚动条 + // } + // return false; //阻止默认事件及冒泡 + // }); + // oMask.click(function(ev) + // { + // /*if($(ev.target).attr('id') == 'mask') + // {*/ + // if(!oLeftNav.is(":animated")) + // { + // oLeftNav.animate({'left':-40 + "rem"},500); + // oMask.hide(); + // $('body').css({ + // 'height':'auto', + // 'overflow-y':'auto' + // }); //打开滚动条 + // } + // //} + // return false; + // }) + // })(); + + //点击关闭底部广告 + // var home_AD = (function() + // { + // var oClose = $(".ad_close"); + // oClose.on('click',function() + // { + // $(this).parents(".ad_box").hide(); + // }) + // })(); + + //点击全部博文展示筛选内容 + // var blogList = (function() + // { + // var oTotalBlog = $(".total_blog"); + // oTotalBlog.on('click',function() + // { + // $(this).next(".filter_category").toggle(); + // }) + // })(); + + //返回顶部 + var backTop = (function() + { + var $backToTopFile = $('.backToTop ') + .click(function() + { + $("body,html").animate({scrollTop:0},500); + }); + + var backToFun = function () + { + var scrollTop = $(document).scrollTop(); + var winh = $(window).height(); + (scrollTop > 0) ? $backToTopFile.show() : $backToTopFile.hide(); + //IE6下的定位 + if (!window.XMLHttpRequest) { + $backToTopFile.css("top", scrollTop + winh - 86); + } + }; + $(window).bind('scroll',backToFun); + backToFun(); + })(); + + //左侧菜单导航增加点击时的样式 + // var leftStyle = (function() + // { + // var aLeftA = $(".nav_list a"); + // aLeftA.on('click',function() + // { + // $(this).addClass("left_cur"); + // }) + // })(); + + // var preCode = (function() + // { + //$("pre").css({'width':'100%!important','overflow':'hidden'}); + // var aPre = document.getElementsByTagName('pre'); + // for(var i=0; i")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,a,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,h],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),o=c[n],a=0===this.alpha()?l("transparent"):this,r=a[o.cache]||o.to(a._rgba),h=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],l=s[o],c=u[n.type]||{};null!==l&&(null===a?h[o]=l:(c.mod&&(l-a>c.mod/2?a+=c.mod:a-l>c.mod/2&&(a-=c.mod)),h[o]=i((l-a)*e+a,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[a]&&(this[a]=h(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[a]=d,n):l(d)},f(o,function(e,i){l.fn[e]||(l.fn[e]=function(n){var o,a=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=l(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function s(e,i){var s,n,a={};for(s in i)n=i[s],e[s]!==n&&(o[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(a[s]=n));return a}var n=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,o,a,r){var h=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map(function(){var e=t(this);return{el:e,start:i(this)}}),o=function(){t.each(n,function(t,i){e[i]&&a[i+"Class"](e[i])})},o(),l=l.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),a.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,o,a,r){return"boolean"==typeof n||n===e?o?t.effects.animateClass.call(this,n?{add:s}:{remove:s},o,a,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,o,a)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.4",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,o;for(o=0;s.length>o;o++)null!==s[o]&&(n=t.data(i+s[o]),n===e&&(n=""),t.css(s[o],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("
").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(o)&&o.call(n[0]),t.isFunction(e)&&e()}var n=t(this),o=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):a.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,o=i.queue,a=t.effects.effect[i.effect];return t.fx.off||!a?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):o===!1?this.each(e):this.queue(o||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()}(jQuery),function(t){var e=0,i={},s={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",s.height=s.paddingTop=s.paddingBottom=s.borderTopWidth=s.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.10.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t(),content:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons;e&&(t("").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons")) -},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),undefined):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),"disabled"===t&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e),undefined)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),o.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus()},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,s=this.options,n=s.heightStyle,o=this.element.parent(),a=this.accordionId="ui-accordion-"+(this.element.attr("id")||++e);this.active=this._findActive(s.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(e){var i=t(this),s=i.attr("id"),n=i.next(),o=n.attr("id");s||(s=a+"-header-"+e,i.attr("id",s)),o||(o=a+"-panel-"+e,n.attr("id",o)),i.attr("aria-controls",o),n.attr("aria-labelledby",s)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(s.event),"fill"===n?(i=o.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===n&&(i=0,this.headers.next().each(function(){i=Math.max(i,t(this).css("height","").height())}).height(i))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n[0]===s[0],a=o&&i.collapsible,r=a?t():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:a?t():n,newPanel:r};e.preventDefault(),o&&!i.collapsible||this._trigger("beforeActivate",e,l)===!1||(i.active=a?!1:this.headers.index(n),this.active=o?t():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),o||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(t,e,n){var o,a,r,h=this,l=0,c=t.length&&(!e.length||t.index()