Skip to content
Snippets Groups Projects
Commit 0a94640e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch 'refactoring/backend'

parents e6c0673e de6fa5dd
No related branches found
No related tags found
No related merge requests found
Showing
with 111 additions and 232 deletions
Loading
Loading
@@ -24,3 +24,4 @@ db/data.yml
.DS_Store
.chef
vendor/bundle/*
rails_best_practices_output.html
Loading
Loading
@@ -8,7 +8,7 @@ branches:
only:
- 'master'
rvm:
- 1.9.3
- 1.9.2
services:
- mysql
- postgresql
Loading
Loading
Loading
Loading
@@ -123,6 +123,8 @@ group :development do
gem 'better_errors'
gem 'binding_of_caller'
 
gem 'rails_best_practices'
# Docs generator
gem "sdoc"
end
Loading
Loading
Loading
Loading
@@ -132,6 +132,8 @@ GEM
chosen-rails (0.9.8)
railties (~> 3.0)
thor (~> 0.14)
code_analyzer (0.3.1)
sexp_processor
coderay (1.0.8)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
Loading
Loading
@@ -302,6 +304,7 @@ GEM
pg (0.14.1)
polyglot (0.3.3)
posix-spawn (0.3.6)
progressbar (0.12.0)
pry (0.9.10)
coderay (~> 1.0.5)
method_source (~> 0.8)
Loading
Loading
@@ -335,6 +338,14 @@ GEM
rails-dev-tweaks (0.6.1)
actionpack (~> 3.1)
railties (~> 3.1)
rails_best_practices (1.13.2)
activesupport
awesome_print
code_analyzer
colored
erubis
i18n
progressbar
railties (3.2.9)
actionpack (= 3.2.9)
activesupport (= 3.2.9)
Loading
Loading
@@ -393,6 +404,7 @@ GEM
multi_json (~> 1.0)
rubyzip
settingslogic (2.0.8)
sexp_processor (4.1.3)
shoulda-matchers (1.3.0)
activesupport (>= 3.0.0)
simplecov (0.7.1)
Loading
Loading
@@ -512,6 +524,7 @@ DEPENDENCIES
rack-mini-profiler
rails (= 3.2.9)
rails-dev-tweaks
rails_best_practices
raphael-rails (= 1.5.2)
rb-fsevent
rb-inotify
Loading
Loading
/**
* ===================================
* Contain 3 main UI block elements:
* .main_box - for show pages
* .ui-box - for simple block & widgets
* Contain UI block elements:
* .ui-box - for any block & widgets
* ===================================
*/
 
/**
* UI box element
* contains top, middle, bottom blocks
* UI Block
*
*/
.main_box {
@extend .borders;
@extend .prepend-top-20;
@extend .append-bottom-20;
border-width: 1px;
.ui-box {
background: #F9F9F9;
margin-bottom: 25px;
border: 1px solid #CCC;
@include solid-shade;
 
&.ui-box-show {
margin:20px 0;
background: #FFF;
}
 
img { max-width: 100%; }
 
Loading
Loading
@@ -27,9 +28,9 @@
}
}
 
.top_box_content,
.middle_box_content,
.bottom_box_content {
.ui-box-head,
.ui-box-body,
.ui-box-bottom {
padding: 15px;
word-wrap: break-word;
 
Loading
Loading
@@ -39,19 +40,25 @@
border: none;
padding: 0;
}
.clearfix {
margin: 0;
}
}
 
