Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* add flash-box.

  • Loading branch information...
commit 86608b98f8c2db2dd1cc42061650a33b8a764e9e 1 parent 4a55357
@kou authored
View
4 app/controllers/sites_controller.rb
@@ -46,7 +46,7 @@ def create
respond_to do |format|
if @site.save
- flash[:notice] = 'Site was successfully created.'
+ flash[:notice] = t('Site was successfully created.')
format.html { redirect_to(@site) }
format.xml { render :xml => @site, :status => :created, :location => @site }
else
@@ -63,7 +63,7 @@ def update
respond_to do |format|
if @site.update_attributes(params[:site])
- flash[:notice] = 'Site was successfully updated.'
+ flash[:notice] = t('Site was successfully updated.')
format.html { redirect_to(@site) }
format.xml { head :ok }
else
View
24 app/views/_share/_flash_box.html.erb
@@ -0,0 +1,24 @@
+<%
+ messages = [flash[:notice], flash[:error], flash[:warning]].compact
+ unless messages.blank?
+%>
+<div id="flash-box" style="display: none;"
+ onclick="new Effect.Fade(this, {duration: 0.1, from: 0.7});">
+ <p><%= messages.flatten.join("<br />") %></p>
+ <%= javascript_tag(visual_effect(:appear, 'flash-box',
+ :duration => 0.5,
+ :to => 0.7,
+ :queue => {
+ :position => :end,
+ :scope => :folder
+ }) +
+ visual_effect(:fade, 'flash-box',
+ :duration => 0.5,
+ :delay => 8,
+ :from => 0.7,
+ :queue => {
+ :position => :end,
+ :scope => :folder
+ })) %>
+</div>
+<% end -%>
View
1  app/views/layouts/application.html.erb
@@ -20,6 +20,7 @@ EOC
<body>
<%= render(:partial => "/_share/header") %>
+<%= render(:partial => "/_share/flash_box") %>
<%= yield %>
View
2  config/locales/ja.yml
@@ -46,6 +46,8 @@ ja:
"(example: ftp.example.com)": "(例: ftp.example.com)"
"(example: /my-site)": "(例: /my-site)"
+ "Site was successfully updated.": "サイトの更新に成功しました。"
+
"Image list": "画像一覧"
"Image file": "画像ファイル"
View
19 public/stylesheets/base.css
@@ -279,6 +279,25 @@ div.image-list ul li p
text-align: center;
}
+div#flash-box
+{
+ position: absolute;
+ top: 40px;
+ left: 0;
+ border: 2px solid #99BBE8;
+ background-color: white;
+ width: 100%;
+ margin: 0px auto;
+ padding: 1em 2em;
+}
+
+div#flash-box p
+{
+ width: 50%;
+ margin: 0px auto;
+ text-align: center;
+}
+
/* TinyMCE */
.defaultSkin span.mce_ruby
{
Please sign in to comment.
Something went wrong with that request. Please try again.