backlog 0.35.5 → 0.36.2
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/Gemfile +19 -0
- data/Gemfile~ +4 -0
- data/History.txt +25 -0
- data/Rakefile +3 -3
- data/app/controllers/{application.rb → application_controller.rb} +1 -2
- data/app/controllers/backlogs_controller.rb +0 -16
- data/app/controllers/search_controller.rb +0 -2
- data/app/controllers/user_controller.rb +7 -7
- data/app/controllers/work_locks_controller.rb +2 -2
- data/app/controllers/works_controller.rb +23 -23
- data/app/helpers/application_helper.rb +9 -6
- data/app/helpers/backlogs_helper.rb +1 -1
- data/app/helpers/periods_helper.rb +1 -1
- data/app/models/backlog.rb +13 -10
- data/app/models/period.rb +0 -5
- data/app/models/sidebar.rb +1 -0
- data/app/models/task.rb +4 -10
- data/app/models/user.rb +5 -6
- data/app/models/user_notify.rb +0 -1
- data/app/models/work.rb +20 -25
- data/app/models/works_report_filter.rb +4 -4
- data/app/views/backlogs/_buttons.rhtml +1 -1
- data/app/views/backlogs/_form.rhtml +5 -9
- data/app/views/layouts/_left_top.rhtml +0 -1
- data/app/views/periods/_form.rhtml +1 -1
- data/app/views/search/results.rhtml +1 -12
- data/app/views/task_notify/{invite_en.rhtml → invite.en.html.erb} +0 -0
- data/app/views/task_notify/{invite_no.rhtml → invite.no.html.erb} +0 -0
- data/app/views/tasks/_task.rhtml +49 -50
- data/app/views/tasks/edit.rhtml +4 -4
- data/app/views/tasks/start_work.rjs +1 -1
- data/app/views/user/_edit.rhtml +1 -1
- data/app/views/user/change_password.rhtml +1 -1
- data/app/views/user/edit.rhtml +4 -4
- data/app/views/user/signup.rhtml +2 -2
- data/app/views/user_notify/{change_password_en.rhtml → change_password.en.html.erb} +0 -0
- data/app/views/user_notify/{change_password_no.rhtml → change_password.no.html.erb} +0 -0
- data/app/views/user_notify/{forgot_password_en.rhtml → forgot_password.en.html.erb} +0 -0
- data/app/views/user_notify/{forgot_password_no.rhtml → forgot_password.no.html.erb} +0 -0
- data/app/views/user_notify/{monitoring_en.rhtml → monitoring.en.html.erb} +0 -0
- data/app/views/user_notify/{monitoring_no.rhtml → monitoring.no.html.erb} +0 -0
- data/app/views/user_notify/{monitoring_invitation_en.rhtml → monitoring_invitation.en.html.erb} +0 -0
- data/app/views/user_notify/{monitoring_invitation_no.rhtml → monitoring_invitation.no.html.erb} +0 -0
- data/app/views/user_notify/{signup_en.rhtml → signup.en.html.erb} +0 -0
- data/app/views/user_notify/{signup_no.rhtml → signup.no.html.erb} +0 -0
- data/app/views/work_lock_notify/{lock_en.rhtml → lock.en.html.erb} +0 -0
- data/app/views/work_lock_notify/{lock_no.rhtml → lock.no.html.erb} +0 -0
- data/app/views/work_lock_notify/{nag_en.rhtml → nag.en.html.erb} +0 -0
- data/app/views/work_lock_notify/{nag_no.rhtml → nag.no.html.erb} +0 -0
- data/app/views/works/_form.rhtml +6 -6
- data/app/views/works/_new_row.rhtml +6 -6
- data/app/views/works/_row.rhtml +2 -2
- data/app/views/works/daily_work_sheet.rhtml +1 -1
- data/app/views/works/list.rhtml +6 -6
- data/app/views/works/list_excel.rhtml +8 -4
- data/app/views/works/timeliste.rhtml +14 -14
- data/app/views/works/update_row.rjs +1 -1
- data/app/views/works/weekly_work_sheet.rhtml +5 -5
- data/app/views/works/weekly_work_sheet_details.rhtml +5 -5
- data/config/boot.rb +108 -27
- data/config/database.yml +3 -26
- data/config/environment.rb +4 -12
- data/config/environments/development.rb +0 -1
- data/config/initializers/jdbc.rb +7 -0
- data/config/initializers/mongrel.rb +83 -0
- data/config/locales/en.yml +189 -0
- data/config/locales/no.yml +192 -0
- data/config/preinitializer.rb +20 -0
- data/cruise_build.sh +10 -0
- data/cruise_config.rb +1 -1
- data/db/migrate/20100720124707_merge_work_account_into_backlog.rb +74 -0
- data/db/schema.rb +93 -127
- data/lib/class_table_inheritance.rb +53 -11
- data/lib/tasks/jdbc.rake +8 -0
- data/lib/user_system.rb +5 -1
- data/public/javascripts/controls.js +76 -79
- data/public/javascripts/dragdrop.js +166 -167
- data/public/javascripts/effects.js +174 -168
- data/public/javascripts/prototype.js +470 -334
- data/public/stylesheets/mwrt002.css +6 -6
- data/script/dbconsole +3 -0
- data/test/fixtures/backlogs.yml +2 -2
- data/test/fixtures/work_lock_subscriptions.yml +2 -2
- data/test/fixtures/works.yml +6 -6
- data/test/functional/absences_controller_test.rb +1 -1
- data/test/functional/backlogs_controller_test.rb +4 -4
- data/test/functional/customers_controller_test.rb +1 -1
- data/test/functional/dashboard_controller_test.rb +1 -1
- data/test/functional/estimates_controller_test.rb +1 -1
- data/test/functional/groups_controller_test.rb +1 -1
- data/test/functional/parties_controller_test.rb +1 -1
- data/test/functional/periods_controller_test.rb +1 -1
- data/test/functional/public_holidays_controller_test.rb +1 -1
- data/test/functional/search_controller_test.rb +1 -1
- data/test/functional/task_files_controller_test.rb +1 -1
- data/test/functional/tasks_controller_test.rb +6 -6
- data/test/functional/user_controller_test.rb +3 -2
- data/test/functional/welcome_controller_test.rb +1 -1
- data/test/functional/work_locks_controller_test.rb +1 -1
- data/test/functional/works_controller_test.rb +11 -11
- data/test/test_helper.rb +2 -2
- data/test/unit/absence_test.rb +1 -1
- data/test/unit/configuration_test.rb +1 -1
- data/test/unit/customer_test.rb +1 -1
- data/test/unit/estimate_test.rb +1 -1
- data/test/unit/group_test.rb +1 -1
- data/test/unit/party_test.rb +1 -1
- data/test/unit/period_test.rb +1 -1
- data/test/unit/public_holiday_test.rb +1 -1
- data/test/unit/task_file_test.rb +1 -1
- data/test/unit/task_test.rb +1 -1
- data/test/unit/user_test.rb +1 -1
- data/test/unit/work_lock_subscription_test.rb +1 -1
- data/test/unit/work_lock_test.rb +1 -1
- data/test/unit/work_test.rb +8 -8
- data/vendor/plugins/acts_as_list/lib/active_record/acts/list.rb +3 -3
- data/vendor/plugins/assert_cookie/lib/assert_cookie.rb +2 -2
- data/vendor/plugins/auto_complete/README +23 -0
- data/vendor/plugins/auto_complete/Rakefile +22 -0
- data/vendor/plugins/auto_complete/init.rb +2 -0
- data/vendor/plugins/auto_complete/lib/auto_complete.rb +47 -0
- data/vendor/plugins/auto_complete/lib/auto_complete_macros_helper.rb +143 -0
- data/vendor/plugins/auto_complete/test/auto_complete_test.rb +67 -0
- data/vendor/plugins/backlog_jira/init.rb +4 -0
- data/vendor/plugins/backlog_jira/{tasks → lib/tasks}/backlog_jira_tasks.rake +0 -0
- data/vendor/plugins/has_history/{tasks → lib/tasks}/has_history_tasks.rake +0 -0
- metadata +745 -817
- data/#SearchRequest.xml# +0 -3443
- data/app/controllers/application.rb~ +0 -207
- data/app/controllers/work_accounts_controller.rb +0 -58
- data/app/helpers/work_accounts_helper.rb +0 -2
- data/app/models/work_account.rb +0 -18
- data/app/models/work_lock_subscription.rb +0 -3
- data/app/views/work_accounts/_form.rhtml +0 -16
- data/app/views/work_accounts/_name_list.rhtml +0 -5
- data/app/views/work_accounts/_title.rhtml +0 -5
- data/app/views/work_accounts/edit.rhtml +0 -12
- data/app/views/work_accounts/list.rhtml +0 -31
- data/app/views/work_accounts/new.rhtml +0 -10
- data/app/views/work_accounts/show.rhtml +0 -50
- data/config/environments/localization_environment.rb +0 -10
- data/jira.log +0 -98246
- data/lang/en.yaml +0 -147
- data/lang/localizations.yaml +0 -2
- data/lang/no.yaml +0 -146
- data/lib/localization.rb +0 -88
- data/test/fixtures/work_accounts.yml +0 -7
- data/test/functional/work_accounts_controller_test.rb +0 -94
- data/test/unit/localization_test.rb +0 -47
- data/test/unit/work_account_test.rb +0 -10
data/lang/en.yaml
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
file_charset: utf-8
|
|
2
|
-
|
|
3
|
-
abort: Abort
|
|
4
|
-
aborted: Aborted
|
|
5
|
-
absent: Absent
|
|
6
|
-
account: Account
|
|
7
|
-
active: Active
|
|
8
|
-
administration: Administration
|
|
9
|
-
all: All
|
|
10
|
-
all_accounts: all accounts
|
|
11
|
-
assigned_to: Assigned to
|
|
12
|
-
back: Back
|
|
13
|
-
backlog: Backlog
|
|
14
|
-
backlog_description: Task list with ordering and status tracking
|
|
15
|
-
backlogs: Backlogs
|
|
16
|
-
burn_down_chart: Burn Down Chart
|
|
17
|
-
cannot_find_user: Cannot find user %s
|
|
18
|
-
change_password: Change Password
|
|
19
|
-
complete: Complete
|
|
20
|
-
completed: Completed
|
|
21
|
-
completed_at: Ended at
|
|
22
|
-
completed_tasks: Completed Tasks
|
|
23
|
-
confirmation: Are you sure?
|
|
24
|
-
created_by: Created by
|
|
25
|
-
customer: Customer
|
|
26
|
-
daily_work_sheet: Daily work sheet
|
|
27
|
-
dashboard: Dashboard
|
|
28
|
-
delete: Delete
|
|
29
|
-
description: Description
|
|
30
|
-
details: Details
|
|
31
|
-
done: Done
|
|
32
|
-
down: Down
|
|
33
|
-
edit: Edit
|
|
34
|
-
editing: Editing
|
|
35
|
-
empty_work_record: Empty work record
|
|
36
|
-
enable_customer: Enable customer
|
|
37
|
-
enable_invoicing: Enable invoicing
|
|
38
|
-
enable_periods: Enable Sprints
|
|
39
|
-
enable_subtasks: Enable Subtasks
|
|
40
|
-
enable_users: Enable users
|
|
41
|
-
end_on: End on
|
|
42
|
-
end_work: Stop
|
|
43
|
-
estimate: Estimate
|
|
44
|
-
experimental: Experimental!
|
|
45
|
-
files: Files
|
|
46
|
-
friday: Friday
|
|
47
|
-
grab_task: Grab task
|
|
48
|
-
grabbed_by_you: Grabbed by you
|
|
49
|
-
group: Group
|
|
50
|
-
groups: Groups
|
|
51
|
-
holiday: Holiday
|
|
52
|
-
holidays_used: Holidays used
|
|
53
|
-
home: Home
|
|
54
|
-
hours: Hours
|
|
55
|
-
hours_last_month: Hours last month
|
|
56
|
-
hours_last_week: Hours last week
|
|
57
|
-
hours_this_month: Hours this month
|
|
58
|
-
hours_this_week: Hours this week
|
|
59
|
-
hours_today: Hours today
|
|
60
|
-
invite: Invite
|
|
61
|
-
invoice: Invoice
|
|
62
|
-
invoice_code: Invoice Code
|
|
63
|
-
invoice_short: Inv.
|
|
64
|
-
left: Left
|
|
65
|
-
listing_works: Recorded work
|
|
66
|
-
lock: Lock
|
|
67
|
-
log_in: Log in
|
|
68
|
-
log_out: Log out
|
|
69
|
-
main_backlog: Main Backlog
|
|
70
|
-
members: Members
|
|
71
|
-
monday: Monday
|
|
72
|
-
move_to_bottom: Move task to bottom of list
|
|
73
|
-
move_to_next_period: Move task to next sprint
|
|
74
|
-
move_to_top: Move task to top of list
|
|
75
|
-
moved: Moved
|
|
76
|
-
name: Name
|
|
77
|
-
new_backlog: Start new backlog
|
|
78
|
-
new_customer: Add new customer
|
|
79
|
-
new_group: Form new group
|
|
80
|
-
new_period: Add new sprint
|
|
81
|
-
new_task: Add new task
|
|
82
|
-
new_work: Add new work record
|
|
83
|
-
new_work_account: Add new work account
|
|
84
|
-
next: Next
|
|
85
|
-
no_backlog: No Backlog
|
|
86
|
-
no_pending_tasks: There are no pending tasks in this sprint.
|
|
87
|
-
no_pending_tasks_in_backlog: There are no pending tasks in this backlog.
|
|
88
|
-
not_grabbed: Not grabbed by anyone
|
|
89
|
-
notes: Notes
|
|
90
|
-
ownership: Ownership
|
|
91
|
-
paging: Paging
|
|
92
|
-
password: Password
|
|
93
|
-
period: Sprint
|
|
94
|
-
periods: Sprints
|
|
95
|
-
please_login: Please login
|
|
96
|
-
position: Position
|
|
97
|
-
postponed: Postponed
|
|
98
|
-
previous: Previous
|
|
99
|
-
previous_abr: Prev.
|
|
100
|
-
projection: Projection
|
|
101
|
-
public_holiday: Public Holiday
|
|
102
|
-
release_task: Release task
|
|
103
|
-
reopen: Reopen task
|
|
104
|
-
resolution: Resolution
|
|
105
|
-
resolution_abr: Res.
|
|
106
|
-
right: Right
|
|
107
|
-
saturday: Saturday
|
|
108
|
-
save: Save
|
|
109
|
-
search: Search
|
|
110
|
-
search_results_for: "Search results for '%s'"
|
|
111
|
-
select: Select
|
|
112
|
-
shortcuts: Shortcuts
|
|
113
|
-
sick_days_used: Sick days
|
|
114
|
-
signup: Sign Up
|
|
115
|
-
specify: Specify
|
|
116
|
-
spreadsheet: Spreadsheet
|
|
117
|
-
start: Start
|
|
118
|
-
start_on: Start on
|
|
119
|
-
start_work: Start
|
|
120
|
-
started_at: Started at
|
|
121
|
-
started_tasks: Started tasks
|
|
122
|
-
stop: Stop
|
|
123
|
-
work_lock_subscriptions: Work Lock Subscriptions
|
|
124
|
-
sunday: Sunday
|
|
125
|
-
task: Task
|
|
126
|
-
tasks: Tasks
|
|
127
|
-
thursday: Thursday
|
|
128
|
-
todo: Todo
|
|
129
|
-
total: Total
|
|
130
|
-
totals: Totals
|
|
131
|
-
track_todo: Estimates
|
|
132
|
-
track_done: Track work done
|
|
133
|
-
track_times: Track start and stop times
|
|
134
|
-
tuesday: Tuesday
|
|
135
|
-
unlock: Unlock
|
|
136
|
-
unplanned_tasks: Unplanned tasks
|
|
137
|
-
up: Up
|
|
138
|
-
updated_by: Updated by
|
|
139
|
-
user: User
|
|
140
|
-
view_fullscreen: View fullscreen
|
|
141
|
-
wednesday: Wednesday
|
|
142
|
-
week: Week
|
|
143
|
-
weekly_work_sheet: Weekly work sheet
|
|
144
|
-
welcome_link: Start getting things done.
|
|
145
|
-
work: Work
|
|
146
|
-
work_account: Work Account
|
|
147
|
-
work_accounts: Work Accounts
|
data/lang/localizations.yaml
DELETED
data/lang/no.yaml
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
file_charset: utf-8
|
|
2
|
-
|
|
3
|
-
abort: Avbryt
|
|
4
|
-
aborted: Avbrutt
|
|
5
|
-
absent: Fravær
|
|
6
|
-
account: Konto
|
|
7
|
-
active: Aktiv
|
|
8
|
-
administration: Administrasjon
|
|
9
|
-
all: All
|
|
10
|
-
all_accounts: alle konti
|
|
11
|
-
assigned_to: Tilordnet
|
|
12
|
-
back: Tilbake
|
|
13
|
-
backlog: Oppgaveliste
|
|
14
|
-
backlog_description: Oppgaveliste med sortering og statussporing
|
|
15
|
-
backlogs: Oppgavelister
|
|
16
|
-
burn_down_chart: Fremdriftsgraf
|
|
17
|
-
cannot_find_user: Kan ikke finne bruker %s
|
|
18
|
-
change_password: Bytt Passord
|
|
19
|
-
complete: Fullfør
|
|
20
|
-
completed: Fullført
|
|
21
|
-
completed_at: Stop tid
|
|
22
|
-
completed_tasks: Fullførte Oppgaver
|
|
23
|
-
confirmation: Er du sikker?
|
|
24
|
-
created_by: Opprettet av
|
|
25
|
-
customer: Kunde
|
|
26
|
-
daily_work_sheet: Timeføringsskjema
|
|
27
|
-
dashboard: Dashboard
|
|
28
|
-
delete: Slett
|
|
29
|
-
description: Beskrivelse
|
|
30
|
-
details: Detaljer
|
|
31
|
-
done: Utført
|
|
32
|
-
down: Ned
|
|
33
|
-
edit: Rediger
|
|
34
|
-
editing: Redigerer
|
|
35
|
-
empty_work_record: Tom arbeidslinje
|
|
36
|
-
enable_customer: Tillat kunder
|
|
37
|
-
enable_invoicing: Tillat fakturering
|
|
38
|
-
enable_periods: Tillat sprinter
|
|
39
|
-
enable_subtasks: Tillat underoppgaver
|
|
40
|
-
enable_users: Tillat brukere
|
|
41
|
-
end_on: Avslutt på
|
|
42
|
-
end_work: Stopp
|
|
43
|
-
estimate: Estimat
|
|
44
|
-
experimental: Eksperimentell!
|
|
45
|
-
files: Files
|
|
46
|
-
friday: Fredag
|
|
47
|
-
grab_task: Grip oppgave
|
|
48
|
-
grabbed_by_you: Tatt av deg
|
|
49
|
-
group: Gruppe
|
|
50
|
-
groups: Grupper
|
|
51
|
-
holiday: Ferie
|
|
52
|
-
holidays_used: Brukte feriedager
|
|
53
|
-
home: Hjem
|
|
54
|
-
hours: Timer
|
|
55
|
-
hours_last_month: Timer forrige måned
|
|
56
|
-
hours_last_week: Timer forrige uke
|
|
57
|
-
hours_this_month: Timer denne måned
|
|
58
|
-
hours_this_week: Timer denne uke
|
|
59
|
-
hours_today: Timer i dag
|
|
60
|
-
invite: Invitèr
|
|
61
|
-
invoice: Fakturerbart
|
|
62
|
-
invoice_code: Faktureringskode
|
|
63
|
-
invoice_short: Fakt
|
|
64
|
-
left: Venstre
|
|
65
|
-
listing_works: Registrert arbeid
|
|
66
|
-
lock: Lås
|
|
67
|
-
log_in: Log inn
|
|
68
|
-
log_out: Log ut
|
|
69
|
-
main_backlog: Hovedliste
|
|
70
|
-
members: Medlemmer
|
|
71
|
-
monday: Mandag
|
|
72
|
-
move_to_bottom: Flytt oppgaven til slutten av listen
|
|
73
|
-
move_to_next_period: Flytt oppgaven til neste periode
|
|
74
|
-
move_to_top: Flytt oppgaven til toppen av listen
|
|
75
|
-
moved: Flyttet
|
|
76
|
-
name: Navn
|
|
77
|
-
new_backlog: Start ny oppgaveliste
|
|
78
|
-
new_customer: Legg til ny kunde
|
|
79
|
-
new_group: Start ny gruppe
|
|
80
|
-
new_period: Start ny periode
|
|
81
|
-
new_task: Legg til ny oppgave
|
|
82
|
-
new_work: Registrer arbeid
|
|
83
|
-
new_work_account: Legg til timeføringskonto
|
|
84
|
-
next: Neste
|
|
85
|
-
no_backlog: Uten oppgaveliste
|
|
86
|
-
no_pending_tasks: Det er ingen ventende oppgaver i denne perioden.
|
|
87
|
-
no_pending_tasks_in_backlog: Det er ingen ventende oppgaver i denne oppgavelisten.
|
|
88
|
-
not_grabbed: Ikke tatt av noen
|
|
89
|
-
notes: Notater
|
|
90
|
-
ownership: Eierskap
|
|
91
|
-
paging: Del opp i flere sider
|
|
92
|
-
password: Passord
|
|
93
|
-
period: Periode
|
|
94
|
-
periods: Perioder
|
|
95
|
-
please_login: Vennligst logg på
|
|
96
|
-
position: Posisjon
|
|
97
|
-
postponed: Utsatt
|
|
98
|
-
previous: Forrige
|
|
99
|
-
previous_abr: Forrige
|
|
100
|
-
projection: Projeksjon
|
|
101
|
-
public_holiday: Offentlig fridag
|
|
102
|
-
release_task: Slipp oppgave
|
|
103
|
-
reopen: Gjenåpne
|
|
104
|
-
resolution: Avslutningsmåte
|
|
105
|
-
resolution_abr: Avsl.
|
|
106
|
-
right: Høyre
|
|
107
|
-
saturday: Lørdag
|
|
108
|
-
save: Lagre
|
|
109
|
-
search: Søk
|
|
110
|
-
search_results_for: "Søkeresultater for '%s'"
|
|
111
|
-
select: Velg
|
|
112
|
-
shortcuts: Knapper
|
|
113
|
-
sick_days_used: Sykedager
|
|
114
|
-
signup: Innmelding
|
|
115
|
-
specify: Spesifisèr
|
|
116
|
-
spreadsheet: Regneark
|
|
117
|
-
start: Start
|
|
118
|
-
start_on: Start på
|
|
119
|
-
start_work: Start arbeid
|
|
120
|
-
started_at: Start tid
|
|
121
|
-
stop: Stopp
|
|
122
|
-
work_lock_subscriptions: Abonenter på timelister
|
|
123
|
-
sunday: Søndag
|
|
124
|
-
task: Oppgave
|
|
125
|
-
tasks: Oppgaver
|
|
126
|
-
thursday: Torsdag
|
|
127
|
-
todo: Igjen
|
|
128
|
-
total: Totalt
|
|
129
|
-
totals: Totalt
|
|
130
|
-
track_todo: Estimater
|
|
131
|
-
track_done: Spor utført arbeid
|
|
132
|
-
track_times: Spor start- og stopptider
|
|
133
|
-
tuesday: Tirsdag
|
|
134
|
-
unlock: Lås opp
|
|
135
|
-
unplanned_tasks: Ikke planlagte oppgaver
|
|
136
|
-
up: Opp
|
|
137
|
-
updated_by: Oppdatert av
|
|
138
|
-
user: Bruker
|
|
139
|
-
view_fullscreen: Vis fullskjerm
|
|
140
|
-
wednesday: Onsdag
|
|
141
|
-
week: Uke
|
|
142
|
-
weekly_work_sheet: Timeoversikt for uke
|
|
143
|
-
welcome_link: Få ting gjort.
|
|
144
|
-
work: Arbeid
|
|
145
|
-
work_account: Timeføringskonto
|
|
146
|
-
work_accounts: Timeføringskonti
|
data/lib/localization.rb
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
require 'iconv'
|
|
2
|
-
|
|
3
|
-
module Localization
|
|
4
|
-
|
|
5
|
-
LOCALIZED_STRINGS = {}
|
|
6
|
-
|
|
7
|
-
def l(symbol, *arguments)
|
|
8
|
-
language = CONFIG[:default_language]
|
|
9
|
-
|
|
10
|
-
symbol = symbol.to_sym if symbol.is_a? String
|
|
11
|
-
|
|
12
|
-
# translation of an LString is simply a call to to_s
|
|
13
|
-
return symbol.to_s if symbol.is_a? LString
|
|
14
|
-
|
|
15
|
-
# translation of an array
|
|
16
|
-
if symbol.is_a? Array
|
|
17
|
-
raise ArgumentError.new("Cannot translate an empty array") if symbol.empty?
|
|
18
|
-
raise ArgumentError.new("Symbol is an array, arguments must be empty") unless arguments.empty?
|
|
19
|
-
arguments = symbol
|
|
20
|
-
symbol = arguments.shift
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
begin
|
|
24
|
-
translation = (LOCALIZED_STRINGS[language][symbol] or
|
|
25
|
-
LOCALIZED_STRINGS['en'][symbol] or
|
|
26
|
-
symbol.to_s)
|
|
27
|
-
rescue
|
|
28
|
-
translation = symbol.to_s
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
begin
|
|
32
|
-
return translation % arguments
|
|
33
|
-
rescue => e
|
|
34
|
-
raise ArgumentError.new("Translation value #{translation.inspect} " +
|
|
35
|
-
"with arguments #{arguments.inspect} caused error '#{e.message}'")
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def valid_language?(language)
|
|
40
|
-
LOCALIZED_STRINGS.has_key? language
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def self.load_localized_strings
|
|
44
|
-
# Load language files
|
|
45
|
-
Dir[RAILS_ROOT + '/lang/*.yaml'].each do |filename|
|
|
46
|
-
filename =~ /(([a-z]+_?)+)\.yaml$/
|
|
47
|
-
hash = YAML::load(File.read(filename))
|
|
48
|
-
file_charset = hash['file_charset'] || 'ascii'
|
|
49
|
-
lang = $1
|
|
50
|
-
|
|
51
|
-
# convert string keys to symbols
|
|
52
|
-
symbol_hash = Hash.new
|
|
53
|
-
Iconv.open(CONFIG[:web_charset], file_charset) do |i|
|
|
54
|
-
hash.each do |key, value|
|
|
55
|
-
symbol_hash[key.to_sym] = i.iconv(value)
|
|
56
|
-
if key =~ /^active_record_errors_(.*)/
|
|
57
|
-
ActiveRecord::Errors.default_error_messages[$1.to_sym] =
|
|
58
|
-
symbol_hash[key.to_sym]
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
LOCALIZED_STRINGS[lang] = symbol_hash
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
class LString
|
|
68
|
-
|
|
69
|
-
include Localization
|
|
70
|
-
|
|
71
|
-
def initialize(symbol, arguments)
|
|
72
|
-
@symbol, @arguments = symbol, arguments
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
def to_s
|
|
76
|
-
l(@symbol, @arguments)
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
# redefinition of ActionMail::Base#render_message, that adds locale suffix to
|
|
81
|
-
# the template name
|
|
82
|
-
ActionMailer::Base.module_eval <<-EOL
|
|
83
|
-
private
|
|
84
|
-
def render_message(method_name, body)
|
|
85
|
-
initialize_template_class(body).render_file(method_name + "_#{CONFIG[:default_language]}")
|
|
86
|
-
end
|
|
87
|
-
EOL
|
|
88
|
-
end
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
|
2
|
-
require 'work_accounts_controller'
|
|
3
|
-
|
|
4
|
-
# Re-raise errors caught by the controller.
|
|
5
|
-
class WorkAccountsController; def rescue_action(e) raise e end; end
|
|
6
|
-
|
|
7
|
-
class WorkAccountsControllerTest < Test::Unit::TestCase
|
|
8
|
-
main_scenario
|
|
9
|
-
|
|
10
|
-
def setup
|
|
11
|
-
@controller = WorkAccountsController.new
|
|
12
|
-
@request = ActionController::TestRequest.new
|
|
13
|
-
@response = ActionController::TestResponse.new
|
|
14
|
-
@request.session[:user_id] = 1000001
|
|
15
|
-
|
|
16
|
-
@first_id = work_accounts(:light_control).id
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def test_index
|
|
20
|
-
get :index
|
|
21
|
-
assert_response :success
|
|
22
|
-
assert_template 'list'
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def test_list
|
|
26
|
-
get :list
|
|
27
|
-
|
|
28
|
-
assert_response :success
|
|
29
|
-
assert_template 'list'
|
|
30
|
-
|
|
31
|
-
assert_not_nil assigns(:work_accounts)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def test_show
|
|
35
|
-
get :show, :id => @first_id
|
|
36
|
-
|
|
37
|
-
assert_response :success
|
|
38
|
-
assert_template 'show'
|
|
39
|
-
|
|
40
|
-
assert_not_nil assigns(:work_account)
|
|
41
|
-
assert assigns(:work_account).valid?
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def test_new
|
|
45
|
-
get :new
|
|
46
|
-
|
|
47
|
-
assert_response :success
|
|
48
|
-
assert_template 'new'
|
|
49
|
-
|
|
50
|
-
assert_not_nil assigns(:work_account)
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def test_create
|
|
54
|
-
num_work_accounts = WorkAccount.count
|
|
55
|
-
|
|
56
|
-
post :create, :work_account => {:name => 'TimeKeeper'}
|
|
57
|
-
|
|
58
|
-
assert_response :redirect
|
|
59
|
-
assert_redirected_to :action => 'list'
|
|
60
|
-
|
|
61
|
-
assert_equal num_work_accounts + 1, WorkAccount.count
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
def test_edit
|
|
65
|
-
get :edit, :id => @first_id
|
|
66
|
-
|
|
67
|
-
assert_response :success
|
|
68
|
-
assert_template 'edit'
|
|
69
|
-
|
|
70
|
-
assert_not_nil assigns(:work_account)
|
|
71
|
-
assert assigns(:work_account).valid?
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
def test_update
|
|
75
|
-
post :update, :id => @first_id
|
|
76
|
-
assert_response :redirect
|
|
77
|
-
assert_redirected_to :action => 'show', :id => @first_id
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
def test_destroy
|
|
81
|
-
assert_nothing_raised {
|
|
82
|
-
WorkAccount.find(@first_id)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
post :destroy, :id => @first_id
|
|
86
|
-
assert_response :redirect
|
|
87
|
-
assert_redirected_to :action => 'list'
|
|
88
|
-
|
|
89
|
-
assert_raise(ActiveRecord::RecordNotFound) {
|
|
90
|
-
WorkAccount.find(@first_id)
|
|
91
|
-
}
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
end
|