Merge pull request #382 from warpc/358-git_help_info_div

[refs #358] Add git clone repo help hint
This commit is contained in:
Vladimir Sharshov 2012-04-05 13:23:13 -07:00
commit e491b8bfb4
5 changed files with 50 additions and 1 deletions

View File

@ -49,4 +49,15 @@ $(document).ready(function() {
return false;
});
$('.description-top .git_help').click(function() {
$('#git_help_data').toggle();
var desc = $('.description-top');
if ($('#git_help_data').css('display') == 'none') {
desc.css('height', '38px');
} else {
desc.css('height', '196px');
}
});
});

View File

@ -764,3 +764,21 @@ div.tos_sidebar ul li a {
padding-top: 5px;
text-decoration: none;
}
div.description-top div.git_help {
float: left;
margin-top: 11px;
margin-left: 10px;
font-size: 11px;
color: green;
cursor: pointer;
}
div#git_help_data {
display: none;
padding-left: 10px;
}
div#git_help_data p {
padding-bottom: 5px;
}

View File

@ -1,7 +1,19 @@
.description-top
= text_field_tag :url, git_repo_url(project.git_repo_name), :class => 'name', :spellcheck => 'false', :readonly => true
.git_help ?
.role= can?(:write, project) ? t("layout.read_write_access") : t("layout.read_access")
= render :partial => 'projects/branch_select', :locals => {:project => project}
#git_help_data
%p= t("layout.projects.git_help.cloning") + ":"
%p
%p~ "git clone #{git_repo_url(project.git_repo_name)} #{project.name}"
%p~ "cd #{project.name}"
%p
%p= t("layout.projects.git_help.remote") + ":"
%p
%p~ "git remote add #{project.name} #{git_repo_url(project.git_repo_name)}"
%p~ "git fetch #{project.name}"
%p~ "git checkout -b my-local-tracking-branch #{project.name}/master_or_other_branch"
.both
:javascript
$(document).ready(function() {

View File

@ -30,6 +30,10 @@ en:
has_issue_description: Tracker adds a lightweight issue management system tightly integrated with your repository.
has_wiki_description: Wikis are the simplest way to allow other users to contribute content. Any user can create and edit pages for documentation, examples, support or anything you wish.
git_help:
cloning: Cloning the repository
remote: Add this repository as a remote to an existing local repository
diff_show_header: "%{files} with %{additions} and %{deletions}."
about_subheader: "About project"
last_commit: "Last commit"

View File

@ -44,7 +44,11 @@ ru:
current_branch: Текущая ветка/тег
current_commit: Текущий коммит
files_in_project: Файлы в
git_help:
cloning: Клонирование этого репозитория
remote: Добавление этого репозитория как удаленного к существующему локальному репозиторию
flash:
project:
saved: Проект успешно сохранен