muck-engine 0.2.23 → 0.2.24

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.23
1
+ 0.2.24
@@ -1,5 +1,7 @@
1
1
  class Admin::Muck::BaseController < ApplicationController
2
2
 
3
+ layout 'admin'
4
+
3
5
  before_filter :login_required
4
6
  before_filter :admin_access_required
5
7
 
@@ -0,0 +1,10 @@
1
+ class Admin::Muck::DefaultController < Admin::Muck::BaseController
2
+
3
+ def index
4
+ @page_title = translate('muck.engine.admin_home_title')
5
+ respond_to do |format|
6
+ format.html { render :template => 'admin/default/index' }
7
+ end
8
+ end
9
+
10
+ end
@@ -0,0 +1,7 @@
1
+ module MuckAdminHelper
2
+
3
+ def sub_navigation
4
+ render :partial => @sub_navigation_path if @sub_navigation_path
5
+ end
6
+
7
+ end
@@ -0,0 +1,5 @@
1
+ <% MuckEngine.muck_dashboard_items.each do |item| -%>
2
+ <div class="dashboard-widget span-6">
3
+ <%= render :partial => item.path, :locals => item.locals -%>
4
+ </div>
5
+ <% end -%>
@@ -6,7 +6,7 @@
6
6
  <body>
7
7
  <div class="container">
8
8
  <div id="header">
9
- <%= yield :header %>
9
+ <%= render :partial => 'layouts/admin/header' %>
10
10
  </div>
11
11
  <div id="content-wrapper">
12
12
  <div id="content">
@@ -0,0 +1,14 @@
1
+ <div id="admin-account" class="navigation span-24">
2
+ <ul>
3
+ <li><%=translate('muck.engine.admin_welcome', :user => current_user.display_name) %></li>
4
+ <li><%=link_to translate('muck.engine.admin_logout'), '/logout' %></li>
5
+ </ul>
6
+ </div>
7
+ <div id="main-navigation" class="navigation">
8
+ <ul id="admin-nav">
9
+ <%= render :partial => 'layouts/admin/header_nav_item', :collection => MuckEngine.muck_admin_nav_items %>
10
+ </ul>
11
+ </div>
12
+ <div id="sub-header" class="span-24">
13
+ <%= sub_navigation %>
14
+ </div>
@@ -0,0 +1,5 @@
1
+ <li id="<%=header_nav_item.name.parameterize%>">
2
+ <a style="background-image: url('<%=header_nav_item.image%>')" href="<%=header_nav_item.path %>">
3
+ <%= header_nav_item.name %>
4
+ </a>
5
+ </li>
@@ -8,7 +8,7 @@
8
8
  <%= stylesheet_link_tag 'blueprint/print.css', :media => "print" %>
9
9
  <!--[if IE]><link rel="stylesheet" href="/stylesheets/blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->
10
10
  <% if defined?(admin_layout) -%>
11
- <%= stylesheet_link_tag %W{ reset styles blueprint/liquid_screen.css }, :cache => true %>
11
+ <%= stylesheet_link_tag %W{ reset styles blueprint/liquid_screen.css admin }, :cache => true %>
12
12
  <% else -%>
13
13
  <%= stylesheet_link_tag %W{ reset styles blueprint/screen.css }, :cache => true %>
14
14
  <% end -%>
@@ -1,3 +1,7 @@
1
1
  ActionController::Routing::Routes.draw do |map|
2
2
  map.resources :helper, :controller => 'muck/helper', :collection => { :load_states_for_country => :get }
3
+
4
+ # admin
5
+ map.admin '/admin', :controller => 'admin/muck/default', :action => 'index'
6
+
3
7
  end
data/lib/muck_engine.rb CHANGED
@@ -2,6 +2,7 @@
2
2
  ActionController::Base.send :include, ActionController::MuckApplication
3
3
  ActiveRecord::Base.send :include, ActiveRecord::MuckModel
4
4
  ActionController::Base.send :helper, MuckEngineHelper
5
+ ActionController::Base.send :helper, MuckAdminHelper
5
6
 
6
7
  I18n.load_path += Dir[ File.join(File.dirname(__FILE__), '..', 'locales', '*.{rb,yml}') ]
7
8
  I18n.load_path += Dir[ File.join(File.dirname(__FILE__), '..', 'rails_i18n', '*.{rb,yml}') ]
@@ -14,4 +15,40 @@ Mime::Type.register_alias "text/html", :iphone
14
15
  # Use to determine whether or not ssl should be used
15
16
  def muck_routes_protocol
16
17
  @@routes_protocol ||= GlobalConfig.enable_ssl ? (ENV["RAILS_ENV"] =~ /(development|test)/ ? "http" : "https") : 'http'
17
- end
18
+ end
19
+
20
+ class MuckEngine
21
+
22
+ def self.muck_admin_nav_items
23
+ @@muck_admin_nav_items || []
24
+ end
25
+
26
+ # Add an item to the main admin navigation menu
27
+ # Paramters:
28
+ # name: Name for the link
29
+ # path: Url to link to
30
+ # image: Image for the link
31
+ def self.add_muck_admin_nav_item(name, path, image = '')
32
+ @@muck_admin_nav_items ||= []
33
+ @@muck_admin_nav_items << OpenStruct.new(:name => name,
34
+ :path => path,
35
+ :image => image)
36
+ end
37
+
38
+ def self.muck_dashboard_items
39
+ @@muck_dashboard_items || []
40
+ end
41
+
42
+ # Add an item to the admin dashboard
43
+ # path: Path to the partial
44
+ # locals: Hash of values to pass as locals to the partial
45
+ def self.add_muck_dashboard_item(path, locals = {})
46
+ @@muck_dashboard_items ||= []
47
+ @@muck_dashboard_items << OpenStruct.new(:path => path,
48
+ :locals => locals)
49
+ end
50
+
51
+ end
52
+
53
+ # Add a link to admin home
54
+ MuckEngine.add_muck_admin_nav_item(I18n.translate('muck.engine.admin_home'), '/admin', '/images/admin/home.gif')
@@ -219,15 +219,16 @@ end
219
219
  Factory.define :group do |f|
