Añade el plugin Redmine Git Hosting 5.0.0

This commit is contained in:
Manuel Cillero 2021-03-20 13:29:16 +01:00
parent cfa0d58b18
commit a3bddad233
458 changed files with 30396 additions and 1 deletions

View file

@ -0,0 +1,6 @@
- if repository.downloadable?
= font_awesome_icon 'fas_download', post_text: l(:label_download_format)
'
= select_tag :download, options_for_select(available_download_format(repository, @rev)),
prompt: l(:label_download_select_format),
onchange: "if (this.value != '') { window.location = this.value; }"

View file

@ -0,0 +1,30 @@
- if @repository.is_a?(Repository::Xitolite) && !@repository.git_annex_enabled?
#repository-tabs
ul
- if User.current.git_allowed_to?(:view_repository_deployment_credentials, @repository)
li#tab-repository_deployment_credentials
= link_to font_awesome_icon('fas_lock', post_text: l(:label_deployment_credentials)),
repository_deployment_credentials_path(@repository)
- if User.current.git_allowed_to?(:view_repository_mirrors, @repository)
li#tab-repository_mirrors
= link_to font_awesome_icon('fas_cloud-upload-alt', post_text: l(:label_repository_mirrors)),
repository_mirrors_path(@repository)
- if User.current.git_allowed_to?(:view_repository_post_receive_urls, @repository)
li#tab-repository_post_receive_urls
= link_to font_awesome_icon('fas_external-link-alt', post_text: l(:label_post_receive_urls)),
repository_post_receive_urls_path(@repository)
- if User.current.git_allowed_to?(:view_repository_git_config_keys, @repository)
li#tab-repository_git_config_keys
= link_to font_awesome_icon('fas_th-list', post_text: l(:label_git_config_keys)),
repository_git_config_keys_path(@repository)
- if User.current.git_allowed_to?(:view_repository_protected_branches, @repository)
li#tab-repository_protected_branches
= link_to font_awesome_icon('fas_shield-alt', post_text: l(:label_protected_branches)),
repository_protected_branches_path(@repository)
javascript:
$(document).ready(function() { setRepositoryActiveTab('#{@tab}'); });

View file

@ -0,0 +1,13 @@
- if @repository.is_a?(Repository::Xitolite)
= render partial: 'common/git_hosting_js_headers'
.git_hosting.box
h3
= l(:label_repository_access_url)
- unless @repository.git_annex_enabled?
'
= link_to l(:label_sort_urls),
sort_urls_repository_git_extras_path(@repository),
remote: true
= render 'common/git_urls', repository: @repository

View file

@ -0,0 +1,2 @@
- if User.current.allowed_to? :add_repository_xitolite_watchers, @project
= watcher_link @repository, User.current

View file

@ -0,0 +1,17 @@
ul.repository.git
- @repositories.sort.each do |repo|
li class="#{'repository git' if repo.is_a? Repository::Xitolite}"
= link_to_repository repo, @repository
- if User.current.allowed_to? :manage_repository, @project
'
= link_to "(#{l(:label_settings)})", edit_repository_path(repo)
- if @repository.try(:watchers) && \
(User.current.allowed_to?(:add_repository_xitolite_watchers, @project) || \
(@repository.watchers.present? && User.current.allowed_to?(:view_repository_xitolite_watchers, @project)))
#watchers
= render 'watchers/watchers', watched: @repository
javascript:
$(document).ready(function() { $('#sidebar p').remove(); });

View file

@ -0,0 +1,14 @@
#readme_container.box
h2.readme_trigger style='cursor: pointer;'
| README
hr
#readme_at_repo_dir.wiki
- if html.html_safe.respond_to?(:force_encoding)
= html.html_safe.force_encoding('UTF-8')
- else
= html.html_safe
javascript:
$(document).ready(function() { $("#readme_trigger").click(function(){ $("#readme_at_repo_dir").toggle(500); }); });

View file

