weeler 0.0.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/.rspec +1 -1
- data/.travis.yml +7 -2
- data/CHANGELOG.md +149 -1
- data/LICENSE.txt +2 -2
- data/README.md +83 -1
- data/app/.DS_Store +0 -0
- data/app/assets/javascripts/weeler/init.js.coffee +13 -2
- data/app/assets/javascripts/weeler/lib/notify.js +18 -0
- data/app/assets/javascripts/weeler/lib/sortable.js +9 -0
- data/app/assets/stylesheets/weeler/init.css.erb +2 -1
- data/app/assets/stylesheets/weeler/style.css.scss +22 -0
- data/app/controllers/concerns/weeler/section_seo.rb +16 -0
- data/app/controllers/weeler/administration_controller.rb +11 -0
- data/app/controllers/weeler/application_controller.rb +5 -0
- data/app/controllers/weeler/base_controller.rb +16 -12
- data/app/controllers/weeler/configuration_controller.rb +9 -0
- data/app/controllers/weeler/content_controller.rb +12 -0
- data/app/controllers/weeler/home_controller.rb +5 -2
- data/app/controllers/weeler/seo_items_controller.rb +24 -0
- data/app/controllers/weeler/settings_controller.rb +21 -0
- data/app/controllers/weeler/static_sections_controller.rb +19 -0
- data/app/controllers/weeler/translations_controller.rb +36 -18
- data/app/models/concerns/weeler/seoable.rb +61 -0
- data/app/models/concerns/weeler/sluger.rb +32 -0
- data/app/models/settings.rb +2 -0
- data/app/models/weeler/seo.rb +9 -0
- data/app/views/kaminari/{_first_page.html.erb → weeler/_first_page.html.erb} +1 -1
- data/app/views/kaminari/{_gap.html.erb → weeler/_gap.html.erb} +1 -1
- data/app/views/kaminari/{_last_page.html.erb → weeler/_last_page.html.erb} +1 -1
- data/app/views/kaminari/{_next_page.html.erb → weeler/_next_page.html.erb} +1 -1
- data/app/views/kaminari/{_page.html.erb → weeler/_page.html.erb} +0 -0
- data/app/views/kaminari/{_paginator.html.erb → weeler/_paginator.html.erb} +1 -1
- data/app/views/kaminari/{_prev_page.html.erb → weeler/_prev_page.html.erb} +1 -1
- data/app/views/layouts/weeler/base.html.haml +22 -0
- data/{lib/generators/weeler/templates/views/weeler/example/index.html.erb → app/views/weeler/administration/_filter.html.haml} +0 -0
- data/app/views/weeler/administration/_header_row.html.haml +5 -0
- data/app/views/weeler/administration/_row.html.haml +5 -0
- data/app/views/weeler/administration/_side_navbar.html.haml +8 -0
- data/app/views/weeler/administration/index.html.haml +17 -0
- data/app/views/weeler/administration/welcome.html.haml +5 -0
- data/app/views/weeler/base/_flash.html.haml +3 -0
- data/app/views/weeler/base/_footer.html.haml +2 -0
- data/app/views/weeler/base/_header_navbar.html.haml +19 -0
- data/app/views/weeler/base/_side_navbar.html.haml +2 -0
- data/app/views/weeler/configuration/_side_navbar.html.haml +12 -0
- data/app/views/weeler/configuration/index.html.haml +3 -0
- data/app/views/weeler/content/_error_messages.html.haml +5 -0
- data/app/views/weeler/content/_form.html.haml +6 -0
- data/app/views/weeler/content/_list.html.haml +23 -0
- data/app/views/weeler/content/_object_seo.html.haml +31 -0
- data/app/views/weeler/content/_side_navbar.html.haml +17 -0
- data/app/views/weeler/content/_sortable_list.html.haml +24 -0
- data/app/views/weeler/content/edit.html.haml +2 -0
- data/app/views/weeler/content/index.html.haml +10 -0
- data/app/views/weeler/content/new.html.haml +2 -0
- data/app/views/weeler/content/welcome.html.haml +3 -0
- data/app/views/weeler/home/_side_navbar.html.haml +8 -0
- data/app/views/weeler/home/about.html.haml +15 -0
- data/app/views/weeler/home/index.html.haml +3 -0
- data/app/views/weeler/seo_items/edit.html.haml +28 -0
- data/app/views/weeler/seo_items/index.html.haml +15 -0
- data/app/views/weeler/settings/index.html.haml +19 -0
- data/app/views/weeler/static_sections/show.html.haml +26 -0
- data/app/views/weeler/translations/_form.html.haml +27 -0
- data/app/views/weeler/translations/_translation.html.haml +11 -0
- data/app/views/weeler/translations/edit.html.haml +14 -0
- data/app/views/weeler/translations/index.html.haml +76 -0
- data/app/views/weeler/translations/new.html.haml +13 -0
- data/lib/.DS_Store +0 -0
- data/lib/generators/weeler/.DS_Store +0 -0
- data/lib/generators/weeler/install_generator.rb +30 -26
- data/lib/generators/weeler/templates/assets/javascripts/weeler/app/index.js +2 -0
- data/lib/generators/weeler/templates/assets/stylesheets/weeler/app/index.css +4 -0
- data/lib/generators/weeler/templates/controllers/weeler/application_controller.rb +6 -0
- data/lib/generators/weeler/templates/initializers/weeler.rb +30 -2
- data/lib/generators/weeler/templates/migrations/create_weeler_seos.rb +14 -0
- data/lib/generators/weeler/templates/migrations/create_weeler_settings.rb +17 -0
- data/lib/generators/weeler/templates/migrations/translate_weeler_seos.rb +15 -0
- data/lib/generators/weeler/templates/views/weeler/.keep +0 -0
- data/lib/i18n/backend/weeler.rb +102 -22
- data/lib/i18n/backend/weeler/dedupe.rb +31 -0
- data/lib/i18n/backend/weeler/exporter.rb +67 -5
- data/lib/i18n/backend/weeler/html_checker.rb +41 -0
- data/lib/i18n/backend/weeler/importer.rb +30 -13
- data/lib/i18n/backend/weeler/translation.rb +12 -7
- data/lib/i18n/humanize_missing_translations.rb +1 -0
- data/lib/i18n/weeler.rb +8 -2
- data/lib/tasks/weeler.rake +8 -0
- data/lib/weeler.rb +80 -7
- data/lib/weeler/.DS_Store +0 -0
- data/lib/weeler/action_controller/acts/restful.rb +185 -0
- data/lib/weeler/action_dispatch/routing/mapper.rb +87 -0
- data/lib/weeler/action_view/helpers/form_helper.rb +13 -0
- data/lib/weeler/action_view/helpers/image_form_helper.rb +84 -0
- data/lib/weeler/action_view/helpers/translation_helper.rb +15 -0
- data/lib/weeler/deprecator.rb +9 -0
- data/lib/weeler/engine.rb +18 -4
- data/lib/weeler/version.rb +7 -1
- data/rspec.html +426 -147
- data/spec/.DS_Store +0 -0
- data/spec/controllers/translations_controller_spec.rb +76 -5
- data/spec/dummy/app/controllers/weeler/posts_controller.rb +3 -7
- data/spec/dummy/app/models/post.rb +17 -0
- data/spec/dummy/app/models/translation.rb +2 -0
- data/spec/dummy/config/locales/en.yml +4 -1
- data/spec/dummy/config/routes.rb +3 -3
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20140123083704_create_weeler_seos.rb +14 -0
- data/spec/dummy/db/migrate/20140123083705_create_weeler_settings.rb +17 -0
- data/spec/dummy/db/migrate/{20131015144900_create_weeler_translations.rb → 20140123083706_create_weeler_translations.rb} +0 -0
- data/spec/dummy/db/migrate/20140123083707_translate_weeler_seos.rb +15 -0
- data/spec/dummy/db/migrate/20140718103237_create_posts.rb +12 -0
- data/spec/dummy/db/migrate/20140726151210_create_translations.rb +12 -0
- data/spec/dummy/db/schema.rb +59 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +221 -0
- data/spec/factories/dummy_posts.rb +6 -0
- data/spec/fixtures/.DS_Store +0 -0
- data/spec/routing/routes_spec.rb +4 -4
- data/spec/spec_helper.rb +14 -3
- data/spec/weeler/action_controller/acts/restful_spec.rb +155 -0
- data/spec/weeler/action_view/helpers/form_helper_spec.rb +26 -0
- data/spec/weeler/action_view/helpers/translation_helper_spec.rb +16 -0
- data/spec/weeler/i18n/backend/weeler/dedupe_spec.rb +21 -0
- data/spec/weeler/i18n/backend/weeler/exporter_spec.rb +2 -4
- data/spec/weeler/i18n/backend/weeler/importer_spec.rb +5 -2
- data/spec/weeler/i18n/backend/weeler_spec.rb +121 -23
- data/weeler.gemspec +15 -7
- metadata +207 -85
- data/.DS_Store +0 -0
- data/app/assets/stylesheets/weeler/vendor/bootstrap.css +0 -6086
- data/app/views/layouts/weeler/base.html.erb +0 -40
- data/app/views/weeler/home/about.html.erb +0 -16
- data/app/views/weeler/home/index.html.erb +0 -4
- data/app/views/weeler/shared/_flash.html.erb +0 -17
- data/app/views/weeler/shared/_footer.html.erb +0 -3
- data/app/views/weeler/shared/_header_navbar.html.erb +0 -18
- data/app/views/weeler/shared/_side_navbar.html.erb +0 -14
- data/app/views/weeler/translations/_form.html.erb +0 -43
- data/app/views/weeler/translations/_translation.html.erb +0 -11
- data/app/views/weeler/translations/edit.html.erb +0 -19
- data/app/views/weeler/translations/index.html.erb +0 -103
- data/app/views/weeler/translations/new.html.erb +0 -19
- data/lib/generators/weeler/templates/controllers/weeler/example_controller.rb.example +0 -7
- data/lib/i18n/backend/weeler/exporter/active_record.rb +0 -37
- data/lib/i18n/backend/weeler/exporter/active_record_relation.rb +0 -38
- data/lib/i18n/backend/weeler/store_procs.rb +0 -39
- data/lib/weeler/route_mapper.rb +0 -41
- data/spec/dummy/db/production.sqlite3 +0 -0
- data/spec/dummy/log/test.log +0 -88454
@@ -0,0 +1,19 @@
|
|
1
|
+
.navbar.navbar-fixed-top.navbar-inverse{role: "navigation"}
|
2
|
+
.container
|
3
|
+
.navbar-header
|
4
|
+
%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", type: "button"}
|
5
|
+
%span.icon-bar
|
6
|
+
%span.icon-bar
|
7
|
+
%span.icon-bar
|
8
|
+
%a.navbar-brand.weeler{href: weeler_root_path}
|
9
|
+
= Weeler
|
10
|
+
%span.weeler_version= Gem.loaded_specs["weeler"].version
|
11
|
+
.collapse.navbar-collapse
|
12
|
+
%ul.nav.navbar-nav
|
13
|
+
- Weeler.main_menu_items.each do |item|
|
14
|
+
%li{class: "#{'active' if @current_menu_item.downcase == item[:name].downcase}"}
|
15
|
+
= link_to item[:name].humanize, "/#{Weeler.mount_location_namespace}/#{item[:weeler_path]}"
|
16
|
+
- if Weeler.logout_path
|
17
|
+
%ul.nav.navbar-nav.navbar-right
|
18
|
+
%li
|
19
|
+
%a{href: Weeler.logout_path} Logout
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#sidebar.col-xs-6.col-sm-3.sidebar-offcanvas{role: "navigation"}
|
2
|
+
.well.sidebar-nav
|
3
|
+
%ul.nav
|
4
|
+
%li Configurations
|
5
|
+
- if Weeler.use_weeler_i18n
|
6
|
+
%li
|
7
|
+
%a{href: weeler_translations_path} Translations
|
8
|
+
- if I18n::Backend::Weeler::Translation.select("key").where("key LIKE ?", "seo.%").order("key").size > 0
|
9
|
+
%li
|
10
|
+
%a{href: weeler_seo_items_path} SEO
|
11
|
+
%li
|
12
|
+
%a{href: weeler_settings_path} Settings
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#content
|
2
|
+
%h2 All #{item_humanized_name} items
|
3
|
+
%h6
|
4
|
+
- path_options = {} if path_options.nil?
|
5
|
+
|
6
|
+
= link_to "click here to add a new #{item_humanized_name} item", {action: :new}.merge(path_options)
|
7
|
+
|
8
|
+
- if collection.count < 1
|
9
|
+
.no_news
|
10
|
+
= "Sorry, It seams there are no #{collection.klass.to_s.underscore.humanize.downcase} items at this moment.. "
|
11
|
+
= link_to "press here to add a new #{collection.klass.to_s.underscore.humanize.downcase} item", {action: :new}.merge(path_options)
|
12
|
+
|
13
|
+
- else
|
14
|
+
- collection.each do |item|
|
15
|
+
.list-group-item{:id => "order_#{item.id}"}
|
16
|
+
%span
|
17
|
+
- if defined? item.weeler_image_path
|
18
|
+
= image_tag(item.weeler_image_path, style: "max-width: 75px")
|
19
|
+
%b
|
20
|
+
= truncate(item.to_s, length: 40)
|
21
|
+
%span{class: "pull-right"}
|
22
|
+
= link_to "Edit", action: :edit, id: item.id
|
23
|
+
= link_to "Delete", [:weeler, item], data: {confirm: 'Are you sure?'}, :method => :delete
|
@@ -0,0 +1,31 @@
|
|
1
|
+
= form.fields_for :seo do |seo_fields|
|
2
|
+
%h2
|
3
|
+
= "SEO options"
|
4
|
+
%p
|
5
|
+
= "Here you can adjust (override) Title and meta tags for current page"
|
6
|
+
%br
|
7
|
+
|
8
|
+
- I18n.available_locales.each do |lang|
|
9
|
+
- if I18n.available_locales.size > 1
|
10
|
+
%h3
|
11
|
+
= lang.capitalize
|
12
|
+
|
13
|
+
= seo_fields.hidden_field :id, :value => seo_fields.object.id if seo_fields.object.present?
|
14
|
+
= seo_fields.hidden_field :section, :value => controller_name
|
15
|
+
|
16
|
+
- seo_fields.globalize_fields_for lang do |g|
|
17
|
+
|
18
|
+
.form-group
|
19
|
+
.input-group
|
20
|
+
= g.label :title, class: "input-group-addon"
|
21
|
+
= g.text_field :title, :class => 'form-control'
|
22
|
+
|
23
|
+
.form-group
|
24
|
+
.input-group
|
25
|
+
= g.label :description, class: "input-group-addon"
|
26
|
+
= g.text_field :description, :class => 'form-control'
|
27
|
+
|
28
|
+
.form-group
|
29
|
+
.input-group
|
30
|
+
= g.label :keywords, class: "input-group-addon"
|
31
|
+
= g.text_field :keywords, :class => 'form-control'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#sidebar.col-xs-6.col-sm-3.sidebar-offcanvas{role: "navigation"}
|
2
|
+
.well.sidebar-nav
|
3
|
+
%ul.nav
|
4
|
+
%li Content
|
5
|
+
- Weeler.content_menu_items.each do |item|
|
6
|
+
%li
|
7
|
+
- if item[:seen].present? && item[:seen] == true
|
8
|
+
= link_to "/#{Weeler.mount_location_namespace}/#{item[:weeler_path]}/" do
|
9
|
+
%span.badge.pull-right= item[:class].where(seen: false).size
|
10
|
+
= item[:name].humanize
|
11
|
+
- else
|
12
|
+
= link_to item[:name].humanize, "/#{Weeler.mount_location_namespace}/#{item[:weeler_path]}/"
|
13
|
+
- if Weeler.static_menu_items.size > 0
|
14
|
+
%li Static content
|
15
|
+
- Weeler.static_menu_items.each do |item|
|
16
|
+
%li
|
17
|
+
= link_to item[:name].humanize, "/#{Weeler.mount_location_namespace}/#{item[:weeler_path]}/"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#content
|
2
|
+
%h2 All #{item_humanized_name} items
|
3
|
+
%h6
|
4
|
+
- path_options = {} if path_options.nil?
|
5
|
+
|
6
|
+
= link_to "click here to add a new #{item_humanized_name} item", {action: :new}.merge(path_options)
|
7
|
+
|
8
|
+
- if collection.count < 1
|
9
|
+
.no_news
|
10
|
+
= "Sorry, It seams there are no #{item_humanized_name} items at this moment.. "
|
11
|
+
= link_to "press here to add a new #{item_humanized_name} item", {action: :new}.merge(path_options)
|
12
|
+
|
13
|
+
- else
|
14
|
+
.sortable.list-group{data: {url: "#{url_for({action: :order}.merge(path_options)) }"} }
|
15
|
+
- collection.each do |item|
|
16
|
+
.list-group-item{:id => "order_#{item.id}"}
|
17
|
+
%span
|
18
|
+
- if defined? item.weeler_image_path
|
19
|
+
= image_tag(item.weeler_image_path, style: "max-width: 75px")
|
20
|
+
%b
|
21
|
+
= raw item.to_s
|
22
|
+
%span{class: "pull-right"}
|
23
|
+
= link_to "Edit", edit_polymorphic_path([:weeler, item])
|
24
|
+
= link_to "Delete", [:weeler, item], data: {confirm: 'Are you sure?'}, :method => :delete
|
@@ -0,0 +1,10 @@
|
|
1
|
+
.row
|
2
|
+
%div{class: "col-lg-12 col-md-12"}
|
3
|
+
- if @items.klass.new.has_attribute?(:sequence)
|
4
|
+
= render "sortable_list", { collection: @items }
|
5
|
+
- else
|
6
|
+
= render "list", { collection: @items }
|
7
|
+
|
8
|
+
- if @paginate.present? && @paginate > 0
|
9
|
+
.row
|
10
|
+
= paginate @items, params: { action: "index" }, theme: "weeler"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
.row
|
2
|
+
.col-12-lg
|
3
|
+
%h2 About
|
4
|
+
%p Simple open source CMS system. Most used in Weby LTC systems.
|
5
|
+
%h3 Features
|
6
|
+
%ul
|
7
|
+
%li Dynamic static texts
|
8
|
+
%li Localization
|
9
|
+
%li Light design
|
10
|
+
%h3 Technology (used in implementation)
|
11
|
+
%ul
|
12
|
+
%li Ruby - cool programming language
|
13
|
+
%li Rails - most advanced WEB MVC framework
|
14
|
+
%li RSpec - automatic tests/unit tests
|
15
|
+
%li Bundler - uses only fresh and tested libs
|
@@ -0,0 +1,28 @@
|
|
1
|
+
.header.container
|
2
|
+
.row
|
3
|
+
.col-lg-12.col-md-12
|
4
|
+
.page-header
|
5
|
+
%h3
|
6
|
+
= "\"#{@section.humanize}\""
|
7
|
+
SEO data
|
8
|
+
.row
|
9
|
+
%div{class: "col-lg-12 col-md-12"}
|
10
|
+
= form_tag weeler_seo_item_path(id: @section.gsub('.', '_')), {method: "put", class: "form-horizontal", role: "form"} do
|
11
|
+
- I18n.available_locales.each do |lang|
|
12
|
+
- if I18n.available_locales.size > 1
|
13
|
+
%h3
|
14
|
+
= lang.capitalize
|
15
|
+
- ["title", "description", "keywords"].each do |subsection|
|
16
|
+
- translation = I18n::Backend::Weeler::Translation.locale(lang).lookup("seo.#{@section}.#{subsection}").first
|
17
|
+
- translation = I18n::Backend::Weeler::Translation.create(key: "seo.#{@section}.#{subsection}", locale: locale) if translation.nil?
|
18
|
+
.form-group
|
19
|
+
= label_tag subsection, subsection.humanize, class: "col-lg-2 col-md-2 control-label"
|
20
|
+
%div{class: "col-lg-10 col-md-10"}
|
21
|
+
= text_area_tag "translations[#{translation.id}]", translation.value, class: 'form-control'
|
22
|
+
- if translation.interpolations.size > 0
|
23
|
+
%b Variables
|
24
|
+
= translation.interpolations.map{ |t| "%{#{t}}" }.join(", ")
|
25
|
+
|
26
|
+
.form-group
|
27
|
+
= submit_tag "Save", class: "btn btn-primary"
|
28
|
+
= link_to 'Back', {action: :index}, class: "btn btn-default"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
.row
|
2
|
+
%div{class: "col-lg-12 col-md-12"}
|
3
|
+
#content
|
4
|
+
%h2 All seo items
|
5
|
+
- if @groups.count < 1
|
6
|
+
.no_news
|
7
|
+
= "Sorry, It seams there are no seo items at this moment."
|
8
|
+
- else
|
9
|
+
- @groups.each do |item|
|
10
|
+
.list-group-item
|
11
|
+
%span
|
12
|
+
%b
|
13
|
+
= item.humanize
|
14
|
+
%span{class: "pull-right"}
|
15
|
+
= link_to "Open", action: :edit, id: item
|
@@ -0,0 +1,19 @@
|
|
1
|
+
.row
|
2
|
+
.header.container
|
3
|
+
.row
|
4
|
+
.col-lg-12
|
5
|
+
.page-header
|
6
|
+
%h1
|
7
|
+
Settings
|
8
|
+
.row
|
9
|
+
%div{class: "col-lg-8 col-md-8"}
|
10
|
+
- @settings.each do |item|
|
11
|
+
%div{style: "min-height: 50px;"}
|
12
|
+
= form_for [:weeler, item], html: {class: "form-vertical", role: "form"} do |f|
|
13
|
+
.form-group
|
14
|
+
%label.col-lg-4.col-md-4.control-label
|
15
|
+
= "#{item.var.humanize.capitalize}:"
|
16
|
+
.col-lg-6.col-md-6
|
17
|
+
= f.text_field :value, value: item.value, class: "form-control"
|
18
|
+
.col-lg-2.col-md-2
|
19
|
+
= f.submit "Save", class: "btn btn-primary"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
.header.container
|
2
|
+
.row
|
3
|
+
.col-lg-12.col-md-12
|
4
|
+
.page-header
|
5
|
+
%h3
|
6
|
+
= @section.humanize
|
7
|
+
section
|
8
|
+
.row
|
9
|
+
%div{class: "col-lg-12 col-md-12"}
|
10
|
+
= form_tag weeler_static_section_path(id: @section), {method: "put", class: "form-horizontal", role: "form"} do
|
11
|
+
- @items.each do |key|
|
12
|
+
- I18n.available_locales.each do |lang|
|
13
|
+
- if I18n.available_locales.size > 1
|
14
|
+
%h3
|
15
|
+
= lang.capitalize
|
16
|
+
- translation = I18n::Backend::Weeler::Translation.locale(lang).lookup(key).first
|
17
|
+
.form-group
|
18
|
+
= label_tag key, key.to_s.split('.').last.humanize, class: "col-lg-2 col-md-2 control-label"
|
19
|
+
%div{class: "col-lg-10 col-md-10"}
|
20
|
+
- if translation.html?
|
21
|
+
= text_area_tag "translations[#{translation.id}]", translation.value, class: 'form-control redactor'
|
22
|
+
- else
|
23
|
+
= text_area_tag "translations[#{translation.id}]", translation.value, class: 'form-control'
|
24
|
+
|
25
|
+
.form-group
|
26
|
+
= submit_tag "Save", class: "btn btn-primary"
|
@@ -0,0 +1,27 @@
|
|
1
|
+
%h4 Basic (required)
|
2
|
+
.form-group
|
3
|
+
%label.col-lg-2.col-md-2.control-label Locale
|
4
|
+
.col-lg-10.col-md-10
|
5
|
+
= f.select :locale, I18n.available_locales, {}, {class: "form-control", placeholder: "en"}
|
6
|
+
.form-group
|
7
|
+
%label.col-lg-2.col-md-2.control-label Key
|
8
|
+
.col-lg-10.col-md-10
|
9
|
+
= f.text_field :key, {class: "form-control", placeholder: "footer.middle"}
|
10
|
+
.form-group
|
11
|
+
%label.col-lg-2.col-md-2.control-label Value
|
12
|
+
.col-lg-10.col-md-10
|
13
|
+
- if translation.html?
|
14
|
+
= f.text_area :value, {class: "form-control redactor"}
|
15
|
+
- else
|
16
|
+
= f.text_area :value, {class: "form-control" }
|
17
|
+
%h4 Info
|
18
|
+
.form-group
|
19
|
+
%label.col-lg-2.col-md-2.control-label Variables
|
20
|
+
.col-lg-10.col-md-10
|
21
|
+
%p.form-control-static
|
22
|
+
%label= translation.interpolations.join(", ")
|
23
|
+
.form-group{style: "display: none;"}
|
24
|
+
%label.col-lg-2.col-md-2.control-label Is a ruby procedure?
|
25
|
+
.col-lg-10.col-md-10
|
26
|
+
%p.form-control-static
|
27
|
+
%label= translation.is_proc
|
@@ -0,0 +1,11 @@
|
|
1
|
+
%tr
|
2
|
+
%td
|
3
|
+
%a{href: edit_weeler_translation_path(translation.id)}
|
4
|
+
\ #{translation.locale}
|
5
|
+
%td= translation.key
|
6
|
+
- if translation.value.present? && translation.value.is_a?(String)
|
7
|
+
%td= strip_tags(truncate(translation.value, lenght: 50))
|
8
|
+
- else
|
9
|
+
%td= translation.value
|
10
|
+
%td= translation.interpolations
|
11
|
+
%td.text-center= translation.created_at.strftime("%d/%m/%Y")
|
@@ -0,0 +1,14 @@
|
|
1
|
+
.header.container
|
2
|
+
.row
|
3
|
+
.col-lg-12.col-md-12
|
4
|
+
.page-header
|
5
|
+
%h1 Edit translation
|
6
|
+
.edit_user.container
|
7
|
+
.row
|
8
|
+
.col-lg-12.col-md-12
|
9
|
+
= form_for @translation, {url: weeler_translation_path(@translation), html: {class: "form-horizontal", role: "form"}} do |f|
|
10
|
+
= render partial: "form", locals: {translation: @translation, f: f}
|
11
|
+
%p.text-center
|
12
|
+
%button.btn.btn-primary{type: "submit"} Save
|
13
|
+
%a.btn.btn-link{href: weeler_translations_path} Cancel
|
14
|
+
= link_to 'Remove', weeler_translation_path(@translation), :confirm => "Are you sure you want remove?", :method => :delete, :class => "btn btn-danger"
|
@@ -0,0 +1,76 @@
|
|
1
|
+
.header.container
|
2
|
+
.row
|
3
|
+
.col-lg-12
|
4
|
+
.page-header
|
5
|
+
%h1 Translations
|
6
|
+
%p.lead.text-muted Static translation data over all your app. You can safely edit translation values. Also you can export excel document, translate in all locales you need and import it back.
|
7
|
+
%p.lead.text-muted
|
8
|
+
= "You can switch between showing keys and translations:"
|
9
|
+
%br/
|
10
|
+
- if params[:show_translation_keys] == 'true'
|
11
|
+
= link_to 'Show translations', weeler_translations_path(show_translation_keys: false)
|
12
|
+
- else
|
13
|
+
= link_to 'Show translation keys', weeler_translations_path(show_translation_keys: true)
|
14
|
+
|
15
|
+
.row
|
16
|
+
%nav.navbar.navbar-default{role: "navigation"}
|
17
|
+
/ Collect the nav links, forms, and other content for toggling
|
18
|
+
.collapse.navbar-collapse.navbar-ex1-collapse
|
19
|
+
/ Groups dropdown
|
20
|
+
%ul.nav.navbar-nav.navbar-left
|
21
|
+
%li.dropdown
|
22
|
+
%a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
|
23
|
+
= (params[:group].capitalize if params[:group]) || "All groups"
|
24
|
+
%b.caret
|
25
|
+
%ul.dropdown-menu
|
26
|
+
%li
|
27
|
+
%a{href: weeler_translations_path(filtered_locale: params[:filtered_locale])} All
|
28
|
+
- @groups.each do |group|
|
29
|
+
- if group.present?
|
30
|
+
%li
|
31
|
+
%a{href: weeler_translations_path(filtered_locale: params[:filtered_locale], group: group)}= group.capitalize
|
32
|
+
/ Locales dropdown
|
33
|
+
%ul.nav.navbar-nav
|
34
|
+
%li.dropdown
|
35
|
+
%a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
|
36
|
+
= (params[:filtered_locale].capitalize if params[:filtered_locale]) || "All locales"
|
37
|
+
%b.caret
|
38
|
+
%ul.dropdown-menu
|
39
|
+
%li
|
40
|
+
%a{href: weeler_translations_path(group: params[:group])} All
|
41
|
+
- I18n.available_locales.each do |locale|
|
42
|
+
- if locale.present?
|
43
|
+
%li
|
44
|
+
%a{href: weeler_translations_path(group: params[:group], filtered_locale: locale)}= locale.capitalize
|
45
|
+
/ Import and export data
|
46
|
+
= form_tag import_weeler_translations_path, {:multipart => true, class: "navbar-form navbar-left"} do
|
47
|
+
.form-group
|
48
|
+
%input.weeler-file-inputs{name: "file", type: "file"}/
|
49
|
+
.btn-group
|
50
|
+
%button.btn.btn-default{type: "submit"} Import
|
51
|
+
%a.btn.btn-default{href: export_weeler_translations_path(filtered_locale: params[:filtered_locale], group: params[:group], query: params[:query], format: :xlsx)} Export
|
52
|
+
/ Search
|
53
|
+
= form_tag weeler_translations_path, method: 'get', class: "navbar-form navbar-right", role: "search" do
|
54
|
+
= hidden_field_tag :filtered_locale, params[:filtered_locale] if params[:filtered_locale].present?
|
55
|
+
= hidden_field_tag :group, params[:group] if params[:group].present?
|
56
|
+
.form-group
|
57
|
+
= text_field_tag :query, params[:query], class: "form-control", placeholder: "Search"
|
58
|
+
%button.btn.btn-default{type: "submit"} Submit
|
59
|
+
/ /.navbar-collapse
|
60
|
+
.container
|
61
|
+
.row
|
62
|
+
.col-lg-12
|
63
|
+
%table.table.table-hover{"data-provides" => "rowlink"}
|
64
|
+
%thead
|
65
|
+
%tr
|
66
|
+
%th Locale
|
67
|
+
%th Key
|
68
|
+
%th.text-center Value
|
69
|
+
%th.text-center Interpolations
|
70
|
+
%th.text-center Created
|
71
|
+
%tbody#translations
|
72
|
+
- @translations.each do |translation|
|
73
|
+
= render :partial => "weeler/translations/translation", locals: {translation: translation}
|
74
|
+
.container
|
75
|
+
.row
|
76
|
+
= paginate @translations, params: {controller: "weeler/translations", action: "index", filtered_locale: params[:filtered_locale], group: params[:group], query: params[:query] }, previous_label: "<<", next_label: ">>", theme: "weeler"
|