From 8f124e174bd724cad655ffdfb68bad1f4e25caab Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Tue, 24 Jan 2012 20:14:42 -0500 Subject: [PATCH 1/3] Got deletion working. --HG-- branch : bridgerwiki --- simplewiki_edit.html | 3 +- simplewiki_error.html | 131 +++++++++++++++------------------- simplewiki_history.html | 57 ++++++++------- simplewiki_searchresults.html | 3 +- simplewiki_view.html | 2 +- 5 files changed, 93 insertions(+), 103 deletions(-) diff --git a/simplewiki_edit.html b/simplewiki_edit.html index fc35c48b30..fbb4b143a3 100644 --- a/simplewiki_edit.html +++ b/simplewiki_edit.html @@ -14,6 +14,7 @@ ${ wiki_article.title } ${wiki_form} - + + diff --git a/simplewiki_error.html b/simplewiki_error.html index eb78521fb0..c257ef9a90 100644 --- a/simplewiki_error.html +++ b/simplewiki_error.html @@ -18,85 +18,66 @@ ${wiki_error} %endif %if wiki_err_notfound is not UNDEFINED: -%if wiki_url is not UNDEFINED: -

-The page you requested could not be found. -Click here to create it. -

-%else: -

-Or maybe rather: Congratulations! It seems that there's no root -article, which is probably because you just installed simple-wiki -and your installation is working. Now you can create the root article. -Click here to create it. -

-%endif + %if wiki_url is not UNDEFINED: +

+ The page you requested could not be found. + Click here to create it. +

+ %else: +

+ Or maybe rather: Congratulations! It seems that there's no root + article, which is probably because you just installed simple-wiki + and your installation is working. Now you can create the root article. + Click here to create it. +

+ %endif %else: %if wiki_err_noparent is not UNDEFINED: -

-You cannot create this page, because its parent -does not exist. Click here -to create it. -

+

+ You cannot create this page, because its parent + does not exist. Click here + to create it. +

%else: - -%if wiki_err_keyword is not UNDEFINED: -

-The page you're trying to create ${wiki_url} starts with _, which is reserved for internal use. -

+%if wiki_err_keyword is not UNDEFINED and wiki_err_keyword: +

+ The page you're trying to create ${wiki_url} starts with _, which is reserved for internal use. +

+%elif wiki_err_locked is not UNDEFINED and wiki_err_locked: +

+ The article you are trying to modify is locked. +

+%elif wiki_err_noread is not UNDEFINED and wiki_err_noread: +

+ You do not have access to read this article. +

+%elif wiki_err_nowrite is not UNDEFINED and wiki_err_nowrite: +

+ You do not have access to edit this article. +

+%elif wiki_err_noanon is not UNDEFINED and wiki_err_noanon: +

+ Anonymous attachments are not allowed. Try logging in. +

+%elif wiki_err_create is not UNDEFINED and wiki_err_create: +

+ You do not have access to create this article. +

+%elif wiki_err_encode is not UNDEFINED and wiki_err_encode: +

+ The url you requested could not be handled by the wiki. + Probably you used a bad character in the URL. + Only use digits, English letters, underscore and dash. For instance + /wiki/An_Article-1 +

+%elif wiki_err_deleted is not UNDEFINED and wiki_err_deleted: +

+ The article you tried to access has been deleted. You may be able to restore it to an earlier version in history, or create a new version edit. +

%else: - -%if wiki_err_locked is not UNDEFINED: -

-The article you are trying to modify is locked. -

-%else: - -%if wiki_err_noread is not UNDEFINED: -

-You do not have access to read this article. -

-%else: - -%if wiki_err_nowrite is not UNDEFINED: -

-You do not have access to edit this article. -

-%else: - -%if wiki_err_noanon is not UNDEFINED: -

-Anonymous attachments are not allowed. Try logging in. -

-%else: - -%if wiki_err_create is not UNDEFINED: -

-You do not have access to create this article. -

-%else: - -%if wiki_err_encode is not UNDEFINED: -

-The url you requested could not be handled by the wiki. -Probably you used a bad character in the URL. -Only use digits, English letters, underscore and dash. For instance -/wiki/An_Article-1 -

- - -%else: -

-An error has occured. -

- - -%endif -%endif -%endif -%endif -%endif -%endif +

