Bonus Question Page History – Web Development


Okay. A little bit more. I’m going to add a bonus problem to this final. This is not required but if you do it you’ll be eligible for a higher level of distinction in the class, and again we’ll enumerate all that in the instructor comments. This bonus problem, and you may have seen this link in the demo I gave, is to add a page history to each page. This history link–implement this. When we click this history link, the URL changes to _history and then URL. In this case, we’re going to front page it with a slash and you can see all the previous versions of a page. Remember, in the original demo of the problem, I just had it say, “Welcome to the Final” and then I edited the page to say, “Your task is to build a wiki.” I’m just including the first 100 characters or so of a page. I can click on view of either of these links to view older versions of a page. This is the most recent version. If I want to edit a page, I can still click edit. Notice how the URL changes to _edit. If I add this other statement and I click save, you can see the page is updated. And if I were to click on history, you can see that there’s a new version at the top here. This might be a little tricky. But for those of you who can figure it out, this will be a really good exercise. Let’s go back to that other URL we are looking at before–new page. This was a page we added in the first part of the assignment. If I were to click history on this page, we can see that this also has two versions. The original version I made–Here’s a new page– and then the other version that had some HTML in it. Now you can see here of course in the history page, the HTML is escaped, and when we view the HTML is unescaped causing it to behave exactly like HTML. We are not going to test on that because it’s up to you to decide on your wiki whether or not you want to trust your users not to put a bunch of garbage on your page or not. You know that’s a decision you can make as a website owner, and we won’t grill you on it. But of course in editing, the text area form should escape things properly if they’re in there. so it can be edited properly, and that’s all we’ve got. When you have that working, submit your URL here and good luck.

Leave a Reply

Your email address will not be published. Required fields are marked *