Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n for italian and patch for repository creation problem #36

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/models/repository/git_remote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class Repository::GitRemote < Repository::Git

before_validation :initialize_clone

safe_attributes 'extra_info', :if => lambda {|repository, _user| repository.new_record?}

# TODO: figure out how to do this safely (if at all)
# before_deletion :rm_removed_repo
# def rm_removed_repo
Expand Down
4 changes: 4 additions & 0 deletions config/locales/it.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
it:
field_extra_clone_url: URL Clone
text_git_remote_url_note: URL da cui clonare.
text_git_remote_path_note: Percorso assoluto del filesystem in cui clonare. Lasciare bianco per autopopolare da URL.
17 changes: 9 additions & 8 deletions lib/redmine_git_remote/repositories_helper_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ def self.included(base) # :nodoc:
module InstanceMethods
def git_remote_field_tags(form, repository)
content_tag('p', form.text_field(:url,
:size => 60, :required => false,
:disabled => !repository.safe_attribute?('url'),
:label => l(:field_path_to_repository)) +
content_tag('em', l(:text_git_remote_path_note), :class => 'info') +
form.text_field(:extra_clone_url, :size => 60, :required => true,
:disabled => !repository.safe_attribute?('url')) +
content_tag('em', l(:text_git_remote_url_note), :class => 'info')
)
:size => 60, :required => false,
:disabled => !repository.safe_attribute?('url'),
:label => l(:field_path_to_repository)) +
content_tag('em', l(:text_git_remote_path_note), :class => 'info') +
form.text_field(:extra_clone_url, :size => 60, :required => true,
:disabled => !repository.safe_attribute?('url'),
name: 'repository[extra_info][extra_clone_url]') +
content_tag('em', l(:text_git_remote_url_note), :class => 'info')
)
end
end
end
Expand Down