Skip to content

Commit d0f6fde

Browse files
author
root
committed
Merge branch 'devel' into v1.0.x
2 parents f2a483d + a00558c commit d0f6fde

File tree

16 files changed

+60
-48
lines changed

16 files changed

+60
-48
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Thanks for their contribution to :
5050
* Nicholas Clark
5151
* Robert Chady
5252
* Sébastien Dinot
53+
* wilsoc5
5354
* and others :)
5455

5556
## Contribute

app/controllers/repository_git_extras_controller.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ class RepositoryGitExtrasController < RedmineGitHostingController
22
unloadable
33

44
skip_before_filter :set_current_tab
5-
before_filter :set_git_extra
65

76
helper :extend_repositories
87

98

109
def update
10+
@git_extra = @repository.extra
1111
## Update attributes
1212
if @git_extra.update_attributes(params[:repository_git_extra])
1313
flash.now[:notice] = l(:notice_gitolite_extra_updated)
@@ -17,12 +17,4 @@ def update
1717
end
1818
end
1919

20-
21-
private
22-
23-
24-
def set_git_extra
25-
@git_extra = @repository.extra
26-
end
27-
2820
end

app/controllers/repository_protected_branches_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def clone
5252

5353
def sort
5454
params[:repository_protected_branche].each_with_index do |id, index|
55-
@repository.protected_branches.update_all({position: index + 1}, {id: id})
55+
@repository.protected_branches.where(:id => id).update_all({:position => index + 1})
5656
end
5757
# Update Gitolite repository
5858
call_use_case

app/models/repository_protected_branche.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class RepositoryProtectedBranche < ActiveRecord::Base
1414

1515
## Validations
1616
validates :repository_id, presence: true
17-
validates :path, presence: true, uniqueness: { scope: :permissions }
17+
validates :path, presence: true, uniqueness: { scope: [:permissions, :repository_id] }
1818
validates :permissions, presence: true, inclusion: { in: VALID_PERMS }
1919
validates :user_list, presence: true
2020

app/views/common/_git_urls.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
#git_url_box= l(:label_repository_access_not_configured)
2020

2121
:javascript
22-
$(document).ready(function() { setFirstGitUrl('.git_url_list'); bindGitUrls('.git_url'); });
22+
$(document).ready(function() { setGitUrls('.git_url'); });

app/views/repositories/git_instructions.html.haml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,4 @@
5555
= render 'common/git_urls', repository: @repository
5656

5757
:javascript
58-
$(document).ready(function() {
59-
var key = $('.git_url_list li').first().attr('id');
60-
var access = access_list[key];
61-
62-
$('.git_url_access').html(access.url);
63-
64-
$('.git_url_list li').on('click', function(){
65-
var key = $(this).attr('id');
66-
var access = access_list[key];
67-
68-
$('.git_url_access').html(access.url);
69-
70-
if (access.committer == true) {
71-
$('#repository_setup').show();
72-
} else {
73-
$('#repository_setup').hide();
74-
}
75-
});
76-
});
58+
$(document).ready(function() { setGitUrlsInstructions('.git_url'); });

app/views/repository_git_notifications/show.html.haml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
%div{ style: 'display:block;height:10px;clear:both;' }
2626

27-
%table{ class: 'list git_mailing_list' }
27+
%table{ class: 'table table-hover' }
2828
%thead
2929
%tr
3030
%th= l(:label_git_notification_default_list)
@@ -36,31 +36,34 @@
3636
%tr
3737
%td
3838
- if @repository.default_list.any?
39-
%ul
39+
%ul{ class: 'list-unstyled' }
4040
- @repository.default_list.each do |item|
4141
%li= item
4242

4343
%td
4444
- if !@git_notification.nil? && @git_notification.include_list.any?
45-
%ul
45+
%ul{ class: 'list-unstyled' }
4646
- @git_notification.include_list.sort.each do |item|
4747
%li= item
4848

