weeler 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/README.md +4 -0
- data/app/.DS_Store +0 -0
- data/app/assets/.DS_Store +0 -0
- data/app/assets/javascripts/.DS_Store +0 -0
- data/app/assets/javascripts/weeler.js.coffee +8 -0
- data/app/assets/javascripts/weeler/.DS_Store +0 -0
- data/app/assets/javascripts/weeler/bootstrap-fileupload.js +169 -0
- data/app/assets/javascripts/weeler/bootstrap.js +1992 -0
- data/app/assets/javascripts/weeler/bootstrap.rowlink.js +71 -0
- data/app/assets/javascripts/weeler/bootstrap.switch.js +382 -0
- data/app/assets/javascripts/weeler/jquery.pnotify.js +912 -0
- data/app/assets/stylesheets/.DS_Store +0 -0
- data/app/assets/stylesheets/weeler.css +9 -0
- data/app/assets/stylesheets/weeler/.DS_Store +0 -0
- data/app/assets/stylesheets/weeler/bootstrap-fileupload.css +132 -0
- data/app/assets/stylesheets/weeler/bootstrap.css +6086 -0
- data/app/assets/stylesheets/weeler/bootstrap.min.css +9 -0
- data/app/assets/stylesheets/weeler/bootstrap.rowlink.css +50 -0
- data/app/assets/stylesheets/weeler/bootstrap.spinner.css +43 -0
- data/app/assets/stylesheets/weeler/bootstrap.switch.css +408 -0
- data/app/assets/stylesheets/weeler/jquery.pnotify.css +84 -0
- data/app/assets/stylesheets/weeler/style.css.scss.erb +48 -0
- data/app/controllers/weeler/base_controller.rb +16 -0
- data/app/controllers/weeler/home_controller.rb +8 -0
- data/app/controllers/weeler/translations_controller.rb +151 -0
- data/app/views/kaminari/_first_page.html.erb +13 -0
- data/app/views/kaminari/_gap.html.erb +8 -0
- data/app/views/kaminari/_last_page.html.erb +13 -0
- data/app/views/kaminari/_next_page.html.erb +14 -0
- data/app/views/kaminari/_page.html.erb +12 -0
- data/app/views/kaminari/_paginator.html.erb +23 -0
- data/app/views/kaminari/_prev_page.html.erb +13 -0
- data/app/views/layouts/weeler/base.html.erb +86 -0
- data/app/views/weeler/home/about.html.erb +16 -0
- data/app/views/weeler/home/index.html.erb +4 -0
- data/app/views/weeler/translations/_form.html.erb +43 -0
- data/app/views/weeler/translations/_translation.html.erb +11 -0
- data/app/views/weeler/translations/edit.html.erb +19 -0
- data/app/views/weeler/translations/index.html.erb +106 -0
- data/app/views/weeler/translations/new.html.erb +19 -0
- data/config/initializers/weeler_mime_types.rb +1 -0
- data/lib/.DS_Store +0 -0
- data/lib/generators/weeler/.DS_Store +0 -0
- data/lib/generators/weeler/install_generator.rb +73 -0
- data/lib/generators/weeler/templates/initializers/weeler.rb +7 -0
- data/lib/generators/weeler/templates/migrations/create_weeler_translations.rb +16 -0
- data/lib/i18n/.DS_Store +0 -0
- data/lib/i18n/backend/.DS_Store +0 -0
- data/lib/i18n/backend/weeler.rb +76 -0
- data/lib/i18n/backend/weeler/store_procs.rb +39 -0
- data/lib/i18n/backend/weeler/translation.rb +118 -0
- data/lib/i18n/humanize_missing_translations.rb +11 -0
- data/lib/i18n/weeler.rb +6 -0
- data/lib/weeler.rb +25 -1
- data/lib/weeler/.DS_Store +0 -0
- data/lib/weeler/engine.rb +11 -0
- data/lib/weeler/route_mapper.rb +41 -0
- data/lib/weeler/version.rb +1 -1
- data/rspec.html +454 -0
- data/spec/.DS_Store +0 -0
- data/spec/controllers/translations_controller_spec.rb +41 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/controllers/weeler/posts_controller.rb +7 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +23 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +29 -0
- data/spec/dummy/config/environments/production.rb +80 -0
- data/spec/dummy/config/environments/test.rb +36 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +12 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/weeler.rb +2 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +5 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20131015144900_create_weeler_translations.rb +16 -0
- data/spec/dummy/db/production.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +29 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/dummy/log/development.log +19 -0
- data/spec/dummy/log/production.log +4 -0
- data/spec/dummy/log/test.log +38396 -0
- data/spec/dummy/public/404.html +58 -0
- data/spec/dummy/public/422.html +58 -0
- data/spec/dummy/public/500.html +57 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/factories/translations.rb +7 -0
- data/spec/routing/routes_spec.rb +140 -0
- data/spec/spec_helper.rb +54 -0
- data/spec/weeler/.DS_Store +0 -0
- data/spec/weeler/i18n_backend_weeler_spec.rb +169 -0
- data/spec/weeler/i18n_humanize_missing_translations_spec.rb +18 -0
- data/weeler.gemspec +14 -0
- metadata +354 -3
@@ -0,0 +1,84 @@
|
|
1
|
+
/*
|
2
|
+
Document : jquery.pnotify.default.css
|
3
|
+
Created on : Nov 23, 2009, 3:14:10 PM
|
4
|
+
Author : Hunter Perrin
|
5
|
+
Version : 1.2.0
|
6
|
+
Link : http://pinesframework.org/pnotify/
|
7
|
+
Description:
|
8
|
+
Default styling for Pines Notify jQuery plugin.
|
9
|
+
*/
|
10
|
+
/* -- Notice */
|
11
|
+
.ui-pnotify {
|
12
|
+
bottom: 25px;
|
13
|
+
right: 25px;
|
14
|
+
position: absolute;
|
15
|
+
height: auto;
|
16
|
+
/* Ensures notices are above everything */
|
17
|
+
z-index: 9999;
|
18
|
+
}
|
19
|
+
/* Hides position: fixed from IE6 */
|
20
|
+
html > body .ui-pnotify {
|
21
|
+
position: fixed;
|
22
|
+
}
|
23
|
+
.ui-pnotify .ui-pnotify-shadow {
|
24
|
+
-webkit-box-shadow: 0px 2px 10px rgba(50, 50, 50, 0.5);
|
25
|
+
-moz-box-shadow: 0px 2px 10px rgba(50, 50, 50, 0.5);
|
26
|
+
box-shadow: 0px 2px 10px rgba(50, 50, 50, 0.5);
|
27
|
+
}
|
28
|
+
.ui-pnotify-container {
|
29
|
+
background-position: 0 0;
|
30
|
+
padding: .8em;
|
31
|
+
height: 100%;
|
32
|
+
margin: 0;
|
33
|
+
}
|
34
|
+
.ui-pnotify-sharp {
|
35
|
+
-webkit-border-radius: 0;
|
36
|
+
-moz-border-radius: 0;
|
37
|
+
border-radius: 0;
|
38
|
+
}
|
39
|
+
.ui-pnotify-closer, .ui-pnotify-sticker {
|
40
|
+
float: right;
|
41
|
+
margin-left: .1em;
|
42
|
+
}
|
43
|
+
.ui-pnotify-title {
|
44
|
+
display: block;
|
45
|
+
margin-bottom: .1em;
|
46
|
+
text-transform: capitalize;
|
47
|
+
}
|
48
|
+
.ui-pnotify-text {
|
49
|
+
display: block;
|
50
|
+
}
|
51
|
+
.ui-pnotify-icon, .ui-pnotify-icon span {
|
52
|
+
display: block;
|
53
|
+
float: left;
|
54
|
+
margin-right: .1em;
|
55
|
+
}
|
56
|
+
/* -- History Pulldown */
|
57
|
+
.ui-pnotify-history-container {
|
58
|
+
position: absolute;
|
59
|
+
top: 0;
|
60
|
+
right: 18px;
|
61
|
+
width: 70px;
|
62
|
+
border-top: none;
|
63
|
+
padding: 0;
|
64
|
+
-webkit-border-top-left-radius: 0;
|
65
|
+
-moz-border-top-left-radius: 0;
|
66
|
+
border-top-left-radius: 0;
|
67
|
+
-webkit-border-top-right-radius: 0;
|
68
|
+
-moz-border-top-right-radius: 0;
|
69
|
+
border-top-right-radius: 0;
|
70
|
+
/* Ensures history container is above notices. */
|
71
|
+
z-index: 10000;
|
72
|
+
}
|
73
|
+
.ui-pnotify-history-container .ui-pnotify-history-header {
|
74
|
+
padding: 2px;
|
75
|
+
}
|
76
|
+
.ui-pnotify-history-container button {
|
77
|
+
cursor: pointer;
|
78
|
+
display: block;
|
79
|
+
width: 100%;
|
80
|
+
}
|
81
|
+
.ui-pnotify-history-container .ui-pnotify-history-pulldown {
|
82
|
+
display: block;
|
83
|
+
margin: 0 auto;
|
84
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
/*
|
2
|
+
* Style twaks
|
3
|
+
* --------------------------------------------------
|
4
|
+
*/
|
5
|
+
body {
|
6
|
+
padding-top: 70px;
|
7
|
+
}
|
8
|
+
footer {
|
9
|
+
padding-left: 15px;
|
10
|
+
padding-right: 15px;
|
11
|
+
}
|
12
|
+
|
13
|
+
/*
|
14
|
+
* Off Canvas
|
15
|
+
* --------------------------------------------------
|
16
|
+
*/
|
17
|
+
@media screen and (max-width: 768px) {
|
18
|
+
.row-offcanvas {
|
19
|
+
position: relative;
|
20
|
+
-webkit-transition: all 0.25s ease-out;
|
21
|
+
-moz-transition: all 0.25s ease-out;
|
22
|
+
transition: all 0.25s ease-out;
|
23
|
+
}
|
24
|
+
|
25
|
+
.row-offcanvas-right
|
26
|
+
.sidebar-offcanvas {
|
27
|
+
right: -50%; /* 6 columns */
|
28
|
+
}
|
29
|
+
|
30
|
+
.row-offcanvas-left
|
31
|
+
.sidebar-offcanvas {
|
32
|
+
left: -50%; /* 6 columns */
|
33
|
+
}
|
34
|
+
|
35
|
+
.row-offcanvas-right.active {
|
36
|
+
right: 50%; /* 6 columns */
|
37
|
+
}
|
38
|
+
|
39
|
+
.row-offcanvas-left.active {
|
40
|
+
left: 50%; /* 6 columns */
|
41
|
+
}
|
42
|
+
|
43
|
+
.sidebar-offcanvas {
|
44
|
+
position: absolute;
|
45
|
+
top: 0;
|
46
|
+
width: 50%; /* 6 columns */
|
47
|
+
}
|
48
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Weeler
|
2
|
+
class BaseController < ApplicationController
|
3
|
+
before_filter :set_current_menu_item
|
4
|
+
before_filter :run_weeler_required_user_method
|
5
|
+
|
6
|
+
private
|
7
|
+
|
8
|
+
def set_current_menu_item
|
9
|
+
@current_menu_item = "home"
|
10
|
+
end
|
11
|
+
|
12
|
+
def run_weeler_required_user_method
|
13
|
+
eval(Weeler.required_user_method.to_s) if Weeler.required_user_method.present?
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,151 @@
|
|
1
|
+
module Weeler
|
2
|
+
class TranslationsController < BaseController
|
3
|
+
|
4
|
+
def index
|
5
|
+
@translations = translations_by_params
|
6
|
+
@translations = @translations.page(params[:page]).per(20)
|
7
|
+
@groups = I18n::Backend::Weeler::Translation.groups
|
8
|
+
end
|
9
|
+
|
10
|
+
def new
|
11
|
+
@translation = I18n::Backend::Weeler::Translation.new
|
12
|
+
end
|
13
|
+
|
14
|
+
def edit
|
15
|
+
@translation = I18n::Backend::Weeler::Translation.find(params[:id])
|
16
|
+
end
|
17
|
+
|
18
|
+
def create
|
19
|
+
@translation = I18n::Backend::Weeler::Translation.new(translation_params)
|
20
|
+
if @translation.save
|
21
|
+
redirect_to edit_weeler_translation_path(@translation), flash: {success: "Translation saved."}
|
22
|
+
else
|
23
|
+
flash.now[:error] = "Errors in saving."
|
24
|
+
render :edit
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def update
|
29
|
+
@translation = I18n::Backend::Weeler::Translation.find(params[:id])
|
30
|
+
if @translation.update_attributes(translation_params)
|
31
|
+
redirect_to edit_weeler_translation_path(@translation), flash: {success: "Translation updated."}
|
32
|
+
else
|
33
|
+
flash.now[:error] = "Errors in updating."
|
34
|
+
render :edit
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def destroy
|
39
|
+
@translation = I18n::Backend::Weeler::Translation.find(params[:id])
|
40
|
+
@translation.destroy
|
41
|
+
redirect_to weeler_translations_path, flash: {success: "Translation succesfully removed."}
|
42
|
+
end
|
43
|
+
|
44
|
+
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
|
+
respond_to do |format|
|
82
|
+
format.xlsx do
|
83
|
+
outstrio = StringIO.new
|
84
|
+
outstrio.write(p.to_stream.read)
|
85
|
+
send_data(outstrio.string, filename: "translations" + '.xlsx')
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
end
|
90
|
+
|
91
|
+
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
|
132
|
+
redirect_to weeler_translations_path, flash: {success: "Translations succesfully imported."}
|
133
|
+
end
|
134
|
+
|
135
|
+
private
|
136
|
+
|
137
|
+
def translation_params
|
138
|
+
params.require(:i18n_backend_weeler_translation).permit([:locale, :key, :value, :is_proc, :interpolations => []])
|
139
|
+
end
|
140
|
+
|
141
|
+
def translations_by_params
|
142
|
+
translations = I18n::Backend::Weeler::Translation.order("locale, key")
|
143
|
+
|
144
|
+
translations = translations.where("key LIKE ?", "%#{params[:query]}%") if params[:query]
|
145
|
+
translations = translations.where(locale: params[:locale]) if params[:locale].present?
|
146
|
+
translations = translations.lookup(params[:group]) if params[:group].present?
|
147
|
+
translations
|
148
|
+
end
|
149
|
+
|
150
|
+
end
|
151
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%# Link to the "First" page
|
2
|
+
- available local variables
|
3
|
+
url: url to the first page
|
4
|
+
current_page: a page object for the currently displayed page
|
5
|
+
total_pages: total number of pages
|
6
|
+
per_page: number of items to fetch per page
|
7
|
+
remote: data-remote
|
8
|
+
-%>
|
9
|
+
<% unless current_page.first? -%>
|
10
|
+
<li class="first">
|
11
|
+
<%= link_to raw(t 'views.pagination.first'), url, {:remote => remote} %>
|
12
|
+
</li>
|
13
|
+
<% end -%>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%# Non-link tag that stands for skipped pages...
|
2
|
+
- available local variables
|
3
|
+
current_page: a page object for the currently displayed page
|
4
|
+
total_pages: total number of pages
|
5
|
+
per_page: number of items to fetch per page
|
6
|
+
remote: data-remote
|
7
|
+
-%>
|
8
|
+
<li class="page gap disabled"><a href="javascript:void(0)"><%= raw(t 'views.pagination.truncate') %></a></li>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%# Link to the "Last" page
|
2
|
+
- available local variables
|
3
|
+
url: url to the last page
|
4
|
+
current_page: a page object for the currently displayed page
|
5
|
+
total_pages: total number of pages
|
6
|
+
per_page: number of items to fetch per page
|
7
|
+
remote: data-remote
|
8
|
+
-%>
|
9
|
+
<% unless current_page.last? -%>
|
10
|
+
<li class="last">
|
11
|
+
<%= link_to raw(t 'views.pagination.last'), url, {:remote => remote} %>
|
12
|
+
</li>
|
13
|
+
<% end -%>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%# Link to the "Next" page
|
2
|
+
- available local variables
|
3
|
+
url: url to the next page
|
4
|
+
current_page: a page object for the currently displayed page
|
5
|
+
total_pages: total number of pages
|
6
|
+
per_page: number of items to fetch per page
|
7
|
+
remote: data-remote
|
8
|
+
-%>
|
9
|
+
|
10
|
+
<% unless current_page.last? -%>
|
11
|
+
<li class="next">
|
12
|
+
<%= link_to raw(t 'views.pagination.next'), url, :remote => remote, :rel => 'next' %>
|
13
|
+
</li>
|
14
|
+
<% end -%>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<%# Link showing page number
|
2
|
+
- available local variables
|
3
|
+
page: a page object for "this" page
|
4
|
+
url: url to this page
|
5
|
+
current_page: a page object for the currently displayed page
|
6
|
+
total_pages: total number of pages
|
7
|
+
per_page: number of items to fetch per page
|
8
|
+
remote: data-remote
|
9
|
+
-%>
|
10
|
+
<li class="page<%= ' active' if page.current? %>">
|
11
|
+
<%= link_to page, (page.current? ? 'javascript:void(0)' : url), opts = {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
|
12
|
+
</li>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%# The container tag
|
2
|
+
- available local variables
|
3
|
+
current_page: a page object for the currently displayed page
|
4
|
+
total_pages: total number of pages
|
5
|
+
per_page: number of items to fetch per page
|
6
|
+
remote: data-remote
|
7
|
+
paginator: the paginator that renders the pagination tags inside
|
8
|
+
-%>
|
9
|
+
<%= paginator.render do -%>
|
10
|
+
<ul class="pagination pagination-lg pull-right">
|
11
|
+
<%= first_page_tag unless current_page.first? %>
|
12
|
+
<%= prev_page_tag unless current_page.first? %>
|
13
|
+
<% each_page do |page| -%>
|
14
|
+
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
|
15
|
+
<%= page_tag page %>
|
16
|
+
<% elsif !page.was_truncated? -%>
|
17
|
+
<%= gap_tag %>
|
18
|
+
<% end -%>
|
19
|
+
<% end -%>
|
20
|
+
<%= next_page_tag unless current_page.last? %>
|
21
|
+
<%= last_page_tag unless current_page.last? %>
|
22
|
+
</ul>
|
23
|
+
<% end -%>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%# Link to the "Previous" page
|
2
|
+
- available local variables
|
3
|
+
url: url to the previous page
|
4
|
+
current_page: a page object for the currently displayed page
|
5
|
+
total_pages: total number of pages
|
6
|
+
per_page: number of items to fetch per page
|
7
|
+
remote: data-remote
|
8
|
+
-%>
|
9
|
+
<% unless current_page.first? -%>
|
10
|
+
<li class="prev">
|
11
|
+
<%= link_to raw(t 'views.pagination.previous'), url, :remote => remote, :rel => 'prev' %>
|
12
|
+
</li>
|
13
|
+
<% end -%>
|
@@ -0,0 +1,86 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
|
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>
|
33
|
+
|
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 -->
|
53
|
+
|
54
|
+
<div class="container">
|
55
|
+
|
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 %>
|
67
|
+
|
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-->
|
75
|
+
|
76
|
+
<hr>
|
77
|
+
|
78
|
+
<footer>
|
79
|
+
<p>© Weby 2013</p>
|
80
|
+
</footer>
|
81
|
+
|
82
|
+
</div><!--/.container-->
|
83
|
+
|
84
|
+
</body>
|
85
|
+
|
86
|
+
</html>
|