@ -0,0 +1,13 @@
- if @repository.is_a? Repository::Xitolite
- content_for :header_tags do
= stylesheet_link_tag 'application', plugin: 'redmine_git_hosting'
= stylesheet_link_tag 'markdown', plugin: 'redmine_git_hosting'
.git_hosting_urls.box
.container
.row
.col-md-8 style='vertical-align: middle;'
= render 'common/git_urls', repository: @repository
.col-md-4 style='text-align: right; vertical-align: middle;'
- if RedmineGitHosting::Config.download_revision_enabled?
= render 'repositories/download_revision', repository: @repository

View file

@ -0,0 +1,85 @@
- if repository.is_a? Repository::Xitolite
= form_for repository.extra, url: repository_git_extras_path(repository), html: { method: :put, remote: true } do |f|
.box.tabular
.container
.row
.col-md-12
#xitolite-messages
= error_messages_for repository.extra
.row
.col-md-6
- unless repository.git_annex_enabled?
p
= label_tag 'repository_git_extra[git_daemon]', l(:label_enable_git_daemon)
= f.check_box :git_daemon, disabled: (!repository.public_project? && !repository.public_repo?)
- if User.current.git_allowed_to?(:create_repository_protected_branches, repository)
p
= label_tag 'repository_git_extra[protected_branch]', l(:label_enable_protected_branches)
= f.check_box :protected_branch
p
= label_tag 'repository_git_extra[public_repo]', l(:label_enable_public_repo)
= f.check_box :public_repo
p
= label_tag 'repository_git_extra[git_http]', l(:label_enable_smart_http)
= f.check_box :git_http
p
= label_tag 'repository_git_extra[git_https]', l(:label_enable_smart_https)
= f.check_box :git_https
p
= label_tag 'repository_git_extra[git_go]', l(:label_enable_go_url)
= f.check_box :git_go
p
= label_tag 'repository_git_extra[git_ssh]', l(:label_enable_ssh_url)
= f.check_box :git_ssh
.col-md-6
p
= label_tag 'repository_git_extra[git_notify]', l(:label_enable_git_notify)
= f.check_box :git_notify
- if repository.git_notification_enabled?
p
= label_tag 'repository_git_extra[notification_sender]', l(:label_git_notification_sender)
= f.text_field :notification_sender
p
= label_tag 'repository_git_extra[notification_prefix]', l(:label_git_notification_prefix)
= f.text_field :notification_prefix
- unless repository.git_annex_enabled?
p
= label_tag 'repository_git_extra[default_branch]', l(:label_repository_default_branch)
- if repository.branches.present?
= f.select :default_branch, repository_branches_list(repository.branches)
- else
span.label.label-info = repository.git_default_branch
p
label = l :label_mirroring_keys_installed
= image_tag(RedmineGitHosting::Config.mirroring_keys_installed? ? 'true.png' : 'exclamation.png')
p
label = l :label_repository_exists_in_gitolite
= image_tag(repository.exists_in_gitolite? ? 'true.png' : 'exclamation.png')
p
- if repository.empty_in_gitolite?
label = l :label_empty_repository
= image_tag 'true.png'
- else
label = l :label_git_objects_count
= repository.git_objects_count
p
label = l :label_browse_repository
= link_to h(repository.url),
{ controller: 'repositories', action: 'show', id: @project, repository_id: repository.identifier_param }
p = f.submit l(:button_save)

View file

@ -0,0 +1,24 @@
.contextual
= render_repository_quick_jump(@repository)
h2
= link_to l(:label_settings), settings_project_path(@project, tab: 'repositories')
'
= Additionals::LIST_SEPARATOR
= l(:label_repository)
'
= Additionals::LIST_SEPARATOR
= @repository.redmine_name
.splitcontent
.splitcontentleft
= call_hook(:view_repository_edit_top, repository: @repository, project: @project)
= labelled_form_for :repository, @repository, url: repository_path(@repository), html: { method: :put, id: 'repository-form' } do |f|
= render partial: 'form', locals: { f: f }
.splitcontentright
#xitolite-options style='vertical-align: top;'
= render 'xitolite_options', repository: @repository
= call_hook(:view_repository_edit_bottom, repository: @repository, project: @project)

View file