4949
%td
5050
- if !@git_notification.nil? && @git_notification.exclude_list.any?
51-
%ul
51+
%ul{ class: 'list-unstyled' }
5252
- @git_notification.exclude_list.sort.each do |item|
5353
%li= item
5454

5555
%td
5656
- if @repository.mail_mapping.any?
57-
%ul
57+
%ul{ class: 'list-unstyled' }
5858
- @repository.mail_mapping.each do |item, from|
5959
%li
6060
= item
6161
(
6262
= from
6363
)
6464

65+
- if [email protected]_notification_enabled?
66+
%em= l(:git_notifications_reminder)
67+
6568
:javascript
6669
$(document).ready(function() { initModalBoxes(modals); });

app/views/repository_protected_branches/index.html.haml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77

88
- if @repository_protected_branches.any?
99

10-
%table{ class: 'table table-hover', id: 'protected_branches', data: { 'update-url' => sort_repository_protected_branches_url } }
10+
%table{ class: 'table table-hover',
11+
id: 'protected_branches',
12+
data: { 'update-url' => sort_repository_protected_branches_url },
13+
style: "opacity: #{@repository.protected_branches_enabled? ? '1' : '0.5'};" }
1114
%thead
1215
%tr
1316
%th
@@ -39,6 +42,9 @@
3942
= link_to l(:button_clone), clone_repository_protected_branch_path(@repository, protected_branch), class: 'icon icon-clone modal-box'
4043
= link_to l(:button_delete), repository_protected_branch_path(@repository, protected_branch), remote: true, method: :delete, confirm: l(:text_are_you_sure), class: 'icon icon-del'
4144

45+
- if [email protected]_branches_enabled?
46+
%em= l(:protected_branches_reminder)
47+
4248
- else
4349
%p{ class: 'nodata' }= l(:label_no_data)
4450

assets/javascripts/application.js

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ function trigger_mode_change(element) {
3737
}
3838
}
3939

40+
// GIT URLS
4041
function updateUrl(element) {
4142
var url = $(element).data('url');
4243
var target = $(element).data('target');
@@ -47,21 +48,41 @@ function updateUrl(element) {
4748
$(element).addClass('selected');
4849
}
4950

50-
function setFirstGitUrl(elements) {
51+
function setGitUrls(elements) {
5152
$(elements).each(function(index, element){
52-
var first_url = $(element).children().first();
53-
updateUrl(first_url);
53+
if (index == 0){
54+
updateUrl(element);
55+
};
56+
$(element).on('click', function(){
57+
updateUrl($(this));
58+
});
5459
});
5560
}
5661

57-
function bindGitUrls(elements) {
62+
// GIT INSTRUCTIONS
63+
function updateInstructionUrl(element) {
64+
var url = $(element).data('url');
65+
var committer = $(element).data('committer');
66+
$('.git_url_access').html(url);
67+
if (committer == 'RW') {
68+
$('#repository_setup').show();
69+
} else {
70+
$('#repository_setup').hide();
71+
}
72+
}
73+
74+
function setGitUrlsInstructions(elements) {
5875
$(elements).each(function(index, element){
76+
if (index == 0){
77+
updateInstructionUrl(element);
78+
};
5979
$(element).on('click', function(){
60-
updateUrl($(this));
80+
updateInstructionUrl($(this));
6181
});
6282
});
6383
}
6484

85+
// REPOSITORY EDIT
6586
function setRepositoryActiveTab(current_tab) {
6687
var all_tabs = $("#repository-tabs li");
6788
var active_tab = '';

assets/stylesheets/application.css

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ PLUGIN ICONS
99
.icon-git { padding-right: 15px; }
1010
.icon-git-disabled { opacity: 0.5; }
1111

12-
table.git_mailing_list { width: 100%; margin-top: 15px; }
13-
table.git_mailing_list th { width: 25%; }
14-
table.git_mailing_list td { text-align: center; }
15-
table.git_mailing_list td ul { padding-left: 0px; list-style-type: none; }
16-
17-
1812
/*
1913
PLUGIN SETTINGS
2014
*/

0 commit comments

Comments
 (0)