Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-06-11 09:52:44 +0400
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-06-11 14:55:38 +0400
commita6dad85d2f94d4e7763eb6b0daefde5f039ece34 (patch)
treed59f25ee829bcee196a81f540815da90496eae91 /app
parent4a14db9391611647eee7a071006b119e8f08cdcb (diff)
Get rid of modularity gem, Styled 'nothing here' message
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/gitlab_bootstrap.scss7
-rw-r--r--app/controllers/projects_controller.rb12
-rw-r--r--app/decorators/milestone_decorator.rb4
-rw-r--r--app/models/project.rb19
-rw-r--r--app/views/dashboard/issues.html.haml3
-rw-r--r--app/views/dashboard/merge_requests.html.haml3
-rw-r--r--app/views/help/web_hooks.html.haml2
-rw-r--r--app/views/keys/index.html.haml5
-rw-r--r--app/views/projects/index.html.haml14
9 files changed, 41 insertions, 28 deletions
diff --git a/app/assets/stylesheets/gitlab_bootstrap.scss b/app/assets/stylesheets/gitlab_bootstrap.scss
index a8a38290765..af319b51405 100644
--- a/app/assets/stylesheets/gitlab_bootstrap.scss
+++ b/app/assets/stylesheets/gitlab_bootstrap.scss
@@ -403,7 +403,7 @@ form {
margin-bottom: 40px;
@include round-borders-all(4px);
@include shade;
- border-color:#ddd;
+ border-color:#CCC;
ul {
margin:0;
@@ -522,3 +522,8 @@ ul.breadcrumb {
}
}
+.nothing_here_message {
+ text-align:center;
+ padding:20px;
+ color:#777;
+}
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 35938167d4e..2da97098719 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -29,17 +29,7 @@ class ProjectsController < ApplicationController
end
def create
- @project = Project.new(params[:project])
- @project.owner = current_user
-
- Project.transaction do
- @project.save!
- @project.users_projects.create!(:project_access => UsersProject::MASTER, :user => current_user)
-
- # when project saved no team member exist so
- # project repository should be updated after first user add
- @project.update_repository
- end
+ @project = Project.create_by_user(params[:project], current_user)
respond_to do |format|
if @project.valid?
diff --git a/app/decorators/milestone_decorator.rb b/app/decorators/milestone_decorator.rb
deleted file mode 100644
index c881da0e9ad..00000000000
--- a/app/decorators/milestone_decorator.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-class MilestoneDecorator < ApplicationDecorator
- decorates :milestone
-
-end
diff --git a/app/models/project.rb b/app/models/project.rb
index 12556d35202..2e4b12e9990 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -42,6 +42,25 @@ class Project < ActiveRecord::Base
where("name like :query or code like :query or path like :query", :query => "%#{query}%")
end
+ def self.create_by_user(params, user)
+ project = Project.new params
+
+ Project.transaction do
+ project.owner = user
+
+ project.save!
+
+ # Add user as project master
+ project.users_projects.create!(:project_access => UsersProject::MASTER, :user => user)
+
+ # when project saved no team member exist so
+ # project repository should be updated after first user add
+ project.update_repository
+ end
+
+ project
+ end
+
#
# Validations
#
diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml
index 9516578d12d..b794e634bf8 100644
--- a/app/views/dashboard/issues.html.haml
+++ b/app/views/dashboard/issues.html.haml
@@ -15,5 +15,4 @@
%hr
= paginate @issues, :theme => "gitlab"
- else
- %h4.padded
- %center Nothing to show here
+ %h3.nothing_here_message Nothing to show here
diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml
index a7c9ed201a1..a7a78f519be 100644
--- a/app/views/dashboard/merge_requests.html.haml
+++ b/app/views/dashboard/merge_requests.html.haml
@@ -15,5 +15,4 @@
= paginate @merge_requests, :theme => "gitlab"
- else
- %h4.padded
- %center Nothing to show here
+ %h3.nothing_here_message Nothing to show here
diff --git a/app/views/help/web_hooks.html.haml b/app/views/help/web_hooks.html.haml
index 2db69bd76d9..0e63237b8cb 100644
--- a/app/views/help/web_hooks.html.haml
+++ b/app/views/help/web_hooks.html.haml
@@ -3,5 +3,5 @@
%p Application will send POST request with some data like example below:
%h5 Hooks request example:
-.borders= render "hooks/data_ex"
+= render "hooks/data_ex"
diff --git a/app/views/keys/index.html.haml b/app/views/keys/index.html.haml
index 565cc800a8f..56ca4e818ea 100644
--- a/app/views/keys/index.html.haml
+++ b/app/views/keys/index.html.haml
@@ -12,3 +12,8 @@
%th
- @keys.each do |key|
= render(:partial => 'show', :locals => {:key => key})
+ - if @keys.blank?
+ %tr
+ %td{:colspan => 3}
+ %h3.nothing_here_message There are no SSH keys with access to your account.
+
diff --git a/app/views/projects/index.html.haml b/app/views/projects/index.html.haml
index 6b050e0c86d..4a47e126043 100644
--- a/app/views/projects/index.html.haml
+++ b/app/views/projects/index.html.haml
@@ -35,15 +35,15 @@
.bottom= paginate @projects, :theme => "gitlab"
- else
- %h3 Nothing here
+ %h3.nothing_here_message There are no projects you have access to.
%br
- - if current_user.can_create_project?
- .alert-message.block-message.warning
+ %h4.nothing_here_message
+ - if current_user.can_create_project?
You can create up to
= current_user.projects_limit
- projects. Click on link below to add a new one
+ projects. Click on button below to add a new one
.link_holder
- = link_to new_project_path, :class => "" do
+ = link_to new_project_path, :class => "btn primary" do
New Project ยป
- - else
- If you will be added to project - it will be displayed here
+ - else
+ If you will be added to project - it will be displayed here