Rename templates
This commit is contained in:
		
							parent
							
								
									2ee79e7970
								
							
						
					
					
						commit
						6c5f491ee0
					
				| 
						 | 
				
			
			@ -2,7 +2,9 @@ import asyncdispatch, asyncfile, httpclient, strutils, strformat, uri, os
 | 
			
		|||
import jester
 | 
			
		||||
 | 
			
		||||
import api, utils, types, cache, formatters
 | 
			
		||||
import views/[user, general, conversation]
 | 
			
		||||
 | 
			
		||||
include views/"user.nimf"
 | 
			
		||||
include views/"general.nimf"
 | 
			
		||||
 | 
			
		||||
const cacheDir {.strdefine.} = "/tmp/nitter"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,38 +0,0 @@
 | 
			
		|||
#? stdtmpl(subsChar = '$', metaChar = '#')
 | 
			
		||||
#import xmltree, strutils, uri
 | 
			
		||||
#import ../types, ../formatters, ./tweet
 | 
			
		||||
#
 | 
			
		||||
#proc renderConversation*(conversation: Conversation): string =
 | 
			
		||||
<div class="conversation" id="tweets">
 | 
			
		||||
  <div class="main-thread">
 | 
			
		||||
    #if conversation.before.len > 0:
 | 
			
		||||
    <div class="before-tweet">
 | 
			
		||||
      #for tweet in conversation.before:
 | 
			
		||||
      ${renderTweet(tweet)}
 | 
			
		||||
      #end for
 | 
			
		||||
    </div>
 | 
			
		||||
    #end if
 | 
			
		||||
    <div class="main-tweet">
 | 
			
		||||
      ${renderTweet(conversation.tweet)}
 | 
			
		||||
    </div>
 | 
			
		||||
    #if conversation.after.len > 0:
 | 
			
		||||
    <div class="after-tweet">
 | 
			
		||||
      #for tweet in conversation.after:
 | 
			
		||||
      ${renderTweet(tweet)}
 | 
			
		||||
      #end for
 | 
			
		||||
    </div>
 | 
			
		||||
    #end if
 | 
			
		||||
  </div>
 | 
			
		||||
  #if conversation.replies.len > 0:
 | 
			
		||||
  <div class="replies">
 | 
			
		||||
    #for thread in conversation.replies:
 | 
			
		||||
    <div class="thread">
 | 
			
		||||
      #for tweet in thread:
 | 
			
		||||
      ${renderTweet(tweet)}
 | 
			
		||||
      #end for
 | 
			
		||||
    </div>
 | 
			
		||||
    #end for
 | 
			
		||||
  </div>
 | 
			
		||||
  #end if
 | 
			
		||||
</div>
 | 
			
		||||
#end proc
 | 
			
		||||
| 
						 | 
				
			
			@ -1,5 +1,4 @@
 | 
			
		|||
#? stdtmpl(subsChar = '$', metaChar = '#')
 | 
			
		||||
#import user
 | 
			
		||||
#import xmltree
 | 
			
		||||
#
 | 
			
		||||
#proc renderMain*(body: string; title="Nitter"): string =
 | 
			
		||||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
#? stdtmpl(subsChar = '$', metaChar = '#')
 | 
			
		||||
#import xmltree, strutils, uri, htmlgen
 | 
			
		||||
#import xmltree, strutils, uri
 | 
			
		||||
#import ../types, ../formatters, ../utils
 | 
			
		||||
#import ./tweet
 | 
			
		||||
#include "tweet.nimf"
 | 
			
		||||
#
 | 
			
		||||
#proc renderProfileCard*(profile: Profile): string =
 | 
			
		||||
#let pic = profile.getUserpic().getSigUrl("pic")
 | 
			
		||||
| 
						 | 
				
			
			@ -103,3 +103,39 @@
 | 
			
		|||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
#end proc
 | 
			
		||||
#
 | 
			
		||||
#proc renderConversation*(conversation: Conversation): string =
 | 
			
		||||
<div class="conversation" id="tweets">
 | 
			
		||||
  <div class="main-thread">
 | 
			
		||||
    #if conversation.before.len > 0:
 | 
			
		||||
    <div class="before-tweet">
 | 
			
		||||
      #for tweet in conversation.before:
 | 
			
		||||
      ${renderTweet(tweet)}
 | 
			
		||||
      #end for
 | 
			
		||||
    </div>
 | 
			
		||||
    #end if
 | 
			
		||||
    <div class="main-tweet">
 | 
			
		||||
      ${renderTweet(conversation.tweet)}
 | 
			
		||||
    </div>
 | 
			
		||||
    #if conversation.after.len > 0:
 | 
			
		||||
    <div class="after-tweet">
 | 
			
		||||
      #for tweet in conversation.after:
 | 
			
		||||
      ${renderTweet(tweet)}
 | 
			
		||||
      #end for
 | 
			
		||||
    </div>
 | 
			
		||||
    #end if
 | 
			
		||||
  </div>
 | 
			
		||||
  #if conversation.replies.len > 0:
 | 
			
		||||
  <div class="replies">
 | 
			
		||||
    #for thread in conversation.replies:
 | 
			
		||||
    <div class="thread">
 | 
			
		||||
      #for tweet in thread:
 | 
			
		||||
      ${renderTweet(tweet)}
 | 
			
		||||
      #end for
 | 
			
		||||
    </div>
 | 
			
		||||
    #end for
 | 
			
		||||
  </div>
 | 
			
		||||
  #end if
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
#end proc
 | 
			
		||||
		Loading…
	
		Reference in New Issue