220
220
  f.creator {|a| a.association(:user)}
221
221
  f.name { Factory.next(:name) }
222
+ f.description { Factory.next(:description) }
222
223
  f.member_count 0
223
224
  end
224
225
 
225
- Factory.define :membership_requests do |f|
226
+ Factory.define :membership_request do |f|
226
227
  f.group {|a| a.association(:group)}
227
228
  f.user {|a| a.association(:user)}
228
229
  end
229
230
 
230
- Factory.define :memberships do |f|
231
+ Factory.define :membership do |f|
231
232
  f.group {|a| a.association(:group)}
232
233
  f.user {|a| a.association(:user)}
233
234
  f.banned false
data/locales/en.yml CHANGED
@@ -1,32 +1,39 @@
1
- en:
2
- muck:
1
+ ---
2
+ en:
3
+ muck:
3
4
  forms:
4
- please_enter_a_value: "Please enter a value for {{label}}"
5
- general:
6
- yes_text: 'Yes'
7
- no_text: 'No'
8
- save: Save
9
- disable: Enable
10
- enable: Disable
5
+ please_enter_a_value: Please enter a value for {{label}}
6
+ engine:
7
+ choose_state: Choose State
8
+ select_state_prompt: Please select a state
9
+ choose_language: Choose Language
10
+ admin_users: Users
11
+ choose_country: Choose Country
12
+ select_country_prompt: Please select a country
13
+ missing_parent_error: Please specify a parent object
14
+ admin_logout: Logout
15
+ admin_home: Home
16
+ admin_roles: Roles
17
+ admin_welcome: Welcome back {{user}}
18
+ admin_home_title: Admin Home
19
+ select_language_prompt: Please select a language
20
+ general:
21
+ no_text: "No"
11
22
  deactivate: Deactivate
12
- activate: Activate
13
- enabled: Enabled?
14
- general_info: General info
15
23
  help: Help
24
+ previous: "&laquo; Previous"
16
25
  settings_saved: Settings have been saved.
17
26
  delete: Delete
18
- update: Update
19
- previous: '&laquo; Previous'
20
- next: 'Next &raquo;'
21
27
  time_ago: "{{time_in_words}} ago"
22
- read_more: "read more"
23
- deleting: "Deleting..."
24
- loading: "Loading..."
25
- engine:
26
- choose_country: "Choose Country"
27
- select_country_prompt: "Please select a country"
28
- choose_state: "Choose State"
29
- select_state_prompt: "Please select a state"
30
- choose_language: "Choose Language"
31
- select_language_prompt: "Please select a language"
32
- missing_parent_error: "Please specify a parent object"
28
+ yes_text: "Yes"
29
+ enable: Disable
30
+ enabled: Enabled?
31
+ loading: Loading...
32
+ save: Save
33
+ disable: Enable
34
+ activate: Activate
35
+ next: Next &raquo;
36
+ general_info: General info
37
+ update: Update
38
+ read_more: read more
39
+ deleting: Deleting...
data/muck-engine.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{muck-engine}
8
- s.version = "0.2.23"
8
+ s.version = "0.2.24"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin Ball", "Joel Duffin"]
12
- s.date = %q{2010-01-06}
12
+ s.date = %q{2010-01-13}
13
13
  s.description = %q{The base engine for the muck system. Contains common tables, custom for, css and javascript.}
14
14
  s.email = %q{justin@tatemae.com}
