Commit ad0ca049 authored by Vinnie Okada's avatar Vinnie Okada

Merge branch 'master' into fix-restricted-visibility

Conflicts:
	db/schema.rb
parents 13e9f4f3 19e0dafb
Please view this file on the master branch, on stable branches it's out of date.
v 7.9.0 (unreleased)
- Update documentation for object_kind field in Webhook push and tag push Webhooks (Stan Hu)
- Fix broken email images (Hannes Rosenögger)
- Fix mass SQL statements on initial push (Hannes Rosenögger)
- Add tag push notifications and normalize HipChat and Slack messages to be consistent (Stan Hu)
- Add comment notification events to HipChat and Slack services (Stan Hu)
- Add issue and merge request events to HipChat and Slack services (Stan Hu)
- Fix merge request URL passed to Webhooks. (Stan Hu)
- Fix bug that caused a server error when editing a comment to "+1" or "-1" (Stan Hu)
- Fix code preview theme setting for comments, issues, merge requests, and snippets (Stan Hu)
- Move labels/milestones tabs to sidebar
- Upgrade Rails gem to version 4.1.9.
- Improve error messages for file edit failures
......@@ -32,6 +36,46 @@ v 7.9.0 (unreleased)
- Support referencing issues to a project whose name starts with a digit
- Condense commits already in target branch when updating merge request source branch.
- Send notifications and leave system comments when bulk updating issues.
- Automatically link commit ranges to compare page: sha1...sha4 or sha1..sha4 (includes sha1 in comparison)
- Move groups page from profile to dashboard
- Starred projects page at dashboard
- Blocking user does not remove him/her from project/groups but show blocked label
- Change subject of EmailsOnPush emails to include namespace, project and branch.
- Change subject of EmailsOnPush emails to include first commit message when multiple were pushed.
- Remove confusing footer from EmailsOnPush mail body.
- Add list of changed files to EmailsOnPush emails.
- Add option to send EmailsOnPush emails from committer email if domain matches.
- Add option to disable code diffs in EmailOnPush emails.
- Wrap commit message in EmailsOnPush email.
- Send EmailsOnPush emails when deleting commits using force push.
- Fix EmailsOnPush email comparison link to include first commit.
- Fix highliht of selected lines in file
- Reject access to group/project avatar if the user doesn't have access.
- Add database migration to clean group duplicates with same path and name (Make sure you have a backup before update)
- Add GitLab active users count to rake gitlab:check
- Starred projects page at dashboard
- Make email display name configurable
- Improve json validation in hook data
- Use Emoji One
- Updated emoji help documentation to properly reference EmojiOne.
- Fix missing GitHub organisation repositories on import page.
- Added blue theme
- Remove annoying notice messages when create/update merge request
- Allow smb:// links in Markdown text.
- Filter merge request by title or description at Merge Requests page
- Block user if he/she was blocked in Active Directory
- Fix import pages not working after first load.
- Use custom LDAP label in LDAP signin form.
- Execute hooks and services when branch or tag is created or deleted through web interface.
- Block and unblock user if he/she was blocked/unblocked in Active Directory
- Raise recommended number of unicorn workers from 2 to 3
v 7.8.4
- Fix issue_tracker_id substitution in custom issue trackers
- Fix path and name duplication in namespaces
v 7.8.3
- Bump version of gitlab_git fixing annotated tags without message
v 7.8.2
- Fix service migration issue when upgrading from versions prior to 7.3
......@@ -41,6 +85,8 @@ v 7.8.2
- Fix check if user is allowed to view the file attachment
- Fix import check for case sensetive namespaces
- Increase timeout for Git-over-HTTP requests to 1 hour since large pulls/pushes can take a long time.
- Properly handle autosave local storage exceptions.
- Escape wildcards when searching LDAP by username.
v 7.8.1
- Fix run of custom post receive hooks
......
......@@ -63,6 +63,8 @@ Merge requests can be filed either at [gitlab.com](https://gitlab.com/gitlab-org
If you are new to GitLab development (or web development in general), search for the label `easyfix` ([gitlab.com](https://gitlab.com/gitlab-org/gitlab-ce/issues?label_name=easyfix), [github](https://github.com/gitlabhq/gitlabhq/labels/easyfix)). Those are issues easy to fix, marked by the GitLab core-team. If you are unsure how to proceed but want to help, mention one of the core-team members to give you a hint.
To start with GitLab download the [GitLab Development Kit](https://gitlab.com/gitlab-org/gitlab-development-kit) and see [Development section](doc/development/README.md) in the help file.
### Merge request guidelines
If you can, please submit a merge request with the fix or improvements including tests. If you don't know how to fix the issue but can write a test that exposes the issue we will accept that as well. In general bug fixes that include a regression test are merged quickly while new features without proper tests are least likely to receive timely feedback. The workflow to make a merge request is as follows:
......
......@@ -39,7 +39,7 @@ gem "browser"
# Extracting information from a git repository
# Provide access to Gitlab::Git library
gem "gitlab_git", '7.0.1'
gem "gitlab_git", '~> 7.1.0'
# Ruby/Rack Git Smart-HTTP Server Handler
gem 'gitlab-grack', '~> 2.0.0.rc2', require: 'grack'
......@@ -88,7 +88,7 @@ gem "six"
gem "seed-fu"
# Markup pipeline for GitLab
gem 'html-pipeline-gitlab', '~> 0.1.0'
gem 'html-pipeline-gitlab', '~> 0.1'
# Markdown to HTML
gem "github-markup"
......@@ -194,7 +194,7 @@ gem "jquery-scrollto-rails"
gem "raphael-rails", "~> 2.1.2"
gem 'bootstrap-sass', '~> 3.0'
gem "font-awesome-rails", '~> 4.2'
gem "gitlab_emoji", "~> 0.0.1.1"
gem "gitlab_emoji", "~> 0.1"
gem "gon", '~> 5.0.0'
gem 'nprogress-rails'
gem 'request_store'
......
......@@ -144,8 +144,6 @@ GEM
email_spec (1.5.0)
launchy (~> 2.1)
mail (~> 2.2)
emoji (1.0.1)
json
enumerize (0.7.0)
activesupport (>= 3.2)
equalizer (0.0.8)
......@@ -193,6 +191,8 @@ GEM
formatador (0.2.4)
gemnasium-gitlab-service (0.2.5)
rugged (~> 0.21)
gemojione (2.0.0)
json
gherkin-ruby (0.3.1)
racc
github-markup (1.3.1)
......@@ -211,9 +211,9 @@ GEM
charlock_holmes (~> 0.6.6)
escape_utils (~> 0.2.4)
mime-types (~> 1.19)
gitlab_emoji (0.0.1.1)
emoji (~> 1.0.1)
gitlab_git (7.0.1)
gitlab_emoji (0.1.0)
gemojione (~> 2.0)
gitlab_git (7.1.1)
activesupport (~> 4.0)
charlock_holmes (~> 0.6)
gitlab-linguist (~> 3.0)
......@@ -278,10 +278,11 @@ GEM
html-pipeline (1.11.0)
activesupport (>= 2)
nokogiri (~> 1.4)
html-pipeline-gitlab (0.1.5)
html-pipeline-gitlab (0.2.0)
actionpack (~> 4)
gitlab_emoji (~> 0.0.1)
gitlab_emoji (~> 0.1)
html-pipeline (~> 1.11.0)
mime-types
sanitize (~> 2.1)
http_parser.rb (0.5.3)
httparty (0.13.0)
......@@ -607,7 +608,7 @@ GEM
eventmachine (>= 1.0.0)
rack (>= 1.0.0)
thor (0.19.1)
thread_safe (0.3.4)
thread_safe (0.3.5)
tilt (1.4.1)
timers (4.0.1)
hitimes
......@@ -707,8 +708,8 @@ DEPENDENCIES
gitlab-flowdock-git-hook (~> 0.4.2)
gitlab-grack (~> 2.0.0.rc2)
gitlab-linguist (~> 3.0.1)
gitlab_emoji (~> 0.0.1.1)
gitlab_git (= 7.0.1)
gitlab_emoji (~> 0.1)
gitlab_git (~> 7.1.0)
gitlab_meta (= 7.0)
gitlab_omniauth-ldap (= 1.2.0)
gollum-lib (~> 4.0.0)
......@@ -720,7 +721,7 @@ DEPENDENCIES
guard-spinach
haml-rails
hipchat (~> 1.4.0)
html-pipeline-gitlab (~> 0.1.0)
html-pipeline-gitlab (~> 0.1)
httparty
jasmine (= 2.0.2)
jquery-atwho-rails (~> 0.3.3)
......
......@@ -14,7 +14,11 @@ class @Autosave
restore: ->
return unless window.localStorage?
try
text = window.localStorage.getItem @key
catch
return
@field.val text if text?.length > 0
@field.trigger "input"
......@@ -23,6 +27,7 @@ class @Autosave
text = @field.val()
if text?.length > 0
try
window.localStorage.setItem @key, text
else
@reset()
......@@ -30,4 +35,5 @@ class @Autosave
reset: ->
return unless window.localStorage?
try
window.localStorage.removeItem @key
......@@ -26,7 +26,7 @@ class @BlobView
unless isNaN first_line
$("#tree-content-holder .highlight .line").removeClass("hll")
$("#LC#{line}").addClass("hll") for line in [first_line..last_line]
$.scrollTo("#L#{first_line}") unless e?
$.scrollTo("#L#{first_line}", offset: -50) unless e?
# parse selected lines from hash
# always return first and last line (initialized to NaN)
......
......@@ -15,7 +15,7 @@ class @EditBlob
$(".js-commit-button").click ->
$("#file-content").val editor.getValue()
$(".file-editor form").submit()
return
return false
editModePanes = $(".js-edit-mode-pane")
editModeLinks = $(".js-edit-mode a")
......
......@@ -15,7 +15,7 @@ class @NewBlob
$(".js-commit-button").click ->
$("#file-content").val editor.getValue()
$(".file-editor form").submit()
return
return false
editor: ->
return @editor
class @Dashboard
constructor: ->
@initSidebarTab()
new ProjectsList()
initSidebarTab: ->
key = "dashboard_sidebar_filter"
# store selection in cookie
$('.dash-sidebar-tabs a').on 'click', (e) ->
$.cookie(key, $(e.target).attr('id'))
# show tab from cookie
sidebar_filter = $.cookie(key)
$("#" + sidebar_filter).tab('show') if sidebar_filter
......@@ -52,9 +52,13 @@ class Dispatcher
new ZenMode()
when 'projects:merge_requests:index'
shortcut_handler = new ShortcutsNavigation()
MergeRequests.init()
when 'dashboard:show'
new Dashboard()
new Activities()
when 'dashboard:projects:starred'
new Activities()
new ProjectsList()
when 'projects:commit:show'
new Commit()
new Diff()
......
......@@ -26,7 +26,7 @@ class @ImporterStatus
if job.import_status == 'finished'
job_item.removeClass("active").addClass("success")
status_field.html('<span class="cgreen"><i class="fa fa-check"></i> done</span>')
status_field.html('<span><i class="fa fa-check"></i> done</span>')
else if job.import_status == 'started'
status_field.html("<i class='fa fa-spinner fa-spin'></i> started")
else
......
......@@ -47,7 +47,7 @@
initSearch: ->
@timer = null
$("#issue_search").keyup ->
clearTimeout(@timer);
clearTimeout(@timer)
@timer = setTimeout(Issues.filterResults, 500)
filterResults: =>
......
#
# * Filter merge requests
#
@merge_requestsPage = ->
$('#assignee_id').select2()
$('#milestone_id').select2()
$('#milestone_id, #assignee_id').on 'change', ->
$(this).closest('form').submit()
@MergeRequests =
init: ->
MergeRequests.initSearch()
# Make sure we trigger ajax request only after user stop typing
initSearch: ->
@timer = null
$("#issue_search").keyup ->
clearTimeout(@timer)
@timer = setTimeout(MergeRequests.filterResults, 500)
filterResults: =>
form = $("#issue_search_form")
search = $("#issue_search").val()
$('.merge-requests-holder').css("opacity", '0.5')
issues_url = form.attr('action') + '? '+ form.serialize()
$.ajax
type: "GET"
url: form.attr('action')
data: form.serialize()
complete: ->
$('.merge-requests-holder').css("opacity", '1.0')
success: (data) ->
$('.merge-requests-holder').html(data.html)
# Change url so if user reload a page - search results are saved
History.replaceState {page: issues_url}, document.title, issues_url
MergeRequests.reload()
dataType: "json"
reload: ->
$('#filter_issue_search').val($('#issue_search').val())
......@@ -49,6 +49,13 @@ class @Milestone
data: data
success: (data) ->
if data.saved == true
if data.assignee_avatar_url
img_tag = $('<img/>')
img_tag.attr('src', data.assignee_avatar_url)
img_tag.addClass('avatar s16')
$(li).find('.assignee-icon').html(img_tag)
else
$(li).find('.assignee-icon').html('')
$(li).effect 'highlight'
else
new Flash("Issue update failed", 'alert')
......
......@@ -11,12 +11,17 @@
*= require cal-heatmap
*/
@import "main/*";
@import "base/variables";
@import "base/mixins";
@import "base/layout";
/**
* Customized Twitter bootstrap
*/
@import 'gl_bootstrap';
@import 'base/gl_variables';
@import 'base/gl_bootstrap';
/**
* NProgress load bar css
......@@ -39,7 +44,7 @@
* Page specific styles (issues, projects etc):
*/
@import "sections/*";
@import "pages/*";
/**
* Code highlight
......
......@@ -3,17 +3,6 @@
*
*/
$font-size-base: 13px !default;
$nav-pills-active-link-hover-bg: $bg_primary;
$pagination-active-bg: $bg_primary;
$list-group-active-bg: $bg_primary;
$brand-primary: $bg_primary;
$brand-success: $bg_success;
$brand-info: #029ACF;
$brand-warning: $bg_warning;
$brand-danger: $bg_danger;
// Core variables and mixins
@import "bootstrap/variables";
@import "bootstrap/mixins";
......@@ -141,10 +130,6 @@ $brand-danger: $bg_danger;
}
}
}
&.nav-small-tabs > li > a {
padding: 6px 9px;
}
}
.nav-tabs > li > a,
......@@ -152,61 +137,6 @@ $brand-danger: $bg_danger;
color: #666;
}
.nav-compact > li > a {
padding: 6px 12px;
}
.nav-small > li > a {
padding: 3px 5px;
font-size: 12px;
}
/*
* Callouts from Bootstrap3 docs
*
* Not quite alerts, but custom and helpful notes for folks reading the docs.
* Requires a base and modifier class.
*/
/* Common styles for all types */
.bs-callout {
margin: 20px 0;
padding: 20px;
border-left: 3px solid #eee;
color: #666;
background: #f9f9f9;
}
.bs-callout h4 {
margin-top: 0;
margin-bottom: 5px;
}
.bs-callout p:last-child {
margin-bottom: 0;
}
/* Variations */
.bs-callout-danger {
background-color: #fdf7f7;
border-color: #eed3d7;
color: #b94a48;
}
.bs-callout-warning {
background-color: #faf8f0;
border-color: #faebcc;
color: #8a6d3b;
}
.bs-callout-info {
background-color: #f4f8fa;
border-color: #bce8f1;
color: #34789a;
}
.bs-callout-success {
background-color: #dff0d8;
border-color: #5cA64d;
color: #3c763d;
}
/**
* fix to keep tooltips position in top navigation bar
*
......@@ -221,16 +151,10 @@ $brand-danger: $bg_danger;
*
*/
.panel {
@include border-radius(0px);
.panel-heading {
@include border-radius(0px);
font-size: 14px;
line-height: 18px;
.panel-head-actions {
position: relative;
top: -7px;
top: -5px;
float: right;
}
}
......@@ -263,40 +187,62 @@ $brand-danger: $bg_danger;
}
}
.panel-default {
.panel-heading {
background-color: #EEE;
.panel-succes .panel-heading,
.panel-info .panel-heading,
.panel-danger .panel-heading,
.panel-warning .panel-heading,
.panel-primary .panel-heading,
.alert {
a {
@extend .alert-link;
color: #fff;
text-decoration: underline;
}
}
.panel-danger {
@include panel-colored;
.panel-heading {
color: $border_danger;
border-color: $border_danger;
}
// Typography =================================================================
.text-primary,
.text-primary:hover {
color: $brand-primary;
}
.panel-success {
@include panel-colored;
.panel-heading {
color: $border_success;
border-color: $border_success;
}
.text-success,
.text-success:hover {
color: $brand-success;
}
.panel-primary {
@include panel-colored;
.panel-heading {
color: $border_primary;
border-color: $border_primary;
}
.text-danger,
.text-danger:hover {
color: $brand-danger;
}
.panel-warning {
@include panel-colored;
.panel-heading {
color: $border_warning;
border-color: $border_warning;
.text-warning,
.text-warning:hover {
color: $brand-warning;
}
.text-info,
.text-info:hover {
color: $brand-info;
}
// Tables =====================================================================
table.table {
.dropdown-menu a {
text-decoration: none;
}
.success,
.warning,
.danger,
.info {
color: #fff;
a:not(.btn) {
text-decoration: underline;
color: #fff;
}
}
}
This diff is collapsed.
......@@ -4,7 +4,7 @@ html {
&.touch .tooltip { display: none !important; }
body {
padding-top: 47px;
padding-top: 46px;
}
}
......
......@@ -121,14 +121,6 @@
}
}
@mixin page-title {
color: #333;
line-height: 1.5;
font-weight: normal;
margin-top: 0px;
margin-bottom: 10px;
}
@mixin str-truncated($max_width: 82%) {
display: inline-block;
overflow: hidden;
......@@ -137,14 +129,3 @@
white-space: nowrap;
max-width: $max_width;
}
@mixin panel-colored {
border: 1px solid #EEE;
background: $box_bg;
@include box-shadow(0 1px 1px rgba(0, 0, 0, 0.09));
.panel-heading {
font-weight: bold;
background-color: $box_bg;
}
}
/*
* General Colors
*/
$style_color: #474D57;
$hover: #FFF3EB;
$box_bg: #F9F9F9;
/*
* Link colors
*/
$link_color: #446e9b;
$link_hover_color: darken($link-color, 10%);
$btn-border: 1px solid #ccc;
/*
* Success colors (green)
*/
$border_success: #019875;
$bg_success: #019875;
/*
* Danger colors (red)
*/
$border_danger: #d43f3a;
$bg_danger: #d9534f;
$gl-link-color: #446e9b;
$nprogress-color: #c0392b;
$gl-font-size: 14px;
$list-font-size: 15px;
$sidebar_width: 230px;
$avatar_radius: 50%;
$code_font_size: 13px;
$code_line_height: 1.5;
$border-color: #dce4ec;
$background-color: #ECF0F1;
/*
* Primary colors (blue)
*/
$border_primary: #446e9b;
$bg_primary: #446e9b;
* State colors:
*/
$gl-success: #019875;
$gl-danger: #d9534f;
$gl-primary: #446e9b;
$gl-info: #029ACF;
$gl-warning: #EB9532;
$gl-primary: #2C3E50;
$gl-success: #18BC9C;
$gl-info: #3498DB;
$gl-warning: #F39C12;
$gl-danger: #E74C3C;
/*
* Warning colors (yellow)
*/
$bg_warning: #EB9532;
$border_warning: #EB9532;
/**
* Commit Diff Colors
*/
$added: #63c363;
$deleted: #f77;
/**
* NProgress customize
*/
$nprogress-color: #c0392b;
/**
* Font sizes
*/
$list-font-size: 15px;
/**
* Sidebar navigation width
/*
* Fonts
*/
$sidebar_width: 230px;
$avatar_radius: 50%;
$code_font_size: 13px;
$code_line_height: 1.5;
$monospace_font: 'Menlo', 'Liberation Mono', 'Consolas', 'DejaVu Sans Mono', 'Ubuntu Mono', 'Courier New', 'andale mono', 'lucida console', monospace;
$regular_font: "Helvetica Neue", Helvetica, Arial, sans-serif;
......@@ -6,12 +6,10 @@
}
&.btn-create {
@extend .wide;
@extend .btn-success;
}
&.btn-save {
@extend .wide;
@extend .btn-primary;
}
......@@ -23,34 +21,17 @@
float: right;
}
&.wide {
padding-left: 20px;
padding-right: 20px;
}
&.btn-small {
padding: 2px 10px;
font-size: 12px;
}
&.btn-tiny {
font-size: 11px;
padding: 2px 6px;
line-height: 16px;
margin: 2px;
}
&.btn-close {
color: $bg_danger;
border-color: $border_danger;
color: $gl-danger;
border-color: $gl-danger;
&:hover {
color: #B94A48;
}
}
&.btn-reopen {
color: $bg_success;
border-color: $border_success;
color: $gl-success;
border-color: $gl-success;
&:hover {
color: #468847;
}
......@@ -91,6 +72,3 @@
}
}
}
.btn-group-small > .btn { @extend .btn.btn-small; }
.btn-group-tiny > .btn { @extend .btn.btn-tiny; }
......@@ -24,7 +24,7 @@
.slead {
color: #666;
font-size: 14px;
font-size: 15px;
margin-bottom: 12px;
font-weight: normal;
line-height: 24px;
......@@ -61,7 +61,7 @@ pre {
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
background: $bg_primary;
background: $gl-primary;
color: #FFF
}
......@@ -71,7 +71,7 @@ pre {
/** FLASH message **/
.author_link {
color: $link_color;
color: $gl-link-color;
}
.help li { color:$style_color; }
......@@ -306,20 +306,8 @@ table {
width: 100%;
}
.broadcast-message {
padding: 10px;
text-align: center;
background: #555;
color: #BBB;
}
.broadcast-message-preview {
@extend .broadcast-message;
margin-bottom: 20px;
}
.btn-sign-in {
margin-top: 7px;
margin-top: 5px;
text-shadow: none;
}
......@@ -337,8 +325,11 @@ table {
overflow-x: auto;
}
.footer-links a {
.footer-links {
margin-bottom: 20px;
a {
margin-right: 15px;
}
}
.search_box {
......
......@@ -3,7 +3,7 @@
*
*/
.file-holder {
border: 1px solid #CCC;
border: 1px solid $border-color;
margin-bottom: 1em;
table {
......@@ -11,34 +11,30 @@
}
.file-title {
background: #EEE;
border-bottom: 1px solid #CCC;
position: relative;
background: $background-color;
border-bottom: 1px solid $border-color;
text-shadow: 0 1px 1px #fff;
margin: 0;
text-align: left;
padding: 10px 15px;
.options {
.file-actions {
float: right;
margin-top: -3px;
position: absolute;
top: 5px;
right: 15px;
.btn {
padding: 0px 10px;
font-size: 13px;
line-height: 28px;
}
}
.left-options {
margin-top: -3px;
}
.file_name {
font-weight: bold;
padding-left: 3px;
font-size: 14px;
small {
color: #888;
font-size: 13px;
font-weight: normal;
padding-left: 10px;
}
}
}
.file-content {
background: #fff;
......@@ -119,7 +115,7 @@
ol {
margin-left: 40px;
padding: 10px 0;
border-left: 1px solid #CCC;
border-left: 1px solid $border-color;
margin-bottom: 0;
background: white;
li {
......
......@@ -29,7 +29,7 @@ fieldset legend {
padding: 17px 20px 18px;
margin-top: 18px;
margin-bottom: 18px;
background-color: whitesmoke;
background-color: #ecf0f1;
border-top: 1px solid #e5e5e5;
}
......
......@@ -3,7 +3,7 @@
*/
.issue-form, .merge-request-form, .wiki-form {
.description {
height: 20em;
height: 16em;
border-top-left-radius: 0;
}
}
......
......@@ -57,7 +57,7 @@
.note-text .code {
border: none;
box-shadow: none;
background: $box_bg;
background: $background-color;
padding: 1em;
overflow-x: auto;
......
......@@ -11,17 +11,17 @@
margin-right: 5px;
&.issue-box-closed {
background-color: $bg_danger;
background-color: $gl-danger;
color: #FFF;
}
&.issue-box-merged {
background-color: $bg_primary;
background-color: $gl-primary;
color: #FFF;
}
&.issue-box-open {
background-color: $bg_success;
background-color: $gl-success;
color: #FFF;
}
......
......@@ -41,8 +41,8 @@
}
.ui-state-active {
border: 1px solid $bg_primary;
background: $bg_primary;
border: 1px solid $gl-primary;
background: $gl-primary;
color: #FFF;
}
......
......@@ -57,7 +57,6 @@
border: 1px solid #ddd;
min-height: 100px;
padding: 5px;
font-size: 14px;
box-shadow: none;
}
......@@ -77,3 +76,12 @@
}
}
}
.markdown-area {
background: #FFF;
border: 1px solid #ddd;
min-height: 100px;
padding: 5px;
box-shadow: none;
width: 100%;
}
......@@ -43,9 +43,11 @@
}
}
.page-title .new-issue-link {
.page-title {
.note_created_ago, .new-issue-link {
display: none;
}
}
.issue_edited_ago, .note_edited_ago {
display: none;
......
......@@ -147,19 +147,27 @@
.collapse-nav a {
left: 0px;
padding: 5px 23px 3px 22px;
padding: 7px 23px 3px 22px;
}
}
}
.collapse-nav a {
position: fixed;
top: 47px;
padding: 5px 13px 3px 13px;
top: 46px;
padding: 5px 13px 5px 13px;
left: 197px;
font-size: 13px;
background: #EEE;
color: black;
border: 1px solid rgba(0,0,0,0.035);
border-left: 1px solid rgba(0,0,0,0.035);
border-right: 1px solid rgba(0,0,0,0.035);
}
.collapse-nav a:hover {
text-decoration: none;
color: #333;
background: #eaeaea;
}
@media (max-width: $screen-md-max) {
......
......@@ -2,10 +2,9 @@
.select2-container, .select2-container.select2-drop-above {
.select2-choice {
background: #FFF;
border-color: #BBB;
padding: 6px 12px;
font-size: 13px;
line-height: 18px;
border-color: #CCC;
padding: 6px 14px;
line-height: 1.42857143;
height: auto;
.select2-arrow {
......@@ -20,7 +19,7 @@
}
.select2-container-multi .select2-choices .select2-search-field input {
padding: 6px 12px;
padding: 8px 14px;
font-size: 13px;
line-height: 18px;
height: auto;
......@@ -42,7 +41,7 @@
.select2-results {
max-height: 350px;
.select2-highlighted {
background: $bg_primary;
background: $gl-primary;
}
}
}
......
......@@ -9,7 +9,7 @@ table {
th {
font-weight: normal;
font-size: 15px;
border-bottom: 1px solid #CCC !important;
border-bottom: 1px solid $border-color !important;
}
td {
border-color: #F1F1F1 !important;
......
......@@ -2,28 +2,12 @@
* Headers
*
*/
h1.page-title {
@include page-title;
font-size: 28px;
}
h2.page-title {
@include page-title;
font-size: 24px;
}
h3.page-title {
@include page-title;
font-size: 22px;
}
h4.page-title {
.page-title {
margin-top: 0px;
}
h6 {
color: #888;
text-transform: uppercase;
color: #333;
line-height: 1.5;
font-weight: normal;
margin-bottom: 5px;
}
/** CODE **/
......@@ -36,52 +20,6 @@ pre {
}
}
/**
* Links
*
*/
a {
outline: none;
color: $link_color;
&:hover {
text-decoration: underline;
color: $link_hover_color;
}
&:focus {
text-decoration: underline;
}
&.darken {
color: $style_color;
}
&.lined {
text-decoration: underline;
&:hover { text-decoration: underline; }
}
&.gray {
color: gray;
}
&.supp_diff_link {
text-align: center;
padding: 20px 0;
background: #f1f1f1;
width: 100%;
float: left;
}
&.neib {
margin-right: 15px;
}
}
a:focus {
outline: none;
}
.monospace {
font-family: $monospace_font;
}
......
/* https://github.com/MozMorris/tomorrow-pygments */
pre.code.highlight.dark,
.code.dark {
background-color: #1d1f21;
color: #c5c8c6;
pre.code,
.line-numbers,
.line-numbers a {
......@@ -13,8 +17,8 @@
}
// highlight line via anchor
pre.hll {
background-color: #fff !important;
pre .hll {
background-color: #557 !important;
}
.hll { background-color: #373b41 }
......
/* https://github.com/richleland/pygments-css/blob/master/monokai.css */
pre.code.monokai,
.code.monokai {
background: #272822;
color: #f8f8f2;
pre.highlight,
.line-numbers,
.line-numbers a {
......@@ -13,7 +17,7 @@
}
// highlight line via anchor
pre.hll {
pre .hll {
background-color: #49483e !important;
}
......
/* https://gist.github.com/qguv/7936275 */
pre.code.highlight.solarized-dark,
.code.solarized-dark {
background-color: #002b36;
color: #93a1a1;
pre.code,
.line-numbers,
.line-numbers a {
......@@ -13,8 +17,8 @@
}
// highlight line via anchor
pre.hll {
background-color: #073642 !important;
pre .hll {
background-color: #174652 !important;
}
/* Solarized Dark
......
/* https://gist.github.com/qguv/7936275 */
pre.code.highlight.solarized-light,
.code.solarized-light {
background-color: #fdf6e3;
color: #586e75;
pre.code,
.line-numbers,
.line-numbers a {
......@@ -13,8 +17,8 @@
}
// highlight line via anchor
pre.hll {
background-color: #eee8d5 !important;
pre .hll {
background-color: #ddd8c5 !important;
}
/* Solarized Light
......
/* https://github.com/aahan/pygments-github-style */
pre.code.highlight.white,
.code.white {
background-color: #fff;
color: #333;
pre.highlight,
.line-numbers,
.line-numbers a {
......@@ -13,7 +17,7 @@
}
// highlight line via anchor
pre.hll {
pre .hll {
background-color: #f8eec7 !important;
}
......
/** Typo **/
$monospace_font: 'Menlo', 'Liberation Mono', 'Consolas', 'DejaVu Sans Mono', 'Ubuntu Mono', 'Courier New', 'andale mono', 'lucida console', monospace;
$regular_font: "Helvetica Neue", Helvetica, Arial, sans-serif;
......@@ -50,3 +50,14 @@
line-height: 2;
}
}
.broadcast-message {
@extend .alert-warning;
padding: 10px;
text-align: center;
}
.broadcast-message-preview {
@extend .broadcast-message;
margin-bottom: 20px;
}
......@@ -30,7 +30,8 @@
color: #666;
font-size: 14px;
font-weight: normal;
padding: 10px 0;
padding: 3px 0;
margin-bottom: 10px;
}
.commit-info-row {
......@@ -45,15 +46,6 @@
}
}
.commit-committer-link,
.commit-author-link {
font-size: 13px;
color: #555;
&:hover {
color: #999;
}
}
.commit-box {
margin: 10px 0;
border-top: 1px solid #ddd;
......
.commits-compare-switch{
@extend .btn;
background: image-url("switch_icon.png") no-repeat center center;
width: 32px;
height: 32px;
text-indent: -9999px;
float: left;
margin-right: 9px;
border: 1px solid #DDD;
@include border-radius(4px);
padding: 4px;
background-color: #EEE;
}
.lists-separator {
margin: 10px 0;
border-color: #DDD;
......@@ -100,6 +94,7 @@ li.commit {
.commit-row-info {
color: #777;
line-height: 24px;
font-size: 13px;
a {
color: #777;
......
......@@ -23,28 +23,6 @@
}
}
.dash-sidebar-tabs {
margin-bottom: 2px;
border: none;
margin: 0 !important;
li {
&.active {
a {
background-color: #EEE;
border-bottom: 1px solid #EEE !important;
&:hover {
background: #eee;
}
}
}
a {
border-color: #DDD !important;
}
}
}
.project-row, .group-row {
padding: 0 !important;
font-size: 14px;
......@@ -111,17 +89,8 @@
}
.dash-new-project {
background: $bg_success;
border: 1px solid $border_success;
a {
color: #FFF;
}
}
.dash-new-group {
background: $bg_success;
border: 1px solid $border_success;
background: $gl-success;
border: 1px solid $gl-success;
a {
color: #FFF;
......
.diff-file {
border: 1px solid #CCC;
border: 1px solid $border-color;
margin-bottom: 1em;
.diff-header {
@extend .clearfix;
background: #EEE;
border-bottom: 1px solid #CCC;
padding: 5px 5px 5px 10px;
position: relative;
background: $background-color;
border-bottom: 1px solid $border-color;
padding: 10px 15px;
color: #555;
z-index: 10;
> span {
@include str-truncated(65%);
font-family: $monospace_font;
line-height: 2;
}
.diff-btn-group {
float: right;
position: absolute;
top: 5px;
right: 15px;
.btn {
background-color: #FFF;
padding: 0px 10px;
font-size: 13px;
line-height: 28px;
}
}
......@@ -87,7 +92,7 @@
background: #F5F5F5;
color: rgba(0,0,0,0.3);
padding: 0px 5px;
border-right: 1px solid #ccc;
border-right: 1px solid $border-color;
text-align: right;
min-width: 35px;
max-width: 50px;
......@@ -136,7 +141,7 @@
background: #ffecec;
}
&.matched {
color: #ccc;
color: $border-color;
background: #fafafa;
}
&.parallel {
......
......@@ -46,7 +46,6 @@
border-bottom: 1px solid #eee;
.event-title {
@include str-truncated(72%);
color: #333;
font-weight: 500;
font-size: 14px;
.author_name {
......@@ -54,6 +53,7 @@
}
}
.event-body {
font-size: 13px;
margin-left: 35px;
margin-right: 80px;
color: #777;
......@@ -185,11 +185,10 @@
}
.event_filter {
li a {
font-size: 13px;
padding: 5px 10px;
background: rgba(0,0,0,0.045);
margin-left: 4px;
}
}
.project-network {
border: 1px solid #CCC;
border: 1px solid $border-color;
.controls {
color: #888;
font-size: 14px;
padding: 5px;
border-bottom: 1px solid #bbb;
border-bottom: 1px solid $border-color;
background: #EEE;
}
......
......@@ -12,7 +12,6 @@
color: #888;
a {
font-size: 14px;
margin-right: 3px;
}
}
......@@ -29,7 +28,6 @@
th {
padding-top: 15px;
font-size: 14px;
line-height: 1.5;
color: #333;
text-align: left
......
......@@ -11,6 +11,7 @@
.issue-info {
color: #999;
font-size: 13px;
}
.issue-check {
......@@ -40,7 +41,7 @@
}
.check-all-holder {
height: 32px;
height: 36px;
float: left;
margin-right: 12px;
padding: 6px 15px;
......
......@@ -12,14 +12,8 @@
}
.accept-merge-holder {
margin-top: 5px;
.accept-action {
display: inline-block;
.accept_merge_request {
padding: 10px 20px;
}
}
.accept-control {
......@@ -96,6 +90,7 @@
.merge-request-info {
color: #999;
font-size: 13px;
.merge-request-labels {
display: inline-block;
......@@ -122,7 +117,8 @@
}
.mr-state-widget {
background: $box_bg;
font-size: 13px;
background: #F9F9F9;
margin-bottom: 20px;
color: #666;
border: 1px solid #EEE;
......@@ -136,8 +132,8 @@
background-color: #F5F5F5;
&.ci-success {
color: $bg_success;
border-color: $border_success;
color: $gl-success;
border-color: $gl-success;
background-color: #F1FAF1;
}
......@@ -148,20 +144,20 @@
}
&.ci-running {
color: $bg_warning;
border-color: $border_warning;
color: $gl-warning;
border-color: $gl-warning;
background-color: #FAF5F1;
}
&.ci-failed {
color: $bg_danger;
border-color: $border_danger;
color: $gl-danger;
border-color: $gl-danger;
background-color: #FAF1F1;
}
&.ci-error {
color: $bg_danger;
border-color: $border_danger;
color: $gl-danger;
border-color: $gl-danger;
background-color: #FAF1F1;
}
}
......
.issues-sortable-list .str-truncated {
max-width: 70%;
max-width: 90%;
}
li.milestone {
h4 {
font-weight: bold;
}
}
......@@ -38,13 +38,11 @@ ul.notes {
.author {
color: #333;
font-weight: bold;
font-size: 14px;
&:hover {
color: $link_color;
color: $gl-link-color;
}
}
.author-username {
font-size: 14px;
}
}
......@@ -57,9 +55,6 @@ ul.notes {
.note {
display: block;
position:relative;
.attachment {
font-size: 14px;
}
.note-body {
overflow: auto;
.note-text {
......@@ -153,7 +148,6 @@ ul.notes {
@extend .cgray;
&:hover {
color: $link_hover_color;
&.danger { @extend .cred; }
}
}
......@@ -181,10 +175,11 @@ ul.notes {
background: #FFF;
padding: 4px;
font-size: 16px;
color: $link_color;
color: $gl-link-color;
margin-left: -60px;
position: absolute;
z-index: 10;
width: 32px;
transition: all 0.2s ease;
......@@ -193,8 +188,9 @@ ul.notes {
filter: alpha(opacity=0);
&:hover {
font-size: 24px;
background: $bg_primary;
width: 38px;
font-size: 20px;
background: $gl-info;
color: #FFF;
@include show-add-diff-note;
}
......
......@@ -10,13 +10,13 @@
}
.ns-part {
color: $bg_primary;
color: $gl-primary;
}
.ns-watch {
color: $bg_success;
color: $gl-success;
}
.ns-mute {
color: $bg_danger;
color: $gl-danger;
}
......@@ -80,6 +80,10 @@
&.violet {
background: #548;
}
&.blue {
background: #2980b9;
}
}
}
}
......
......@@ -99,25 +99,6 @@
margin-right: 45px;
}
.btn,
.form-control {
border: 1px solid #E1E1E1;
box-shadow: none;
padding: 6px 9px;
}
.btn {
background: none;
color: $link_color;
&.active {
background-color: #f5f5f5;
border: 1px solid rgba(0,0,0,0.195);
color: #333;
font-weight: bold;
}
}
.form-control {
cursor: auto;
@extend .monospace;
......@@ -267,15 +248,15 @@ ul.nav.nav-projects-tabs {
}
.vs-public {
color: $bg_primary;
color: $gl-primary;
}
.vs-internal {
color: $bg_warning;
color: $gl-warning;
}
.vs-private {
color: $bg_success;
color: $gl-success;
}
.breadcrumb.repo-breadcrumb {
......@@ -320,3 +301,8 @@ table.table.protected-branches-list tr.no-border {
border: 0;
}
}
.project-import .btn {
float: left;
margin-right: 10px;
}
......@@ -39,14 +39,9 @@
.tree-item-file-name {
max-width: 320px;
vertical-align: middle;
a {
&:hover {
color: $link_hover_color;
}
}
i {
color: $bg_primary;
i, a {
color: $gl-link-color;
}
img {
......@@ -66,13 +61,18 @@
.tree_author {
padding-right: 8px;
.commit-author-name {
color: gray;
}
}
.tree_commit {
color: gray;
.tree-commit-link {
color: #444;
color: gray;
&:hover {
text-decoration: underline;
}
......
.gitlab-ui-dev-kit {
> h2 {
font-size: 27px;
border-bottom: 1px solid #CCC;
color: #666;
margin: 30px 0;
font-weight: bold;
}
}
.markdown-area {
background: #FFF;
border: 1px solid #ddd;
min-height: 100px;
padding: 5px;
font-size: 14px;
box-shadow: none;
width: 100%;
}
/**
* Modern GitLab UI theme
*/
.ui_blue {
@include dark-theme(#BECDE9, #2980b9, #1970a9, #096099);
}
......@@ -5,12 +5,12 @@ class Admin::GroupsController < Admin::ApplicationController
@groups = Group.all
@groups = @groups.sort(@sort = params[:sort])
@groups = @groups.search(params[:name]) if params[:name].present?
@groups = @groups.page(params[:page]).per(20)
@groups = @groups.page(params[:page]).per(PER_PAGE)
end
def show
@members = @group.members.order("access_level DESC").page(params[:members_page]).per(30)
@projects = @group.projects.page(params[:projects_page]).per(30)
@members = @group.members.order("access_level DESC").page(params[:members_page]).per(PER_PAGE)
@projects = @group.projects.page(params[:projects_page]).per(PER_PAGE)
end
def new
......
......@@ -11,15 +11,15 @@ class Admin::ProjectsController < Admin::ApplicationController
@projects = @projects.abandoned if params[:abandoned].present?
@projects = @projects.search(params[:name]) if params[:name].present?
@projects = @projects.sort(@sort = params[:sort])
@projects = @projects.includes(:namespace).order("namespaces.path, projects.name ASC").page(params[:page]).per(20)
@projects = @projects.includes(:namespace).order("namespaces.path, projects.name ASC").page(params[:page]).per(PER_PAGE)
end
def show
if @group
@group_members = @group.members.order("access_level DESC").page(params[:group_members_page]).per(30)
@group_members = @group.members.order("access_level DESC").page(params[:group_members_page]).per(PER_PAGE)
end
@project_members = @project.project_members.page(params[:project_members_page]).per(30)
@project_members = @project.project_members.page(params[:project_members_page]).per(PER_PAGE)
end
def transfer
......
......@@ -45,7 +45,8 @@ class Admin::ServicesController < Admin::ApplicationController
:room, :recipients, :project_url, :webhook,
:user_key, :device, :priority, :sound, :bamboo_url, :username, :password,
:build_key, :server, :teamcity_url, :build_type,
:description, :issues_url, :new_issue_url, :restrict_to_branch
:description, :issues_url, :new_issue_url, :restrict_to_branch,
:send_from_committer_email, :disable_diffs
])
end
end
......@@ -24,7 +24,7 @@ class Admin::UsersController < Admin::ApplicationController
def block
if user.block
redirect_to :back, alert: "Successfully blocked"
redirect_to :back, notice: "Successfully blocked"
else
redirect_to :back, alert: "Error occurred. User was not blocked"
end
......@@ -32,7 +32,7 @@ class Admin::UsersController < Admin::ApplicationController
def unblock
if user.activate
redirect_to :back, alert: "Successfully unblocked"
redirect_to :back, notice: "Successfully unblocked"
else
redirect_to :back, alert: "Error occurred. User was not unblocked"
end
......
......@@ -4,6 +4,8 @@ class ApplicationController < ActionController::Base
include Gitlab::CurrentSettings
include GitlabRoutingHelper
PER_PAGE = 20
before_filter :authenticate_user_from_token!
before_filter :authenticate_user!
before_filter :reject_blocked!
......
class Profiles::GroupsController < ApplicationController
layout "profile"
class Dashboard::GroupsController < ApplicationController
def index
@user_groups = current_user.group_members.page(params[:page]).per(20)
@user_groups = current_user.group_members.page(params[:page]).per(PER_PAGE)
end
def leave
@users_group = group.group_members.where(user_id: current_user.id).first
if can?(current_user, :destroy, @users_group)
@users_group.destroy
redirect_to(profile_groups_path, info: "You left #{group.name} group.")
redirect_to(dashboard_groups_path, info: "You left #{group.name} group.")
else
return render_403
end
......
......@@ -8,7 +8,7 @@ class Dashboard::MilestonesController < ApplicationController
else state('active')
end
@dashboard_milestones = Milestones::GroupService.new(project_milestones).execute
@dashboard_milestones = Kaminari.paginate_array(@dashboard_milestones).page(params[:page]).per(30)
@dashboard_milestones = Kaminari.paginate_array(@dashboard_milestones).page(params[:page]).per(PER_PAGE)
end
def show
......
class Dashboard::ProjectsController < ApplicationController
before_filter :event_filter
def starred
@projects = current_user.starred_projects
@projects = @projects.includes(:namespace, :forked_from_project, :tags)
@projects = @projects.sort(@sort = params[:sort])
@groups = []
respond_to do |format|
format.html
format.json do
load_events
pager_json("events/_events", @events.count)
end
end
end
private
def load_events
@events = Event.in_projects(@projects.pluck(:id))
@events = @event_filter.apply_filter(@events).with_associations
@events = @events.limit(20).offset(params[:offset] || 0)
end
end
......@@ -5,15 +5,9 @@ class DashboardController < ApplicationController
before_filter :event_filter, only: :show
def show
@projects_limit = 20
@groups = current_user.authorized_groups.order_name_asc
@has_authorized_projects = @projects.count > 0
@projects_count = @projects.count
@projects = @projects.includes(:namespace)
@last_push = current_user.recent_push
@publicish_project_count = Project.publicish(current_user).count
respond_to do |format|
format.html
......@@ -29,38 +23,15 @@ class DashboardController < ApplicationController
end
end
def projects
@projects = case params[:scope]
when 'personal' then
current_user.namespace.projects
when 'joined' then
current_user.authorized_projects.joined(current_user)
when 'owned' then
current_user.owned_projects
else
current_user.authorized_projects
end
@projects = @projects.where(namespace_id: Group.find_by(name: params[:group])) if params[:group].present?
@projects = @projects.where(visibility_level: params[:visibility_level]) if params[:visibility_level].present?
@projects = @projects.includes(:namespace, :forked_from_project, :tags)
@projects = @projects.tagged_with(params[:tag]) if params[:tag].present?
@projects = @projects.sort(@sort = params[:sort])
@projects = @projects.page(params[:page]).per(30)
@tags = current_user.authorized_projects.tags_on(:tags)
@groups = current_user.authorized_groups
end
def merge_requests
@merge_requests = get_merge_requests_collection
@merge_requests = @merge_requests.page(params[:page]).per(20)
@merge_requests = @merge_requests.page(params[:page]).per(PER_PAGE)
@merge_requests = @merge_requests.preload(:author, :target_project)
end
def issues
@issues = get_issues_collection
@issues = @issues.page(params[:page]).per(20)
@issues = @issues.page(params[:page]).per(PER_PAGE)
@issues = @issues.preload(:author, :project)
respond_to do |format|
......
......@@ -8,6 +8,6 @@ class Explore::GroupsController < ApplicationController
@groups = GroupsFinder.new.execute(current_user)
@groups = @groups.search(params[:search]) if params[:search].present?
@groups = @groups.sort(@sort = params[:sort])
@groups = @groups.page(params[:page]).per(20)
@groups = @groups.page(params[:page]).per(PER_PAGE)
end
end
......@@ -6,19 +6,22 @@ class Explore::ProjectsController < ApplicationController
def index
@projects = ProjectsFinder.new.execute(current_user)
@tags = @projects.tags_on(:tags)
@projects = @projects.tagged_with(params[:tag]) if params[:tag].present?
@projects = @projects.where(visibility_level: params[:visibility_level]) if params[:visibility_level].present?
@projects = @projects.search(params[:search]) if params[:search].present?
@projects = @projects.sort(@sort = params[:sort])
@projects = @projects.includes(:namespace).page(params[:page]).per(20)
@projects = @projects.includes(:namespace).page(params[:page]).per(PER_PAGE)
end
def trending
@trending_projects = TrendingProjectsFinder.new.execute(current_user)
@trending_projects = @trending_projects.page(params[:page]).per(10)
@trending_projects = @trending_projects.page(params[:page]).per(PER_PAGE)
end
def starred
@starred_projects = ProjectsFinder.new.execute(current_user)
@starred_projects = @starred_projects.reorder('star_count DESC')
@starred_projects = @starred_projects.page(params[:page]).per(10)
@starred_projects = @starred_projects.page(params[:page]).per(PER_PAGE)
end
end
class Groups::ApplicationController < ApplicationController
private
def authorize_admin_group!
unless can?(current_user, :manage_group, group)
return render_404
end
end
end
class Groups::GroupMembersController < ApplicationController
class Groups::GroupMembersController < Groups::ApplicationController
before_filter :group
# Authorize
......@@ -37,12 +37,6 @@ class Groups::GroupMembersController < ApplicationController
@group ||= Group.find_by(path: params[:group_id])
end
def authorize_admin_group!
unless can?(current_user, :manage_group, group)
return render_404
end
end
def member_params
params.require(:group_member).permit(:access_level, :user_id)
end
......
......@@ -10,7 +10,7 @@ class Groups::MilestonesController < ApplicationController
else state('active')
end
@group_milestones = Milestones::GroupService.new(project_milestones).execute
@group_milestones = Kaminari.paginate_array(@group_milestones).page(params[:page]).per(30)
@group_milestones = Kaminari.paginate_array(@group_milestones).page(params[:page]).per(PER_PAGE)
end
def show
......
class GroupsController < ApplicationController
class GroupsController < Groups::ApplicationController
skip_before_filter :authenticate_user!, only: [:show, :issues, :members, :merge_requests]
respond_to :html
before_filter :group, except: [:new, :create]
......@@ -52,13 +52,13 @@ class GroupsController < ApplicationController
def merge_requests
@merge_requests = get_merge_requests_collection
@merge_requests = @merge_requests.page(params[:page]).per(20)
@merge_requests = @merge_requests.page(params[:page]).per(PER_PAGE)
@merge_requests = @merge_requests.preload(:author, :target_project)
end
def issues
@issues = get_issues_collection
@issues = @issues.page(params[:page]).per(20)
@issues = @issues.page(params[:page]).per(PER_PAGE)
@issues = @issues.preload(:author, :project)
respond_to do |format|
......@@ -132,12 +132,6 @@ class GroupsController < ApplicationController
end
end
def authorize_admin_group!
unless can?(current_user, :manage_group, group)
return render_404
end
end
def set_title
@title = 'New Group'
end
......
......@@ -15,4 +15,7 @@ class HelpController < ApplicationController
def shortcuts
end
def ui
end
end
......@@ -3,19 +3,17 @@ class Import::BaseController < ApplicationController
private
def get_or_create_namespace
existing_namespace = Namespace.find_by_path_or_name(@target_namespace)
if existing_namespace
if existing_namespace.owner == current_user
namespace = existing_namespace
else
begin
namespace = Group.create!(name: @target_namespace, path: @target_namespace, owner: current_user)
namespace.add_owner(current_user)
rescue ActiveRecord::RecordNotUnique, ActiveRecord::RecordInvalid
namespace = Namespace.find_by_path_or_name(@target_namespace)
unless namespace.owner == current_user
@already_been_taken = true
return false
end
else
namespace = Group.create(name: @target_namespace, path: @target_namespace, owner: current_user)
namespace.add_owner(current_user)
namespace
end
namespace
end
end
......@@ -14,7 +14,7 @@ class Import::GithubController < Import::BaseController
def status
@repos = client.repos
client.orgs.each do |org|
@repos += client.repos(org.login)
@repos += client.org_repos(org.login)
end
@already_added_projects = current_user.created_projects.where(import_type: "github")
......
......@@ -43,7 +43,7 @@ class ProfilesController < ApplicationController
end
def history
@events = current_user.recent_events.page(params[:page]).per(20)
@events = current_user.recent_events.page(params[:page]).per(PER_PAGE)
end
def update_username
......
......@@ -7,7 +7,7 @@ class Projects::BlameController < Projects::ApplicationController
before_filter :authorize_download_code!
def show
@blob = @repository.blob_at(@commit.id, @path)
@blame = Gitlab::Git::Blame.new(project.repository, @commit.id, @path)
@blame = Gitlab::Git::Blame.new(@repository, @commit.id, @path)
@blob = @blame.blob
end
end
......@@ -8,7 +8,7 @@ class Projects::BranchesController < Projects::ApplicationController
def index
@sort = params[:sort] || 'name'
@branches = @repository.branches_sorted_by(@sort)
@branches = Kaminari.paginate_array(@branches).page(params[:page]).per(30)
@branches = Kaminari.paginate_array(@branches).page(params[:page]).per(PER_PAGE)
end
def recent
......
......@@ -28,8 +28,8 @@ class Projects::GraphsController < Projects::ApplicationController
@commits.each do |commit|
@log << {
author_name: commit.author_name.force_encoding('UTF-8'),
author_email: commit.author_email.force_encoding('UTF-8'),
author_name: commit.author_name,
author_email: commit.author_email,
date: commit.committed_date.strftime("%Y-%m-%d")
}
end
......
......@@ -37,7 +37,7 @@ class Projects::ImportsController < Projects::ApplicationController
private
def require_no_repo
if @project.repository_exists?
if @project.repository_exists? && !@project.import_in_progress?
redirect_to(namespace_project_path(@project.namespace, @project)) and return
end
end
......
......@@ -20,7 +20,7 @@ class Projects::IssuesController < Projects::ApplicationController
terms = params['issue_search']
@issues = get_issues_collection
@issues = @issues.full_search(terms) if terms.present?
@issues = @issues.page(params[:page]).per(20)
@issues = @issues.page(params[:page]).per(PER_PAGE)
respond_to do |format|
format.html
......
......@@ -7,7 +7,7 @@ class Projects::LabelsController < Projects::ApplicationController
respond_to :js, :html
def index
@labels = @project.labels.page(params[:page]).per(20)
@labels = @project.labels.page(params[:page]).per(PER_PAGE)
end
def new
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment