Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gitlabhq/gitlabhq
Browse files Browse the repository at this point in the history
  • Loading branch information
dzaporozhets committed Oct 21, 2014
2 parents 3f4cfd3 + 8ad9a75 commit c3b81e5
Show file tree
Hide file tree
Showing 57 changed files with 143 additions and 217 deletions.
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Expand Up @@ -101,7 +101,11 @@ For examples of feedback on merge requests please look at already [closed merge
1. Contains functionality we think other users will benefit from too
1. Doesn't add configuration options since they complicate future changes
1. Changes after submitting the merge request should be in separate commits (no squashing). You will be asked to squash when the review is over, before merging.
1. It conforms to the following style guides
1. It conforms to the following style guides.
If your change touches a line that does not follow the style,
modify the entire line to follow it. This prevents linting tools from generating warnings.
Don't touch neighbouring lines. As an exception, automatic mass refactoring modifications
may leave style non-compliant.

## Style guides

Expand Down
4 changes: 1 addition & 3 deletions app/assets/javascripts/activities.js.coffee
@@ -1,4 +1,4 @@
class Activities
class @Activities
constructor: ->
Pager.init 20, true
$(".event_filter_link").bind "click", (event) =>
Expand Down Expand Up @@ -27,5 +27,3 @@ class Activities
event_filters.splice index, 1

$.cookie "event_filter", event_filters.join(","), { path: '/' }

@Activities = Activities
4 changes: 1 addition & 3 deletions app/assets/javascripts/admin.js.coffee
@@ -1,4 +1,4 @@
class Admin
class @Admin
constructor: ->
$('input#user_force_random_password').on 'change', (elem) ->
elems = $('#user_password, #user_password_confirmation')
Expand Down Expand Up @@ -51,5 +51,3 @@ class Admin

$('li.group_member').bind 'ajax:success', ->
Turbolinks.visit(location.href)

@Admin = Admin
5 changes: 1 addition & 4 deletions app/assets/javascripts/blob.js.coffee
@@ -1,4 +1,4 @@
class BlobView
class @BlobView
constructor: ->
# handle multi-line select
handleMultiSelect = (e) ->
Expand Down Expand Up @@ -71,6 +71,3 @@ class BlobView

# Highlight the correct lines when the hash part of the URL changes
$(window).on("hashchange", highlightBlobLines)


@BlobView = BlobView
4 changes: 1 addition & 3 deletions app/assets/javascripts/commit.js.coffee
@@ -1,6 +1,4 @@
class Commit
class @Commit
constructor: ->
$('.files .diff-file').each ->
new CommitFile(this)

@Commit = Commit
4 changes: 1 addition & 3 deletions app/assets/javascripts/commit/file.js.coffee
@@ -1,7 +1,5 @@
class CommitFile
class @CommitFile

constructor: (file) ->
if $('.image', file).length
new ImageFile(file)

@CommitFile = CommitFile
4 changes: 1 addition & 3 deletions app/assets/javascripts/commit/image-file.js.coffee
@@ -1,4 +1,4 @@
class ImageFile
class @ImageFile

# Width where images must fits in, for 2-up this gets divided by 2
@availWidth = 900
Expand Down Expand Up @@ -124,5 +124,3 @@ class ImageFile
else
img.on 'load', =>
callback.call(this, domImg.naturalWidth, domImg.naturalHeight)

@ImageFile = ImageFile
4 changes: 1 addition & 3 deletions app/assets/javascripts/commits.js.coffee
@@ -1,4 +1,4 @@
class CommitsList
class @CommitsList
@data =
ref: null
limit: 0
Expand Down Expand Up @@ -53,5 +53,3 @@ class CommitsList
@disable
callback: =>
this.getOld()

this.CommitsList = CommitsList
4 changes: 1 addition & 3 deletions app/assets/javascripts/confirm_danger_modal.js.coffee
@@ -1,4 +1,4 @@
class ConfirmDangerModal
class @ConfirmDangerModal
constructor: (form, text) ->
@form = form
$('.js-confirm-text').text(text || '')
Expand All @@ -16,5 +16,3 @@ class ConfirmDangerModal

$('.js-confirm-danger-submit').on 'click', =>
@form.submit()

@ConfirmDangerModal = ConfirmDangerModal
5 changes: 1 addition & 4 deletions app/assets/javascripts/dashboard.js.coffee
@@ -1,4 +1,4 @@
class Dashboard
class @Dashboard
constructor: ->
@initSidebarTab()

Expand Down Expand Up @@ -28,6 +28,3 @@ class Dashboard
# show tab from cookie
sidebar_filter = $.cookie(key)
$("#" + sidebar_filter).tab('show') if sidebar_filter


@Dashboard = Dashboard
5 changes: 1 addition & 4 deletions app/assets/javascripts/diff.js.coffee
@@ -1,4 +1,4 @@
class Diff
class @Diff
UNFOLD_COUNT = 20
constructor: ->
$(document).on('click', '.js-unfold', (event) =>
Expand Down Expand Up @@ -41,6 +41,3 @@ class Diff
lines = line.children().slice(0, 2)
line_numbers = ($(l).attr('data-linenumber') for l in lines)
(parseInt(line_number) for line_number in line_numbers)


@Diff = Diff
4 changes: 1 addition & 3 deletions app/assets/javascripts/flash.js.coffee
@@ -1,4 +1,4 @@
class Flash
class @Flash
constructor: (message, type)->
flash = $(".flash-container")
flash.html("")
Expand All @@ -10,5 +10,3 @@ class Flash

flash.click -> $(@).fadeOut()
flash.show()

@Flash = Flash
4 changes: 1 addition & 3 deletions app/assets/javascripts/groups.js.coffee
@@ -1,10 +1,8 @@
class GroupMembers
class @GroupMembers
constructor: ->
$('li.group_member').bind 'ajax:success', ->
$(this).fadeOut()

@GroupMembers = GroupMembers

$ ->
# avatar
$('.js-choose-group-avatar-button').bind "click", ->
Expand Down
4 changes: 1 addition & 3 deletions app/assets/javascripts/issue.js.coffee
@@ -1,4 +1,4 @@
class Issue
class @Issue
constructor: ->
$('.edit-issue.inline-update input[type="submit"]').hide()
$(".issue-box .inline-update").on "change", "select", ->
Expand All @@ -15,5 +15,3 @@ class Issue
"issue"
updateTaskState
)

@Issue = Issue
4 changes: 1 addition & 3 deletions app/assets/javascripts/labels.js.coffee
@@ -1,4 +1,4 @@
class Labels
class @Labels
constructor: ->
form = $('.label-form')
@setupLabelForm(form)
Expand Down Expand Up @@ -31,5 +31,3 @@ class Labels
# Notify the form, that color has changed
$('.label-form').trigger('keyup')
e.preventDefault()

@Labels = Labels
4 changes: 1 addition & 3 deletions app/assets/javascripts/merge_request.js.coffee
@@ -1,4 +1,4 @@
class MergeRequest
class @MergeRequest
constructor: (@opts) ->
@initContextWidget()
this.$el = $('.merge-request')
Expand Down Expand Up @@ -132,5 +132,3 @@ class MergeRequest
this.$('.automerge_widget').hide()
this.$('.merge-in-progress').hide()
this.$('.automerge_widget.already_cannot_be_merged').show()

this.MergeRequest = MergeRequest
4 changes: 1 addition & 3 deletions app/assets/javascripts/milestone.js.coffee
@@ -1,4 +1,4 @@
class Milestone
class @Milestone
@updateIssue: (li, issue_url, data) ->
$.ajax
type: "PUT"
Expand Down Expand Up @@ -115,5 +115,3 @@ class Milestone
Milestone.updateMergeRequest(ui.item, merge_request_url, data)

).disableSelection()

