Skip to content

Commit 03530d6

Browse files
author
Michael Wood
committed
View templates for the consumer app
1 parent 2afccbd commit 03530d6

File tree

6 files changed

+96
-0
lines changed

6 files changed

+96
-0
lines changed

views_client/consumerkey.erb

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<h2>Add your Consumer Key and Secret</h2>
2+
3+
<form action="/addconsumerkey" method="POST">
4+
<div class="key">
5+
Consumer Key:
6+
<br/>
7+
<input type="text" name="consumer_key" id="consumer_key" rows="20" />
8+
</div>
9+
<div class="secret">
10+
Consumer Secret:
11+
<br/>
12+
<input type="text" name="consumer_secret" id="consumer_secret" rows="20" />
13+
</div>
14+
15+
<input type="submit" value="Save Consumer Key and Secret"/>
16+
</form>

views_client/error.erb

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<h2>Oops! There was an error.</h2>
2+
3+
<p><%= @error %><p>

views_client/index.erb

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Welcome to my Sinatra OAuth Test API App!

views_client/layout.erb

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<title>Sinatra OAuth API Test!</title>
5+
<style>
6+
html {
7+
background-color: #eee;
8+
font-family: Arial, sans-serif;
9+
}
10+
11+
#content {
12+
width: 550px;
13+
margin: 100px auto;
14+
background-color: #fff;
15+
border: 1px solid #ccc;
16+
padding: 20px;
17+
}
18+
#navigation {
19+
background-color: #eee;
20+
padding: 20px;
21+
margin-bottom: 20px;
22+
23+
}
24+
</style>
25+
</head>
26+
<body>
27+
<div id="content">
28+
<h1>Sinatra OAuth API Test</h1>
29+
30+
<div id="navigation">
31+
<a href="/">Home</a> | <a href="/messages">Messages</a>
32+
</div>
33+
34+
<%= yield %>
35+
</div>
36+
</body>
37+
</html>

views_client/list.erb

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<h2>My Messages</h2>
2+
3+
<% if @messages.empty? %>
4+
You don't have any messages.
5+
<% else %>
6+
<ul>
7+
<% @messages.each do |message| %>
8+
<li><a href="/messages/<%= message.message_id %>"><%= message.name %></a></li>
9+
<% end %>
10+
</ul>
11+
<% end %>
12+
13+
<h3>Create New Message</h3>
14+
15+
<div class="message">
16+
<form action="/messages" method="POST">
17+
<div class="name">
18+
Message Name:
19+
<br/>
20+
<input type="text" name="message_name" id="message_name" rows="20" /></div>
21+
<div class="details">
22+
Details:
23+
<br/>
24+
<textarea name="message_details" id="message_details" cols="50" rows="10"></textarea>
25+
</div>
26+
27+
28+
<input type="submit" value="Save Message"/>
29+
</form>
30+
</div>

views_client/show.erb

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<h2><%= @message.name %></h2>
2+
3+
<div class="message">
4+
<div class="details"><%= @message.details %></div>
5+
6+
<div class="date" style="margin-top:20px;font-size:11px;color:#666;">
7+
Created on <%= @message.created_at %>
8+
</div>
9+
</div>

0 commit comments

Comments
 (0)