weeler 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/CHANGELOG.md +68 -0
  4. data/README.md +1 -0
  5. data/app/.DS_Store +0 -0
  6. data/app/assets/.DS_Store +0 -0
  7. data/app/assets/javascripts/.DS_Store +0 -0
  8. data/app/assets/javascripts/weeler/.DS_Store +0 -0
  9. data/app/assets/javascripts/weeler/app/index.js +0 -0
  10. data/app/assets/javascripts/weeler/init.js.coffee +8 -0
  11. data/app/assets/javascripts/weeler/vendor/.DS_Store +0 -0
  12. data/app/assets/javascripts/weeler/vendor/bootstrap.file-input.js +122 -0
  13. data/app/assets/javascripts/weeler/{bootstrap.js → vendor/bootstrap.js} +0 -0
  14. data/app/assets/javascripts/weeler/{bootstrap.rowlink.js → vendor/bootstrap.rowlink.js} +0 -0
  15. data/app/assets/javascripts/weeler/{bootstrap.switch.js → vendor/bootstrap.switch.js} +0 -0
  16. data/app/assets/javascripts/weeler/{jquery.pnotify.js → vendor/jquery.pnotify.js} +0 -0
  17. data/app/assets/stylesheets/.DS_Store +0 -0
  18. data/app/assets/stylesheets/weeler/.DS_Store +0 -0
  19. data/app/assets/stylesheets/weeler/app/index.css +0 -0
  20. data/app/assets/stylesheets/weeler/init.css.erb +5 -0
  21. data/app/assets/stylesheets/weeler/{style.css.scss.erb → style.css.scss} +11 -0
  22. data/app/assets/stylesheets/weeler/{bootstrap.css → vendor/bootstrap.css} +0 -0
  23. data/app/assets/stylesheets/weeler/{bootstrap.min.css → vendor/bootstrap.min.css} +0 -0
  24. data/app/assets/stylesheets/weeler/{bootstrap.rowlink.css → vendor/bootstrap.rowlink.css} +0 -0
  25. data/app/assets/stylesheets/weeler/{bootstrap.spinner.css → vendor/bootstrap.spinner.css} +0 -0
  26. data/app/assets/stylesheets/weeler/{bootstrap.switch.css → vendor/bootstrap.switch.css} +0 -0
  27. data/app/assets/stylesheets/weeler/{jquery.pnotify.css → vendor/jquery.pnotify.css} +0 -0
  28. data/app/controllers/weeler/translations_controller.rb +5 -78
  29. data/app/views/layouts/weeler/base.html.erb +27 -73
  30. data/app/views/weeler/shared/_flash.html.erb +17 -0
  31. data/app/views/weeler/shared/_footer.html.erb +3 -0
  32. data/app/views/weeler/shared/_header_navbar.html.erb +18 -0
  33. data/app/views/weeler/shared/_side_navbar.html.erb +14 -0
  34. data/app/views/weeler/translations/index.html.erb +2 -5
  35. data/lib/.DS_Store +0 -0
  36. data/lib/generators/weeler/install_generator.rb +15 -6
  37. data/lib/generators/weeler/templates/controllers/weeler/example_controller.rb.example +7 -0
  38. data/lib/generators/weeler/templates/views/weeler/example/index.html.erb +0 -0
  39. data/lib/i18n/backend/weeler/exporter/active_record.rb +37 -0
  40. data/lib/i18n/backend/weeler/exporter/active_record_relation.rb +38 -0
  41. data/lib/i18n/backend/weeler/exporter.rb +18 -0
  42. data/lib/i18n/backend/weeler/importer.rb +85 -0
  43. data/lib/i18n/backend/weeler.rb +4 -0
  44. data/lib/weeler/.DS_Store +0 -0
  45. data/lib/weeler/route_mapper.rb +1 -1
  46. data/lib/weeler/version.rb +1 -1
  47. data/rspec.html +176 -98
  48. data/spec/.DS_Store +0 -0
  49. data/spec/controllers/translations_controller_spec.rb +8 -3
  50. data/spec/dummy/db/test.sqlite3 +0 -0
  51. data/spec/dummy/log/test.log +49556 -0
  52. data/spec/fixtures/.DS_Store +0 -0
  53. data/spec/fixtures/test.xlsx +0 -0
  54. data/spec/spec_helper.rb +0 -1
  55. data/spec/weeler/.DS_Store +0 -0
  56. data/spec/weeler/i18n/.DS_Store +0 -0
  57. data/spec/weeler/i18n/backend/.DS_Store +0 -0
  58. data/spec/weeler/i18n/backend/weeler/exporter_spec.rb +72 -0
  59. data/spec/weeler/i18n/backend/weeler/importer_spec.rb +47 -0
  60. data/spec/weeler/{i18n_backend_weeler_spec.rb → i18n/backend/weeler_spec.rb} +9 -9
  61. data/spec/weeler/{i18n_humanize_missing_translations_spec.rb → i18n/humanize_missing_translations_spec.rb} +0 -0
  62. metadata +46 -21
  63. data/app/assets/javascripts/weeler/bootstrap-fileupload.js +0 -169
  64. data/app/assets/javascripts/weeler.js.coffee +0 -8
  65. data/app/assets/stylesheets/weeler/bootstrap-fileupload.css +0 -132
  66. data/app/assets/stylesheets/weeler.css +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65141fa7b10f285e8e70ec0488fa845fead1ec10
