tkh_admin_panel 0.3 → 0.3.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
 
4
4
 
5
+ ## 0.3.1
6
+
7
+ * Added context tab menu in site settings section
8
+ * Set up some translations
9
+ * Tidied up dependencies
10
+
11
+
5
12
  ## 0.3
6
13
 
7
14
  * Styled up the admin layout pretty good
@@ -1,28 +1,3 @@
1
1
  @import 'bootstrap_and_overrides.css.scss';
2
2
  @import 'united.css.scss';
3
-
4
- body {
5
- margin-top: 35px;
6
- }
7
-
8
- footer {
9
- margin: 2em 1em .5em;
10
- text-align: center;
11
- }
12
-
13
- input, textarea {
14
- width: 450px;
15
- }
16
-
17
- h1 {
18
- text-align: center;
19
- }
20
-
21
- form {
22
- margin: 2em .5em;
23
- }
24
-
25
- .form-horizontal .help-block {
26
- color: #999;
27
- margin-top: 1px;
28
- }
3
+ @import 'custom.css.scss';
@@ -0,0 +1,26 @@
1
+ body {
2
+ margin-top: 35px;
3
+ }
4
+
5
+ footer {
6
+ margin: 2em 1em .5em;
7
+ text-align: center;
8
+ }
9
+
10
+ input, textarea {
11
+ width: 450px;
12
+ }
13
+
14
+ h1 {
15
+ text-align: center;
16
+ }
17
+
18
+ form {
19
+ margin: 2em .5em;
20
+ }
21
+
22
+ .help-block { color: #999; }
23
+
24
+ .form-horizontal input + .help-block, .form-horizontal select + .help-block, .form-horizontal textarea + .help-block, .form-horizontal .uneditable-input + .help-block, .form-horizontal .input-prepend + .help-block, .form-horizontal .input-append + .help-block {
25
+ margin-top: 3px;
26
+ }
@@ -16,9 +16,9 @@ class SettingsController < ApplicationController
16
16
  def update
17
17
  @setting = Setting.first
18
18
  if @setting.update_attributes(params[:setting])
19
- redirect_to @setting, notice: 'Settings were successfully updated.'
19
+ redirect_to @setting, notice: t('settings.update.notice')
20
20
  else
21
- render action: "edit", layout: 'admin'
21
+ render action: "edit", warning: t('settings.update.warning')
22
22
  end
23
23
  end
24
24
  end
@@ -0,0 +1,15 @@
1
+ <ul class="nav nav-tabs" id="admin-menu-tab">
2
+
3
+ <% if controller.action_name.to_s == 'show' %>
4
+ <%= content_tag :li, link_to(t('view'), Setting.first), class: 'active' %>
5
+ <% else %>
6
+ <%= content_tag :li, link_to(t('view'), Setting.first) %>
7
+ <% end -%>
8
+
9
+ <% if controller.action_name.to_s == 'edit' %>
10
+ <%= content_tag :li, link_to(t('edit'), Setting.first), class: 'active' %>
11
+ <% else %>
12
+ <%= content_tag :li, link_to(t('edit'), edit_setting_path(Setting.first)) %>
13
+ <% end -%>
14
+
15
+ </ul>
@@ -1,4 +1,6 @@
1
- <h1>Edit Settings</h1>
1
+ <h1><%= t('activerecord.models.settings') %></h1>
2
+
3
+ <%= render 'tab_admin_menu' %>
2
4
 
3
5
  <%= simple_form_for @setting, :html => { class: 'form-horizontal' } do |f| %>
4
6
  <%= f.error_notification %>
@@ -1,15 +1,17 @@
1
- <h1>Settings</h1>
1
+ <h1><%= t('activerecord.models.settings') %></h1>
2
+
3
+ <%= render 'tab_admin_menu' %>
2
4
 
3
5
  <p>
4
- <strong>Company name:</strong> <%= @setting.company_name %><br />
5
- <strong>Contact email:</strong> <%= @setting.contact_email %><br />
6
- <strong>Site name:</strong> <%= @setting.site_name %><br />
7
- <strong>Site tagline:</strong> <%= @setting.site_tagline %><br />
8
- <strong>Enable comments in pages?:</strong> <%= @setting.enable_comments_in_pages? ? "<span class=\"label label-success\">✓</span>".html_safe : "<span class=\"label label-important\">X</span>".html_safe %><br />
9
- <strong>Blog enabled?:</strong> <%= @setting.disable_blog? ? "<span class=\"label label-important\">X</span>".html_safe : "<span class=\"label label-success\">✓</span>".html_safe %><br />
10
- <strong>Blog name:</strong> <%= @setting.blog_name %><br />
11
- <strong>Blog tagline:</strong> <%= @setting.blog_tagline %><br />
12
- <strong>Enable comments in blog?:</strong> <%= @setting.enable_comments_in_blog? ? "<span class=\"label label-success\">✓</span>".html_safe : "<span class=\"label label-important\">X</span>".html_safe %>
6
+ <strong><%= t('activerecord.attributes.settings.company_name') + t('colon') %></strong> <%= @setting.company_name %><br />
7
+ <strong><%= t('activerecord.attributes.settings.contact_email') + t('colon') %></strong> <%= @setting.contact_email %><br />
8
+ <strong><%= t('activerecord.attributes.settings.site_name') + t('colon') %></strong> <%= @setting.site_name %><br />
9
+ <strong><%= t('activerecord.attributes.settings.site_tagline') + t('colon') %></strong> <%= @setting.site_tagline %><br />
10
+ <strong><%= t('activerecord.attributes.settings.enable_comments_in_pages') + t('questionmark') %></strong> <%= @setting.enable_comments_in_pages? ? "<span class=\"label label-success\">✓</span>".html_safe : "<span class=\"label label-important\">X</span>".html_safe %><br />
11
+ <strong><%= t('settings.blog_enabled') %></strong> <%= @setting.disable_blog? ? "<span class=\"label label-important\">X</span>".html_safe : "<span class=\"label label-success\">✓</span>".html_safe %><br />
12
+ <strong><%= t('activerecord.attributes.settings.blog_name') + t('colon') %></strong> <%= @setting.blog_name %><br />
13
+ <strong><%= t('activerecord.attributes.settings.blog_tagline') + t('colon') %></strong> <%= @setting.blog_tagline %><br />
14
+ <strong><%= t('activerecord.attributes.settings.enable_comments_in_blog') + t('questionmark') %></strong> <%= @setting.enable_comments_in_blog? ? "<span class=\"label label-success\">✓</span>".html_safe : "<span class=\"label label-important\">X</span>".html_safe %>
13
15
  </p>
14
16
 
15
17
  <%= link_to t('edit'), edit_setting_path(@setting), class: 'btn btn-primary' %>
@@ -1,9 +1,12 @@
1
1
  <% content_for :admin_sidebar do %>
2
- <h2>Sections</h2>
2
+ <h2><%= t('sections') %></h2>
3
3
  <ul>
4
- <li><%= link_to 'site settings', setting_path(1) %></li>
5
- <li><%= link_to 'scaffold name', 'path' %></li>
6
- <li>for example ...</li>
7
- <li><%= link_to 'pages', pages_path %></li>
4
+ <li><%= link_to t('activerecord.models.pages'), pages_path %></li>
5
+ <li><%= link_to t('activerecord.models.comments'), comments_path %></li>
6
+ <li><%= link_to t('activerecord.models.illustrations'), illustrations_path %></li>
7
+ <li><%= link_to t('activerecord.models.menus'), menus_path %></li>
8
+ <li><%= link_to t('activerecord.models.users'), users_path %></li>
9
+ <li><%= link_to t('contacts.messages_from_forms'), contacts_path %></li>
10
+ <li><%= link_to t('activerecord.models.settings'), setting_path(1) %></li>
8
11
  </ul>
9
12
  <% end %>
@@ -1,3 +1,30 @@
1
1
  de:
2
2
  admin_panel: 'Administratorschaltfläche'
3
- admin_panel_for: "Administratorschaltfläche für"
3
+ admin_panel_for: "Administratorschaltfläche für"
4
+
5
+ activerecord:
6
+ models:
7
+ settings: 'site settings'
8
+
9
+ attributes:
10
+ settings:
11
+ site_name: 'site name'
12
+ site_tagline: 'site tagline'
13
+ enable_comments_in_pages: 'enable comments in pages'
14
+ disable_blog: 'disable blog'
15
+ blog_name: 'blog name'
16
+ blog_tagline: 'blog tagline'
17
+ enable_comments_in_blog: 'enable comments in blog'
18
+ contact_email: 'contact email'
19
+ company_name: 'company name'
20
+
21
+ settings:
22
+ blog_enabled: 'blog enabled?'
23
+
24
+ update:
25
+ notice: 'Site Settings were successfully updated.'
26
+ warning: 'There was a problem saving your changes.'
27
+
28
+ colon: ':'
29
+ questionmark: '?'
30
+ view: 'view'
@@ -1,3 +1,30 @@
1
1
  en:
2
2
  admin_panel: 'Admin Panel'
3
- admin_panel_for: "Admin Panel for "
3
+ admin_panel_for: "Admin Panel for "
4
+
5
+ activerecord:
6
+ models:
7
+ settings: 'site settings'
8
+
9
+ attributes:
10
+ settings:
11
+ site_name: 'site name'
12
+ site_tagline: 'site tagline'
13
+ enable_comments_in_pages: 'enable comments in pages'
14
+ disable_blog: 'disable blog'
15
+ blog_name: 'blog name'
16
+ blog_tagline: 'blog tagline'
17
+ enable_comments_in_blog: 'enable comments in blog'
18
+ contact_email: 'contact email'
19
+ company_name: 'company name'
20
+
21
+ settings:
22
+ blog_enabled: 'blog enabled?'
23
+
24
+ update:
25
+ notice: 'Site Settings were successfully updated.'
26
+ warning: 'There was a problem saving your changes.'
27
+
28
+ colon: ':'
29
+ questionmark: '?'
30
+ view: 'view'
@@ -1,4 +1,32 @@
1
1
  es:
2
2
  admin_panel: "El panel de administración"
3
3
  admin_panel_with_site_name: "El panel de administración: "
4
+
5
+ activerecord:
6
+ models:
7
+ settings: 'configuración del sitio'
8
+
9
+ attributes:
10
+ settings:
11
+ site_name: 'nombre del sitio'
12
+ site_tagline: 'lema sitio'
13
+ enable_comments_in_pages: 'habilitar los comentarios en las páginas'
14
+ disable_blog: 'deshabilitar el blog'
15
+ blog_name: 'nombre del blog'
16
+ blog_tagline: 'blog lema'
17
+ enable_comments_in_blog: 'habilitar los comentarios en el blog'
18
+ contact_email: 'correo electrónico de contacto'
19
+ company_name: 'nombre de compañía'
20
+
21
+ settings:
22
+ blog_enabled: '¿blogs habilitado?'
23
+
24
+ update:
25
+ notice: 'Configuración del sitio se han actualizado con éxito.'
26
+ warning: 'Hubo un problema al guardar los cambios.'
27
+
28
+ colon: ':'
29
+ questionmark: '?'
30
+ view: 'ver'
31
+
4
32
 
@@ -1,4 +1,31 @@
1
1
  fr:
2
2
  admin_panel: "Panneau d'administration"
3
3
  admin_panel_for: "Panneau d'administration pour "
4
+
5
+ activerecord:
6
+ models:
7
+ settings: 'options du site'
8
+
9
+ attributes:
10
+ settings:
11
+ site_name: 'nom du site'
12
+ site_tagline: 'slogan du site'
13
+ enable_comments_in_pages: 'commentaires dans les pages'
14
+ disable_blog: 'désactiver blog'
15
+ blog_name: 'nom du blog'
16
+ blog_tagline: 'slogan du blog'
17
+ enable_comments_in_blog: 'commentaires dans le blog'
18
+ contact_email: 'email du contact'
19
+ company_name: 'raison sociale'
20
+
21
+ settings:
22
+ blog_enabled: 'activer le blog ?'
23
+
24
+ update:
25
+ notice: 'Succes: les options du site ont été mises à jour.'
26
+ warning: "Il y'a eu un problem et vos modifications n'ont pas été sauvegardées."
27
+
28
+ colon: ' :'
29
+ questionmark: ' ?'
30
+ view: 'voir'
4
31
 
@@ -1,3 +1,3 @@
1
1
  module TkhAdminPanel
2
- VERSION = "0.3"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -2,8 +2,6 @@ require "tkh_admin_panel/version"
2
2
  require 'bootstrap-sass'
3
3
  require 'simple_form'
4
4
  require 'tkh_admin_panel/tkh_admin_panel_action_controller_extension'
5
- # require 'bootstrap-wysihtml5-rails'
6
- # require 'tkh_inline_editor'
7
5
 
8
6
  module TkhAdminPanel
9
7
  class Engine < ::Rails::Engine
@@ -11,12 +11,6 @@ Gem::Specification.new do |gem|
11
11
  gem.add_dependency "railties", "~> 3.2"
12
12
  gem.add_dependency "bootstrap-sass", '~> 2.0'
13
13
  gem.add_dependency "simple_form", '~> 2.0'
14
- gem.add_dependency 'exception_notification'
15
-
16
- # This gem does not support p tags until wysihtml5 0.4 is released and linked to gem below
17
- # gem.add_dependency 'bootstrap-wysihtml5-rails'
18
- # try using my own tkh_inline_editor instead
19
- # gem.add_dependency 'tkh_inline_editor'
20
14
 
21
15
  gem.files = `git ls-files`.split($\)
22
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_admin_panel
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: 0.3.1
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-01-27 00:00:00.000000000 Z
12
+ date: 2013-01-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -59,22 +59,6 @@ dependencies:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '2.0'
62
- - !ruby/object:Gem::Dependency
63
- name: exception_notification
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
70
- type: :runtime
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
78
62
  description: Admin panel layout engine
79
63
  email:
80
64
  - swami@TenThousandHours.eu
@@ -94,12 +78,14 @@ files:
94
78
  - app/assets/javascripts/custom.js.coffee
95
79
  - app/assets/stylesheets/admin.css.scss
96
80
  - app/assets/stylesheets/bootstrap_and_overrides.css.scss
81
+ - app/assets/stylesheets/custom.css.scss
97
82
  - app/assets/stylesheets/united.css.scss
98
83
  - app/controllers/settings_controller.rb
99
84
  - app/mailers/admin_mailer.rb
100
85
  - app/models/setting.rb
101
86
  - app/views/admin_mailer/rescued_exceptions.text.erb
102
87
  - app/views/layouts/admin.html.erb
88
+ - app/views/settings/_tab_admin_menu.html.erb
103
89
  - app/views/settings/edit.html.erb
104
90
  - app/views/settings/show.html.erb
105
91
  - app/views/shared/_admin_sidebar.html.erb