소스 검색

Merge pull request #506 from writefreely/minor-fixes

Miscellaneous fixes
pull/525/head
Matt Baer 2 년 전
committed by GitHub
부모
커밋
1530bf37ef
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
8개의 변경된 파일17개의 추가작업 그리고 17개의 파일을 삭제
  1. +1
    -1
      database.go
  2. +8
    -8
      feed.go
  3. +1
    -0
      less/core.less
  4. +3
    -0
      postrender.go
  5. +2
    -2
      prose/markdownSerializer.js
  6. +1
    -1
      templates/edit-meta.tmpl
  7. +1
    -1
      templates/pad.tmpl
  8. +0
    -4
      templates/user/collection.tmpl

+ 1
- 1
database.go 파일 보기

@@ -661,7 +661,7 @@ func (db *datastore) CreatePost(userID, collID int64, post *SubmittedPost) (*Pos
// SQLite stores datetimes in UTC, so convert time.Now() to it here
created = created.UTC()
}
if post.Created != nil {
if post.Created != nil && *post.Created != "" {
created, err = time.Parse("2006-01-02T15:04:05Z", *post.Created)
if err != nil {
log.Error("Unable to parse Created time '%s': %v", *post.Created, err)


+ 8
- 8
feed.go 파일 보기

@@ -1,5 +1,5 @@
/*
* Copyright © 2018-2020 A Bunch Tell LLC.
* Copyright © 2018-2021 A Bunch Tell LLC.
*
* This file is part of WriteFreely.
*
@@ -15,7 +15,7 @@ import (
"net/http"
"time"

. "github.com/gorilla/feeds"
"github.com/gorilla/feeds"
"github.com/gorilla/mux"
stripmd "github.com/writeas/go-strip-markdown/v2"
"github.com/writeas/web-core/log"
@@ -87,11 +87,11 @@ func ViewFeed(app *App, w http.ResponseWriter, req *http.Request) error {
siteURL += "tag:" + tag
}

feed := &Feed{
feed := &feeds.Feed{
Title: collectionTitle,
Link: &Link{Href: siteURL},
Link: &feeds.Link{Href: siteURL},
Description: coll.Description,
Author: &Author{author, ""},
Author: &feeds.Author{author, ""},
Created: time.Now(),
}

@@ -103,13 +103,13 @@ func ViewFeed(app *App, w http.ResponseWriter, req *http.Request) error {
// Create the item for the feed
title = p.PlainDisplayTitle()
permalink = fmt.Sprintf("%s%s", baseUrl, p.Slug.String)
feed.Items = append(feed.Items, &Item{
feed.Items = append(feed.Items, &feeds.Item{
Id: fmt.Sprintf("%s%s", basePermalinkUrl, p.Slug.String),
Title: title,
Link: &Link{Href: permalink},
Link: &feeds.Link{Href: permalink},
Description: "<![CDATA[" + stripmd.Strip(p.Content) + "]]>",
Content: string(p.HTMLContent),
Author: &Author{author, ""},
Author: &feeds.Author{author, ""},
Created: p.Created,
Updated: p.Updated,
})


+ 1
- 0
less/core.less 파일 보기

@@ -695,6 +695,7 @@ table.downloads {

select.inputform, textarea.inputform {
border: 1px solid #999;
background: white;
}

input, button, select.inputform, textarea.inputform, a.btn {


+ 3
- 0
postrender.go 파일 보기

@@ -201,6 +201,9 @@ func applyBasicMarkdown(data []byte) string {
md := blackfriday.Markdown(append([]byte("# "), data...), blackfriday.HtmlRenderer(htmlFlags, "", ""), mdExtensions)
// Remove H1 markup
md = bytes.TrimSpace(md) // blackfriday.Markdown adds a newline at the end of the <h1>
if len(md) == 0 {
return ""
}
md = md[len("<h1>") : len(md)-len("</h1>")]
// Strip out bad HTML
policy := bluemonday.UGCPolicy()


+ 2
- 2
prose/markdownSerializer.js 파일 보기

@@ -92,8 +92,8 @@ export const writeFreelyMarkdownSerializer = new MarkdownSerializer(
},
{
em: {
open: "*",
close: "*",
open: "_",
close: "_",
mixable: true,
expelEnclosingWhitespace: true,
},


+ 1
- 1
templates/edit-meta.tmpl 파일 보기

@@ -65,7 +65,7 @@
{{end}}
<dt><label for="lang">Language</label></dt>
<dd>
<select name="lang" id="lang" dir="auto">
<select name="lang" id="lang" dir="auto" class="inputform">
<option value=""></option>
<option value="ab"{{if eq "ab" .Post.Language.String}} selected="selected"{{end}}>аҧсуа бызшәа, аҧсшәа</option>
<option value="aa"{{if eq "aa" .Post.Language.String}} selected="selected"{{end}}>Afaraf</option>


+ 1
- 1
templates/pad.tmpl 파일 보기

@@ -24,7 +24,7 @@
{{if not .SingleUser}}<h1><a href="/me/c/" title="View blogs"><img class="ic-24dp" src="/img/ic_blogs_dark@2x.png" /></a></h1>{{end}}
<nav id="target" {{if .SingleUser}}style="margin-left:0"{{end}}><ul>
{{if .Editing}}<li>{{if .EditCollection}}<a href="{{.EditCollection.CanonicalURL}}">{{.EditCollection.Title}}</a>{{else}}<a>Draft</a>{{end}}</li>
{{else}}<li class="has-submenu"><a id="publish-to"><span id="target-name">Draft</span> <img class="ic-18dp" src="/img/ic_down_arrow_dark@2x.png" /></a>
{{else}}<li class="has-submenu"><a href="#" id="publish-to" onclick="return false"><span id="target-name">Draft</span> <img class="ic-18dp" src="/img/ic_down_arrow_dark@2x.png" /></a>
<ul>
<li class="menu-heading">Publish to...</li>
{{if .Blogs}}{{range $idx, $el := .Blogs}}


+ 0
- 4
templates/user/collection.tmpl 파일 보기

@@ -1,7 +1,3 @@
{{define "upgrade"}}
<p><a href="/me/plan?to=/me/c/{{.Alias}}">Upgrade</a> for <span>$40 / year</span> to edit.</p>
{{end}}

{{define "collection"}}
{{template "header" .}}



불러오는 중...
취소
저장