@ -0,0 +1,88 @@
#flash_warning.flash.warning = l :notice_empty_repository
- if @repository.urls_are_viewable?
- content_for :header_tags do
= stylesheet_link_tag 'application', plugin: 'redmine_git_hosting'
.git_hosting_urls.box
.container
.row
.col-md-8 style='vertical-align: middle;'
= render 'common/git_urls', repository: @repository
.col-md-4 style='text-align: right; vertical-align: middle;'
.box
- if User.current.allowed_to? :view_changesets, @project
h3
= l :label_help_git_setup
| :
pre
code.shell.syntaxhl
= link_to l(:label_download_and_install_git), 'https://git-scm.com/download', class: 'external'
br
== render_shell_text "git config --global user.name \"#{User.current.name(:firstname_lastname)}\""
br
== render_shell_text "git config --global user.email #{User.current.mail || 'mail@example.com'}"
- if !User.current.anonymous? && User.current.gitolite_public_keys.empty?
br
= link_to 'Upload SSH Public Key', public_keys_path
- if User.current.allowed_to? :commit_access, @project
#repository_setup
h3
= l :label_help_repository_setup_new
| :
pre
code.shell.syntaxhl
== render_shell_text "mkdir #{@repository.redmine_name}"
br
== render_shell_text "cd #{@repository.redmine_name}"
br
== render_shell_text 'git init'
br
== render_shell_text 'touch readme.txt'
br
== render_shell_text 'git add readme.txt'
br
== render_shell_text "git commit -m 'Initializing #{@repository.redmine_name} repository'"
br
' git remote add origin
span.git_url_access
br
== render_shell_text 'git push -u origin master'
h3
= l :label_help_repository_setup_existing
| :
pre
code.shell.syntaxhl
== render_shell_text 'cd existing_git_rep'
br
' git remote add origin
span.git_url_access
br
== render_shell_text 'git push -u origin master'
h3
= l :label_help_repository_clone
| :
pre
code.shell.syntaxhl
' git clone
span.git_url_access
- else
= l :label_help_no_repo_rights
- content_for :sidebar do
h3 = l :label_repository_plural
ul.repository.git
- @repositories.sort.each do |repo|
li class="#{'repository git' if repo.is_a?(Repository::Xitolite)}"
= link_to_repository(repo, @repository)
- if User.current.allowed_to?(:manage_repository, @project)
'
= link_to "(#{l(:label_settings)})", edit_repository_path(repo)
javascript:
$(document).ready(function() { setGitUrlsInstructions('.git_url'); });

View file

@ -0,0 +1,49 @@
- report = RepositoryCommitsStats.new(repository)
#chart_commits_per_month style='height: 300px; width: 47%; margin: 10px; float: left;'
#chart_commits_per_day style='height: 300px; width: 47%; margin: 10px; float: left;'
.clear-both style='margin: 10px;'
#chart_commits_per_hour style = 'height: 500px; width: 47%; margin: 10px; float: left;'
#chart_commits_per_weekday style= 'height: 300px; width: 47%; margin: 10px; float: left;'
#chart_commits_per_weekday style='margin-top: 20px;'
javascript:
var chart_commits_per_month = new Object();
chart_commits_per_month.label = "#{l(:label_commits_per_month)}";
chart_commits_per_month.label_y_axis = "#{l(:label_commits_number)}";
chart_commits_per_month.target = '#chart_commits_per_month';
chart_commits_per_month.categories = #{report.commits_per_month[:categories].to_json.html_safe};
chart_commits_per_month.series = #{report.commits_per_month[:series].to_json.html_safe};
var chart_commits_per_day = new Object();
chart_commits_per_day.label = "#{l(:label_commits_per_day)}";
chart_commits_per_day.label_y_axis = "#{l(:label_commits_number)}";
chart_commits_per_day.target = '#chart_commits_per_day';
chart_commits_per_day.categories = #{report.commits_per_day[:categories].to_json.html_safe};
chart_commits_per_day.series = #{report.commits_per_day[:series].to_json.html_safe};
chart_commits_per_day.legend = {
layout: 'vertical',
align: 'left',
verticalAlign: 'top',
x: 50,
y: 50,
floating: true,
borderWidth: 1,
backgroundColor: '#fff'
};
var chart_commits_per_hour = new Object();
chart_commits_per_hour.label = "#{l(:label_commits_per_hour)}";
chart_commits_per_hour.label_y_axis = "#{l(:label_hour)}";
chart_commits_per_hour.label_x_axis = "#{l(:label_commits_number)}";
chart_commits_per_hour.target = '#chart_commits_per_hour';
chart_commits_per_hour.categories = #{report.commits_per_hours[:categories].to_json.html_safe};
chart_commits_per_hour.series = #{report.commits_per_hours[:series].to_json.html_safe};
var chart_commits_per_weekday = new Object();
chart_commits_per_weekday.label = "#{l(:label_commits_per_weekday)}";
chart_commits_per_weekday.target = '#chart_commits_per_weekday';
chart_commits_per_weekday.series = #{report.commits_per_weekday.to_json.html_safe};

