From b0f834c40c0d8b9db1a5fd30b96aec1e71215986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Tue, 18 Apr 2017 01:45:19 +0200 Subject: [PATCH] Version 16.181.3 --- swad_changelog.h | 3 ++- swad_forum.c | 23 ++++++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 7d99b3f65..8298d088b 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -214,13 +214,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.181.2 (2017-04-18)" +#define Log_PLATFORM_VERSION "SWAD 16.181.3 (2017-04-18)" #define CSS_FILE "swad16.181.css" #define JS_FILE "swad16.181.js" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1 /* + Version 16.181.3: Apr 18, 2017 Code refactoring in forums. (217604 lines) Version 16.181.2: Apr 18, 2017 Code refactoring in forums. (217590 lines) Version 16.181.1: Apr 17, 2017 Code refactoring in forums. (217538 lines) Version 16.181: Apr 17, 2017 Changes in layout of messages. diff --git a/swad_forum.c b/swad_forum.c index ca00cd5d9..92d01cecd 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -1220,8 +1220,20 @@ static void For_ShowAForumPost (struct Forum *ForumSelected, if (LastPst && Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat.UsrCod) // Post can be removed if post is the last (without answers) and it's mine { - Act_FormStart (For_ActionsDelPstFor[ForumSelected->Type]); - Pag_PutHiddenParamPagNum (Pag_POSTS_FORUM,Gbl.Forum.CurrentPagePsts); + if (PstNum == 1) // First and unique post in thread + { + Act_FormStartAnchor (For_ActionsDelPstFor[ForumSelected->Type], + For_ID_FORUM_THREADS_SECTION); + Pag_PutHiddenParamPagNum (Pag_THREADS_FORUM, + Gbl.Forum.CurrentPageThrs); + } + else // Last of several posts in thread + { + Act_FormStartAnchor (For_ActionsDelPstFor[ForumSelected->Type], + For_ID_FORUM_POSTS_SECTION); + Pag_PutHiddenParamPagNum (Pag_POSTS_FORUM, + Gbl.Forum.CurrentPagePsts); + } For_PutAllHiddenParamsForum (Gbl.Forum.ForumSet, Gbl.Forum.SelectedOrder, Gbl.Forum.ForumSelected.Location, @@ -1236,8 +1248,9 @@ static void For_ShowAForumPost (struct Forum *ForumSelected, { if (ICanModerateForum) { - Act_FormStart (Enabled ? For_ActionsDisPstFor[ForumSelected->Type] : - For_ActionsEnbPstFor[ForumSelected->Type]); + Act_FormStartAnchor (Enabled ? For_ActionsDisPstFor[ForumSelected->Type] : + For_ActionsEnbPstFor[ForumSelected->Type], + For_ID_FORUM_POSTS_SECTION); Pag_PutHiddenParamPagNum (Pag_POSTS_FORUM,Gbl.Forum.CurrentPagePsts); For_PutAllHiddenParamsForum (Gbl.Forum.ForumSet, Gbl.Forum.SelectedOrder, @@ -3776,7 +3789,7 @@ static void For_WriteFormForumPst (bool IsReply,const char *Subject) { Act_FormStartAnchor (For_ActionsRecRepFor[Gbl.Forum.ForumSelected.Type], For_ID_FORUM_POSTS_SECTION); - Pag_PutHiddenParamPagNum (Pag_POSTS_FORUM,0); + Pag_PutHiddenParamPagNum (Pag_POSTS_FORUM,Gbl.Forum.CurrentPagePsts); For_PutAllHiddenParamsForum (Gbl.Forum.ForumSet, Gbl.Forum.SelectedOrder, Gbl.Forum.ForumSelected.Location,