public this repo is viewable by everyone
Description: open-source e-commerce built on merb
Clone URL: git://github.com/myabc/merb_mart.git
Click here to lend your support to: merb_mart and make a donation at www.pledgie.com !
Update of controllers and views

* Removing unused controllers and views.
* Renaming view files to .haml, to allow
  for using Haml instead of ERB.
* Added Haml as a dependency.
* Set Store#index as default app page.
myabc (author)
4 days ago
commit  e5e879ebc205d7f055885f29c9526e94d3e45606
tree    63af1419959d154e00cda55355ec427d28088a2b
parent  82d5d35a57e3408aa5ae1857e93355bca7b9648a
...
1
2
3
4
5
6
7
8
9
...
 
 
 
 
 
 
 
 
 
0
@@ -1,9 +0,0 @@
0
-module Admin
0
-class ContentNodes < Application
0
-
0
- def index
0
- render
0
- end
0
-
0
-end
0
-end # Admin
...
1
2
3
4
5
6
7
8
9
10
11
...
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,11 +0,0 @@
0
-module Admin
0
-class Questions < Application
0
-
0
- def index
0
- @questions = Question.all
0
-
0
- display @questions
0
- end
0
-
0
-end
0
-end # Admin
...
1
2
3
4
5
6
7
8
9
...
 
 
 
 
 
 
 
 
 
0
@@ -1,9 +0,0 @@
0
-module Admin
0
-class Sections < Application
0
-
0
- def index
0
- render
0
- end
0
-
0
-end
0
-end # Admin
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,72 +0,0 @@
0
-class ContentNodes < Application
0
- #provides :html, :xml
0
-
0
- def show
0
- @content_node = ContentNode[params[:id]]
0
- end
0
-
0
- # Shows an entire page of content by name
0
- def show_by_name
0
- #@content_node = ContentNode.with_slug(id)
0
- @content_node = ContentNode.first(:name => params[:name])
0
- raise NotFound unless @content_node
0
-
0
- # Set a title
0
- if @content_node.title.blank? then
0
- @title = @content_node.name.capitalize
0
- else
0
- @title = @content_node.title
0
- end
0
-
0
- # Render special template for blog posts
0
- #if @content_node.type == Blog then
0
- # render(:template => 'content_nodes/blog_post')
0
- #else # Render basic template for regular pages
0
- # render(:layout => 'main')
0
- #end
0
-
0
- display @content_node
0
- end
0
-
0
- # Shows a snippet of content
0
- def show_snippet
0
- @content_node = Snippet.first(:name => params[:name])
0
- display @content_node
0
- end
0
-
0
- # Shows all blog content nodes.
0
- def index
0
- @title = "Blog"
0
- @content_nodes = Blog.all
0
-
0
- #@content_nodes = Blog.paginate(
0
- # :conditions => 'display_on <= CURRENT_DATE',
0
- # :page => params[:page],
0
- # :per_page => 5,
0
- # :order => 'display_on DESC, created_on DESC'
0
- #)
0
-
0
- display @content_nodes
0
- end
0
-
0
- def list_by_section
0
- # Find section, if no section 404...
0
- #@section = Section.find_by_name(params[:section_name])
0
- @section = Section.first(:name => params[:section_name])
0
- raise NotFound unless @section
0
-
0
- @title = "Blog entries for #{@section.name}"
0
-
0
- display @section
0
- end
0
-
0
- # List blog entries by section
0
-
0
- private
0
- # Sets the sections instance variable
0
- #
0
- def set_sections
0
- @sections = Section.find_ordered_parents
0
- end
0
-
0
-end
...
1
2
 
 
 
3
4
5
...
1
2
3
4
5
6
7
8
0
@@ -1,4 +1,7 @@
0
 class Store < Application
0
   
0
+ def index
0
+ render
0
+ end
0
   
0
 end
0
\ No newline at end of file
...
1
2
3
4
5
6
7
8
...
 
 
 
 
 
 
 
0
0
@@ -1,7 +0,0 @@
0
-module Merb
0
-module Admin
0
-module ContentNodesHelper
0
-
0
-end
0
-end # Admin
0
-end
0
\ No newline at end of file
...
1
2
3
4
5
6
7
8
...
 
 
 
 
 
 
 
