manifest-rails 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,9 +4,26 @@
4
4
  //= require_tree .
5
5
 
6
6
  $(function() {
7
+ $.fn.touchBind = function(fn) {
8
+ $(this).live('click', function() {
9
+ return fn.call(this);
10
+ })
11
+
12
+ $(this).live('touchmove', function() {
13
+ $(this).addClass('dragged');
14
+ });
15
+
16
+ $(this).live('touchend', function() {
17
+ if (!$(this).hasClass('dragged')) fn.call(this);
18
+ $(this).removeClass('dragged');
19
+ });
20
+
21
+ return this;
22
+ }
23
+
7
24
  $('.tinymce').tinymce({});
8
25
 
9
- $('#content_block_allow_html').change(function() {
26
+ $('#content_block_allow_html').live('change', function() {
10
27
  if ($(this).is(':checked')) {
11
28
  $('#content_block_content').tinymce({});
12
29
  } else {
@@ -17,12 +34,15 @@ $(function() {
17
34
  })
18
35
 
19
36
  $(".nav-select").change(function() {
20
- window.location = $(this).find("option:selected").val();
37
+ $.pjax({
38
+ url: $(this).find('option:selected').val(),
39
+ container: '.app-content'
40
+ })
21
41
  });
22
42
 
23
43
  $('a:not([data-remote]):not([data-behavior]):not([data-skip-pjax])').pjax('.app-content', { timeout: 10000 });
24
44
 
25
- $('tbody tr').live('click', function() {
45
+ $('tbody tr').touchBind(function() {
26
46
  controller = $(this).parent().parent().attr('id').split(':').pop();
27
47
  id = $(this).attr('id').split('_').pop();
28
48
 
@@ -18,6 +18,13 @@ textarea {
18
18
  height: $base;
19
19
  padding: $base / 4;
20
20
  @include box-shadow(0 1px 1px rgba(0,0,0,0.1) inset, 0 1px 0 white);
21
+
22
+ @media screen and (max-width: 480px) {
23
+ width: 100%;
24
+ height: $base + $base / 2;
25
+ display: block;
26
+ @include box-sizing(border-box);
27
+ }
21
28
  }
22
29
 
23
30
  textarea {
@@ -58,4 +65,9 @@ textarea {
58
65
  position: absolute;
59
66
  left: -24px;
60
67
  }
68
+
69
+ @media screen and (max-width: 480px) {
70
+ width: 100%;
71
+ @include box-sizing(border-box);
72
+ }
61
73
  }
@@ -1,39 +1,52 @@
1
- table { margin-bottom: $base; }
2
-
3
- thead {
4
- border: 1px solid darken(#36c, 13.5);
5
- border-bottom: none;
6
- }
7
-
8
- th, td {
9
- padding: $base / 4 $base / 2;
1
+ table.resource_table {
2
+ margin-bottom: $base;
3
+
4
+ @media screen and (max-width: 480px) {
5
+ width: 100%;
6
+ }
7
+
8
+ thead {
9
+ border: 1px solid darken(#36c, 13.5);
10
+ border-bottom: none;
11
+ }
12
+
13
+ th, td {
14
+ padding: $base / 4 $base / 2;
15
+
16
+ &.minor {
17
+ @media screen and (max-width: 480px) {
18
+ display: none;
19
+ }
20
+ }
21
+ }
22
+
23
+ th {
24
+ background: #36c;
25
+ @include background(linear-gradient(#36c, darken(#36c, 6.75)));
26
+ @include box-shadow(0 -1px 0 darken(#36c, 27) inset);
27
+ color: #fff;
28
+ }
29
+
30
+ tr:first-child td { @include box-shadow(0 1px 0 #f8f8f8 inset); }
31
+
32
+ tr:nth-child(odd) {
33
+ background: #e8e8e8;
34
+ }
35
+
36
+ tr:nth-child(even) {
37
+ background: #fff;
38
+ }
39
+
40
+ tbody tr:hover {
41
+ background: lighten($accent, 10);
42
+ background: $accent;
43
+ cursor: pointer;
44
+ color: white;
45
+ }
46
+
47
+ tbody {
48
+ border: 1px solid #ccc;
49
+ border-top: none;
50
+ }
10
51
  }
11
52
 
12
- th {
13
- background: #36c;
14
- @include background(linear-gradient(#36c, darken(#36c, 6.75)));
15
- @include box-shadow(0 -1px 0 darken(#36c, 27) inset);
16
- color: #fff;
17
- }
18
-
19
- tr:first-child td { @include box-shadow(0 1px 0 #f8f8f8 inset); }
20
-
21
- tr:nth-child(odd) {
22
- background: #e8e8e8;
23
- }
24
-
25
- tr:nth-child(even) {
26
- background: #fff;
27
- }
28
-
29
- tbody tr:hover {
30
- background: lighten($accent, 10);
31
- background: $accent;
32
- cursor: pointer;
33
- color: white;
34
- }
35
-
36
- tbody {
37
- border: 1px solid #ccc;
38
- border-top: none;
39
- }
@@ -1,16 +1,4 @@
1
- <% if @content_block.errors.any? %>
2
- <div class='form-errors'>
3
- <h3>Whoops!</h3>
4
-
5
- <p>Please correct the following errors:</p>
6
-
7
- <ul>
8
- <% @content_block.errors.full_messages.each do |msg| %>
9
- <li><%= msg %></li>
10
- <% end %>
11
- </ul>
12
- </div><!-- form-errors -->
13
- <% end %>
1
+ <%= render 'manifest/shared/form_error_list', object: @content_block %>
14
2
 
15
3
  <%= form_for [:manifest, @content_block], builder: Manifest::LabelledFormBuilder do |f| %>
16
4
  <% if current_editor.admin? %>
@@ -1,12 +1,12 @@
1
1
  <h2>Content Blocks</h2>
2
2
 
3
3
  <% if @content_blocks.count > 0 %>
4
- <table id='table:<%= controller_name %>'>
4
+ <table id='table:<%= controller_name %>' class='resource_table'>
5
5
  <thead>
6
6
  <th>Title</th>
7
7
  <th>Page</th>
8
- <th>Created</th>
9
- <th>Updated</th>
8
+ <th class='minor'>Created</th>
9
+ <th class='minor'>Updated</th>
10
10
  </thead>
11
11
 
12
12
  <tbody>
@@ -14,8 +14,8 @@
14
14
  <%= content_tag_for(:tr, c) do %>
15
15
  <td><%= c.title %></td>
16
16
  <td><%= c.page.title %></td>
17
- <td><%= c.created_at.to_s(:short) %></td>
18
- <td><%= c.updated_at.to_s(:short) %></td>
17
+ <td class='minor'><%= c.created_at.to_s(:short) %></td>
18
+ <td class='minor'><%= c.updated_at.to_s(:short) %></td>
19
19
  <% end %>
20
20
  <% end %>
21
21
  </tbody>
@@ -1,16 +1,4 @@
1
- <% if @page.errors.any? %>
2
- <div class='form-errors'>
3
- <h3>Whoops!</h3>
4
-
5
- <p>Please correct the following errors:</p>
6
-
7
- <ul>
8
- <% @page.errors.full_messages.each do |msg| %>
9
- <li><%= msg %></li>
10
- <% end %>
11
- </ul>
12
- </div><!-- form-errors -->
13
- <% end %>
1
+ <%= render 'manifest/shared/form_error_list', object: @page %>
14
2
 
15
3
  <%= form_for [:manifest, @page], builder: Manifest::LabelledFormBuilder do |f| %>
16
4
  <%= f.text_field :title %>
@@ -3,19 +3,19 @@
3
3
  <h3>Content Blocks</h3>
4
4
 
5
5
  <% if @page.content_blocks.count > 0 %>
6
- <table id='table:content_blocks'>
6
+ <table id='table:content_blocks' class='resource_table'>
7
7
  <thead>
8
8
  <th>Title</th>
9
- <th>Created</th>
10
- <th>Updated</th>
9
+ <th class='minor'>Created</th>
10
+ <th class='minor'>Updated</th>
11
11
  </thead>
12
12
 
13
13
  <tbody>
14
14
  <% @page.content_blocks.each do |c| %>
15
15
  <%= content_tag_for(:tr, c) do %>
16
16
  <td><%= c.title %></td>
17
- <td><%= c.created_at.to_s(:short) %></td>
18
- <td><%= c.updated_at.to_s(:short) %></td>
17
+ <td class='minor'><%= c.created_at.to_s(:short) %></td>
18
+ <td class='minor'><%= c.updated_at.to_s(:short) %></td>
19
19
  <% end %>
20
20
  <% end %>
21
21
  </tbody>
@@ -0,0 +1,13 @@
1
+ <% if object.errors.any? %>
2
+ <div class='form-errors'>
3
+ <h3>Whoops!</h3>
4
+
5
+ <p>Please correct the following errors:</p>
6
+
7
+ <ul>
8
+ <% object.errors.full_messages.each do |msg| %>
9
+ <li><%= msg %></li>
10
+ <% end %>
11
+ </ul>
12
+ </div>
13
+ <% end %>
@@ -1,3 +1,5 @@
1
+ <%%= render 'manifest/shared/form_error_list', object: @<%= name.underscore %> %>
2
+
1
3
  <%%= form_for [:manifest, @<%= name.underscore %>], builder: Manifest::LabelledFormBuilder do |f| %>
2
4
  <% attributes.each do |attribute| %>
3
5
  <% if [:integer, :decimal, :float, :string].include?(attribute.type) %>
@@ -1,7 +1,7 @@
1
1
  <h2><%= table_name %></h2>
2
2
 
3
3
  <%% if @<%= table_name %>.count > 0 %>
4
- <table id='table:<%%= controller_name %>'>
4
+ <table id='table:<%%= controller_name %>' class='resource_table'>
5
5
  <thead>
6
6
  <% attributes.each do |attribute| -%>
7
7
  <th><%= attribute.name.humanize %></th>
@@ -1,3 +1,3 @@
1
1
  module Manifest
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manifest-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-08 00:00:00.000000000 Z
12
+ date: 2012-03-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70348846821520 !ruby/object:Gem::Requirement
16
+ requirement: &70327481984300 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.2.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70348846821520
24
+ version_requirements: *70327481984300
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: friendly_id
27
- requirement: &70348846818440 !ruby/object:Gem::Requirement
27
+ requirement: &70327481983820 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70348846818440
35
+ version_requirements: *70327481983820
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sass-rails
38
- requirement: &70348846812800 !ruby/object:Gem::Requirement
38
+ requirement: &70327481983120 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 3.2.3
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70348846812800
46
+ version_requirements: *70327481983120
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: compass-rails
49
- requirement: &70348846805960 !ruby/object:Gem::Requirement
49
+ requirement: &70327481982640 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70348846805960
57
+ version_requirements: *70327481982640
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: bcrypt-ruby
60
- requirement: &70348846803880 !ruby/object:Gem::Requirement
60
+ requirement: &70327481982040 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 3.0.0
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70348846803880
68
+ version_requirements: *70327481982040
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: tinymce-rails
71
- requirement: &70348846801280 !ruby/object:Gem::Requirement
71
+ requirement: &70327481981580 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70348846801280
79
+ version_requirements: *70327481981580
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: sqlite3
82
- requirement: &70348846795340 !ruby/object:Gem::Requirement
82
+ requirement: &70327481981100 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70348846795340
90
+ version_requirements: *70327481981100
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rspec-rails
93
- requirement: &70348846793900 !ruby/object:Gem::Requirement
93
+ requirement: &70327481980640 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70348846793900
101
+ version_requirements: *70327481980640
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: factory_girl_rails
104
- requirement: &70348846792860 !ruby/object:Gem::Requirement
104
+ requirement: &70327481980140 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70348846792860
112
+ version_requirements: *70327481980140
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: yard
115
- requirement: &70348846791800 !ruby/object:Gem::Requirement
115
+ requirement: &70327481979660 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *70348846791800
123
+ version_requirements: *70327481979660
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: rake
126
- requirement: &70348846789840 !ruby/object:Gem::Requirement
126
+ requirement: &70327481979120 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,7 +131,7 @@ dependencies:
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *70348846789840
134
+ version_requirements: *70327481979120
135
135
  description: Manifest allows for the creation of simple content management with support
136
136
  for easy custom data types. It attempts to preserve the Rails way of working where
137
137
  possible.
@@ -169,6 +169,7 @@ files:
169
169
  - app/views/manifest/pages/new.html.erb
170
170
  - app/views/manifest/pages/show.html.erb
171
171
  - app/views/manifest/sessions/new.html.erb
172
+ - app/views/manifest/shared/_form_error_list.html.erb
172
173
  - config/initializers/manifest.rb
173
174
  - config/routes.rb
174
175
  - db/migrate/20120303200114_create_pages.rb
@@ -214,7 +215,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
214
215
  version: '0'
215
216
  segments:
216
217
  - 0
217
- hash: 3388462568342458365
218
+ hash: 3770417001256903588
218
219
  required_rubygems_version: !ruby/object:Gem::Requirement
219
220
  none: false
220
221
  requirements:
@@ -223,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
224
  version: '0'
224
225
  segments:
225
226
  - 0
226
- hash: 3388462568342458365
227
+ hash: 3770417001256903588
227
228
  requirements: []
228
229
  rubyforge_project:
229
230
  rubygems_version: 1.8.17