diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 9340d1b..17ae87d 100755 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -90,23 +90,6 @@ table a { font-weight:bold; } margin: 0 auto; } -.demo_notice { - display:block; - clear:both; - padding:10px 10px 10px 36px; - -webkit-border-radius:3px; - -moz-border-radius:3px; - border-radius:3px; - border:1px solid; - color:#646464; - background-position:10px 12px; - background-repeat:no-repeat; - margin:10px 0; - background-color: #cee6f2; - border: solid 1px #058dc7; - background-image:url('/assets/icon_notification_information.png'); -} - #flash_notice, #flash_error, #flash_alert { display:block; clear:both; diff --git a/app/assets/stylesheets/forum-monster.css.scss b/app/assets/stylesheets/forum-monster.css.scss index b2bb939..305ef8d 100755 --- a/app/assets/stylesheets/forum-monster.css.scss +++ b/app/assets/stylesheets/forum-monster.css.scss @@ -1,6 +1,6 @@ /* Modules --------------------------------------------------------------------------------------------------*/ -.module { border:1px solid #e2e2e2; margin:.8em 0; background-color:#fff; overflow:auto; } +.module { border:1px solid #e2e2e2; margin:.8em 0; background-color:#fff; } .module_controls { padding:.8em; } .module_header { color:#fff; padding:.7em .7em .7em 1.4em; background-color:#000; } .module_header a { color:#fff; } diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 68d810a..2c0744d 100755 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -1,7 +1,9 @@ class PostsController < ApplicationController load_and_authorize_resource :topic load_and_authorize_resource :post, :through => :topic, :shallow => true - + + before_filter :check_for_cancel#, :only[:create, :update] + def new if params[:quote] quote_post = Post.find(params[:quote]) @@ -12,6 +14,7 @@ class PostsController < ApplicationController end def create + check_for_cancel @post.user ||= current_user if @post.save flash[:notice] = "Post was successfully created." @@ -42,4 +45,10 @@ class PostsController < ApplicationController end end + def check_for_cancel + if params[:commit] == 'cancel' + redirect_to topic_path(@post.topic) + end + end + end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a2f4870..ef1c9d2 100755 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,3 +1,8 @@ module ApplicationHelper + def cancel_link + return link_to 'Cancel', request.env["HTTP_REFERER"], + :confirm => 'Are you sure? Any changes will be lost.' + end + end diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 387fdb4..0c1c1b5 100755 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -8,19 +8,19 @@ <%= form_for("user", :as => resource_name, :url => registration_path("user")) do |f| %>

Username:
- <%= f.text_field :username, :style => "font-size:2.2em", :autocomplete => "off" %>
+ <%= f.text_field :username, :autocomplete => "off" %>

Email Address:
- <%= f.text_field :email, :style => "font-size:2.2em", :autocomplete => "off" %>
+ <%= f.text_field :email, :autocomplete => "off" %>

Password:
- <%= f.password_field :password, :style => "font-size:2.2em", :autocomplete => "off" %>
+ <%= f.password_field :password, :autocomplete => "off" %>

Confirm Password:
- <%= f.password_field :password_confirmation, :style => "font-size:2.2em", :autocomplete => "off" %>
+ <%= f.password_field :password_confirmation, :autocomplete => "off" %>

<%= f.submit "Sign up" %>

<% end %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index f3bd48b..d627f77 100755 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -24,8 +24,8 @@
<%= form_for("user", :url => user_session_path) do |f| %> -

<%= f.text_field :username , :value => "username", :style => "font-size:2.2em;" %>

-

<%= f.password_field :password, :value => "password", :style => "font-size:2.2em" %>

+

<%= f.text_field :username , :value => "username" %>

+

<%= f.password_field :password, :value => "password" %>

<%= f.submit 'Sign in' %> <% end %>
diff --git a/app/views/posts/_form.html.erb b/app/views/posts/_form.html.erb index 7a7a774..379f7b4 100755 --- a/app/views/posts/_form.html.erb +++ b/app/views/posts/_form.html.erb @@ -1,26 +1,23 @@
-
<%= action_name.humanize %> Post
+
+ Re: <%= @post.topic.title %> +
<%= form_for [@topic, @post] do |f| %> <% if @post.errors.any? %> <% flash.now[:error] = @post.errors.full_messages.join(', and ') %> <% end %> -
- - <%= f.label :body %>
- (Required) -
- <%= f.text_area :body, :cols => 60, :rows => 15 %> -
-
+ <%= f.label :body %> + <%= f.text_area :body, :width => "80%", :rows => 15 %>
<% end %>
- \ No newline at end of file +