.top_box_content {
.ui-box-head {
.box-title {
color: $style_color;
font-size: 18px;
font-weight: normal;
line-height: 28px;
}
h3 {
margin: 0;
}
}
 
.middle_box_content {
@include border-radius(0);
.ui-box-body {
border: none;
font-size: 12px;
background-color: #f5f5f5;
Loading
Loading
@@ -59,24 +66,9 @@
border-top: 1px solid #eee;
}
 
.bottom_box_content {
.ui-box-bottom {
border-top: 1px solid #eee;
}
}
/**
* Big UI Block for show page content
*
*/
.ui-box {
background: #F9F9F9;
margin-bottom: 25px;
border: 1px solid #eaeaea;
@include border-radius(4px);
border-color: #CCC;
@include solid-shade;
 
&.white {
background: #fff;
Loading
Loading
@@ -86,47 +78,47 @@
margin: 0;
}
 
h5, .title {
padding: 0 10px;
@include border-radius(4px 4px 0 0);
.title {
@include bg-gray-gradient;
border-top: 1px solid #eaeaea;
border-bottom: 1px solid #bbb;
border-bottom: 1px solid #CCC;
color: #456;
font-size: 16px;
text-shadow: 0 1px 1px #fff;
padding: 0px 10px;
line-height: 36px;
font-size: 14px;
font-weight: normal;
 
> a {
text-shadow: 0 1px 1px #fff;
}
 
&.small {
line-height: 28px;
font-size: 14px;
line-height: 28px;
text-shadow: 0 1px 1px white;
}
form {
padding: 9px 0;
margin: 0px;
margin-bottom: 0;
margin-top: 3px;
}
 
.nav-pills {
li {
padding: 3px 0;
&.active a { background-color: $style_color; }
a {
@include border-radius(7px);
> li {
> a {
padding: 13px;
margin: 0;
font-size: 13px;
}
&.active {
> a {
background: #D5D5D5;
color: $style_color;
@include border-radius(0);
border-radius: 0;
border-left: 1px solid #CCC;
border-right: 1px solid #CCC;
}
}
}
}
}
 
.bottom {
@include bg-gray-gradient;
@include border-radius(0 0 4px 4px);
border-bottom: none;
border-top: 1px solid #bbb;
}
&.padded {
h5, .title {
margin: -20px;
Loading
Loading
@@ -143,6 +135,7 @@
color: #777;
}
}
.row_title {
font-weight: bold;
color: #444;
Loading
Loading
@@ -151,8 +144,4 @@
text-decoration: underline;
}
}
.ui-box-body {
padding: 10px;
}
}
Loading
Loading
@@ -23,14 +23,12 @@
border-bottom: 1px solid #ADF;
}
 
&:first-child {
@include border-radius(4px 4px 0 0);
border-top: none;
}
&:last-child {
@include border-radius(0 0 4px 4px);
border: none;
border-bottom: none;
&.bottom {
background: #f5f5f5;
}
}
 
.author { color: #999; }
Loading
Loading
Loading
Loading
@@ -25,7 +25,7 @@ table {
}
 
th, td {
padding: 8px;
padding: 10px;
line-height: 18px;
text-align: left;
}
Loading
Loading
.commit-box {
@extend .main_box;
.commit-head {
@extend .top_box_content;
.commit-title {
line-height: 26px;
margin: 0;
}
.commit-description {
font-size: 14px;
border: none;
background-color: white;
padding-top: 10px;
}
.browse-button {
@extend .btn;
@extend .btn-small;
float: right;
}
}
.commit-info {
@extend .middle_box_content;
@extend .clearfix;
.sha-block {
text-align: right;
&:first-child {
padding-bottom: 6px;
}
a {
border-bottom: 1px solid #aaa;
margin-left: 9px;
}
}
&.merge-commit .sha-block {
clear: right;
}
.committer {
padding-left: 32px;
}
.author a,
.committer a {
font-size: 14px;
line-height: 22px;
text-shadow: 0 1px 1px #fff;
color: #777;
&:hover {
color: #999;
}
}
.avatar {
margin-right: 10px;
}
}
}
/**
*
* COMMIT SHOw
*
*/
.commit-committer-link,
.commit-author-link {
font-size: 13px;
color: #555;
&:hover {
color: #999;
}
}
.diff_file {
border: 1px solid #CCC;
margin-bottom: 1em;
Loading
Loading
@@ -255,13 +198,6 @@
min-width: 65px;
font-family: $monospace;
}
.commit-author-name {
color: #777;
&:hover {
color: #999;
}
}
}
 
.diff_file_header a,
Loading
Loading
.issue_form_box {
@extend .main_box;
.issue_title {
@extend .top_box_content;
.clearfix {
margin-bottom: 0px;
input {
@extend .span8;
}
}
}
.issue_middle_block {
@extend .middle_box_content;
height: 30px;
.issue_assignee {
@extend .span6;
float: left;
}
.issue_milestone {
@extend .span4;
float: left;
}
}
.issue_description {
@extend .bottom_box_content;
}
}
.issues_table {
.issue {
padding: 7px 10px;
Loading
Loading
@@ -89,31 +61,25 @@ input.check_all_issues {
 
#issues-table-holder {
.issues_filters {
form {
padding: 0;
margin: 0;
margin-top:7px
}
}
 
.issues_bulk_update {
margin: 0;
form {
padding: 0;
margin: 0;
margin-top:7px
float:left;
}
.update_selected_issues {
position: relative;
top:-2px;
top:5px;
margin-left: 4px;
float: left;
}
 
.update_issues_text {
padding: 3px;
line-height: 18px;
line-height: 28px;
float: left;
color: #479;
}
}
}
Loading
Loading
/**
* MR form
*
*/
.mr_branch_box {
@extend .ui-box;
margin-bottom: 20px;
.body {
background: #f1f1f1;
}
}
 
/**
* MR -> show: Automerge widget
Loading
Loading
@@ -121,19 +107,3 @@ li.merge_request {
.mr_direction_tip {
margin-top:40px
}
.merge_requests_form_box {
@extend .main_box;
.merge_requests_middle_box {
@extend .middle_box_content;
height: 30px;
.merge_requests_assignee {
@extend .span6;
float: left;
}
.merge_requests_milestone {
@extend .span4;
float: left;
}
}
}
Loading
Loading
@@ -8,16 +8,12 @@
 
.groups_box,
.projects_box {
> h5 {
color: $style_color;
font-size: 16px;
text-shadow: 0 1px 1px #fff;
padding: 2px 10px;
line-height: 32px;
font-size: 14px;
> .title {
padding: 2px 15px;
}
.nav-projects-tabs li { padding: 0; }
.well-list {
li { padding: 15px; }
.arrow {
float: right;
padding: 10px;
Loading
Loading
@@ -109,7 +105,7 @@ ul.nav.nav-projects-tabs {
 
li {
a {
padding: 4px 20px;
padding: 6px 25px;
margin-top: 2px;
border-color: #DDD;
background-color: #EEE;
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ class CommitLoadContext < BaseContext
status: :ok
}
 
commit = project.commit(params[:id])
commit = project.repository.commit(params[:id])
 
if commit
commit = CommitDecorator.decorate(commit)
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ module Notes
 
@notes = case target_type
when "commit"
project.commit_notes(project.commit(target_id)).fresh.limit(20)
project.commit_notes(project.repository.commit(target_id)).fresh.limit(20)
when "issue"
project.issues.find(target_id).notes.inc_author.fresh.limit(20)
when "merge_request"
Loading
Loading
@@ -18,7 +18,7 @@ module Notes
project.snippets.find(target_id).notes.fresh
when "wall"
# this is the only case, where the order is DESC
project.common_notes.order("created_at DESC, id DESC").limit(50)
project.notes.common.inc_author_project.order("created_at DESC, id DESC").limit(50)
end
 
@notes = if after_id
Loading
Loading
class TestHookContext < BaseContext
def execute
hook = project.hooks.find(params[:id])
commits = project.commits(project.default_branch, nil, 3)
commits = project.repository.commits(project.default_branch, nil, 3)
data = project.post_receive_data(commits.last.id, commits.first.id, "refs/heads/#{project.default_branch}", current_user)
hook.execute(data)
end
Loading
Loading
Loading
Loading
@@ -10,6 +10,7 @@ class Admin::ProjectsController < AdminController
end
 
def show
@repository = @project.repository
@users = User.active
@users = @users.not_in_project(@project) if @project.users.present?
@users = @users.all
Loading
Loading
@@ -19,7 +20,7 @@ class Admin::ProjectsController < AdminController
end
 
def team_update
@project.add_users_ids_to_team(params[:user_ids], params[:project_access])
@project.team.add_users_ids(params[:user_ids], params[:project_access])
 
redirect_to [:admin, @project], notice: 'Project was successfully updated.'
end
Loading
Loading
@@ -36,7 +37,7 @@ class Admin::ProjectsController < AdminController
 
def destroy
# Delete team first in order to prevent multiple gitolite calls
@project.truncate_team
@project.team.truncate
 
@project.destroy
 
Loading
Loading
Loading
Loading
@@ -19,9 +19,9 @@ class Admin::UsersController < AdminController
def team_update
@admin_user = User.find(params[:id])
 
UsersProject.user_bulk_import(
@admin_user,
UsersProject.add_users_into_projects(
params[:project_ids],
[@admin_user.id],
params[:project_access]
)
 
Loading
Loading
Loading
Loading
@@ -76,6 +76,12 @@ class ApplicationController < ActionController::Base
end
end
 
def repository
@repository ||= project.repository
rescue Grit::NoSuchPathError
nil
end
def add_abilities
abilities << Ability
end
Loading
Loading
Loading
Loading
@@ -9,10 +9,10 @@ class CommitsController < ProjectResourceController
before_filter :require_non_empty_project
 
def show
@repo = @project.repo
@repo = @project.repository
@limit, @offset = (params[:limit] || 40), (params[:offset] || 0)
 
@commits = @project.commits(@ref, @path, @limit, @offset)
@commits = @repo.commits(@ref, @path, @limit, @offset)
@commits = CommitDecorator.decorate(@commits)
 
respond_to do |format|
Loading
Loading
Loading
Loading
@@ -83,12 +83,12 @@ class MergeRequestsController < ProjectResourceController
end
 
def branch_from
@commit = project.commit(params[:ref])
@commit = @repository.commit(params[:ref])
@commit = CommitDecorator.decorate(@commit)
end
 
def branch_to
@commit = project.commit(params[:ref])
@commit = @repository.commit(params[:ref])
@commit = CommitDecorator.decorate(@commit)
end
 
Loading
Loading
class ProjectResourceController < ApplicationController
before_filter :project
before_filter :repository
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment