~oyvindsk/rss-web-reader

7176f0ce5798ec4374a5aea3af6e5b90a0123357 — Øyvind Skaar 8 months ago ea6bffa
improved css a little with Tachyons
3 files changed, 67 insertions(+), 29 deletions(-)

M README.adoc
M templates/show-all.html
M templates/show-one.html
M README.adoc => README.adoc +5 -4
@@ 108,13 108,14 @@ Should just work and print some useful info. Also see Cloud Scheduler in the web
 - Remember seeen [OK]

=== 3rd version:
 * Nicer templates
 * Clean up code
 * Nicer templates [kind of]
 * Put username/password in a file or something, for all the scripts too [OK]
 * Fix scrips [OK]
 
=== 4th version:

 * Clean up code
 * Optimize datastore calls, use *multi
 * Test if the "mark these as read" only marks those seen 
    ** (and not just 10 random)


== Echo

M templates/show-all.html => templates/show-all.html +31 -13
@@ 1,27 1,45 @@

{{define "show-all"}}
<html>
	<body>

<!DOCTYPE html>
<html lang="en">
	<head>
  		<title>RSS ftw</title>
  		<meta name="viewport" content="width=device-width, initial-scale=1">
  		<link rel="stylesheet" href="https://unpkg.com/tachyons/css/tachyons.min.css">
	</head>

	<body class="ma2 ma4-l">
		
		<p>Showing {{len .Items}} of {{.Cnt}} unseen</p>

		<form action="/seen" method="post">
			<input type="submit" value="Set all these {{len .Items}} as seen!">
		</form>
		
		Showing {{len .Items}} of {{.Cnt}} unseen
		
		<ul class="list pl0">
			{{range $i := .Items}}
				<li class="pa3 pa4-ns bb b--black-10">
					<b class="db f3 mb1">{{$i.FeedDesc}}</b>
					<b class="db f3 mb1"><a href="/show-one?guid={{$i.K.Name}}">{{$i.Title}}</a></b>
					<span class="f5 db lh-copy">
						<a href={{$i.Link}}>Post Link</a> || <a href={{$i.FeedURL}}>Feed Link</a> || Published: {{$i.PublishedParsed}} | Updated: {{$i.UpdatedParsed}} | FirstSeen: {{$i.FirstSeen}}
						<br>
						Categories: {{$i.Categories}}
						<br>
					</span>
				</li>
			{{end}}
		  </ul>


		{{range $i := .Items}}
			<p>
				<h1><a href="/show-one?guid={{$i.K.Name}}">{{$i.Title}}</a></h1>
                <h2>{{$i.FeedDesc}}</h2> <a href={{$i.FeedURL}}>feed url</a> GUID: {{$i.K.Name}} <br>
				Published: {{$i.PublishedParsed}} | Updated: {{$i.UpdatedParsed}} | FirstSeen: {{$i.FirstSeen}} <br>
				Categories: {{$i.Categories}} <br>
			</p>
		{{end}}
		<p>Showing {{len .Items}} of {{.Cnt}} unseen</p>

		<form action="/seen" method="post">
			<input type="submit" value="Set all these {{len .Items}} as seen!">
		</form>
		Unseen: {{.Cnt}}
		

	</body>
</html>
{{end}}

M templates/show-one.html => templates/show-one.html +31 -12
@@ 1,25 1,44 @@

{{define "show-one"}}
<html>

<!DOCTYPE html>
<html lang="en">
	<head>
  		<title>RSS ftw: {{.Title}}</title>
  		<meta name="viewport" content="width=device-width, initial-scale=1">
  		<link rel="stylesheet" href="https://unpkg.com/tachyons/css/tachyons.min.css">
	</head>

	<body>
        <div class="lh-copy measure-wide-l measure ma4 ma7-l">

            <a href="/"><< back</a>

           <h2>
                {{.FeedDesc}} 
            </h2>
        
			<h1>
                {{.Title}}
            </h1>
            <p>
                <h2>
                    <a href={{.FeedURL}}>{{.FeedDesc}}</a> 
                </h2>
                <a href={{.Link}}>{{.Link}}</a>
            </p>
            <p>
				Published: {{.PublishedParsed}} | Updated: {{.UpdatedParsed}} | FirstSeen: {{.FirstSeen}} <br>
            </p>

        
        
            <a href={{.Link}}>Post Link</a> || <a href={{.FeedURL}}>Feed Link</a> || Published: {{.PublishedParsed}} | Updated: {{.UpdatedParsed}} | FirstSeen: {{.FirstSeen}}
            <br>
            Categories: {{.Categories}}
            <br>


            <p>
                {{.Description}}
            </p>
            <p>
                {{.Content}}
			</p>
	</body>
            </p>

                
        </div>
    </body>
</html>
{{end}}
\ No newline at end of file