@Milestone = Milestone
6 changes: 1 addition & 5 deletions app/assets/javascripts/notes.js.coffee
@@ -1,4 +1,4 @@
class Notes
class @Notes
@interval: null

constructor: (notes_url, note_ids, last_fetched_at) ->
Expand Down Expand Up @@ -514,7 +514,3 @@ class Notes
else
form.find('.js-note-target-reopen').text('Reopen')
form.find('.js-note-target-close').text('Close')



@Notes = Notes
4 changes: 1 addition & 3 deletions app/assets/javascripts/notes_votes.js.coffee
@@ -1,4 +1,4 @@
class NotesVotes
class @NotesVotes
updateVotes: ->
votes = $("#votes .votes")
notes = $("#notes-list .note .vote")
Expand All @@ -18,5 +18,3 @@ class NotesVotes
# replace vote numbers
votes.find(".upvotes").text votes.find(".upvotes").text().replace(/\d+/, upvotes)
votes.find(".downvotes").text votes.find(".downvotes").text().replace(/\d+/, downvotes)

@NotesVotes = NotesVotes
5 changes: 1 addition & 4 deletions app/assets/javascripts/project.js.coffee
@@ -1,4 +1,4 @@
class Project
class @Project
constructor: ->
$('.project-edit-container').on 'ajax:before', =>
$('.project-edit-container').hide()
Expand All @@ -24,9 +24,6 @@ class Project
else
$('#project_issues_tracker_id').removeAttr('disabled')


@Project = Project

$ ->
# Git clone panel switcher
scope = $ '.git-clone-holder'
Expand Down
4 changes: 1 addition & 3 deletions app/assets/javascripts/project_import.js.coffee
@@ -1,7 +1,5 @@
class ProjectImport
class @ProjectImport
constructor: ->
setTimeout ->
Turbolinks.visit(location.href)
, 5000

@ProjectImport = ProjectImport
4 changes: 1 addition & 3 deletions app/assets/javascripts/search_autocomplete.js.coffee
@@ -1,4 +1,4 @@
class SearchAutocomplete
class @SearchAutocomplete
constructor: (search_autocomplete_path, project_id, project_ref) ->
project_id = '' unless project_id
project_ref = '' unless project_ref
Expand All @@ -9,5 +9,3 @@ class SearchAutocomplete
minLength: 1
select: (event, ui) ->
location.href = ui.item.url

@SearchAutocomplete = SearchAutocomplete
2 changes: 1 addition & 1 deletion app/assets/javascripts/stat_graph.js.coffee
@@ -1,4 +1,4 @@
class window.StatGraph
class @StatGraph
@log: {}
@get_log: ->
@log
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/stat_graph_contributors.js.coffee
@@ -1,4 +1,4 @@
class window.ContributorsStatGraph
class @ContributorsStatGraph
init: (log) ->
@parsed_log = ContributorsStatGraphUtil.parse_log(log)
@set_current_field("commits")
Expand Down
@@ -1,4 +1,4 @@
class window.ContributorsGraph
class @ContributorsGraph
MARGIN:
top: 20
right: 20
Expand Down Expand Up @@ -44,7 +44,7 @@ class window.ContributorsGraph
set_data: (data) ->
@data = data

class window.ContributorsMasterGraph extends ContributorsGraph
class @ContributorsMasterGraph extends ContributorsGraph
constructor: (@data) ->
@width = $('.container').width() - 70
@height = 200
Expand Down Expand Up @@ -117,7 +117,7 @@ class window.ContributorsMasterGraph extends ContributorsGraph
@svg.select("path").attr("d", @area)
@svg.select(".y.axis").call(@y_axis)

class window.ContributorsAuthorGraph extends ContributorsGraph
class @ContributorsAuthorGraph extends ContributorsGraph
constructor: (@data) ->
@width = $('.container').width()/2 - 100
@height = 200
Expand Down
4 changes: 1 addition & 3 deletions app/assets/javascripts/team_members.js.coffee
@@ -1,6 +1,4 @@
class TeamMembers
class @TeamMembers
constructor: ->
$('.team-members .project-access-select').on "change", ->
$(this.form).submit()

@TeamMembers = TeamMembers
4 changes: 1 addition & 3 deletions app/assets/javascripts/tree.js.coffee
@@ -1,4 +1,4 @@
class TreeView
class @TreeView
constructor: ->
@initKeyNav()

Expand Down Expand Up @@ -39,5 +39,3 @@ class TreeView
else if e.which is 13
path = $('.tree-item.selected .tree-item-file-name a').attr('href')
Turbolinks.visit(path)

@TreeView = TreeView
5 changes: 1 addition & 4 deletions app/assets/javascripts/wikis.js.coffee
@@ -1,4 +1,4 @@
class Wikis
class @Wikis
constructor: ->
$('.build-new-wiki').bind "click", ->
field = $('#new_wiki_path')
Expand All @@ -7,6 +7,3 @@ class Wikis

if(slug.length > 0)
location.href = path + "/" + slug


@Wikis = Wikis
8 changes: 3 additions & 5 deletions app/controllers/admin/projects_controller.rb
Expand Up @@ -31,17 +31,15 @@ def transfer
protected

def project
id = params[:project_id] || params[:id]

@project = Project.find_with_namespace(id)
@project = Project.find_with_namespace(params[:id])
@project || render_404
end

def group
@group ||= project.group
@group ||= @project.group
end

def repository
@repository ||= project.repository
@repository ||= @project.repository
end
end

0 comments on commit c3b81e5

Please sign in to comment.