edanm avatar edanm committed 87217a9

Final touches before posting (back to userpage links, footer, etc)

Comments (0)

Files changed (9)

Add a comment to this file

stack2blog/stack2blogapp/static_media/img/so_user_id.jpg

Added
New image
Add a comment to this file

stack2blog/stack2blogapp/static_media/img/so_user_profile.jpg

Added
New image

stack2blog/stack2blogapp/static_media/style.css

 #header {
-	margin-top:10px;
+	padding-top:10px;
 	margin-bottom:40px;
 }
 
+#header .call_to_act {
+	float: right;
+	color: #FE7A15;
+	font-size:14px;
+
+}
+
+.color_wrap {
+	background:white;
+}
+
+body {
+	background:#BFBFBF;
+}
+
+#footer {
+	padding-top:300px;
+
+}
+
+.footerwrap {
+	border-top:4px solid #000000;
+
+	background:#BFBFBF;
+	height: 200px;
+	padding-top:20px;
+}
+
+#footer {
+	font-size:16px;
+}
+
 /***********************
  General stylings
  ***********************/
+a {
+	color: #0077CC:
+}
+
+a:visited {
+	color: #003255;
+}
+
 .question_link {
 	color:#0077CC;
 	cursor:pointer;
 #postanswer_container .mark_as_posted {
 	margin-top:40px;
 }
+
+
+#how_to_find_id_container img {
+	margin-bottom: 100px;
+
+}

stack2blog/stack2blogapp/templates/home.html

 	<div class="error_messages grid_12">{{error_message}}</div>
 	<div class="clear"></div>
 
-	<div class="clear"></div>
+	{% if request.session.so_userid %}
+		<a class="grid_12 back_to_userpage" href="/userpage/{{request.session.so_userid}}">
+			Back to your user page
+		</a>
+		<div class="clear"></div>
+	{% endif %}
+
 </div>
 
 {% endblock %}

stack2blog/stack2blogapp/templates/how_to_find_id.html

 
 <div id="how_to_find_id_container" class="container_12">
 
-	
+	<h1 class="grid_12"> How to find your StackOverflow user ID </h1>
+	<div class="clear"></div>
+	<div class="grid_4">
+		To find your id, visit StackOverflow and go to your user profile.
+	</div>
+	<div class="clear"></div>
+
+	<div class="grid_12">
+		<img src="{{MEDIA_URL}}stack2blog_media/static_media/img/so_user_profile.jpg" alt="StackOverflow user profile" height="200"/>
+	</div>
+	<div class="clear"></div>
+
+	<div class="grid_4">
+		Your id will appear in your profile's url.
+	</div>
+	<div class="clear"></div>
+
+	<div class="grid_12">
+		<img src="{{MEDIA_URL}}stack2blog_media/static_media/img/so_user_id.jpg" alt="StackOverflow user id" height="200"/>
+	</div>
+	<div class="clear"></div>
+
+
 
 </div>
 

stack2blog/stack2blogapp/templates/post_answer.html

 	<div class="clear"></div>
 
 	<p class="grid_12">
-	To post this answer, simply copy the following code into Wordpress' htlm tab.
+	To post this answer, simply copy the following code into Wordpress' html tab.
 	</p>
 	<div class="clear"></div>
 
 		</div>
 	</div>
 
+	{% if request.session.so_userid %}
+		<a class="grid_12 back_to_userpage" href="/userpage/{{request.session.so_userid}}">
+			Back to your user page
+		</a>
+		<div class="clear"></div>
+		<br/>
+		<br/>
+		<br/>
+		<br/>
+	{% endif %}
+
+
 	<div id="select_all_button" class="grid_12"><button>Select All</button></div>
 	<div class="clear"></div>
 

stack2blog/stack2blogapp/templates/superpage.html

 
 	{% block head %}{% endblock %}
 
+
+	<script type="text/javascript">
+	  var _gaq = _gaq || [];
+	  _gaq.push(['_setAccount', 'UA-16997140-1']);
+	  _gaq.push(['_trackPageview']);
+
+	  (function() {
+	    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+	    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+	    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+	  })();
+
+	</script>
 </head>
 
 <body>
 
