Permalink
Browse files

Cool flash bro!

  • Loading branch information...
1 parent db7169b commit d0bc17325dfdfa9063608d1101ea5515ff1c6fdd @nakajima committed Jun 20, 2010
@@ -26,11 +26,11 @@ def edit
redirect_to login_bookmarklet_path(params[:id])
end
end
-
+
def login
@bookmarklet = Bookmarklet.find(params[:id])
end
-
+
def authorize
@bookmarklet = Bookmarklet.find_by_id_and_password(params[:id], params[:password])
if @bookmarklet and @bookmarklet.password?
@@ -50,7 +50,7 @@ def create
respond_to do |format|
if @bookmarklet.save
- flash[:notice] = 'Bookmarklet was successfully created.'
+ flash[:notice] = 'Your bookmarklet was successfully created!'
format.html { redirect_to(@bookmarklet) }
format.xml { render :xml => @bookmarklet, :status => :created, :location => @bookmarklet }
else
@@ -64,7 +64,7 @@ def update
if session[:owns].include?(params[:id])
@bookmarklet = Bookmarklet.find(params[:id])
if @bookmarklet.update_attributes(params[:bookmarklet])
- flash[:notice] = 'Success!'
+ flash[:notice] = 'Your bookmark was saved!'
redirect_to @bookmarklet
else
edit_bookmarklet_path(@bookmarklet)
@@ -80,10 +80,10 @@ def update
def destroy
redirect_to Bookmarklet.find(params[:id])
end
-
+
private
-
+
def login_required
-
+
end
end
@@ -35,6 +35,6 @@
</p>
<p class="last">
- <%= f.submit 'Create Bookmarklet' %> or <%= link_to 'Back', @bookmarklet %>
+ <%= f.submit 'Save Bookmarklet', :disable_with => "Saving Bookmarklet..." %> or <%= link_to 'Back', @bookmarklet %>
</p>
<% end %>
@@ -3,8 +3,7 @@
<% form_tag authorize_bookmarklet_path(@bookmarklet), :method => :post do %>
Enter the password for <%= h(@bookmarklet.name) %>:<br>
<%= text_field_tag :password %>
- <%= submit_tag 'Authorize' %>
+ <%= submit_tag 'Authorize', :disable_with => "Authorizing..." %>
<% end %>
<%= link_to 'Back', @bookmarklet %>
-
@@ -35,7 +35,7 @@
</p>
<p class="last">
- <%= f.submit 'Create Bookmarklet' %> or <%= link_to 'Back', bookmarklets_path %>
+ <%= f.submit 'Create Bookmarklet', :disable_with => "Creating Bookmarklet..." %> or <%= link_to 'Back', bookmarklets_path %>
</p>
<p class="required">
@@ -13,7 +13,9 @@
</head>
<body>
-<p style="color: green"><%= flash[:notice] %></p>
+<% if flash.has_key?(:notice) %>
+ <p class="flash"><%= flash[:notice] %></p>
+<% end %>
<%= yield %>
@@ -60,10 +60,10 @@ input[type="checkbox"] {
textarea {
width: 800px;
height: 100px;
- font-family: Courier, monospace;
+ font-family: Bitstream Vera Sans Mono, Courier, monospace;
margin-bottom: 2em;
padding: 10px;
- font-size: 16px;
+ font-size: 14px;
}
#inject-label {
@@ -146,6 +146,17 @@ form p.last {
font-size: 16px;
}
+form p.last a:hover {
+ background: white;
+ color: #0af;
+}
+
+.flash {
+ background: #ffc;
+ margin-bottom: 20px;
+ padding: 10px;
+}
+
blockquote {
margin: 20px 0;
color: #ccc;

0 comments on commit d0bc173

Please sign in to comment.