15
15
  s.extra_rdoc_files = [
@@ -22,13 +22,16 @@ Gem::Specification.new do |s|
22
22
  "Rakefile",
23
23
  "VERSION",
24
24
  "app/controllers/admin/muck/base_controller.rb",
25
+ "app/controllers/admin/muck/default_controller.rb",
25
26
  "app/controllers/muck/helper_controller.rb",
27
+ "app/helpers/muck_admin_helper.rb",
26
28
  "app/helpers/muck_custom_form_builder.rb",
27
29
  "app/helpers/muck_engine_helper.rb",
28
30
  "app/models/basic_mailer.rb",
29
31
  "app/models/country.rb",
30
32
  "app/models/language.rb",
31
33
  "app/models/state.rb",
34
+ "app/views/admin/default/index.html.erb",
32
35
  "app/views/forms/_base_field.html.erb",
33
36
  "app/views/forms/_color_picker_field.html.erb",
34
37
  "app/views/forms/_default.html.erb",
@@ -37,6 +40,8 @@ Gem::Specification.new do |s|
37
40
  "app/views/forms/_menu_field.html.erb",
38
41
  "app/views/forms/_tips.html.erb",
39
42
  "app/views/layouts/admin.html.erb",
43
+ "app/views/layouts/admin/_header.html.erb",
44
+ "app/views/layouts/admin/_header_nav_item.html.erb",
40
45
  "app/views/layouts/default.html.erb",
41
46
  "app/views/layouts/email_default.text.html.erb",
42
47
  "app/views/layouts/email_default.text.plain.erb",
@@ -121,6 +126,8 @@ Gem::Specification.new do |s|
121
126
  "locales/zh-TW.yml",
122
127
  "locales/zh.yml",
123
128
  "muck-engine.gemspec",
129
+ "public/images/admin/Home.gif",
130
+ "public/images/admin/source/Home.png",
124
131
  "public/images/arrow_down.gif",
125
132
  "public/images/arrow_left.gif",
126
133
  "public/images/arrow_right.gif",
@@ -676,6 +683,7 @@ Gem::Specification.new do |s|
676
683
  "rails_i18n/pl.yml",
677
684
  "rails_i18n/pt-BR.yml",
678
685
  "rails_i18n/pt-PT.yml",
686
+ "rails_i18n/pt.yml",
679
687
  "rails_i18n/rm.yml",
680
688
  "rails_i18n/ro.yml",
681
689
  "rails_i18n/ru.yml",
Binary file
Binary file
@@ -1,12 +1,19 @@
1
- /* main-navigation */
2
- #main-navigation{float:left;display:inline;}
3
- #account-navigation {float:right;display:inline;}
4
-
5
- .navigation ul{float:left;margin:4px 0;padding:2px;display:inline;}
6
- .navigation ul li{float:left;padding:0 4px 0 10px;list-style:none;font-weight:bold;}
1
+ /* header */
2
+ #main-navigation{}
3
+ #account-navigation {}
4
+ .navigation ul{padding:2px;margin:0;}
5
+ .navigation ul li{list-style:none;font-weight:bold;display:inline-block;}
7
6
  .navigation ul li a{float:left;text-decoration:none;font-weight:bold;}
8
7
  .navigation ul li a:hover{text-decoration:underline;}
9
-
8
+ #header{height:90px;border-bottom:solid 2px #333;}
9
+ #admin-account{width:100%;float:right;}
10
+ #admin-account ul{float:right;}
11
+ #admin-account ul li{margin:1px;padding:0 4px;float:left;}
12
+ #admin-nav li a{background-repeat:no-repeat;height:20px;margin:0 4px;padding-top:35px;text-align:center;width:40px;}
13
+ #sub-header{width:100%;float:left;}
14
+ /* dashboard widgets */
15
+ .dashboard-widget{padding:5px;}
16
+ .dashboard-widget h2{font-size:12px;border-bottom:solid 1px #555;}
10
17
  /* themes */
11
18
  #current-theme{clear:both;float:left;width:100%;}
12
19
  .theme-block{width:250px;height:300px;float:left;clear:none;margin:10px;}
data/rails_i18n/bg.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  # Bulgarian localization for Ruby on Rails 2.2+
2
2
  # by Samson Behar <master.webmaster.master@gmail.com>
3
+ # Fixes by Yavor Ivanov, http://github.com/YavorIvanov
3
4
  #
4
5
  # Минимална локализация на приложения за поддръжка на български език.
5
6
 
@@ -117,6 +118,11 @@ bg:
117
118
  few: "{{count}} месеца"
118
119
  many: "{{count}} месеци"
119
120
  other: "{{count}} месеца"
121
+ almost_x_years:
122
+ one: "почти {{count}} година"
123
+ few: "почти {{count}} години"
124
+ many: "почти {{count}} години"
125
+ other: "почти {{count}} години"
120
126
  about_x_years:
121
127
  one: "около {{count}} година"
122
128
  few: "около {{count}} години"
data/rails_i18n/es-CO.yml CHANGED
@@ -88,7 +88,7 @@ es-CO:
88
88
  other: "{{model}} no pudo guardarse debido a {{count}} errores"
89
89
  body: "Revise que los siguientes campos sean válidos:"
90
90
  messages:
91
- record_invalid: "Falla de validación: {{errors}}"
91
+ record_invalid:"Falla de validación: {{errors}}"
92
92
  inclusion: "no está incluído en la lista"
93
93
  exclusion: "está reservado"
94
94
  invalid: "es inválido"
data/rails_i18n/fi.yml CHANGED
@@ -1,4 +1,4 @@
1
- # Finnish translations for Ruby on Rails
1
+ # Finnish translations for Ruby on Rails
2
2
  # by Marko Seppä (marko.seppa@gmail.com)
3
3
  #
4
4
  # corrected by Petri Kivikangas (pkivik@gmail.com)
@@ -10,7 +10,7 @@ fi:
10
10
  default: "%e. %Bta %Y"
11
11
  long: "%A %e. %Bta %Y"
12
12
  short: "%e.%m.%Y"
13
-
13
+
14
14
  day_names: [sunnuntai, maanantai, tiistai, keskiviikko, torstai, perjantai, lauantai]
15
15
  abbr_day_names: [su, ma, ti, ke, to, pe, la]
16
16
  month_names: [~, tammikuu, helmikuu, maaliskuu, huhtikuu, toukokuu, kesäkuu, heinäkuu, elokuu, syyskuu, lokakuu, marraskuu, joulukuu]
@@ -20,7 +20,7 @@ fi:
20
20
  time:
21
21
  formats:
22
22
  default: "%A %e. %Bta %Y %H:%M:%S %z"
23
- short: "%e.%m. %H:%M"
23
+ short: "%e.%m. %H.%M"
24
24
  long: "%e. %Bta %Y %H.%M"
25
25
  am: "aamupäivä"
26
26
  pm: "iltapäivä"
@@ -36,7 +36,7 @@ fi:
36
36
  separator: ","
37
37
  delimiter: "."
38
38
  precision: 3
39
-
39
+
40
40
  currency:
41
41
  format:
42
42
  format: "%n %u"
@@ -44,19 +44,19 @@ fi:
44
44
  separator: ","
45
45
  delimiter: "."
46
46
  precision: 2
47
-
47
+
48
48
  percentage:
49
49
  format:
50
50
  # separator:
51
51
  delimiter: ""
52
- # precision:
52
+ # precision:
53
53
 
54
54
  precision:
55
55
  format:
56
56
  # separator:
57
57
  delimiter: ""
58
58
  # precision:
59
-
59
+
60
60
  human:
61
61
  format:
62
62
  delimiter: ""
@@ -119,14 +119,14 @@ fi:
119
119
  support:
120
120
  select:
121
121
  prompt: "Valitse"
122
-
122
+
123
123
  # which one should it be
124
124
  #activemodel:
125
125
  activerecord:
126
126
  errors:
127
127
  template:
128
128
  header:
129
- one: "Virhe esti mallin {{model}} tallentamisen"
129
+ one: "Virhe syötteessä esti mallin {{model}} tallentamisen"
130
130
  other: "{{count}} virhettä esti mallin {{model}} tallentamisen"
131
131
  body: "Seuraavat kentät aiheuttivat ongelmia:"
132
132
  #activerecord:
data/rails_i18n/pt-BR.yml CHANGED
@@ -10,7 +10,7 @@ pt-BR:
10
10
  abbr_day_names: [Dom, Seg, Ter, Qua, Qui, Sex, Sáb]
11
11
  month_names: [~, Janeiro, Fevereiro, Março, Abril, Maio, Junho, Julho, Agosto, Setembro, Outubro, Novembro, Dezembro]
12
12
  abbr_month_names: [~, Jan, Fev, Mar, Abr, Mai, Jun, Jul, Ago, Set, Out, Nov, Dez]
13
- order: [ :day, :month, :year ]
13
+ order: [:day, :month, :year]
14
14
 
15
15
  time:
16
16
  formats:
@@ -20,7 +20,7 @@ pt-BR:
20
20
  am: ''
21
21
  pm: ''
22
22
 
23
- # date helper distanci em palavras
23
+ # distancia do tempo em palavras
24
24
  datetime:
25
25
  distance_in_words:
26
26
  half_a_minute: 'meio minuto'
@@ -63,6 +63,7 @@ pt-BR:
63
63
  over_x_years:
64
64
  one: 'mais de 1 ano'
65
65
  other: 'mais de {{count}} anos'
66
+
66
67
  prompts:
67
68
  year: "Ano"
68
69
  month: "Mês"
@@ -105,14 +106,14 @@ pt-BR:
105
106
  gb: "GB"
106
107
  tb: "TB"
107
108
 
108
- # Used in array.to_sentence.
109
+ # Usado no Array.to_sentence
109
110
  support:
110
111
  array:
111
112
  words_connector: ", "
112
113
  two_words_connector: " e "
113
114
  last_word_connector: " e "
114
115
 
115
- # Active Record
116
+ # ActiveRecord
116
117
  activerecord:
117
118
  errors:
118
119
  template:
data/rails_i18n/pt.yml ADDED
@@ -0,0 +1,220 @@
1
+ # Portuguese localization for Ruby on Rails
2
+ # by Ricardo Otero <oterosantos@gmail.com>
3
+ #
4
+ # This localization file targets Rails 2.3.2.
5
+ # If you need a previous version go to http://github.com/weppos/rails-i18n/
6
+ # and choose between available tags.
7
+ pt-PT:
8
+ # Used in array.to_sentence.
9
+ support:
10
+ # default value for :prompt => true in FormOptionsHelper
11
+ select:
12
+ # default value for :prompt => true in FormOptionsHelper
13
+ prompt: "Por favor seleccione"
14
+ array:
15
+ # Rails <= v.2.2.2
16
+ # sentence_connector: "y"
17
+ # Rails >= v.2.3
18
+ words_connector: ","
19
+ two_words_connector: "e"
20
+ last_word_connector: ", e"
21
+
22
+ date:
23
+ formats:
24
+ # Use the strftime parameters for formats.
25
+ # When no format has been given, it uses default.
26
+ # You can provide other formats here if you like!
27
+ default: "%d/%m/%Y"
28
+ short: "%d de %B"
29
+ long: "%d de %B de %Y"
30
+
31
+ day_names: [Domingo, Segunda, Terça, Quarta, Quinta, Sexta, Sábado]
32
+ abbr_day_names: [Dom, Seg, Ter, Qua, Qui, Sex, Sáb]
33
+
34
+ # Don't forget the nil at the beginning; there's no such thing as a 0th month
35
+ month_names: [~, Janeiro, Fevereiro, Março, Abril, Maio, Junho, Julho, Agosto, Setembro, Outubro, Novembro, Dezembro]
36
+ abbr_month_names: [~, Jan, Fev, Mar, Abr, Mai, Jun, Jul, Ago, Set, Out, Nov, Dez]
37
+ # Used in date_select and datime_select.
38
+ order: [:day, :month, :year]
39
+
40
+ time:
41
+ formats:
42
+ default: "%A, %d de %B de %Y, %H:%Mh"
43
+ short: "%d/%m, %H:%M hs"
44
+ long: "%A, %d de %B de %Y, %H:%Mh"
45
+ am: ''
46
+ pm: ''
47
+
48
+ # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
49
+ datetime:
50
+ distance_in_words:
51
+ half_a_minute: "meio minuto"
52
+ less_than_x_seconds:
53
+ one: "menos de 1 segundo"
54
+ other: "menos de {{count}} segundos"
55
+ x_seconds:
56
+ one: "1 segundo"
57
+ other: "{{count}} segundos"
58
+ less_than_x_minutes:
59
+ one: "menos de um minuto"
60
+ other: "menos de {{count}} minutos"
61
+ x_minutes:
62
+ one: "1 minuto"
63
+ other: "{{count}} minutos"
64
+ about_x_hours:
65
+ one: "aproximadamente 1 hora"
66
+ other: "aproximadamente {{count}} horas"
67
+ x_days:
68
+ one: "1 dia"
69
+ other: "{{count}} dias"
70
+ about_x_months:
71
+ one: "aproximadamente 1 mês"
72
+ other: "aproximadamente {{count}} meses"
73
+ x_months:
74
+ one: "1 mês"
75
+ other: "{{count}} meses"
76
+ about_x_years:
77
+ one: "aproximadamente 1 ano"
78
+ other: "aproximadamente {{count}} anos"
79
+ over_x_years:
80
+ one: "mais de 1 ano"
81
+ other: "mais de {{count}} anos"
82
+ almost_x_years:
83
+ one: "quase 1 ano"
84
+ other: "quase {{count}} years"
85
+ prompts:
86
+ year: "Ano"
87
+ month: "Mês"
88
+ day: "Dia"
89
+ hour: "Hora"
90
+ minute: "Minuto"
91
+ second: "Segundo"
92
+
93
+ number:
94
+ # Used in number_with_delimiter()
95
+ # These are also the defaults for 'currency', 'percentage', 'precision', and 'human'
96
+ format:
97
+ # Number of decimals, behind the separator (1 with a precision of 2 gives: 1.00)
98
+ precision: 3
99
+ # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5)
100
+ separator: ','
101
+ # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three)
102
+ delimiter: '.'
103
+
104
+ # Used in number_to_currency()
105
+ currency:
106
+ # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00)
107
+ format:
108
+ format: "%u%n"
109
+ unit: '€'
110
+ # These three are to override number.format and are optional
111
+ separator: ','
112
+ delimiter: '.'
113
+ precision: 2
114
+
115
+ # Used in number_to_percentage()
116
+ percentage:
117
+ format:
118
+ # These three are to override number.format and are optional
119
+ # separator:
120
+ delimiter: ''
121
+ # precision:
122
+
123
+ # Used in number_to_precision()
124
+ precision:
125
+ format:
126
+ # These three are to override number.format and are optional
127
+ # separator:
128
+ delimiter: ''
129
+ # precision:
130
+
131
+ # Used in number_to_human_size()
132
+ human:
133
+ format:
134
+ # These three are to override number.format and are optional
135
+ # separator:
136
+ delimiter: ''
137
+ precision: 1
138
+ # Rails <= v2.2.2
139
+ # storage_units: [Bytes, KB, MB, GB, TB]
140
+ # Rails >= v2.3
141
+ storage_units:
142
+ format: "%n %u"
143
+ units:
144
+ byte:
145
+ one: "Byte"
146
+ other: "Bytes"
147
+ kb: "KB"
148
+ mb: "MB"
149
+ gb: "GB"
150
+ tb: "TB"
151
+
152
+ activerecord:
153
+ errors:
154
+ template:
155
+ header:
156
+ one: "Não foi possível guardar {{model}}: 1 erro"
157
+ other: "Não foi possível guardar {{model}}: {{count}} erros"
158
+ # The variable :count is also available
159
+ body: "Por favor, verifique os seguintes campos:"
160
+ # The values :model, :attribute and :value are always available for interpolation
161
+ # The value :count is available when applicable. Can be used for pluralization.
162
+ messages:
163
+ inclusion: "não está incluído na lista"
164
+ exclusion: "não está disponível"
165
+ invalid: "não é válido"
166
+ confirmation: "não está de acordo com a confirmação"
167
+ accepted: "precisa de ser aceite"
168
+ empty: "não pode estar em branco"
169
+ blank: "não pode estar em branco"
170
+ too_long: "tem demasiados caracteres (máximo: {{count}} caracteres)"
171
+ too_short: "tem poucos caracteres (mínimo: {{count}} caracteres)"
172
+ wrong_length: "não é do tamanho correcto (necessita de ter {{count}} caracteres)"
173
+ taken: "não está disponível"
174
+ not_a_number: "não é um número"
175
+ greater_than: "tem de ser maior do que {{count}}"
176
+ greater_than_or_equal_to: "tem de ser maior ou igual a {{count}}"
177
+ equal_to: "tem de ser igual a {{count}}"
178
+ less_than: "tem de ser menor do que {{count}}"
179
+ less_than_or_equal_to: "tem de ser menor ou igual a {{count}}"
180
+ odd: "tem de ser ímpar"
181
+ even: "tem de ser par"
182
+ record_invalid: "A validação falhou: {{errors}}"
183
+ # Append your own errors here or at the model/attributes scope.
184
+
185
+ # You can define own errors for models or model attributes.
186
+ # The values :model, :attribute and :value are always available for interpolation.
187
+ #
188
+ # For example,
189
+ # models:
190
+ # user:
191
+ # blank: "This is a custom blank message for {{model}}: {{attribute}}"
192
+ # attributes:
193
+ # login:
194
+ # blank: "This is a custom blank message for User login"
195
+ # Will define custom blank validation message for User model and
196
+ # custom blank validation message for login attribute of User model.
197
+ #models:
198
+
199
+ # Translate model names. Used in Model.human_name().
200
+ #models:
201
+ # For example,
202
+ # user: "Dude"
203
+ # will translate User model name to "Dude"
204
+
205
+ # Translate model attribute names. Used in Model.human_attribute_name(attribute).
206
+ #attributes:
207
+ # For example,
208
+ # user:
209
+ # login: "Handle"
210
+ # will translate User attribute "login" as "Handle"
211
+
212
+
213
+ activemodel:
214
+ errors:
215
+ template:
216
+ header:
217
+ one: "Não foi possível guardar {{model}}: 1 erro"
218
+ other: "Não foi possível guardar {{model}}: {{count}} erros"
219
+ # The variable :count is also available
220
+ body: "Por favor, verifique os seguintes campos:"
data/rails_i18n/sv-SE.yml CHANGED
@@ -117,6 +117,9 @@
117
117
 
118
118
  activerecord:
119
119
  errors:
120
+ # model.errors.full_messages format.
121
+ format: "{{attribute}} {{message}}"
122
+
120
123
  # The values :model, :attribute and :value are always available for interpolation
121
124
  # The value :count is available when applicable. Can be used for pluralization.
122
125
  messages:
data/rails_i18n/th.rb CHANGED
@@ -1,110 +1,131 @@
1
1
  # Thai translation for Ruby on Rails
2
2
  # original by Prem Sichanugrist (s@sikachu.com/sikandsak@gmail.com)
3
3
  # activerecord keys fixed by Jittat Fakcharoenphol (jittat@gmail.com)
4
+ #
5
+ # Note: You must install i18n gem in order to use this language pack.
6
+ # If you're calling I18n.localize(Time.now), the year will be in Bhuddhist calendar
4
7
 
5
- {
8
+ {
6
9
  :'th' => {
7
- :date => {
8
- :formats => {
9
- :default => lambda { |date| "%d-%m-#{date.year+543}" },
10
- :short => "%e %b",
11
- :long => lambda { |date| "%e %B #{date.year+543}" },
12
- :long_ordinal => lambda { |date| "%e %B #{date.year+543}" },
13
- :only_day => "%e"
14
- },
15
- :day_names => %w(อาทิตย์ จันทร์ อังคาร พุธ พฤหัสบดี ศุกร์ เสาร์),
16
- :abbr_day_names => %w(อา จ อ พ พฤ ศ ส),
17
- :month_names => [nil] + %w(มกราคม กุมภาพันธ์ มีนาคม เมษายน พฤษภาคม มิถุนายน กรกฎาคม สิงหาคม กันยายน ตุลาคม พฤศจิกายน ธันวาคม),
18
- :abbr_month_names => [nil] + %w(ม.ค. ก.พ. มี.ค. เม.ย. พ.ค. มิ.ย. ก.ค. ส.ค. ก.ย. ต.ค. พ.ย. ธ.ค.),
19
- :order => [:day, :month, :year]
20
- },
21
- :time => {
22
- :formats => {
23
- :default => lambda { |time| "%a %d %b #{time.year+543} %H:%M:%S %Z" },
24
- :time => "%H:%M น.",
25
- :short => "%d %b %H:%M น.",
26
- :long => lambda { |time| "%d %B #{time.year+543} %H:%M น." },
27
- :long_ordinal => lambda { |time| "%d %B #{time.year+543} %H:%M น." },
28
- :only_second => "%S"
29
- },
30
- :time_with_zone => {
31
- :formats => {
32
- :default => lambda { |time| "%Y-%m-%d %H:%M:%S #{time.formatted_offset(false, 'UTC')}" }
33
- }
34
- },
35
- :am => '',
36
- :pm => ''
37
- },
38
- :datetime => {
39
- :formats => {
40
- :default => "%Y-%m-%dT%H:%M:%S%Z"
41
- },
42
- :distance_in_words => {
43
- :half_a_minute => 'ครึ่งนาทีที่ผ่านมา',
44
- :less_than_x_seconds => 'น้อยกว่า {{count}} วินาที',
45
- :x_seconds => '{{count}} วินาที',
46
- :less_than_x_minutes => 'น้อยกว่า {{count}} วินาที',
47
- :x_minutes => '{{count}} นาที',
48
- :about_x_hours => 'ประมาณ {{count}} ชั่วโมง',
49
- :x_hours => '{{count}} ชั่วโมง',
50
- :about_x_days => 'ประมาณ {{count}} วัน',
51
- :x_days => '{{count}} วัน',
52
- :about_x_months => 'ประมาณ {{count}} เดือน',
53
- :x_months => '{{count}} เดือน',
54
- :about_x_years => 'ประมาณ {{count}} ปี',
55
- :over_x_years => 'เกิน {{count}} ปี'
56
- }
57
- },
58
-
59
- # numbers
60
10
  :number => {
11
+ # Used in number_with_delimiter()
12
+ # These are also the defaults for 'currency', 'percentage', 'precision', and 'human'
61
13
  :format => {
62
- :precision => 3,
63
- :separator => '.',
64
- :delimiter => ','
14
+ # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5)
15
+ :separator => ".",
16
+ # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three)
17
+ :delimiter => ",",
18
+ # Number of decimals, behind the separator (the number 1 with a precision of 2 :gives => 1.00)
19
+ :precision => 3
65
20
  },
21
+
22
+ # Used in number_to_currency()
66
23
  :currency => {
67
24
  :format => {
68
- :unit => 'Baht',
69
- :precision => 2,
70
- :format => '%n %u'
25
+ # Where is the currency sign? %u is the currency unit, %n the number :(default => $5.00)
26
+ :format => "%n %u",
27
+ :unit => "บาท",
28
+ # These three are to override number.format and are optional
29
+ :separator => ".",
30
+ :delimiter => ",",
31
+ :precision => 2
71
32
  }
72
33
  },
34
+
35
+ # Used in number_to_percentage()
36
+ :percentage => {
37
+ :format => {
38
+ # These three are to override number.format and are optional
39
+ # :separator => ".",
40
+ :delimiter => "",
41
+ # :precision => 3
42
+ }
43
+ },
44
+
45
+ # Used in number_to_precision()
46
+ :precision => {
47
+ :format => {
48
+ # These three are to override number.format and are optional
49
+ # :separator => ".",
50
+ :delimiter => "",
51
+ # :precision => 3
52
+ }
53
+ },
54
+
55
+ # Used in number_to_human_size()
73
56
  :human => {
74
57
  :format => {
75
- :precision => 1,
76
- :delimiter => ''
58
+ # These three are to override number.format and are optional
59
+ # :separator => ".",
60
+ :delimiter => ",",
61
+ :precision => 1
77
62
  },
78
- :storage_units => {
79
- :format => "%n %u",
80
- :units => {
81
- :byte => "B",
82
- :kb => "KB",
83
- :mb => "MB",
84
- :gb => "GB",
85
- :tb => "TB",
86
- }
87
- }
63
+
64
+ :storage_units => {
65
+ # Storage units output formatting.
66
+ # %u is the storage unit, %n is the number :(default => 2 MB)
67
+ :format => "%n %u",
68
+ :units => {
69
+ :byte => {
70
+ :one => "Byte",
71
+ :other => "Bytes"
72
+ },
73
+ :kb => "KB",
74
+ :mb => "MB",
75
+ :gb => "GB",
76
+ :tb => "TB"
77
+ }
78
+ }
79
+ }
80
+ },
81
+
82
+ # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
83
+ :datetime => {
84
+ :distance_in_words => {
85
+ :half_a_minute => "ครึ่งนาที",
86
+ :less_than_x_seconds => "น้อยกว่า {{count}} วินาที",
87
+ :x_seconds => "{{count}} วินาที",
88
+ :less_than_x_minutes => "น้อยกว่า {{count}} นาที",
89
+ :x_minutes => "{{count}} นาที",
90
+ :about_x_hours => "ประมาณ {{count}} ชั่วโมง",
91
+ :x_days => "{{count}} วัน",
92
+ :about_x_months => "ประมาณ {{count}} เดือน",
93
+ :x_months => "{{count}} เดือน",
94
+ :about_x_years => "ประมาณ {{count}} ปี",
95
+ :over_x_years => "มากกว่า {{count}} ปี",
96
+ :almost_x_years => "เกือบ {{count}} ปี",
88
97
  },
98
+ :prompts => {
99
+ :year => "ปี",
100
+ :month => "เดือน",
101
+ :day => "วัน",
102
+ :hour => "ชั่วโมง",
103
+ :minute => "นาที",
104
+ :second => "วินาที",
105
+ }
89
106
  },
90
107
 
91
- # Active Record
92
- :activerecord => {
108
+ :activemodel => {
93
109
  :errors => {
94
110
  :template => {
95
- :header => {
96
- :one => "ไม่สามารถบันทึก {{model}} ได้เนื่องจากเกิดข้อผิดพลาด",
97
- :other => "ไม่สามารถบันทึก {{model}} ได้เนื่องจากเกิด {{count}} ข้อผิดพลาด"
98
- },
99
- :body => "โปรดตรวจสอบข้อมูลที่คุณกรอกในช่องต่อไปนี้:"
100
- },
111
+ :header => "พบข้อผิดพลาด {{count}} ประการ ทำให้ไม่สามารถบันทึก{{model}}ได้",
112
+ # The variable :count is also available
113
+ :body => "โปรดตรวจสอบข้อมูลต่อไปนี้:"
114
+ }
115
+ }
116
+ },
117
+
118
+ :activerecord => {
119
+ :errors => {
120
+ # The values :model, :attribute and :value are always available for interpolation
121
+ # The value :count is available when applicable. Can be used for pluralization.
101
122
  :messages => {
102
- :inclusion => "ไม่ได้อยู่ในลิสต์",
103
- :exclusion => "ถูกจองเอาไว้แล้ว",
123
+ :inclusion => "ไม่ได้อยู่ในรายการ",
124
+ :exclusion => "ไม่อนุญาตให้ใช้",
104
125
  :invalid => "ไม่ถูกต้อง",
105
126
  :confirmation => "ไม่ตรงกับการยืนยัน",
106
- :accepted => "ต้องอยู่ในรูปแบบที่ยอมรับ",
107
- :empty => "ต้องไม้เว้นว่างเอาไว้",
127
+ :accepted => "ต้องถูกยอมรับ",
128
+ :empty => "ต้องไม่เว้นว่างเอาไว้",
108
129
  :blank => "ต้องไม่เว้นว่างเอาไว้",
109
130
  :too_long => "ยาวเกินไป (ต้องไม่เกิน {{count}} ตัวอักษร)",
110
131
  :too_short => "สั้นเกินไป (ต้องยาวกว่า {{count}} ตัวอักษร)",
@@ -113,14 +134,89 @@
113
134
  :not_a_number => "ไม่ใช่ตัวเลข",
114
135
  :greater_than => "ต้องมากกว่า {{count}}",
115
136
  :greater_than_or_equal_to => "ต้องมากกว่าหรือเท่ากับ {{count}}",
116
- :equal_to => "ต้องเท่ากับ {{count}}",
117
- :less_than => "ต้องน้อยกว่า {{count}}",
118
- :less_than_or_equal_to => "ต้องน้อยกว่าหรือเท่ากับ {{count}}",
119
- :odd => "ต้องเป็นเลขคี่",
120
- :even => "ต้องเป็นเลขคู่"
121
- }
137
+ :equal_to => "ต้องมีค่าเท่ากับ {{count}}",
138
+ :less_than => "ต้องมีค่าน้อยกว่า {{count}}",
139
+ :less_than_or_equal_to => "ต้องมีค่าน้อยกว่าหรือเท่ากับ {{count}}",
140
+ :odd => "ต้องเป็นจำนวนคี่",
141
+ :even => "ต้องเป็นจำนวนคู่",
142
+ :record_invalid => "ไม่ผ่านการตรวจสอบ: {{errors}}"
143
+ # Append your own errors here or at the model/attributes scope.
144
+ },
145
+
146
+ # You can define own errors for models or model attributes.
147
+ # The values :model, :attribute and :value are always available for interpolation.
148
+ #
149
+ # For example,
150
+ # :models =>
151
+ # :user =>
152
+ # :blank => "This is a custom blank message for :{{model}} => {{attribute}}"
153
+ # :attributes =>
154
+ # :login =>
155
+ # :blank => "This is a custom blank message for User login"
156
+ # Will define custom blank validation message for User model and
157
+ # custom blank validation message for login attribute of User model.
158
+ # models => {
159
+ #
160
+ # },
161
+ },
162
+
163
+ # Translate model names. Used in Model.human_name().
164
+ # :models => {
165
+ # For example,
166
+ # :user => "Dude"
167
+ # will translate User model name to "Dude"
168
+ # },
169
+
170
+ # Translate model attribute names. Used in Model.human_attribute_name(attribute).
171
+ # :attributes => {
172
+ # For example,
173
+ # :user =>
174
+ # :login => "Handle"
175
+ # will translate User attribute "login" as "Handle"
176
+ # },
177
+ },
178
+
179
+ :date => {
180
+ :formats => {
181
+ # Use the strftime parameters for formats.
182
+ # When no format has been given, it uses default.
183
+ # You can provide other formats here if you like!
184
+ :default => lambda { |date, opts| "%d-%m-#{date.year + 543}" },
185
+ :short => "%e %b",
186
+ :long => lambda { |date, opts| "%e %B #{date.year + 543}" },
187
+ },
188
+
189
+ :day_names => ["อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัสบดี", "ศุกร์", "เสาร์"],
190
+ :abbr_day_names => ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส"],
191
+
192
+ # Don't forget the nil at the beginning; there's no such thing as a 0th month
193
+ :month_names => [nil, "มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"],
194
+ :abbr_month_names => [nil, "ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."],
195
+ # Used in date_select and datime_select.
196
+ :order => [ :day, :month, :year ]
197
+ },
198
+
199
+ :time => {
200
+ :formats => {
201
+ :default => lambda { |date, opts| "%a %d %b #{date.year + 543} %H:%M:%S %z" },
202
+ :short => "%e %b %H:%M น.",
203
+ :long => lambda { |date, opts| "%e %B #{date.year + 543} %H:%M น." },
204
+ },
205
+ :am => "",
206
+ :pm => "",
207
+ },
208
+
209
+ # Used in array.to_sentence.
210
+ :support => {
211
+ :array => {
212
+ :words_connector => ", ",
213
+ :two_words_connector => " และ ",
214
+ :last_word_connector => ", และ ",
215
+ },
216
+ :select => {
217
+ # default value for :prompt => true in FormOptionsHelper
218
+ :prompt => "โปรดเลือก"
122
219
  }
123
220
  }
124
221
  }
125
- }
126
-
222
+ }
data/rails_i18n/zh-CN.yml CHANGED
@@ -109,6 +109,7 @@
109
109
  other: "有 {{count}} 个错误发生导致「{{model}}」无法被保存。"
110
110
  body: "如下字段出现错误:"
111
111
  messages:
112
+ record_invalid: "交验失败: {{errors}}"
112
113
  inclusion: "不包含于列表中"
113
114
  exclusion: "是保留关键字"
114
115
  invalid: "是无效的"
@@ -128,6 +129,3 @@
128
129
  less_than_or_equal_to: "必须小于或等于 {{count}}"
129
130
  odd: "必须为单数"
130
131
  even: "必须为双数"
131
-
132
-
133
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muck-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.23
4
+ version: 0.2.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Ball
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-01-06 00:00:00 -07:00
13
+ date: 2010-01-13 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -58,13 +58,16 @@ files:
58
58
  - Rakefile
59
59
  - VERSION
60
60
  - app/controllers/admin/muck/base_controller.rb
61
+ - app/controllers/admin/muck/default_controller.rb
61
62
  - app/controllers/muck/helper_controller.rb
63
+ - app/helpers/muck_admin_helper.rb
62
64
  - app/helpers/muck_custom_form_builder.rb
63
65
  - app/helpers/muck_engine_helper.rb
64
66
  - app/models/basic_mailer.rb
65
67
  - app/models/country.rb
66
68
  - app/models/language.rb
67
69
  - app/models/state.rb
70
+ - app/views/admin/default/index.html.erb
68
71
  - app/views/forms/_base_field.html.erb
69
72
  - app/views/forms/_color_picker_field.html.erb
70
73
  - app/views/forms/_default.html.erb
@@ -73,6 +76,8 @@ files:
73
76
  - app/views/forms/_menu_field.html.erb
74
77
  - app/views/forms/_tips.html.erb
75
78
  - app/views/layouts/admin.html.erb
79
+ - app/views/layouts/admin/_header.html.erb
80
+ - app/views/layouts/admin/_header_nav_item.html.erb
76
81
  - app/views/layouts/default.html.erb
77
82
  - app/views/layouts/email_default.text.html.erb
78
83
  - app/views/layouts/email_default.text.plain.erb
@@ -157,6 +162,8 @@ files:
157
162
  - locales/zh-TW.yml
158
163
  - locales/zh.yml
159
164
  - muck-engine.gemspec
165
+ - public/images/admin/Home.gif
166
+ - public/images/admin/source/Home.png
160
167
  - public/images/arrow_down.gif
161
168
  - public/images/arrow_left.gif
162
169
  - public/images/arrow_right.gif
@@ -712,6 +719,7 @@ files:
712
719
  - rails_i18n/pl.yml
713
720
  - rails_i18n/pt-BR.yml
714
721
  - rails_i18n/pt-PT.yml
722
+ - rails_i18n/pt.yml
715
723
  - rails_i18n/rm.yml
716
724
  - rails_i18n/ro.yml
717
725
  - rails_i18n/ru.yml