tida_template 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/generators/tida_template/install_generator.rb +19 -19
- data/lib/generators/tida_template/templates/app/inputs/date_picker_input.rb +9 -0
- data/lib/generators/tida_template/templates/app/inputs/date_time_picker_input.rb +9 -0
- data/lib/generators/tida_template/templates/renderers/component_renderer.rb +49 -0
- data/lib/tida_template/version.rb +1 -1
- data/vendor/assets/stylesheets/_buttons.scss +4 -3
- data/vendor/assets/stylesheets/_modals.scss +9 -4
- metadata +7 -4
@@ -22,6 +22,14 @@ module TidaTemplate #:nodoc:
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
+
def run_other_generators
|
26
|
+
generate 'devise:install'
|
27
|
+
generate 'devise user'
|
28
|
+
generate 'simple_form:install --bootstrap'
|
29
|
+
generate 'wice_grid:install'
|
30
|
+
generate 'navigation_config'
|
31
|
+
end
|
32
|
+
|
25
33
|
def copy_stuff #:nodoc:
|
26
34
|
# copy layouts
|
27
35
|
copy_file 'app/views/layouts/single.html.erb', 'app/views/layouts/single.html.erb'
|
@@ -36,20 +44,10 @@ module TidaTemplate #:nodoc:
|
|
36
44
|
copy_file 'app/views/shared/components/_page_title.html.erb', 'app/views/shared/components/_page_title.html.erb'
|
37
45
|
copy_file 'app/views/shared/components/_toolbar.html.erb', 'app/views/shared/components/_toolbar.html.erb'
|
38
46
|
|
39
|
-
# copy devise view
|
40
|
-
copy_file 'app/views/devise/sessions/new.html.erb', 'app/views/devise/sessions/new.html.erb'
|
41
|
-
|
42
|
-
# copy rails template files
|
43
|
-
copy_file 'rails_templates/erb/scaffold/_form.html.erb', 'lib/templates/erb/scaffold/_form.html.erb'
|
44
|
-
copy_file 'rails_templates/erb/scaffold/index.html.erb', 'lib/templates/erb/scaffold/index.html.erb'
|
45
|
-
copy_file 'rails_templates/erb/scaffold/new.html.erb', 'lib/templates/erb/scaffold/new.html.erb'
|
46
|
-
copy_file 'rails_templates/erb/scaffold/edit.html.erb', 'lib/templates/erb/scaffold/edit.html.erb'
|
47
|
-
copy_file 'rails_templates/erb/scaffold/show.html.erb', 'lib/templates/erb/scaffold/show.html.erb'
|
48
|
-
copy_file 'rails_templates/rails/scaffold_controller/controller.rb', 'lib/templates/rails/scaffold_controller/controller.rb'
|
49
|
-
|
50
47
|
# copy renders
|
51
48
|
copy_file 'renderers/sub_navigation_bar_renderer.rb', 'lib/tida/renderers/sub_navigation_bar_renderer.rb'
|
52
49
|
copy_file 'renderers/top_navigation_bar_renderer.rb', 'lib/tida/renderers/top_navigation_bar_renderer.rb'
|
50
|
+
copy_file 'renderers/component_renderer.rb', 'lib/tida/renderers/component_renderer.rb'
|
53
51
|
|
54
52
|
# copy paperclip attachment access token
|
55
53
|
copy_file 'paperclip/attachment_access_token.rb', 'lib/tida/paperclip/attachment_access_token.rb'
|
@@ -66,16 +64,18 @@ module TidaTemplate #:nodoc:
|
|
66
64
|
#copy other configurations
|
67
65
|
copy_file 'config/application.yml', 'config/application.yml'
|
68
66
|
copy_file 'settingslogic/settings.rb', 'lib/settings.rb'
|
69
|
-
end
|
70
67
|
|
71
|
-
|
72
|
-
|
73
|
-
generate 'devise user'
|
74
|
-
generate 'simple_form:install --bootstrap'
|
75
|
-
generate 'wice_grid:install'
|
76
|
-
generate 'navigation_config'
|
77
|
-
end
|
68
|
+
# copy devise view
|
69
|
+
copy_file 'app/views/devise/sessions/new.html.erb', 'app/views/devise/sessions/new.html.erb'
|
78
70
|
|
71
|
+
# copy rails template files
|
72
|
+
copy_file 'rails_templates/erb/scaffold/_form.html.erb', 'lib/templates/erb/scaffold/_form.html.erb'
|
73
|
+
copy_file 'rails_templates/erb/scaffold/index.html.erb', 'lib/templates/erb/scaffold/index.html.erb'
|
74
|
+
copy_file 'rails_templates/erb/scaffold/new.html.erb', 'lib/templates/erb/scaffold/new.html.erb'
|
75
|
+
copy_file 'rails_templates/erb/scaffold/edit.html.erb', 'lib/templates/erb/scaffold/edit.html.erb'
|
76
|
+
copy_file 'rails_templates/erb/scaffold/show.html.erb', 'lib/templates/erb/scaffold/show.html.erb'
|
77
|
+
copy_file 'rails_templates/rails/scaffold_controller/controller.rb', 'lib/templates/rails/scaffold_controller/controller.rb'
|
78
|
+
end
|
79
79
|
end
|
80
80
|
end
|
81
81
|
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class DatePickerInput < SimpleForm::Inputs::Base
|
2
|
+
def input
|
3
|
+
content = []
|
4
|
+
content << @builder.text_field(attribute_name, input_html_options)
|
5
|
+
icon_content = template.content_tag(:i, nil, 'data-time-icon' => 'icon-time', 'data-date-icon' => 'icon-calendar')
|
6
|
+
content << template.content_tag(:span, icon_content.html_safe, :class => 'add-on')
|
7
|
+
template.content_tag(:div, content.join.html_safe, :class => 'date datepicker input-append date-picker')
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class DateTimePickerInput < SimpleForm::Inputs::Base
|
2
|
+
def input
|
3
|
+
content = []
|
4
|
+
content << @builder.text_field(attribute_name, input_html_options)
|
5
|
+
icon_content = template.content_tag(:i, nil, 'data-time-icon' => 'icon-time', 'data-date-icon' => 'icon-calendar')
|
6
|
+
content << template.content_tag(:span, icon_content.html_safe, :class => 'add-on')
|
7
|
+
template.content_tag(:div, content.join.html_safe, :class => 'date datetimepicker input-append date-time-picker')
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module Tida
|
2
|
+
module Renderers
|
3
|
+
module ComponentRenderer
|
4
|
+
def render_component(options = {})
|
5
|
+
render partial: options[:partial], object: options
|
6
|
+
end
|
7
|
+
|
8
|
+
def render_page_title(title)
|
9
|
+
toolbar = []
|
10
|
+
if block_given?
|
11
|
+
yield toolbar
|
12
|
+
end
|
13
|
+
data = {title: title.html_safe, toolbar: toolbar, partial: 'shared/components/page_title'}
|
14
|
+
render_component data
|
15
|
+
end
|
16
|
+
|
17
|
+
def render_article_title(title, class_name = nil)
|
18
|
+
toolbar = []
|
19
|
+
if block_given?
|
20
|
+
yield toolbar
|
21
|
+
end
|
22
|
+
data = {title: title.html_safe, class: class_name, toolbar: toolbar, partial: 'shared/components/article_title'}
|
23
|
+
render_component data
|
24
|
+
end
|
25
|
+
|
26
|
+
def render_modal_window(name, title, inner_partial)
|
27
|
+
data = {name: name, title: title, inner_partial: inner_partial, partial: 'shared/components/modal'}
|
28
|
+
render_component data
|
29
|
+
end
|
30
|
+
|
31
|
+
def render_icon_and_text_content(icon_name, text)
|
32
|
+
content = []
|
33
|
+
content << content_tag(:i, nil, class: icon_name)
|
34
|
+
content << content_tag(:span, text)
|
35
|
+
content.join(" ").html_safe
|
36
|
+
end
|
37
|
+
|
38
|
+
def render_icon_content(icon_name)
|
39
|
+
content_tag(:i, nil, class: icon_name)
|
40
|
+
end
|
41
|
+
|
42
|
+
def render_progress_bar(label)
|
43
|
+
label_content = content_tag :span, label
|
44
|
+
bar_content = content_tag :div, label_content, class: 'bar', style: 'width: 100%;'
|
45
|
+
content_tag :div, bar_content, class: 'progress progress-striped active'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -7,8 +7,8 @@
|
|
7
7
|
text-shadow: none;
|
8
8
|
background: $btnBackground;
|
9
9
|
@include box-shadow(none);
|
10
|
-
border:
|
11
|
-
border-bottom:
|
10
|
+
border: 1px solid darken($btnBackground, 5%);
|
11
|
+
border-bottom: 4px solid darken($btnBackground, 10%);
|
12
12
|
outline: none !important;
|
13
13
|
|
14
14
|
&.disabled,
|
@@ -37,7 +37,8 @@
|
|
37
37
|
@include box-shadow(none);
|
38
38
|
background: $backgroundColor;
|
39
39
|
color: $foreColor;
|
40
|
-
border
|
40
|
+
border: 1px solid darken($backgroundColor, 5%);
|
41
|
+
border-bottom: 3px solid darken($backgroundColor, 10%);
|
41
42
|
&:hover, &:active {
|
42
43
|
background: darken($backgroundColor, 10%);
|
43
44
|
}
|
@@ -7,11 +7,16 @@ $modalHeaderFontColor: $pageTitleFontColor;
|
|
7
7
|
.modal-header {
|
8
8
|
border: none;
|
9
9
|
color: $modalHeaderFontColor;
|
10
|
-
padding:
|
11
|
-
border-top: 5px solid #ccc;
|
10
|
+
padding: $bigPadding;
|
12
11
|
h4 {
|
13
|
-
font-weight: normal;
|
14
|
-
|
12
|
+
font-weight: normal !important;
|
13
|
+
font-size: 24px;
|
14
|
+
}
|
15
|
+
background: $borderColor;
|
16
|
+
.close {
|
17
|
+
position: absolute;
|
18
|
+
right: 10px;
|
19
|
+
top: 5px;
|
15
20
|
}
|
16
21
|
}
|
17
22
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tida_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -275,6 +275,8 @@ extensions: []
|
|
275
275
|
extra_rdoc_files: []
|
276
276
|
files:
|
277
277
|
- lib/generators/tida_template/install_generator.rb
|
278
|
+
- lib/generators/tida_template/templates/app/inputs/date_picker_input.rb
|
279
|
+
- lib/generators/tida_template/templates/app/inputs/date_time_picker_input.rb
|
278
280
|
- lib/generators/tida_template/templates/app/views/devise/sessions/new.html.erb
|
279
281
|
- lib/generators/tida_template/templates/app/views/layouts/application.html.erb
|
280
282
|
- lib/generators/tida_template/templates/app/views/layouts/single.html.erb
|
@@ -298,6 +300,7 @@ files:
|
|
298
300
|
- lib/generators/tida_template/templates/rails_templates/erb/scaffold/new.html.erb
|
299
301
|
- lib/generators/tida_template/templates/rails_templates/erb/scaffold/show.html.erb
|
300
302
|
- lib/generators/tida_template/templates/rails_templates/rails/scaffold_controller/controller.rb
|
303
|
+
- lib/generators/tida_template/templates/renderers/component_renderer.rb
|
301
304
|
- lib/generators/tida_template/templates/renderers/sub_navigation_bar_renderer.rb
|
302
305
|
- lib/generators/tida_template/templates/renderers/top_navigation_bar_renderer.rb
|
303
306
|
- lib/generators/tida_template/templates/settingslogic/settings.rb
|
@@ -376,7 +379,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
376
379
|
version: '0'
|
377
380
|
segments:
|
378
381
|
- 0
|
379
|
-
hash:
|
382
|
+
hash: 390698480970998465
|
380
383
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
381
384
|
none: false
|
382
385
|
requirements:
|
@@ -385,7 +388,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
385
388
|
version: '0'
|
386
389
|
segments:
|
387
390
|
- 0
|
388
|
-
hash:
|
391
|
+
hash: 390698480970998465
|
389
392
|
requirements: []
|
390
393
|
rubyforge_project:
|
391
394
|
rubygems_version: 1.8.25
|