View file

@ -0,0 +1,34 @@
- report = RepositoryContributorsStats.new(repository)
ul.thumbnails
- @author_charts = []
- report.commits_per_author.each do |commits_data|
- idx = report.commits_per_author.index(commits_data)
- @author_charts.push("chart_commits_per_author_#{idx}")
javascript:
var chart_commits_per_author_#{idx} = new Object();
chart_commits_per_author_#{idx}.label = "";
chart_commits_per_author_#{idx}.label_y_axis = "#{l(:label_commits_number)}";
chart_commits_per_author_#{idx}.target = '#chart_commits_per_author_#{idx}';
chart_commits_per_author_#{idx}.categories = #{commits_data[:categories].to_json.html_safe};
chart_commits_per_author_#{idx}.series = #{commits_data[:series].to_json.html_safe};
chart_commits_per_author_#{idx}.legend = {};
li.span6
.thumbnail id="contributor-#{idx}"
h4
= commits_data[:author_name]
'
small = commits_data[:author_mail]
h5 = commits_data[:total_commits]
div id="chart_commits_per_author_#{idx}" style='height: 200px; width: 100%'
#chart_commits_per_author
javascript:
var chart_commits_per_author = new Object();
chart_commits_per_author.label = "#{l(:label_commits_per_author)}";
chart_commits_per_author.label_y_axis = "#{l(:label_commits_number)}";
chart_commits_per_author.target = '#chart_commits_per_author';
chart_commits_per_author.categories = #{report.commits_per_author_global[:categories].to_json.html_safe};
chart_commits_per_author.series = #{report.commits_per_author_global[:series].to_json.html_safe};

View file

@ -0,0 +1,8 @@
- report = RepositoryGlobalStats.new(repository).build
ul.thumbnails
- report.each do |key, value|
li.span4
.thumbnail
.title = key
.value = value

View file

@ -0,0 +1,43 @@
h2 = l :label_statistics
#statistics-tabs
ul
li
a href="#statistics-global"
= l(:label_repository_statistics_global)
li
a href="#statistics-commits"
= l(:label_repository_statistics_commits)
li
a href="#statistics-contributors"
= l(:label_repository_statistics_contributors)
#statistics-global
= render 'repositories/statistics/global', repository: @repository
#statistics-commits
= render 'repositories/statistics/commits', repository: @repository
#statistics-contributors
= render 'repositories/statistics/contributors', repository: @repository
.clear-both style="margin: 10px;"
p = link_to l(:button_back), action: 'show', id: @project
- html_title(l(:label_repository), l(:label_statistics))
- content_for :header_tags do
= javascript_include_tag('highcharts/highcharts', plugin: 'redmine_git_hosting')
= javascript_include_tag('highcharts/modules/drilldown', plugin: 'redmine_git_hosting')
= stylesheet_link_tag 'application', plugin: 'redmine_git_hosting'
= javascript_include_tag 'set_highcharts', plugin: 'redmine_git_hosting'
- charts = @author_charts.map { |chart| "createZoomableAreaChart(#{chart});" }
javascript:
$(document).ready(function() {
createAreaChart(chart_commits_per_month);
createZoomableAreaChart(chart_commits_per_day);
createBarChart(chart_commits_per_hour);
createPieChart(chart_commits_per_weekday);
#{raw charts.join("\n")}
createColumnChart(chart_commits_per_author);
$("#statistics-tabs").tabs();
});