summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/images/new_project.pngbin0 -> 257 bytes
-rw-r--r--app/assets/stylesheets/gitlab_bootstrap.scss1
-rw-r--r--app/assets/stylesheets/highlight.scss6
-rw-r--r--app/assets/stylesheets/sections/projects.scss25
-rw-r--r--app/assets/stylesheets/ui_basic.scss4
-rw-r--r--app/assets/stylesheets/ui_mars.scss4
-rw-r--r--app/controllers/milestones_controller.rb3
-rw-r--r--app/models/milestone.rb4
-rw-r--r--app/models/user.rb5
-rw-r--r--app/views/dashboard/issues.html.haml29
-rw-r--r--app/views/dashboard/merge_requests.html.haml31
-rw-r--r--app/views/layouts/_head_panel.html.haml5
-rw-r--r--app/views/milestones/show.html.haml24
-rw-r--r--app/views/profile/password.html.haml4
-rw-r--r--app/views/profile/show.html.haml57
-rw-r--r--app/views/projects/_form.html.haml56
-rw-r--r--app/views/projects/_new_form.html.haml29
-rw-r--r--app/views/projects/create.js.haml2
-rw-r--r--app/views/projects/new.html.haml5
-rw-r--r--spec/requests/projects_spec.rb23
20 files changed, 200 insertions, 117 deletions
diff --git a/app/assets/images/new_project.png b/app/assets/images/new_project.png
new file mode 100644
index 00000000000..045dc705ba3
--- /dev/null
+++ b/app/assets/images/new_project.png
Binary files differ
diff --git a/app/assets/stylesheets/gitlab_bootstrap.scss b/app/assets/stylesheets/gitlab_bootstrap.scss
index 641064a3091..64f8a62d9db 100644
--- a/app/assets/stylesheets/gitlab_bootstrap.scss
+++ b/app/assets/stylesheets/gitlab_bootstrap.scss
@@ -111,6 +111,7 @@ table {
&.btn-primary {
background:$link_color;
+ border-color: #2A79A3;
&:hover {
background:$blue_link;
}
diff --git a/app/assets/stylesheets/highlight.scss b/app/assets/stylesheets/highlight.scss
index 8f71c4f57f2..4010edf9129 100644
--- a/app/assets/stylesheets/highlight.scss
+++ b/app/assets/stylesheets/highlight.scss
@@ -64,12 +64,8 @@ table.highlighttable pre{
}
.git-empty .highlight {
- @include round-borders-all(4px);
- background:#eee;
- padding:5px;
- //overflow-x:scroll;
pre{
- padding:0;
+ padding:15px;
line-height:2.0;
margin:0;
font-family: 'Menlo', 'Courier New', 'andale mono','lucida console',monospace;
diff --git a/app/assets/stylesheets/sections/projects.scss b/app/assets/stylesheets/sections/projects.scss
index eb39c8e2788..713cdc67df0 100644
--- a/app/assets/stylesheets/sections/projects.scss
+++ b/app/assets/stylesheets/sections/projects.scss
@@ -13,3 +13,28 @@
}
}
}
+
+.new_project,
+.edit_project {
+ .project_name_holder {
+ input,
+ label {
+ font-size:16px;
+ line-height:20px;
+ padding:8px;
+ }
+ label {
+ color:#888;
+ }
+ .btn {
+ padding:6px;
+ margin-left:10px;
+ }
+ }
+}
+
+.new_project {
+ .field_with_errors {
+ display:inline;
+ }
+}
diff --git a/app/assets/stylesheets/ui_basic.scss b/app/assets/stylesheets/ui_basic.scss
index 1666bcde37e..a2ddb20375e 100644
--- a/app/assets/stylesheets/ui_basic.scss
+++ b/app/assets/stylesheets/ui_basic.scss
@@ -81,11 +81,11 @@
}
}
- .admin_link {
+ .top_panel_ico {
width: 16px;
height: 16px;
padding: 5px;
- margin-right: 15px;
+ margin-right:10px;
float:right;
}
diff --git a/app/assets/stylesheets/ui_mars.scss b/app/assets/stylesheets/ui_mars.scss
index d61df9a5e68..0f7bc9394e1 100644
--- a/app/assets/stylesheets/ui_mars.scss
+++ b/app/assets/stylesheets/ui_mars.scss
@@ -94,11 +94,11 @@
}
}
- .admin_link {
+ .top_panel_ico {
width: 16px;
height: 16px;
padding: 5px;
- margin-right: 15px;
+ margin-right:10px;
float:right;
}
}
diff --git a/app/controllers/milestones_controller.rb b/app/controllers/milestones_controller.rb
index 5e23426f32b..1f2490cb6ef 100644
--- a/app/controllers/milestones_controller.rb
+++ b/app/controllers/milestones_controller.rb
@@ -36,6 +36,9 @@ class MilestonesController < ApplicationController
end
def show
+ @issues = @milestone.issues.opened.page(params[:page]).per(40)
+ @users = @milestone.participants
+
respond_to do |format|
format.html
format.js
diff --git a/app/models/milestone.rb b/app/models/milestone.rb
index 87e9d1db588..733c6a86803 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -9,6 +9,10 @@ class Milestone < ActiveRecord::Base
where("due_date > ? OR due_date IS NULL", Date.today)
end
+ def participants
+ User.where(:id => issues.map(&:assignee_id))
+ end
+
def percent_complete
@percent_complete ||= begin
total_i = self.issues.count
diff --git a/app/models/user.rb b/app/models/user.rb
index b98ae33818f..af88284470d 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -131,6 +131,11 @@ class User < ActiveRecord::Base
self.blocked = true
save
end
+
+ def projects_limit_percent
+ return 100 if projects_limit.zero?
+ (my_own_projects.count.to_f / projects_limit) * 100
+ end
end
# == Schema Information
#
diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml
index bcbfc77404b..9516578d12d 100644
--- a/app/views/dashboard/issues.html.haml
+++ b/app/views/dashboard/issues.html.haml
@@ -1,24 +1,19 @@
%h3
Issues
%small (assigned to you)
+ %small.right #{@issues.total_count} issues
%br
-%div#issues-table-holder.ui-box
- %title
- %ul#issues-table.unstyled
- - if @issues.any?
- - @issues.group_by(&:project).each do |group|
- %li.wll.smoke
- - project = group[0]
- = project.name
+- if @issues.any?
+ - @issues.group_by(&:project).each do |group|
+ %div.ui-box
+ - project = group[0]
+ %h5= project.name
+ %ul.unstyled
- group[1].each do |issue|
= render(:partial => 'issues/show', :locals => {:issue => issue})
- %li.bottom
- .row
- .span7= paginate @issues, :theme => "gitlab"
- .span4.right
- %span.cgray.right #{@issues.total_count} issues
-
- - else
- %li
- %p.padded Nothing to show here
+ %hr
+ = paginate @issues, :theme => "gitlab"
+- else
+ %h4.padded
+ %center Nothing to show here
diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml
index 00803531f00..a0b0426b637 100644
--- a/app/views/dashboard/merge_requests.html.haml
+++ b/app/views/dashboard/merge_requests.html.haml
@@ -1,24 +1,19 @@
%h3
Merge Requests
%small (authored or assigned to you)
+ %small.right #{@merge_requests.total_count} merge requests
%br
-%div#merge_requests-table-holder.ui-box
- %title
- %ul#merge_requests-table.unstyled
- - if @merge_requests.any?
- - @merge_requests.group_by(&:project).each do |group|
- %li.wll.smoke
- - project = group[0]
- = project.name
- - group[1].each do |merge_request|
- = render(:partial => 'merge_requests/merge_request', :locals => {:merge_request => merge_request})
- %li.bottom
- .row
- .span7= paginate @merge_requests, :theme => "gitlab"
- .span4.right
- %span.cgray.right #{@merge_requests.total_count} merge requests
+- if @merge_requests.any?
+ - @merge_requests.group_by(&:project).each do |group|
+ %ul.unstyled.ui-box
+ - project = group[0]
+ %h5= project.name
+ - group[1].each do |merge_request|
+ = render(:partial => 'merge_requests/merge_request', :locals => {:merge_request => merge_request})
+ %hr
+ = paginate @merge_requests, :theme => "gitlab"
- - else
- %li
- %p.padded Nothing to show here
+- else
+ %li
+ %p.padded Nothing to show here
diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml
index 5d09b5bc7eb..dff7a5dd196 100644
--- a/app/views/layouts/_head_panel.html.haml
+++ b/app/views/layouts/_head_panel.html.haml
@@ -11,8 +11,11 @@
.search
= form_tag search_path, :method => :get do |f|
= text_field_tag "search", nil, :placeholder => "Search", :class => "search-input"
+ - if current_user.can_create_project?
+ = link_to new_project_path, :class => "top_panel_ico", :title => "Create New Project" do
+ = image_tag "new_project.png", :width => 16
- if current_user.is_admin?
- = link_to admin_root_path, :class => "admin_link", :title => "Admin area" do
+ = link_to admin_root_path, :class => "top_panel_ico", :title => "Admin area" do
= image_tag "admin.PNG", :width => 16
.account-box
= link_to profile_path, :class => "pic" do
diff --git a/app/views/milestones/show.html.haml b/app/views/milestones/show.html.haml
index 38b198a9acb..4996e7472f7 100644
--- a/app/views/milestones/show.html.haml
+++ b/app/views/milestones/show.html.haml
@@ -42,6 +42,30 @@
= preserve do
= markdown @milestone.description
+.row
+ .span6
+ %h4 Open Issues:
+ - @issues.each do |issue|
+ = link_to [@project, issue] do
+ %h5
+ = image_tag gravatar_icon(issue.assignee_email, 16), :width => "16"
+ &nbsp;
+ Issue ##{issue.id}
+ &ndash;
+ = truncate issue.title, :length => 50
+ %small
+ updated at
+ = issue.updated_at.stamp("Aug 25, 2011")
+ %br
+ = paginate @issues, :theme => "gitlab"
+
+ .span6
+ %h4 Participants:
+ - @users.each do |user|
+ %h5
+ = image_tag gravatar_icon(user.email, 16), :width => "16"
+ &nbsp;
+ = user.name
:javascript
$(function() {
diff --git a/app/views/profile/password.html.haml b/app/views/profile/password.html.haml
index 0234785b6fb..4edf299948a 100644
--- a/app/views/profile/password.html.haml
+++ b/app/views/profile/password.html.haml
@@ -6,7 +6,7 @@
%hr
= form_for @user, :url => profile_password_path, :method => :put do |f|
.data
- .alert-message.block-message.warning
+ .alert.alert-info
%p After successfull password update you will be redirected to login page where you should login with new password
-if @user.errors.any?
.alert-message.block-message.error
@@ -33,7 +33,7 @@
%hr
= form_for @user, :url => profile_reset_private_token_path, :method => :put do |f|
.data
- .alert-message.block-message.warning
+ .alert.alert-info
%p Private token used to access application resources without authentication.
%hr
%p * required for rss feed
diff --git a/app/views/profile/show.html.haml b/app/views/profile/show.html.haml
index 1970a76a308..892cfbf5ec1 100644
--- a/app/views/profile/show.html.haml
+++ b/app/views/profile/show.html.haml
@@ -1,26 +1,12 @@
-.row
- .span8
- .profile_avatar_holder
- = image_tag gravatar_icon(@user.email, 90), :class => "styled_image"
- %h3
- = @user.name
- %br
- %small
- = @user.email
-
- .span4.right
- %div
- %div
- %h5.cgray
- Personal projects:
- %span.right
- %span= current_user.my_own_projects.count
- of
- %span= current_user.projects_limit
- %h5.cgray
- SSH public keys:
- %span.right
- %span= current_user.keys.count
+.profile_avatar_holder
+ = image_tag gravatar_icon(@user.email, 90), :class => "styled_image"
+%h3
+ = @user.name
+ %br
+ %small
+ = @user.email
+
+
%hr
= form_for @user, :url => profile_update_path, :method => :put, :html => { :class => "edit_user form-horizontal" } do |f|
@@ -41,6 +27,8 @@
.controls
= f.text_field :email, :class => "input-xlarge"
%span.help-block We also use email for avatar detection.
+
+ %hr
.control-group
= f.label :skype, :class => "control-label"
.controls= f.text_field :skype, :class => "input-xlarge"
@@ -56,12 +44,27 @@
= f.text_area :bio, :rows => 6, :class => "input-xlarge", :maxlength => 250
%span.help-block Tell us about yourself in fewer than 250 characters.
.span5.right
- %p.alert-message.block-message
+
+ %p.alert.alert-info
%strong Tip:
You can change your avatar at gravatar.com
+ %h4
+ Personal projects:
+ %small.right
+ %span= current_user.my_own_projects.count
+ of
+ %span= current_user.projects_limit
+ .progress
+ .bar{:style => "width: #{current_user.projects_limit_percent}%;"}
+
+ %h4
+ SSH public keys:
+ %small.right
+ %span= current_user.keys.count
+
+ = link_to "Add Public Key", new_key_path, :class => "btn small right"
+
+
.form-actions
= f.submit 'Save', :class => "btn-primary btn"
-
--#= link_to "New project", new_project_path, :class => "btn small padded"
--#= link_to "New public key", new_key_path, :class => "btn small"
diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml
index 8f6244f2f5b..932ed04d11e 100644
--- a/app/views/projects/_form.html.haml
+++ b/app/views/projects/_form.html.haml
@@ -4,31 +4,39 @@
%ul
- @project.errors.full_messages.each do |msg|
%li= msg
- .clearfix
- = f.label :name
- .input= f.text_field :name, :placeholder => "Example Project"
- .clearfix
- = f.label :path do
- Path
+ .clearfix.project_name_holder
+ = f.label :name do
+ Project name is
.input
- .input-prepend
- %span.add-on= "#{GIT_HOST["git_user"]}@#{GIT_HOST["host"]}:"
- = f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record?
- .clearfix
- = f.label :code do
- Code
- .input
- .input-prepend
- %span.add-on= web_app_url
- = f.text_field :code, :placeholder => "example"
+ = f.text_field :name, :placeholder => "Example Project", :class => "xxlarge"
- - unless @project.new_record? || @project.heads.empty?
+ %hr
+ .alert.alert-info
+ %h5 Advanced settings:
+ .clearfix
+ = f.label :path do
+ Git Clone
+ .input
+ .input-prepend
+ %span.add-on= "#{GIT_HOST["git_user"]}@#{GIT_HOST["host"]}:"
+ = f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record?
+ %span.add-on= ".git"
.clearfix
- = f.label :default_branch, "Default Branch"
- .input= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:210px;")
+ = f.label :code do
+ URL
+ .input
+ .input-prepend
+ %span.add-on= web_app_url
+ = f.text_field :code, :placeholder => "example"
+
+ - unless @project.new_record? || @project.heads.empty?
+ .clearfix
+ = f.label :default_branch, "Default Branch"
+ .input= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:210px;")
- .alert-message.block-message.warning
- %h5 Features
+ - unless @project.new_record?
+ .alert.alert-info
+ %h5 Features:
.clearfix
= f.label :issues_enabled, "Issues"
@@ -46,12 +54,6 @@
= f.label :wiki_enabled, "Wiki"
.input= f.check_box :wiki_enabled
- .clearfix
- = f.label :description
- .input
- = f.text_area :description, :placeholder => "project description", :class => "xxlarge", :rows => 5
- %p.hint Markdown is enabled.
-
%br
.actions
diff --git a/app/views/projects/_new_form.html.haml b/app/views/projects/_new_form.html.haml
new file mode 100644
index 00000000000..240ee884783
--- /dev/null
+++ b/app/views/projects/_new_form.html.haml
@@ -0,0 +1,29 @@
+= form_for(@project, :remote => true) do |f|
+ - if @project.errors.any?
+ .alert-message.block-message.error
+ %span= @project.errors.full_messages.first
+ .clearfix.project_name_holder
+ = f.label :name do
+ Project name is
+ .input
+ = f.text_field :name, :placeholder => "Example Project", :class => "xxlarge"
+ = f.submit 'Create project', :class => "btn primary"
+
+ %hr
+ .alert.alert-info
+ %h5 Advanced settings:
+ .clearfix
+ = f.label :path do
+ Git Clone
+ .input
+ .input-prepend
+ %span.add-on= "#{GIT_HOST["git_user"]}@#{GIT_HOST["host"]}:"
+ = f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record?
+ %span.add-on= ".git"
+ .clearfix
+ = f.label :code do
+ URL
+ .input
+ .input-prepend
+ %span.add-on= web_app_url
+ = f.text_field :code, :placeholder => "example"
diff --git a/app/views/projects/create.js.haml b/app/views/projects/create.js.haml
index 80ca332da37..859c985a308 100644
--- a/app/views/projects/create.js.haml
+++ b/app/views/projects/create.js.haml
@@ -4,5 +4,5 @@
- else
:plain
$('.project_new_holder').show();
- $("#new_project").replaceWith("#{escape_javascript(render('form'))}");
+ $("#new_project").replaceWith("#{escape_javascript(render('new_form'))}");
$('.ajax_loader').hide();
diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml
index 3f3d51d038a..ef3e3ac4c08 100644
--- a/app/views/projects/new.html.haml
+++ b/app/views/projects/new.html.haml
@@ -1,7 +1,8 @@
.project_new_holder
- %h3 New Project
+ %h3
+ New Project
%hr
- = render 'form'
+ = render 'new_form'
%div.ajax_loader.hide
%center
%div.padded= image_tag "ajax_loader.gif"
diff --git a/spec/requests/projects_spec.rb b/spec/requests/projects_spec.rb
index f3be8075283..dd7d040cb55 100644
--- a/spec/requests/projects_spec.rb
+++ b/spec/requests/projects_spec.rb
@@ -34,19 +34,17 @@ describe "Projects" do
end
it "should have labels for new project" do
- page.should have_content("Name")
- page.should have_content("Path")
- page.should have_content("Description")
+ page.should have_content("Project name is")
end
end
describe "POST /projects" do
before do
visit new_project_path
- fill_in 'Name', :with => 'NewProject'
- fill_in 'Code', :with => 'NPR'
- fill_in 'Path', :with => 'newproject'
- expect { click_button "Save" }.to change { Project.count }.by(1)
+ fill_in 'project_name', :with => 'NewProject'
+ fill_in 'project_code', :with => 'NPR'
+ fill_in 'project_path', :with => 'newproject'
+ expect { click_button "Create project" }.to change { Project.count }.by(1)
@project = Project.last
end
@@ -120,9 +118,9 @@ describe "Projects" do
end
it "should have labels for new project" do
- page.should have_content("Name")
- page.should have_content("Path")
- page.should have_content("Description")
+ page.should have_content("Project name is")
+ page.should have_content("Advanced settings:")
+ page.should have_content("Features:")
end
end
@@ -133,9 +131,8 @@ describe "Projects" do
visit edit_project_path(@project)
- fill_in 'Name', :with => 'Awesome'
- fill_in 'Path', :with => 'gitlabhq'
- fill_in 'Description', :with => 'Awesome project'
+ fill_in 'project_name', :with => 'Awesome'
+ fill_in 'project_path', :with => 'gitlabhq'
click_button "Save"
@project = @project.reload
end