+ An error has occured. +

%endif %endif %endif diff --git a/simplewiki_history.html b/simplewiki_history.html index 936459354b..860310e5b0 100644 --- a/simplewiki_history.html +++ b/simplewiki_history.html @@ -27,30 +27,32 @@ ${ wiki_article.title } <% loopCount = 0 %> %for revision in wiki_history: - <% loopCount += 1 %> - - - - - - - ${ revision.revision_text if revision.revision_text else "None" } - - %for x in revision.get_diff(): - ${x|h}
- %endfor - ${revision.get_user} -
- ${revision.revision_date.strftime("%b %d, %Y, %I:%M %p")} - - + %if revision.deleted < 2 or show_delete_revision: + <% loopCount += 1 %> + + + + + + + ${ revision.revision_text if revision.revision_text else "None" } + + %for x in revision.get_diff(): + ${x|h}
+ %endfor + ${revision.get_user()} +
+ ${revision.revision_date.strftime("%b %d, %Y, %I:%M %p")} + + + %endif %endfor %if wiki_prev_page or wiki_next_page: @@ -68,10 +70,15 @@ ${ wiki_article.title } %endif - +%if show_delete_revision: + + + +%endif diff --git a/simplewiki_searchresults.html b/simplewiki_searchresults.html index 13513639c3..88b70c3b7e 100644 --- a/simplewiki_searchresults.html +++ b/simplewiki_searchresults.html @@ -16,7 +16,8 @@ <%block name="wiki_body"> %for article in wiki_search_results: - ${article.get_url()}
+ <% article_deleted = not article.current_revision.deleted == 0 %> + ${article.get_url()} ${'(Deleted)' if article_deleted else ''}
%endfor %if not wiki_search_results: diff --git a/simplewiki_view.html b/simplewiki_view.html index 31511e5d92..d939e3e1d8 100644 --- a/simplewiki_view.html +++ b/simplewiki_view.html @@ -3,7 +3,7 @@ <%inherit file="simplewiki_base.html"/> <%block name="wiki_page_title"> - ${ wiki_article.title } + ${ wiki_article.title } ${'- Deleted Revision!' if wiki_current_revision_deleted else ''} <%block name="wiki_body"> From 92196110ad421625da304e9f32a3b29ec13dc616 Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Tue, 24 Jan 2012 20:56:02 -0500 Subject: [PATCH 2/3] Added UI for locking article. Did more testing/bug fixes on deletion. Seems stable. --HG-- branch : bridgerwiki --- simplewiki_history.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/simplewiki_history.html b/simplewiki_history.html index 860310e5b0..c5c873ed3b 100644 --- a/simplewiki_history.html +++ b/simplewiki_history.html @@ -76,9 +76,10 @@ ${ wiki_article.title } %endif /> %if show_delete_revision: - - - + + + + %endif From 60e9b91049e986330cd00ad47fa81d86dd579ceb Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Wed, 25 Jan 2012 11:40:00 -0500 Subject: [PATCH 3/3] Fixed wording for deleted page error. --HG-- branch : bridgerwiki --- .DS_Store | Bin 6148 -> 6148 bytes simplewiki_error.html | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.DS_Store b/.DS_Store index 9a2711a1c55cc44b790dcec335287d1d68111ad3..5a0cb2b53d4d5186eaa5877d80e607dba3b6c8d0 100644 GIT binary patch delta 160 zcmZoMXfc=|#>B)qu~2NHo}wr-0|Nsi1A_nqLp(zoLncEGLn=e@=8KHW83RF5TtJ~b zphP~hbWVPHaB_Zb0Z<+Uc!3zJy4-vhmz2_yWCn)QHeJ0844ZivSF>(r=iui6+7Gnj VJM(0I5larB^*{ua4iMSG3;;()A)f#M delta 82 zcmZoMXfc=|#>B`mu~2NHo}wrt0|NsP3os;=7Z)VuiXJp(Q!?c=pV?zMr gW_AvK4xo %elif wiki_err_deleted is not UNDEFINED and wiki_err_deleted:

- The article you tried to access has been deleted. You may be able to restore it to an earlier version in history, or create a new version edit. + The article you tried to access has been deleted. You may be able to restore it to an earlier version in its history, or create a new version.

%else: