Changeset 276
- Timestamp:
- 06/08/07 00:00:08 (1 year ago)
- Files:
-
- mrblog/trunk/dist/app/controllers/blog.rb (modified) (1 diff)
- mrblog/trunk/dist/app/helpers/global_helper.rb (modified) (1 diff)
- mrblog/trunk/dist/app/models/user.rb (modified) (1 diff)
- mrblog/trunk/dist/app/views/account/login.herb (modified) (2 diffs)
- mrblog/trunk/dist/app/views/account/signup.herb (modified) (2 diffs)
- mrblog/trunk/dist/app/views/admin/index.herb (modified) (2 diffs)
- mrblog/trunk/dist/app/views/blog/index.herb (modified) (1 diff)
- mrblog/trunk/dist/app/views/layout/admin.herb (modified) (1 diff)
- mrblog/trunk/dist/app/views/layout/application.herb (modified) (1 diff)
- mrblog/trunk/dist/public/images/new.gif (modified) (previous)
- mrblog/trunk/dist/public/stylesheets/merb.css (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
mrblog/trunk/dist/app/controllers/blog.rb
r235 r276 2 2 3 3 def show 4 @post = Post.find params[:id] 5 @comments = @post.comments 6 render 4 @post = Post.find_by_id params[:id] 5 if @post.nil? 6 redirect_back_or_default("/") 7 else 8 @comments = @post.comments 9 render 10 end 7 11 end 8 12 mrblog/trunk/dist/app/helpers/global_helper.rb
r220 r276 23 23 end 24 24 25 def logged_in? 26 @controller.send(:logged_in?) 27 end 28 29 def current_user 30 @controller.send(:current_user) 31 end 32 25 33 end 26 34 end mrblog/trunk/dist/app/models/user.rb
r133 r276 35 35 crypted_password == encrypt(password) 36 36 end 37 38 def admin? 39 true 40 end 37 41 38 42 protected mrblog/trunk/dist/app/views/account/login.herb
r133 r276 1 1 2 <form method="post" action="/account/login" >2 <form method="post" action="/account/login" class="mascot"> 3 3 4 4 <p><label for="login">Login</label> … … 8 8 <input type="password" id="password" name="password"></p> 9 9 10 <p ><input type="submit" value="Log in"></p>10 <p class="buttons"><button class="imaged" type="submit" value="Log in">Log In</button></p> 11 11 12 12 </form> mrblog/trunk/dist/app/views/account/signup.herb
r220 r276 1 1 <%= error_messages_for @user %> 2 2 3 <form method="post" action="/account/signup" >3 <form method="post" action="/account/signup" class="mascot"> 4 4 5 5 <p><label for="user_login">Login</label> … … 12 12 <input type="password" id="user_password" name="user[password]"></p> 13 13 14 <p><label for="user_password_confirmation">Confirm Password</label>14 <p><label for="user_password_confirmation">Confirm</label> 15 15 <input type="password" id="user_password_confirmation" 16 16 name="user[password_confirmation]"></p> 17 17 18 <p ><input type="submit" value="Sign up"></p>18 <p class="buttons"><button type="submit" value="Sign up" class="imaged">Sign Up</button></p> 19 19 20 20 </form> mrblog/trunk/dist/app/views/admin/index.herb
r229 r276 1 <br />2 1 <h3>Articles</h3> 3 2 <hr /> … … 11 10 <span></span> 12 11 <% end %> 12 <%= "<h2>No articles yet</h2>" if @page.items.blank? %> 13 13 </div> 14 14 <br /> 15 15 <p><%= link_to("Prev", "/admin/index?page=#{@page.prev.number}") if @page.prev? %> 16 16 <%= link_to("Next", "/admin/index?page=#{@page.next.number}") if @page.next? %></p> 17 <%= link_to image_tag('new.gif'), "/admin/new" %>17 <%= link_to image_tag('new.gif'), "/admin/new", :class => "button" %> mrblog/trunk/dist/app/views/blog/index.herb
r138 r276 7 7 <span><%= truncate p.body, 300 %></span> 8 8 <% end %> 9 <%= "<h2>No articles yet</h2>" if @page.items.blank? %> 9 10 </div> 10 11 <br /> mrblog/trunk/dist/app/views/layout/admin.herb
r133 r276 1 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>Merb: Mongrel + Erb</title> 5 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> 6 <%= css_include_tag :merb %> 7 <%= js_include_tag :prototype, :effects %> 8 </head> 3 9 4 <head> 5 <title>Merb: Mongrel + Erb</title> 6 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> 7 <%= css_include_tag :merb %> 8 <%= js_include_tag :prototype, :effects %> 9 </head> 10 <body> 10 11 11 <body> 12 <div id="blogtitle"> 13 <div id="small">Welcome to Merbivore | 14 <a href="http://svn.devjavu.com/merb">SVN</a> | 15 <a href="http://svn.devjavu.com/merb/trunk/README">README</a> | 16 <a href="http://merb.devjavu.com/">Trac</a> | 17 <%= link_to "Login", "/account/login" if !logged_in? %> 18 <%= link_to "Logout #{current_user.login}", "/account/login" if logged_in? %> | 19 <%= link_to "Blog", "/" %> 20 </div> 21 </div> 12 22 13 <div id="blogtitle"> 14 <div id="small">Welcome to Merbivore | <a href="http://svn.devjavu.com/merb">SVN</a> | <a href="http://svn.devjavu.com/merb/README">README</a> | <a href="http://merb.devjavu.com/">Trac</a></div> 15 </div> 23 <div id="border"> 24 <div id="container"> 25 <div id="content"> 26 <div id="topmenu"> 27 <ul> 28 <li><a href="/admin"><span>Articles</span></a></li> 29 <li><a href="/admin/files"><span>Manage Files</span></a></li> 30 <li><a href="/admin/settings"><span>Settings</span></a></li> 31 </ul> 32 </div> 16 33 17 <div id="border"> 34 <div id='main'> 35 <%= catch_content :layout %> 36 </div> 37 </div> 38 </div> 18 39 19 <div id="container">40 <div id="footer">Merb: Mongrel + Erb</div> 20 41 21 <div id="content"> 22 23 <div id="topmenu"> 24 <ul> 25 <li><a href="/admin"><span>Articles</span></a></li> 26 <li><a href="/admin/files"><span>Manage Files</span></a></li> 27 <li><a href="/admin/settings"><span>Settings</span></a></li> 28 </ul> 29 </div> 42 </div> 30 43 31 <div id='main'> 32 <%= catch_content :layout %> 33 </div> 34 </div> 35 </div> 36 37 <div id="footer">Merb: Mongrel + Erb</div> 38 39 </div> 40 41 42 43 44 </body> 44 </body> 45 45 </html> mrblog/trunk/dist/app/views/layout/application.herb
r222 r276 13 13 14 14 <div id="blogtitle"> 15 <div id="small">Welcome to Merbivore | <a href="http://svn.devjavu.com/merb">SVN</a> | <a href="http://svn.devjavu.com/merb/README">README</a> | <a href="http://merb.devjavu.com/">Trac</a></div> 15 <div id="small">Welcome to Merbivore | 16 <a href="http://svn.devjavu.com/merb">SVN</a> | 17 <a href="http://svn.devjavu.com/merb/trunk/README">README</a> | 18 <a href="http://merb.devjavu.com/">Trac</a> | 19 <%= link_to "Login", "/account/login" if !logged_in? %> 20 <%= " | #{link_to "Blog", "/"}" if !logged_in? && @controller.class != Blog %> 21 <%= link_to "Logout #{current_user.login}", "/account/login" if logged_in? %> 22 <%= " | #{link_to "Admin", "/admin"}" if current_user && current_user.admin? %> 23 </div> 16 24 </div> 17 25 mrblog/trunk/dist/public/stylesheets/merb.css
r275 r276 33 33 font-weight:bold; 34 34 padding:0 2px; 35 margin: 0;35 margin:10px 0 0 0; 36 36 } 37 37 … … 302 302 } 303 303 304 form.mascot { 305 margin-top: 20px; 306 float: left; 307 } 308 309 form.mascot p input, form.mascot p textarea { 310 width: 385px; 311 } 312 304 313 form p.buttons { 305 314 text-align: right; … … 312 321 cursor: pointer; 313 322 } 323 324 form p button.imaged { 325 background: transparent url(/images/blank_button.gif) no-repeat; 326 width: 67px; 327 height: 23px; 328 line-height: 20px; 329 padding-bottom: 4px; 330 text-align: center; 331 }