-	<div id="header" class="container_12">
-		<div id="logo" class="grid_12">
-			<div class="wrap">
-				<a href="/">
-					<img src="{{MEDIA_URL}}stack2blog_media/static_media/img/stack2blog_logo.png" alt="Stack2Blog logo" height="70"/>
-				</a>
-			</div> <!-- class="wrap" -->
-		</div> <!-- id="logo" -->
+	<div class="color_wrap">
+		<div id="header" class="container_12">
+			<div id="logo" class="grid_4">
+				<div class="wrap">
+					<a href="/">
+						<img src="{{MEDIA_URL}}stack2blog_media/static_media/img/stack2blog_logo.png" alt="Stack2Blog logo" height="85"/>
+					</a>
+				</div> <!-- class="wrap" -->
+			</div> <!-- id="logo" -->
 
-		<div class="clear"></div>
+			<div class="call_to_act">
+				Like Stack2Blog? Support us with feedback and votes on our <a href="http://stackapps.com/questions/611/stack2blog-turning-your-best-answers-into-blogging-material">StackApps</a> page.
+			</div>
 
-	</div> <!-- id="header" -->
+			<div class="clear"></div>
+		</div> <!-- id="header" -->
 
-	<div id="block_content">
-		{% block content %}{% endblock %}
+		<div id="block_content">
+			{% block content %}{% endblock %}
+		</div>
 	</div>
 
-	<div id="footer">
+
+	<div id="footer" class="color_wrap">
+		<div class="footerwrap">
+			<div class="container_12">
+				<p class="grid_8">Stack2Blog is built by <a href="http://www.yenhq.com">YenHQ</a></p>
+				<div class="clear"></div>
+				<p class="grid_8">Stack2Blog is currently in early beta. Please help us out by giving us feedback and votes on our <a href="http://stackapps.com/questions/611/stack2blog-turning-your-best-answers-into-blogging-material">StackApps page.</a></p>
+			</div>
+		</div>
 	</div>
 
 </body>

stack2blog/stack2blogapp/templates/userpage.html

 	<h1 class="grid_12" class="display_name"> Welcome {{so_user_display_name}} </h1>
 	<div class="clear"></div>
 
-	<p class="grid_12 already_published_count">
+	<p class="grid_16 already_published_count">
 		{% if published_answers|length %}
 			You have <a href="#published_answers_table"><strong>published {{published_answers|length}} answer{{published_answers|pluralize}}</strong></a> already (see table below).
 		{%else%}
 	{% endfor %}
 
 	<br/>
-	<br/>
-	<br/>
-	<br/>
-	<br/>
-	<br/>
-	<br/>
-	<br/>
-	<br/>
-	<br/>
-	<br/>
-	<br/>
-	<br/>
-	<br/>
-	<br/>
-	<br/>
-	<br/>
-	<br/>
 
 </div>
 

stack2blog/stack2blogapp/views.py

 	# Post. Make sure all is well.
 	try:
 		if not request.POST.has_key("userid"):
-			raise RuntimeError("POST call doesn't have title variable")
+			raise RuntimeError("POST call doesn't have userid variable")
 
 		try:
 			userid = int(request.POST.get("userid", ""))
 	answer_obj.body_blurb = meth
 	return answer_obj
 
-def backHomeWithError(request, message):
-	request.session["error_message"] = message
-	return HttpResponseRedirect("/")
-
 def userpage(request, userid):
 	try:
 		userid = int(userid)
 	try:
 		answer_id = int(answer_id)
 	except ValueError:
-		raise Http404 # Send back to homepage with an error.
+		request.session["error_message"] = "The answer you're trying to post doesn't exist."
+		return HttpResponseRedirect("/")
 
 	site = stackexchange.Site(stackexchange.StackOverflow, app_key = "SL5xzbpFYUCSae3tqVlL7A")
 	site.be_inclusive()
 	try:
 		answer_id = int(answer_id)
 	except ValueError:
-		raise Http404 # Send back to homepage with an error.
+		request.session["error_message"] = "The answer you're trying to post doesn't exist."
+		return HttpResponseRedirect("/")
+
 
 	post = PublishedPost(postid = answer_id)
 	post.save()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.