0
0
@@ -1,7 +0,0 @@
0
-module Merb
0
-module Admin
0
-module PreferencesHelper
0
-
0
-end
0
-end # Admin
0
-end
0
\ No newline at end of file
...
1
2
3
4
5
6
7
8
...
 
 
 
 
 
 
 
0
0
@@ -1,7 +0,0 @@
0
-module Merb
0
-module Admin
0
-module QuestionsHelper
0
-
0
-end
0
-end # Admin
0
-end
0
\ No newline at end of file
...
1
2
3
4
5
6
...
 
 
 
 
 
0
0
@@ -1,5 +0,0 @@
0
-module Merb
0
- module ContentNodesHelper
0
-
0
- end
0
-end
0
\ No newline at end of file
...
1
2
3
4
5
6
...
 
 
 
 
 
0
0
@@ -1,5 +0,0 @@
0
-module Merb
0
- module QuestionsHelper
0
-
0
- end
0
-end
0
\ No newline at end of file
...
1
2
...
 
0
0
@@ -1 +0,0 @@
0
-<%= catch_content :layout %>
0
\ No newline at end of file
...
 
0
...
1
2
0
@@ -0,0 +1 @@
0
+<%= catch_content :layout %>
0
\ No newline at end of file
...
1
2
...
 
0
0
@@ -1 +0,0 @@
0
-You're in index of the Customers
0
\ No newline at end of file
...
 
0
...
1
2
0
@@ -0,0 +1 @@
0
+You're in index of the Customers
0
\ No newline at end of file
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
@@ -1,33 +0,0 @@
0
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
0
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
0
- <head>
0
- <title><%= @title unless @title.nil? %></title>
0
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
0
- <link rel="stylesheet" href="/stylesheets/master.css" type="text/css" media="screen" charset="utf-8">
0
-
0
- <!-- TODO: add CSS -->
0
- <!-- TODO: add JS -->
0
-
0
- </head>
0
- <body>
0
- <div id="container">
0
- <div id="header">
0
-
0
-
0
-
0
-
0
- </div>
0
-
0
- <div id="content">
0
- <%= catch_content :for_layout %>
0
- </div>
0
-
0
- <div id="footer">
0
- <ul class="navigation">
0
-
0
- </ul>
0
- </div>
0
-
0
- </div>
0
- </body>
0
-</html>
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
0
@@ -0,0 +1,33 @@
0
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
0
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
0
+ <head>
0
+ <title><%= @title unless @title.nil? %></title>
0
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
0
+ <link rel="stylesheet" href="/stylesheets/master.css" type="text/css" media="screen" charset="utf-8">
0
+
0
+ <!-- TODO: add CSS -->
0
+ <!-- TODO: add JS -->
0
+
0
+ </head>
0
+ <body>
0
+ <div id="container">
0
+ <div id="header">
0
+
0
+
0
+
0
+
0
+ </div>
0
+
0
+ <div id="content">
0
+ <%= catch_content :for_layout %>
0
+ </div>
0
+
0
+ <div id="footer">
0
+ <ul class="navigation">
0
+
0
+ </ul>
0
+ </div>
0
+
0
+ </div>
0
+ </body>
0
+</html>
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
0
@@ -1,44 +0,0 @@
0
-<div id="container">
0
- <div id="header-container">
0
-
0
- <h2>merb_mart</h2>
0
- <hr />
0
-
0
- <ul>
0
-
0
- </ul>
0
-
0
- </div>
0
-
0
- <div id="left-container">
0
- <h3></h3>
0
-
0
- <h4></h4>
0
-
0
- <ul>
0
-
0
- </ul>
0
-
0
-
0
-
0
- </div>
0
-
0
- <div id="main-container">
0
-
0
-
0
- </div>
0
-
0
- <div id="footer-container">
0
- <hr />
0
- <div class="left">
0
- <ul>
0
- <li>Home</li>
0
- <li>About this Website</li>
0
- <li>Links</li>
0
- </ul>
0
-
0
- </div>
0
- <div class="right">&copy; 2008 STORE_NAME</div>
0
- <p>&nbsp;</p>
0
- </div>
0
-</div>
0
\ No newline at end of file
...
1
2
...
 