4
- data.tar.gz: 12c5b73383d1af0ed440a66d0ee17f4250ac11d8
3
+ metadata.gz: f125a52f99e3be0ecbc7bd79dcbcfd1d7a66e0d5
4
+ data.tar.gz: e853a94bc834beb1c75aee9384c04d98e92c4262
5
5
  SHA512:
6
- metadata.gz: ddde632811f7a6886189e7a005e6ce0b5efddc61ea51e58cef810c5f66c8675a8832f69d921951c551f9268b30a7514c6d31f92e28170765533776fc3a8a6346
7
- data.tar.gz: 265f18ff090c4ef3dc6c497f7480aba342c79cbc9967a63e04ceea2d550c5b809e8d43dc046683fa7e3420e945f8c4cc959fea526d345a323e73f97c1e9f2a85
6
+ metadata.gz: 6b50067fa6a4cc485e90284a7ec420650e4fa9352c97dd623693fc95495f43c71afe227a90b3acd4a89ce0de9c8ef968d04fb59a058a1287e8f4881d92a7bd88
7
+ data.tar.gz: 95f657a3eb4d93311230b93da56a51b1fb98380bf36551060e0cc297d7533b67e8811d87ecefb7531403bf4c39db6702a6299a77655431341b67332074f17a2f
data/.DS_Store CHANGED
Binary file
data/CHANGELOG.md ADDED
@@ -0,0 +1,68 @@
1
+ ## 0.0.4
2
+
3
+ ### Features & Enhancements
4
+
5
+ * Refacture translations import and export. Moved logic to lib/i18n/backend/weeler .
6
+ * Append routes and controller example generators.
7
+ * Increase test covorage.
8
+
9
+ ### Bug Fixes
10
+
11
+ * Fixed export multiply export bug.
12
+ * Change file browser button to fix dependency error.
13
+
14
+ ### Contributors
15
+
16
+ * Arturs Braucs
17
+
18
+ ## 0.0.3
19
+
20
+ ### Bug Fixes
21
+
22
+ * Remove routes isolation. That crashed all backend. :(
23
+
24
+ ### Contributors
25
+
26
+ * Arturs Braucs
27
+
28
+ ## 0.0.2
29
+
30
+ ### Features & Enhancements
31
+
32
+ * Implement I18n Active Record backend
33
+ * Add GUI for frontend - bootstrap
34
+ * List, add, edit application I18n translations
35
+ * Import and export translation excel (xlsx) files
36
+ * Implement weeler routes
37
+
38
+ ### Test Suite
39
+
40
+ * I18n backend tests
41
+ * Weeler routes tests
42
+
43
+ Translations not tested yet
44
+
45
+ ### Bug Fixes
46
+
47
+ ### Contributors
48
+
49
+ * Arturs Braucs
50
+
51
+ ## 0.0.1
52
+
53
+ * Initial release
54
+
55
+ ### Features & Enhancements
56
+
57
+ * Gem structure
58
+ * Rails dependencies
59
+
60
+ ### Bug Fixes
61
+
62
+ ### Test Suite
63
+
64
+ * RSpec
65
+
66
+ ### Contributors
67
+
68
+ * Arturs Braucs
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/weeler.png)](http://badge.fury.io/rb/weeler)
4
4
  [![Build Status](https://travis-ci.org/weby-lv/weeler.png?branch=master)](https://travis-ci.org/weby-lv/weeler)
5
5
  [![Coverage Status](https://coveralls.io/repos/weby-lv/weeler/badge.png)](https://coveralls.io/r/weby-lv/weeler)
6
+ [![Code Climate](https://codeclimate.com/github/weby-lv/weeler.png)](https://codeclimate.com/github/weby-lv/weeler)
6
7
 
7
8
  CMS for weby.lv projects.
8
9
 
data/app/.DS_Store CHANGED
Binary file
data/app/assets/.DS_Store CHANGED
Binary file
Binary file
File without changes
@@ -0,0 +1,8 @@
1
+ #= require jquery
2
+ #= require jquery_ujs
3
+ #= require_tree "./vendor"
4
+ #= require weeler/app
5
+ #= require_self
6
+
7
+ $(document).ready () ->
8
+ $('.weeler-file-inputs').bootstrapFileInput()
@@ -0,0 +1,122 @@
1
+ /*
2
+ Bootstrap - File Input
3
+ ======================
4
+
5
+ This is meant to convert all file input tags into a set of elements that displays consistently in all browsers.
6
+
7
+ Converts all
8
+ <input type="file">
9
+ into Bootstrap buttons
10
+ <a class="btn">Browse</a>
11
+
12
+ */
13
+ $(function() {
14
+
15
+ $.fn.bootstrapFileInput = function() {
16
+
17
+ this.each(function(i,elem){
18
+
19
+ var $elem = $(elem);
20
+
21
+ // Maybe some fields don't need to be standardized.
22
+ if (typeof $elem.attr('data-bfi-disabled') != 'undefined') {
23
+ return;
24
+ }
25
+
26
+ // Set the word to be displayed on the button
27
+ var buttonWord = 'Browse';
28
+
29
+ if (typeof $elem.attr('title') != 'undefined') {
30
+ buttonWord = $elem.attr('title');
31
+ }
32
+
33
+ // Start by getting the HTML of the input element.
34
+ // Thanks for the tip http://stackoverflow.com/a/1299069
35
+ var input = $('<div>').append( $elem.eq(0).clone() ).html();
36
+ var className = '';
37
+
38
+ if (!!$elem.attr('class')) {
39
+ className = ' ' + $elem.attr('class');
40
+ }
41
+
42
+ // Now we're going to replace that input field with a Bootstrap button.
43
+ // The input will actually still be there, it will just be float above and transparent (done with the CSS).
44
+ $elem.replaceWith('<a class="file-input-wrapper btn' + className + '">'+buttonWord+input+'</a>');
45
+ })
46
+
47
+ // After we have found all of the file inputs let's apply a listener for tracking the mouse movement.
48
+ // This is important because the in order to give the illusion that this is a button in FF we actually need to move the button from the file input under the cursor. Ugh.
49
+ .promise().done( function(){
50
+
51
+ // As the cursor moves over our new Bootstrap button we need to adjust the position of the invisible file input Browse button to be under the cursor.
52
+ // This gives us the pointer cursor that FF denies us
53
+ $('.file-input-wrapper').mousemove(function(cursor) {
54
+
55
+ var input, wrapper,
56
+ wrapperX, wrapperY,
57
+ inputWidth, inputHeight,
58
+ cursorX, cursorY;
59
+
60
+ // This wrapper element (the button surround this file input)
61
+ wrapper = $(this);
62
+ // The invisible file input element
63
+ input = wrapper.find("input");
64
+ // The left-most position of the wrapper
65
+ wrapperX = wrapper.offset().left;
66
+ // The top-most position of the wrapper
67
+ wrapperY = wrapper.offset().top;
68
+ // The with of the browsers input field
69
+ inputWidth= input.width();
70
+ // The height of the browsers input field
71
+ inputHeight= input.height();
72
+ //The position of the cursor in the wrapper
73
+ cursorX = cursor.pageX;
74
+ cursorY = cursor.pageY;
75
+
76
+ //The positions we are to move the invisible file input
77
+ // The 20 at the end is an arbitrary number of pixels that we can shift the input such that cursor is not pointing at the end of the Browse button but somewhere nearer the middle
78
+ moveInputX = cursorX - wrapperX - inputWidth + 20;
79
+ // Slides the invisible input Browse button to be positioned middle under the cursor
80
+ moveInputY = cursorY- wrapperY - (inputHeight/2);
81
+
82
+ // Apply the positioning styles to actually move the invisible file input
83
+ input.css({
84
+ left:moveInputX,
85
+ top:moveInputY
86
+ });
87
+ });
88
+
89
+ $('.file-input-wrapper input[type=file]').change(function(){
90
+
91
+ var fileName;
92
+ fileName = $(this).val();
93
+
94
+ // Remove any previous file names
95
+ $(this).parent().next('.file-input-name').remove();
96
+ if (!!$(this).prop('files') && $(this).prop('files').length > 1) {
97
+ fileName = $(this)[0].files.length+' files';
98
+ //$(this).parent().after('<span class="file-input-name">'+$(this)[0].files.length+' files</span>');
99
+ }
100
+ else {
101
+ // var fakepath = 'C:\\fakepath\\';
102
+ // fileName = $(this).val().replace('C:\\fakepath\\','');
103
+ fileName = fileName.substring(fileName.lastIndexOf('\\')+1,fileName.length);
104
+ }
105
+
106
+ $(this).parent().after('<span class="file-input-name">'+fileName+'</span>');
107
+ });
108
+
109
+ });
110
+
111
+ };
112
+
113
+ // Add the styles before the first stylesheet
114
+ // This ensures they can be easily overridden with developer styles
115
+ var cssHtml = '<style>'+
116
+ '.file-input-wrapper { overflow: hidden; position: relative; cursor: pointer; z-index: 1; }'+
117
+ '.file-input-wrapper input[type=file], .file-input-wrapper input[type=file]:focus, .file-input-wrapper input[type=file]:hover { position: absolute; top: 0; left: 0; cursor: pointer; opacity: 0; filter: alpha(opacity=0); z-index: 99; outline: 0; }'+
118
+ '.file-input-name { margin-left: 8px; }'+
119
+ '</style>';
120
+ $('link[rel=stylesheet]').eq(0).before(cssHtml);
121
+
122
+ });
Binary file
File without changes
@@ -0,0 +1,5 @@
1
+ /*
2
+ *= require_tree ./vendor
3
+ *= require ./style
4
+ *= require weeler/app
5
+ */
@@ -10,6 +10,17 @@ footer {
10
10
  padding-right: 15px;
11
11
  }
12
12
 
13
+ /*
14
+ * Fix bootrsap top bug
15
+ *
16
+ */
17
+ body.modal-open,
18
+ .modal-open .navbar-fixed-top,
19
+ .modal-open .navbar-fixed-bottom {
20
+ margin-right: 0;
21
+ }
22
+
23
+
13
24
  /*
14
25
  * Off Canvas
15
26
  * --------------------------------------------------
@@ -17,6 +17,9 @@ module Weeler
17
17
 
18
18
  def create
19
19
  @translation = I18n::Backend::Weeler::Translation.new(translation_params)
20
+
21
+
22
+
20
23
  if @translation.save
21
24
  redirect_to edit_weeler_translation_path(@translation), flash: {success: "Translation saved."}
22
25
  else
@@ -42,93 +45,17 @@ module Weeler
42
45
  end
43
46
 
44
47
  def export
45
- require( 'axlsx' )
46
-
47
- # construct xlsx file
48
- p = Axlsx::Package.new
49
- # Numbers requires this
50
- p.use_shared_strings = true
51
-
52
- sheet = p.workbook.add_worksheet(name: "translations")
53
-
54
- # All used locales and translations by params
55
- locales = I18n::Backend::Weeler::Translation.available_locales
56
- locales = locales.select{ |l| l.present? }
57
- @translations = translations_by_params
58
-
59
- # title row
60
- row = [ 'Key' ]
61
- locales.each do |locale|
62
- row.push(locale.capitalize)
63
- end
64
-
65
- sheet.add_row(row)
66
-
67
- @translations.each do |translation|
68
- row = [ translation.key ]
69
- locales.each do |locale|
70
- result = I18n::Backend::Weeler::Translation.locale(locale).lookup(translation.key).load
71
- if result.first.present?
72
- row.push(result.first.value)
73
- else
74
- row.push("")
75
- end
76
- end
77
-
78
- sheet.add_row(row)
79
- end
80
-
81
48
  respond_to do |format|
82
49
  format.xlsx do
83
50
  outstrio = StringIO.new
84
- outstrio.write(p.to_stream.read)
51
+ outstrio.write(translations_by_params.as_xlsx_package.to_stream.read)
85
52
  send_data(outstrio.string, filename: "translations" + '.xlsx')
86
53
  end
87
54
  end
88
-
89
55
  end
90
56
 
91
57
  def import
92
- require "roo"
93
- xls = Roo::Excelx.new(params[:file].tempfile.path, file_warning: :ignore)
94
-
95
- xls.each_with_pagename do |name, sheet|
96
-
97
- # Lookup locales
98
- locales = []
99
- sheet.row(1).each_with_index do |cell, i|
100
- if i > 0
101
- locales.push(cell.downcase)
102
- end
103
- end
104
-
105
- # Lookup values
106
- (2..sheet.last_row).each do |row_no|
107
- locale = nil
108
- key = nil
109
- value = nil
110
- sheet.row(row_no).each_with_index do |cell, i|
111
- if i == 0
112
- key = cell
113
- else
114
- locale = locales[ i - 1 ]
115
- value = cell.nil? ? '' : cell
116
-
117
- p "> Readed: #{locale}.#{key} = #{value} "
118
- if locale.present? && key.present?
119
- translation = I18n::Backend::Weeler::Translation.find_or_initialize_by locale: locale, key: key
120
- if translation.value != value
121
- translation.value = value
122
- translation.save
123
- end
124
- end
125
-
126
- end
127
- end # cells
128
-
129
- end # rows
130
-
131
- end # sheets
58
+ I18n::Backend::Weeler::Translation.import params[:file].tempfile.path
132
59
  redirect_to weeler_translations_path, flash: {success: "Translations succesfully imported."}
133
60
  end
134
61
 
@@ -1,86 +1,40 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
+ <head>
4
+ <title>Weeler</title>
5
+
6
+ <meta charset="utf-8">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
8
+
9
+ <%= stylesheet_link_tag "weeler/init", :media => "all" %>
10
+ <%= javascript_include_tag "weeler/init" %>
11
+
12
+ <%= csrf_meta_tags %>
13
+
14
+ <%= render "weeler/shared/flash" %>
3
15
 
4
- <head>
5
- <title>Weeler</title>
6
-
7
- <meta charset="utf-8">
8
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
9
-
10
- <%= stylesheet_link_tag "weeler", :media => "all" %>
11
- <%= javascript_include_tag "weeler" %>
12
-
13
- <%= csrf_meta_tags %>
14
-
15
- <% flash.each do |name, message| %>
16
- <script type="text/javascript">
17
- $(function(){
18
- $.pnotify({
19
- type: '<%= name %>', // 'notice', 'info', 'success', 'error'
20
- title: '<%= name %>',
21
- text: '<%= message %>',
22
- styling: 'bootstrap',
23
- shadow: false,
24
- animation: 'fade',
25
- closer: true,
26
- history: false,
27
- auto_display: true
28
- });
29
- });
30
- </script>
31
- <% end %>
32
- </head>
16
+ <%= yield :weeler_header %>
17
+ </head>
33
18
 
34
- <body>
35
- <div class="navbar navbar-fixed-top navbar-inverse" role="navigation">
36
- <div class="container">
37
- <div class="navbar-header">
38
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
39
- <span class="icon-bar"></span>
40
- <span class="icon-bar"></span>
41
- <span class="icon-bar"></span>
42
- </button>
43
- <a class="navbar-brand" href="<%= weeler_root_path %>">Weeler</a>
44
- </div>
45
- <div class="collapse navbar-collapse">
46
- <ul class="nav navbar-nav">
47
- <li class="<%= 'active' if @current_menu_item == 'home' %>"><a href="<%= weeler_root_path %>">Home</a></li>
48
- <li class="<%= 'active' if @current_menu_item == 'about' %>"><a href="<%= weeler_about_path %>">About</a></li>
49
- </ul>
50
- </div><!-- /.nav-collapse -->
51
- </div><!-- /.container -->
52
- </div><!-- /.navbar -->
19
+ <body <%= yield :weeler_body_tag %> >
20
+ <%= render "weeler/shared/header_navbar" %>
53
21
 
54
- <div class="container">
22
+ <div class="container">
23
+ <div class="row row-offcanvas row-offcanvas-right">
55
24
 
56
- <div class="row row-offcanvas row-offcanvas-right">
57
- <div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar" role="navigation">
58
- <div class="well sidebar-nav">
59
- <ul class="nav">
60
- <li>Configuration</li>
61
- <li class="<%= "active" %> "><a href="<%= weeler_translations_path %>">Translations</a></li>
62
- <li>Content</li>
63
-
64
- <% Weeler.menu_items.each do |item| %>
65
- <li><%= link_to item.to_s.capitalize, eval("weeler_#{item.to_s}_path") %></li>
66
- <% end %>
25
+ <%= render "weeler/shared/side_navbar" %>
67
26
 
68
- </ul>
69
- </div><!--/.well -->
70
- </div><!--/span-->
71
- <div class="col-xs-12 col-sm-9">
72
- <%= yield %>
73
- </div><!--/span-->
74
- </div><!--/row-->
27
+ <div class="col-xs-12 col-sm-9">
28
+ <%= yield %>
29
+ </div><!--/span-->
30
+ </div><!--/row-->
75
31
 
76
- <hr>
32
+ <hr>
77
33
 
78
- <footer>
79
- <p>&copy; Weby 2013</p>
80
- </footer>
34
+ <%= render "weeler/shared/footer" %>
81
35
 
82
- </div><!--/.container-->
36
+ </div><!--/.container-->
83
37
 
84
- </body>
38
+ </body>
85
39
 
86
40
  </html>
@@ -0,0 +1,17 @@
1
+ <% flash.each do |name, message| %>
2
+ <script type="text/javascript">
3
+ $(function(){
4
+ $.pnotify({
5
+ type: '<%= name %>', // 'notice', 'info', 'success', 'error'
6
+ title: '<%= name %>',
7
+ text: '<%= message %>',
8
+ styling: 'bootstrap',
9
+ shadow: false,
10
+ animation: 'fade',
11
+ closer: true,
12
+ history: false,
13
+ auto_display: true
14
+ });
15
+ });
16
+ </script>
17
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <footer>
2
+ <p>&copy; Weby 2013</p>
3
+ </footer>
@@ -0,0 +1,18 @@
1
+ <div class="navbar navbar-fixed-top navbar-inverse" role="navigation">
2
+ <div class="container">
3
+ <div class="navbar-header">
4
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
5
+ <span class="icon-bar"></span>
6
+ <span class="icon-bar"></span>
7
+ <span class="icon-bar"></span>
8
+ </button>
9
+ <a class="navbar-brand" href="<%= weeler_root_path %>">Weeler</a>
10
+ </div>
11
+ <div class="collapse navbar-collapse">
12
+ <ul class="nav navbar-nav">
13
+ <li class="<%= 'active' if @current_menu_item == 'home' %>"><a href="<%= weeler_root_path %>">Home</a></li>
14
+ <li class="<%= 'active' if @current_menu_item == 'about' %>"><a href="<%= weeler_home_about_path %>">About</a></li>
15
+ </ul>
16
+ </div><!-- /.nav-collapse -->
17
+ </div><!-- /.container -->
18
+ </div><!-- /.navbar -->
@@ -0,0 +1,14 @@
1
+ <div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar" role="navigation">
2
+ <div class="well sidebar-nav">
3
+ <ul class="nav">
4
+ <li>Configuration</li>
5
+ <li class="<%= "active" %> "><a href="<%= weeler_translations_path %>">Translations</a></li>
6
+ <li>Content</li>
7
+
8
+ <% Weeler.menu_items.each do |item| %>
9
+ <li><%= link_to item.to_s.capitalize, "#{weeler_root_url}/#{item}" %></li>
10
+ <% end %>
11
+
12
+ </ul>
13
+ </div><!--/.well -->
14
+ </div><!--/span-->
@@ -47,12 +47,9 @@
47
47
  </ul>
48
48
 
49
49
  <!-- Import and export data -->
50
- <form class="navbar-form navbar-left" role="import" method="post" action="<%= import_weeler_translations_path %>" enctype="multipart/form-data">
51
50
  <%= form_tag import_weeler_translations_path, {:multipart => true, class: "navbar-form navbar-left"} do %>
52
- <div class="form-group fileupload fileupload-new" data-provides="fileupload">
53
- <span class="btn btn-file"><span class="fileupload-new">Select file</span><span class="fileupload-exists">Change</span><input type="file" name="file" /></span>
54
- <span class="fileupload-preview"></span>
55
- <a href="#" class="close fileupload-exists" data-dismiss="fileupload" style="float: none">×</a>
51
+ <div class="form-group">
52
+ <input type="file" name="file" class="weeler-file-inputs" /></span>
56
53
  </div>
57
54
  <div class="btn-group">
58
55
  <button type="submit" class="btn btn-default">Import</button>
data/lib/.DS_Store CHANGED
Binary file
@@ -33,13 +33,22 @@ module Weeler
33
33
  # copy_files 'models', 'app/models'
34
34
  #end
35
35
 
36
- #def install_views
37
- # copy_files 'views', 'app/views'
38
- #end
36
+ def install_views
37
+ copy_files 'views', 'app/views'
38
+ end
39
+
40
+ def install_controllers
41
+ copy_files 'controllers', 'app/controllers'
42
+ end
43
+
44
+ class_option :routes, :desc => "Generate routes", :type => :boolean, :default => true
45
+ def add_weeler_routes
46
+ weeler_routes = "mount_weeler_at \"weeler\" do \n"
47
+ weeler_routes << " # weeler_resources :example, include_in_weeler_menu: true \n"
48
+ weeler_routes << " end"
49
+ route weeler_routes
50
+ end
39
51
 
40
- #def install_controllers
41
- # copy_files 'controllers', 'app/controllers'
42
- #end
43
52
 
44
53
  private
45
54
 
@@ -0,0 +1,7 @@
1
+ # class Weeler::ExampleController < Weeler::BaseController
2
+
3
+ # def index
4
+ # # index action is required for menu items
5
+ # end
6
+
7
+ # end