web-app-theme 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/{LICENSE → MIT-LICENSE} +0 -0
- data/README.md +17 -1
- data/Rakefile +21 -23
- data/{stylesheets → app/assets/images/web-app-theme}/themes/activo/images/arrow.png +0 -0
- data/{stylesheets → app/assets/images/web-app-theme}/themes/activo/images/boxbar-background.png +0 -0
- data/{stylesheets → app/assets/images/web-app-theme}/themes/activo/images/button-background-active.png +0 -0
- data/{stylesheets → app/assets/images/web-app-theme}/themes/activo/images/button-background.png +0 -0
- data/{stylesheets → app/assets/images/web-app-theme}/themes/activo/images/menubar-background.png +0 -0
- data/{stylesheets → app/assets/images/web-app-theme}/themes/default/images/arrow.png +0 -0
- data/{stylesheets → app/assets/images/web-app-theme}/themes/default/images/bgd.jpg +0 -0
- data/{stylesheets → app/assets/images/web-app-theme}/themes/default/images/boxbar-background.png +0 -0
- data/{stylesheets → app/assets/images/web-app-theme}/themes/default/images/button-background-active.png +0 -0
- data/{stylesheets → app/assets/images/web-app-theme}/themes/default/images/button-background.png +0 -0
- data/{stylesheets → app/assets/images/web-app-theme}/themes/default/images/messages/error.png +0 -0
- data/{stylesheets → app/assets/images/web-app-theme}/themes/default/images/messages/notice.png +0 -0
- data/{stylesheets → app/assets/images/web-app-theme}/themes/default/images/messages/warning.png +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/base.css +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/activo/style.css +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/amro/style.css +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/bec-green/style.css +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/bec/style.css +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/blue/style.css +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/default/fonts/museo700-regular-webfont.eot +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/default/fonts/museo700-regular-webfont.svg +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/default/fonts/museo700-regular-webfont.ttf +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/default/fonts/museo700-regular-webfont.woff +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/default/fonts/museosans_500-webfont.eot +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/default/fonts/museosans_500-webfont.svg +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/default/fonts/museosans_500-webfont.ttf +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/default/fonts/museosans_500-webfont.woff +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/default/fonts/museosans_500_italic-webfont.eot +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/default/fonts/museosans_500_italic-webfont.svg +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/default/fonts/museosans_500_italic-webfont.ttf +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/default/fonts/museosans_500_italic-webfont.woff +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/default/style.css +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/djime-cerulean/style.css +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/drastic-dark/style.css +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/kathleene/style.css +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/olive/style.css +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/orange/style.css +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/red/style.css +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/reidb-greenish/style.css +0 -0
- data/{stylesheets → app/assets/stylesheets/web-app-theme}/themes/warehouse/style.css +0 -0
- data/features/assets_generator.feature +18 -0
- data/features/step_definitions/assets_step.rb +11 -0
- data/features/step_definitions/common_steps.rb +82 -0
- data/features/step_definitions/theme_steps.rb +35 -0
- data/features/step_definitions/themed_steps.rb +12 -14
- data/features/support/env.rb +7 -80
- data/features/theme_generator.feature +15 -18
- data/features/themed_generator.feature +10 -10
- data/lib/generators/web_app_theme/assets/assets_generator.rb +17 -0
- data/lib/generators/web_app_theme/theme/templates/layout_admin.html.erb +1 -1
- data/lib/generators/web_app_theme/theme/templates/layout_sign.html.erb +1 -1
- data/lib/generators/web_app_theme/theme/templates/web_app_theme.css.erb +9 -0
- data/lib/generators/web_app_theme/theme/theme_generator.rb +3 -19
- data/lib/web-app-theme.rb +5 -0
- data/lib/web-app-theme/version.rb +3 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/javascripts/testing.js +2 -0
- data/spec/dummy/app/assets/stylesheets/web_app_theme.css +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/controllers/testing_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/helpers/testing_helper.rb +2 -0
- data/spec/dummy/app/models/post.rb +2 -0
- data/spec/dummy/app/views/articles/_form.html.erb +8 -0
- data/spec/dummy/app/views/articles/_sidebar.html.erb +13 -0
- data/spec/dummy/app/views/articles/edit.html.erb +19 -0
- data/spec/dummy/app/views/articles/index.html.erb +42 -0
- data/spec/dummy/app/views/articles/new.html.erb +18 -0
- data/spec/dummy/app/views/articles/show.html.erb +19 -0
- data/spec/dummy/app/views/layouts/application.html.erb +46 -0
- data/spec/dummy/app/views/posts/_form.html.erb +8 -0
- data/spec/dummy/app/views/posts/_sidebar.html.erb +13 -0
- data/spec/dummy/app/views/posts/edit.html.erb +19 -0
- data/spec/dummy/app/views/posts/index.html.erb +42 -0
- data/spec/dummy/app/views/posts/new.html.erb +18 -0
- data/spec/dummy/app/views/posts/show.html.erb +19 -0
- data/spec/dummy/app/views/testing/index.html.erb +2 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +42 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +27 -0
- data/spec/dummy/config/environments/production.rb +51 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +58 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20110827160301_create_posts.rb +8 -0
- data/spec/dummy/db/schema.rb +21 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/{images → spec/dummy/public/images}/avatar.png +0 -0
- data/{images → spec/dummy/public/images}/icons/application_edit.png +0 -0
- data/{images → spec/dummy/public/images}/icons/cross.png +0 -0
- data/{images → spec/dummy/public/images}/icons/key.png +0 -0
- data/{images → spec/dummy/public/images}/icons/tick.png +0 -0
- data/{index.html → spec/dummy/public/index.html} +3 -3
- data/{javascripts → spec/dummy/public/javascripts}/jquery-1.3.min.js +0 -0
- data/{javascripts → spec/dummy/public/javascripts}/jquery.localscroll.js +0 -0
- data/{javascripts → spec/dummy/public/javascripts}/jquery.scrollTo.js +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/spec/models/post_spec.rb +5 -0
- data/spec/dummy/test/functional/testing_controller_test.rb +9 -0
- data/spec/dummy/test/unit/helpers/testing_helper_test.rb +4 -0
- data/spec/spec_helper.rb +30 -0
- metadata +226 -71
- data/VERSION +0 -1
- data/features/step_definitions/layout_steps.rb +0 -59
- data/lib/web_app_theme.rb +0 -2
- data/stylesheets/override.css +0 -1
- data/test/spec_helper.rb +0 -5
- data/test/themed_generator_spec.rb +0 -115
- data/web-app-theme.gemspec +0 -117
@@ -5,38 +5,35 @@ Feature: Layout generation
|
|
5
5
|
# script/generate theme
|
6
6
|
Scenario: Generate a layout
|
7
7
|
Given I have a new rails app
|
8
|
-
And
|
9
|
-
And
|
10
|
-
When
|
11
|
-
Then
|
12
|
-
And
|
13
|
-
And
|
14
|
-
And I should have a stylesheet named "themes/default/style.css"
|
15
|
-
And I should have an image named "web-app-theme/cross.png"
|
16
|
-
And I should have an image named "web-app-theme/key.png"
|
17
|
-
And I should have an image named "web-app-theme/tick.png"
|
18
|
-
And I should have an image named "web-app-theme/application_edit.png"
|
8
|
+
And I have no layouts
|
9
|
+
And I have no stylesheets
|
10
|
+
When I generate a theme
|
11
|
+
Then I should have a layout named "application.html.erb"
|
12
|
+
And I should have a stylesheet named "web_app_theme.css"
|
13
|
+
And The stylesheet "web_app_theme.css" should contain "web-app-theme/themes/default/"
|
19
14
|
|
20
15
|
# script/generate theme admin
|
21
16
|
Scenario: Generate a layout with a name
|
22
17
|
Given I have a new rails app
|
23
|
-
And
|
24
|
-
And
|
25
|
-
Then
|
18
|
+
And I have no layouts
|
19
|
+
And I generate a theme with name "admin"
|
20
|
+
Then I should have a layout named "admin.html.erb"
|
21
|
+
And I should have a stylesheet named "web_app_theme.css"
|
22
|
+
And The stylesheet "web_app_theme.css" should contain "web-app-theme/themes/default/"
|
26
23
|
|
27
24
|
# script/generate theme --theme="drastic-dark"
|
28
25
|
Scenario: Generate a layout choosing a theme
|
29
26
|
Given I have a new rails app
|
30
27
|
And I have no stylesheets
|
31
28
|
And I generate a theme choosing the "drastic-dark" theme
|
32
|
-
Then
|
29
|
+
Then The stylesheet "web_app_theme.css" should contain "web-app-theme/themes/drastic-dark/"
|
33
30
|
|
34
31
|
# script/generate theme --theme=bec --no_layout
|
35
32
|
Scenario: Generate only stylesheets without layout
|
36
33
|
Given I have a new rails app
|
37
34
|
And I have no layouts
|
38
35
|
And I generate a theme without layout choosing the "bec" theme
|
39
|
-
Then
|
36
|
+
Then The stylesheet "web_app_theme.css" should contain "web-app-theme/themes/bec/"
|
40
37
|
But I should not have any layouts
|
41
38
|
|
42
39
|
# script/generate theme --app_name="My New Application"
|
@@ -44,7 +41,7 @@ Feature: Layout generation
|
|
44
41
|
Given I have a new rails app
|
45
42
|
And I have no layouts
|
46
43
|
And I generate a theme with application name "My New Application"
|
47
|
-
Then
|
44
|
+
Then The layout "application.html.erb" should contain "My New Application"
|
48
45
|
|
49
46
|
# script/generate theme --type=sign
|
50
47
|
Scenario: Generate layout for signin and signup
|
@@ -52,4 +49,4 @@ Feature: Layout generation
|
|
52
49
|
And I have no layouts
|
53
50
|
And I generate a theme for signin and signup
|
54
51
|
Then I should have a layout named "sign.html.erb"
|
55
|
-
And I should have a layout named "sign.html.erb"
|
52
|
+
And I should have a layout named "sign.html.erb"
|
@@ -5,8 +5,8 @@ Feature: Theme generation
|
|
5
5
|
# script/generate themed posts
|
6
6
|
Scenario: Creating CRUD views with controller path
|
7
7
|
Given I have a new rails app
|
8
|
-
|
9
|
-
|
8
|
+
And I have a model named "post"
|
9
|
+
When I run the themed generator for the "posts" controller
|
10
10
|
Then I should have a view named "posts/index.html.erb"
|
11
11
|
And I should have a view named "posts/new.html.erb"
|
12
12
|
And I should have a view named "posts/show.html.erb"
|
@@ -15,8 +15,8 @@ Feature: Theme generation
|
|
15
15
|
# script/generate themed items Post
|
16
16
|
Scenario: Creating CRUD views with controller path and model name
|
17
17
|
Given I have a new rails app
|
18
|
-
And a model "
|
19
|
-
|
18
|
+
And I have a model named "post"
|
19
|
+
When I run the themed generator for the "items" controller with the model "post"
|
20
20
|
Then I should have a view named "items/index.html.erb"
|
21
21
|
And I should have a view named "items/new.html.erb"
|
22
22
|
And I should have a view named "items/show.html.erb"
|
@@ -25,8 +25,8 @@ Feature: Theme generation
|
|
25
25
|
# script/generate themed admin/items Post
|
26
26
|
Scenario: Creating CRUD views with controller path "admin/items" and model name
|
27
27
|
Given I have a new rails app
|
28
|
-
And a model "
|
29
|
-
|
28
|
+
And I have a model named "post"
|
29
|
+
When I run the themed generator for the "admin/items" controller with the model "post"
|
30
30
|
Then I should have a view named "admin/items/index.html.erb"
|
31
31
|
And I should have a view named "admin/items/new.html.erb"
|
32
32
|
And I should have a view named "admin/items/show.html.erb"
|
@@ -35,8 +35,8 @@ Feature: Theme generation
|
|
35
35
|
# script/generate themed admin/gallery_pictures
|
36
36
|
Scenario: Creating CRUD views with controller path "admin/gallery_pictures"
|
37
37
|
Given I have a new rails app
|
38
|
-
|
39
|
-
|
38
|
+
And I have a model named "GalleryPicture"
|
39
|
+
When I run the themed generator for the "admin/gallery_pictures" controller
|
40
40
|
Then I should have a view named "admin/gallery_pictures/index.html.erb"
|
41
41
|
And I should have a view named "admin/gallery_pictures/new.html.erb"
|
42
42
|
And I should have a view named "admin/gallery_pictures/show.html.erb"
|
@@ -45,8 +45,8 @@ Feature: Theme generation
|
|
45
45
|
# script/generate themed homes --type=text
|
46
46
|
Scenario: Creating text theme
|
47
47
|
Given I have a new rails app
|
48
|
-
|
48
|
+
When I run the themed generator for the "homes" controller with the option --"themed_type"="text"
|
49
49
|
Then I should have a view named "homes/show.html.erb"
|
50
50
|
And I should have a view named "homes/_sidebar.html.erb"
|
51
51
|
|
52
|
-
|
52
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module WebAppTheme
|
2
|
+
class AssetsGenerator < Rails::Generators::Base
|
3
|
+
desc "Copy the --theme stylesheets to your rails application assets path, so you can customize them"
|
4
|
+
source_root File.expand_path('../../../../../app/assets/', __FILE__)
|
5
|
+
class_option :theme, :type => :string, :default => :default, :desc => 'Specify the layout theme to be copied'
|
6
|
+
|
7
|
+
def copy_stylesheets
|
8
|
+
copy_file "stylesheets/web-app-theme/base.css" , "app/assets/stylesheets/web-app-theme/base.css"
|
9
|
+
directory "stylesheets/web-app-theme/themes/#{options.theme}" , "app/assets/stylesheets/web-app-theme/themes/#{options.theme}"
|
10
|
+
end
|
11
|
+
|
12
|
+
def copy_images
|
13
|
+
directory "images/web-app-theme/themes/#{options.theme}" , "app/assets/images/web-app-theme/themes/#{options.theme}"
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title><%= options.app_name %></title>
|
5
|
-
<%%= stylesheet_link_tag
|
5
|
+
<%%= stylesheet_link_tag 'web_app_theme' %>
|
6
6
|
<%%= javascript_include_tag :defaults, :cache => true %>
|
7
7
|
<%%= csrf_meta_tag %>
|
8
8
|
</head>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title><%= options.app_name %></title>
|
5
|
-
<%%= stylesheet_link_tag "
|
5
|
+
<%%= stylesheet_link_tag "web_app_theme" %>
|
6
6
|
<%%= csrf_meta_tag %>
|
7
7
|
</head>
|
8
8
|
<body>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
module WebAppTheme
|
2
2
|
class ThemeGenerator < Rails::Generators::Base
|
3
|
+
desc "Installs the application layout and creates the web_app_theme.css"
|
3
4
|
source_root File.expand_path('../templates', __FILE__)
|
4
5
|
|
5
6
|
argument :layout_name, :type => :string, :default => 'application'
|
@@ -20,30 +21,13 @@ module WebAppTheme
|
|
20
21
|
generate_haml_layout(admin_layout_name)
|
21
22
|
end
|
22
23
|
end
|
23
|
-
|
24
|
-
def copy_base_stylesheets
|
25
|
-
copy_file "#{stylesheets_path}/base.css", "public/stylesheets/web-app-theme/base.css"
|
26
|
-
copy_file "#{stylesheets_path}/override.css", "public/stylesheets/web-app-theme/override.css"
|
27
|
-
end
|
28
|
-
|
29
|
-
def copy_theme_stylesheets
|
30
|
-
directory "#{stylesheets_path}/themes/#{options.theme}", "public/stylesheets/web-app-theme/themes/#{options.theme}"
|
31
|
-
end
|
32
24
|
|
33
|
-
def
|
34
|
-
|
25
|
+
def copy_theme_stylesheet
|
26
|
+
template "web_app_theme.css.erb", "app/assets/stylesheets/web_app_theme.css"
|
35
27
|
end
|
36
28
|
|
37
29
|
protected
|
38
30
|
|
39
|
-
def stylesheets_path
|
40
|
-
"../../../../../stylesheets"
|
41
|
-
end
|
42
|
-
|
43
|
-
def images_path
|
44
|
-
"../../../../../images"
|
45
|
-
end
|
46
|
-
|
47
31
|
def generate_haml_layout(admin_layout_name)
|
48
32
|
require 'haml'
|
49
33
|
Dir.mktmpdir('web-app-theme-haml') do |haml_root|
|
data/spec/dummy/Rakefile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
3
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
4
|
+
|
5
|
+
require File.expand_path('../config/application', __FILE__)
|
6
|
+
|
7
|
+
Dummy::Application.load_tasks
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
+
// the compiled file.
|
6
|
+
//
|
7
|
+
//= require jquery
|
8
|
+
//= require jquery_ujs
|
9
|
+
//= require_tree .
|
@@ -0,0 +1,8 @@
|
|
1
|
+
|
2
|
+
<div class="group navform wat-cf">
|
3
|
+
<button class="button" type="submit">
|
4
|
+
<%= image_tag("web-app-theme/icons/tick.png", :alt => "#{t("web-app-theme.save", :default => "Save")}") %> <%= t("web-app-theme.save", :default => "Save") %>
|
5
|
+
</button>
|
6
|
+
<span class="text_button_padding"><%= t("web-app-theme.or", :default => "or") %></span>
|
7
|
+
<%= link_to t("web-app-theme.cancel", :default => "Cancel"), articles_path, :class => "text_button_padding link_button" %>
|
8
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div class="block notice">
|
2
|
+
<h3>Simple Block</h3>
|
3
|
+
<div class="content">
|
4
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
5
|
+
</div>
|
6
|
+
</div>
|
7
|
+
<div class="block">
|
8
|
+
<h3>Links</h3>
|
9
|
+
<ul class="navigation">
|
10
|
+
<li><a href="#">Link 1</a></li>
|
11
|
+
<li><a href="#">Link 2</a></li>
|
12
|
+
</ul>
|
13
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div class="block">
|
2
|
+
<div class="secondary-navigation">
|
3
|
+
<ul class="wat-cf">
|
4
|
+
<li class="first"><%= link_to "#{t("web-app-theme.list", :default => "List")}", articles_path %></li>
|
5
|
+
<li><%= link_to "#{t("web-app-theme.new", :default => "New")}", new_article_path %></li>
|
6
|
+
<li class="active"><%= link_to "#{t("web-app-theme.edit", :default => "Edit")}", edit_article_path %></li>
|
7
|
+
</ul>
|
8
|
+
</div>
|
9
|
+
<div class="content">
|
10
|
+
<h2 class="title"><%= t("web-app-theme.edit", :default => "Edit") %> Post</h2>
|
11
|
+
<div class="inner">
|
12
|
+
<%= form_for @post, :url => article_path(@post), :html => { :class => :form } do |f| -%>
|
13
|
+
<%= render :partial => "form", :locals => {:f => f} %>
|
14
|
+
<% end -%>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<% content_for :sidebar, render(:partial => 'sidebar') -%>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<div class="block">
|
2
|
+
<div class="secondary-navigation">
|
3
|
+
<ul class="wat-cf">
|
4
|
+
<li class="first active"><%= link_to "#{t("web-app-theme.list", :default => "List")}", articles_path %></li>
|
5
|
+
<li><%= link_to "#{t("web-app-theme.new", :default => "New")}", new_article_path %></li>
|
6
|
+
</ul>
|
7
|
+
</div>
|
8
|
+
<div class="content">
|
9
|
+
<h2 class="title"><%= t("web-app-theme.all", :default => "All") %> Posts</h2>
|
10
|
+
<div class="inner">
|
11
|
+
<table class="table">
|
12
|
+
<tr>
|
13
|
+
<th class="first">ID</th>
|
14
|
+
<th><%= t("web-app-theme.created_at", :default => "Created at") %></th>
|
15
|
+
<th class="last"> </th>
|
16
|
+
</tr>
|
17
|
+
<% @posts.each do |post| -%>
|
18
|
+
<tr class="<%= cycle("odd", "even") %>">
|
19
|
+
<td>
|
20
|
+
<%= post.id %>
|
21
|
+
</td>
|
22
|
+
<td>
|
23
|
+
<%= post.created_at %>
|
24
|
+
</td>
|
25
|
+
<td class="last">
|
26
|
+
<%= link_to "#{t("web-app-theme.show", :default => "Show")}", article_path(post) %> |
|
27
|
+
<%= link_to "#{t("web-app-theme.edit", :default => "Edit")}", edit_article_path(post) %> |
|
28
|
+
<%= link_to "#{t("web-app-theme.delete", :default => "Delete")}", article_path(post), :method => :delete, :confirm => "#{t("web-app-theme.confirm", :default => "Are you sure?")}" %>
|
29
|
+
</td>
|
30
|
+
</tr>
|
31
|
+
<% end -%>
|
32
|
+
</table>
|
33
|
+
<div class="actions-bar wat-cf">
|
34
|
+
<div class="actions">
|
35
|
+
</div>
|
36
|
+
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<% content_for :sidebar, render(:partial => 'sidebar') -%>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<div class="block">
|
2
|
+
<div class="secondary-navigation">
|
3
|
+
<ul class="wat-cf">
|
4
|
+
<li class="first"><%= link_to "#{t("web-app-theme.list", :default => "List")}", articles_path %></li>
|
5
|
+
<li class="active"><%= link_to "#{t("web-app-theme.new", :default => "New")}", new_article_path %></li>
|
6
|
+
</ul>
|
7
|
+
</div>
|
8
|
+
<div class="content">
|
9
|
+
<h2 class="title"><%= t("web-app-theme.new", :default => "New")%> Post</h2>
|
10
|
+
<div class="inner">
|
11
|
+
<%= form_for :post, :url => articles_path, :html => { :class => :form } do |f| -%>
|
12
|
+
<%= render :partial => "form", :locals => {:f => f} %>
|
13
|
+
<% end -%>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<% content_for :sidebar, render(:partial => 'sidebar') -%>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div class="block">
|
2
|
+
<div class="secondary-navigation">
|
3
|
+
<ul class="wat-cf">
|
4
|
+
<li class="first"><%= link_to "#{t("web-app-theme.list", :default => "List")}", articles_path %></li>
|
5
|
+
<li><%= link_to "#{t("web-app-theme.new", :default => "New")}", new_article_path %></li>
|
6
|
+
<li class="active"><%= link_to "#{t("web-app-theme.show", :default => "Show")}", article_path %></li>
|
7
|
+
</ul>
|
8
|
+
</div>
|
9
|
+
<div class="content">
|
10
|
+
<div class="inner">
|
11
|
+
<div class="wat-cf">
|
12
|
+
<%= link_to image_tag("web-app-theme/icons/application_edit.png", :alt => "#{t("web-app-theme.edit", :default=> "Edit")}") + " " + t("web-app-theme.edit", :default=> "Edit"), edit_article_path(@post), :class => "button" %>
|
13
|
+
<%= link_to image_tag("web-app-theme/icons/cross.png", :alt => "#{t("web-app-theme.delete", :default=> "Delete")}") + " " + t("web-app-theme.delete", :default => "Delete"), article_path(@post), :method => "delete", :class => "button", :confirm => "#{t("web-app-theme.confirm", :default => "Are you sure?")}" %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<% content_for :sidebar, render(:partial => 'sidebar') -%>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Web App</title>
|
5
|
+
<%= stylesheet_link_tag 'web_app_theme' %>
|
6
|
+
<%= javascript_include_tag :defaults, :cache => true %>
|
7
|
+
<%= csrf_meta_tag %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<div id="container">
|
11
|
+
<div id="header">
|
12
|
+
<h1><a href="/">Web App</a></h1>
|
13
|
+
<div id="user-navigation">
|
14
|
+
<ul class="wat-cf">
|
15
|
+
<li><a href="#"><%= t("web-app-theme.profile", :default => "Profile") %></a></li>
|
16
|
+
<li><a href="#"><%= t("web-app-theme.settings", :default => "Settings") %></a></li>
|
17
|
+
<li><a href="/logout" class="logout"><%= t("web-app-theme.logout", :default => "Logout") %></a></li>
|
18
|
+
</ul>
|
19
|
+
</div>
|
20
|
+
<div id="main-navigation">
|
21
|
+
<ul class="wat-cf"></ul>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
<div id="wrapper" class="wat-cf">
|
25
|
+
<div class="flash">
|
26
|
+
<% flash.each do |type, message| -%>
|
27
|
+
<div class="message <%= type %>">
|
28
|
+
<p><%= message %></p>
|
29
|
+
</div>
|
30
|
+
<% end -%>
|
31
|
+
</div>
|
32
|
+
<div id="main">
|
33
|
+
<%= yield %>
|
34
|
+
<div id="footer">
|
35
|
+
<div class="block">
|
36
|
+
<p>Copyright © <%= Time.now.year %> Web App.</p>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
<div id="sidebar">
|
41
|
+
<%= yield :sidebar %>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
</div>
|
45
|
+
</body>
|
46
|
+
</html>
|