From 4514a42cfc7409c2378ab4f59d92ca3afa00f139 Mon Sep 17 00:00:00 2001 From: Robin Malley Date: Mon, 20 Feb 2023 01:56:09 +0000 Subject: [PATCH] rename "idp" to "short" rename a variable with a useless name to something more descriptive --- src/lua/endpoints/read_get.lua | 8 ++++---- src/pages/read.etlua.in | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lua/endpoints/read_get.lua b/src/lua/endpoints/read_get.lua index 3bdca26..fa583a1 100644 --- a/src/lua/endpoints/read_get.lua +++ b/src/lua/endpoints/read_get.lua @@ -106,8 +106,8 @@ local function read_get(req) local err --Get our story id assert(string.len(ps.path) > 0,"Tried to read 0-length story id") - ps.idp = string.sub(ps.path,2)--remove leading "/" - ps.storyid,err = util.decode_id(ps.idp) + ps.short = string.sub(ps.path,2)--remove leading "/" + ps.storyid,err = util.decode_id(ps.short) if not ps.storyid then local page = pages.error{ errcode = 400, @@ -180,8 +180,8 @@ local function read_get(req) --If this isn't unlisted, dirty everywhere the hit counter is shown cache.dirty(string.format("%s",config.domain)) - cache.dirty(string.format("%s/%s",config.domain,ps.idp)) -- This place to read this post - cache.dirty(string.format("%s.%s",config.domain,ps.idp)) -- The author's index page + cache.dirty(string.format("%s/%s",config.domain,ps.short)) -- This place to read this post + cache.dirty(string.format("%s.%s",config.domain,ps.short)) -- The author's index page assert(text) http_response(req,200,text) diff --git a/src/pages/read.etlua.in b/src/pages/read.etlua.in index 4bed22a..6bf0d25 100644 --- a/src/pages/read.etlua.in +++ b/src/pages/read.etlua.in @@ -1,15 +1,15 @@ <{system cat src/pages/parts/header.etlua}> <% if owner then -%>
- +
- +
@@ -37,14 +37,14 @@

<%= views %> Hits

- + <% if unlisted then %> <% end %>
<% if not show_comments then -%> -
+
<% if unlisted then %> @@ -52,7 +52,7 @@
<% else %> -
+ <% if unlisted then %> <% end %>