0
0
@@ -1 +0,0 @@
0
-You're in index of the Questions
0
\ No newline at end of file
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
0
@@ -1,14 +0,0 @@
0
-<% form_tag :action => url(:login) do -%>
0
-<p><label for="login">Login</label><br/>
0
-<%= text_field :name => "login" %></p>
0
-
0
-<p><label for="password">Password</label><br/>
0
-<%= password_field :name => "password" %></p>
0
-
0
-<!-- Uncomment this if you want this functionality
0
-<p><label for="remember_me">Remember me:</label>
0
-<%= checkbox_field :name => 'remember_me' %></p>
0
--->
0
-
0
-<p><%= submit_button 'Log in' %></p>
0
-<% end -%>
0
\ No newline at end of file
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
@@ -0,0 +1,14 @@
0
+<% form_tag :action => url(:login) do -%>
0
+<p><label for="login">Login</label><br/>
0
+<%= text_field :name => "login" %></p>
0
+
0
+<p><label for="password">Password</label><br/>
0
+<%= password_field :name => "password" %></p>
0
+
0
+<!-- Uncomment this if you want this functionality
0
+<p><label for="remember_me">Remember me:</label>
0
+<%= checkbox_field :name => 'remember_me' %></p>
0
+-->
0
+
0
+<p><%= submit_button 'Log in' %></p>
0
+<% end -%>
0
\ No newline at end of file
...
 
...
1
0
@@ -0,0 +1 @@
0
+This is the front-page of the store.
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
0
@@ -1,18 +0,0 @@
0
-<%= error_messages_for @user %>
0
-<% form_for @user, :action => url(:users) do %>
0
- <p>
0
- <%= text_control :login, :label => "Login" %>
0
- </p>
0
- <p>
0
- <%= text_control :email, :label => "Email" %>
0
- </p>
0
- <p>
0
- <%= password_control :password, :label => "Password" %>
0
- </p>
0
- <p>
0
- <%= password_control :password_confirmation, :label => "Password Confirmation" %>
0
- </p>
0
- <p>
0
- <%= submit_button "Sign up" %>
0
- </p>
0
-<% end %>
0
\ No newline at end of file
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
0
@@ -0,0 +1,18 @@
0
+<%= error_messages_for @user %>
0
+<% form_for @user, :action => url(:users) do %>
0
+ <p>
0
+ <%= text_control :login, :label => "Login" %>
0
+ </p>
0
+ <p>
0
+ <%= text_control :email, :label => "Email" %>
0
+ </p>
0
+ <p>
0
+ <%= password_control :password, :label => "Password" %>
0
+ </p>
0
+ <p>
0
+ <%= password_control :password_confirmation, :label => "Password Confirmation" %>
0
+ </p>
0
+ <p>
0
+ <%= submit_button "Sign up" %>
0
+ </p>
0
+<% end %>
0
\ No newline at end of file
...
33
34
35
36
 
37
 
38
39
 
40
41
42
...
33
34
35
 
36
37
38
39
 
40
41
42
43
0
@@ -33,10 +33,11 @@ Gem.path.unshift(Merb.root / "gems")
0
 # ==== Dependencies
0
 
0
 dependency "merb-assets"
0
-dependency "merb-mailer"
0
+dependency "merb-haml"
0
 dependency "merb_helpers"
0
+dependency "merb-mailer"
0
 #dependency "merb_paginate"
0
-dependency "ezcrypto"
0
+require "ezcrypto"
0
 
0
 #MerbPaginate.activate! :finder => :datamapper # require the custom finder for datamapper
0
 #MerbPaginate.activate! :view_helpers # require the will_paginate view helper
...
21
22
23
24
25
26
 
27
28
29
...
21
22
23
 
 
 
24
25
26
27
0
@@ -21,9 +21,7 @@ Merb::Router.prepare do |r|
0
   r.match("/logout").to(:controller => "Sessions", :action => "destroy").name(:logout)
0
   r.match("/users/activate/:activation_code").to(:controller => "Users", :action => "activate").name(:user_activation)
0
   
0
-
0
- #r.match('/').to(:controller => 'ContentNodes', :action =>'show_by_name', :name => 'home')
0
- #r.match('').to(:controller => 'ContentNodes', :action => 'show_by_name', :name => 'home')
0
+ r.match('/').to(:controller => 'Store', :action => 'index')
0
 
0
   # Default administration mapping
0
   #map.connect 'admin',

Comments

    No one has commented yet.