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 <dmitriy.zaporozhets@gmail.com>2012-03-06 02:29:40 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-03-06 02:29:40 +0400
commiteb7bbedb20e57e7ff266dfd0611d4d25b69cde1b (patch)
tree70f177f53e36c0d2b8f8d4ab8a574b66a8e21d74 /app
parentcb59aade4e568e6146a966362385ac41af4dc604 (diff)
Polishin & fixed tree switch
Diffstat (limited to 'app')
-rw-r--r--app/models/event.rb8
-rw-r--r--app/views/dashboard/index.html.haml8
-rw-r--r--app/views/dashboard/issues.html.haml3
-rw-r--r--app/views/dashboard/merge_requests.html.haml3
-rw-r--r--app/views/deploy_keys/index.html.haml7
-rw-r--r--app/views/events/_event_push.html.haml14
-rw-r--r--app/views/hooks/_data_ex.html.erb2
-rw-r--r--app/views/hooks/index.html.haml25
-rw-r--r--app/views/projects/files.html.haml4
-rw-r--r--app/views/projects/index.html.haml51
-rw-r--r--app/views/refs/tree.js.haml7
11 files changed, 82 insertions, 50 deletions
diff --git a/app/models/event.rb b/app/models/event.rb
index 6b1180d7c8c..c5c08df600b 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -33,6 +33,10 @@ class Event < ActiveRecord::Base
action == self.class::Pushed
end
+ def new_tag?
+ data[:ref]["refs/tags"]
+ end
+
def new_branch?
data[:before] =~ /^00000/
end
@@ -49,6 +53,10 @@ class Event < ActiveRecord::Base
@branch_name ||= data[:ref].gsub("refs/heads/", "")
end
+ def tag_name
+ @tag_name ||= data[:ref].gsub("refs/tags/", "")
+ end
+
def pusher
User.find_by_id(data[:user_id])
end
diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml
index 72fb42ab4e6..c7fbc8fd748 100644
--- a/app/views/dashboard/index.html.haml
+++ b/app/views/dashboard/index.html.haml
@@ -1,5 +1,5 @@
- if current_user.require_ssh_key?
- .alert-message.warning
+ .alert-message.block-message.error
%p
You wont be able to pull/push project code unless you
= link_to new_key_path, :class => "vlink" do
@@ -32,7 +32,7 @@
New Project »
-- unless @merge_requests.blank?
+- if @merge_requests.any?
%div.dashboard_category
%h3
= link_to "Merge Requests" , "#merge_requests", :id => "merge_requests"
@@ -45,7 +45,7 @@
.row
.dashboard_block= render "dashboard/merge_requests_feed"
-- unless @issues.blank?
+- if @issues.any?
%div.dashboard_category
%h3
= link_to "Issues" , "#issues", :id => "issues"
@@ -57,7 +57,7 @@
.row
.dashboard_block= render "dashboard/issues_feed"
-- unless @events.blank?
+- if @events.any?
%div.dashboard_category
%h3
%span.ico.activities
diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml
index b9c467a5235..c543dbe920a 100644
--- a/app/views/dashboard/issues.html.haml
+++ b/app/views/dashboard/issues.html.haml
@@ -3,4 +3,5 @@
%small ( assigned to you )
%br
-.ui-box= render "dashboard/issues_feed"
+- if @issues.any?
+ .ui-box= render "dashboard/issues_feed"
diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml
index ec1c233c33c..4acdb4dae28 100644
--- a/app/views/dashboard/merge_requests.html.haml
+++ b/app/views/dashboard/merge_requests.html.haml
@@ -3,4 +3,5 @@
%small ( authored or assigned to you )
%br
-.ui-box= render "dashboard/merge_requests_feed"
+- if @merge_requests.any?
+ .ui-box= render "dashboard/merge_requests_feed"
diff --git a/app/views/deploy_keys/index.html.haml b/app/views/deploy_keys/index.html.haml
index b03e7539806..09db49fed4a 100644
--- a/app/views/deploy_keys/index.html.haml
+++ b/app/views/deploy_keys/index.html.haml
@@ -5,6 +5,7 @@
= link_to new_project_deploy_key_path(@project), :class => "btn small", :title => "New Deploy Key" do
Add Deploy Key
-%table.zebra-striped.borders
- - @keys.each do |key|
- = render(:partial => 'show', :locals => {:key => key})
+- if @keys.any?
+ %table.zebra-striped.borders
+ - @keys.each do |key|
+ = render(:partial => 'show', :locals => {:key => key})
diff --git a/app/views/events/_event_push.html.haml b/app/views/events/_event_push.html.haml
index 705e8a0702b..b48429f425b 100644
--- a/app/views/events/_event_push.html.haml
+++ b/app/views/events/_event_push.html.haml
@@ -1,9 +1,15 @@
-- if event.new_branch?
+- if event.new_branch? || event.new_tag?
= image_tag gravatar_icon(event.pusher_email), :class => "avatar"
%strong #{event.pusher_name}
- pushed new branch
- = link_to project_commits_path(event.project, :ref => event.branch_name) do
- %strong= event.branch_name
+ pushed new
+ - if event.new_tag?
+ tag
+ = link_to project_commits_path(event.project, :ref => event.tag_name) do
+ %strong= event.tag_name
+ - else
+ branch
+ = link_to project_commits_path(event.project, :ref => event.branch_name) do
+ %strong= event.branch_name
at
%strong= link_to event.project.name, event.project
%span.cgray
diff --git a/app/views/hooks/_data_ex.html.erb b/app/views/hooks/_data_ex.html.erb
index f212bb2dc0b..838b7da114a 100644
--- a/app/views/hooks/_data_ex.html.erb
+++ b/app/views/hooks/_data_ex.html.erb
@@ -3,6 +3,8 @@
:before => "95790bf891e76fee5e1747ab589903a6a1f80f22",
:after => "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
:ref => "refs/heads/master",
+ :user_id => 4,
+ :user_name => "John Smith",
:repository => {
:name => "Diaspora",
:url => "localhost/diaspora",
diff --git a/app/views/hooks/index.html.haml b/app/views/hooks/index.html.haml
index 69881752e4b..64497a1c5e3 100644
--- a/app/views/hooks/index.html.haml
+++ b/app/views/hooks/index.html.haml
@@ -6,17 +6,16 @@
= link_to new_project_hook_path(@project), :class => "btn small", :title => "New Web Hook" do
Add Post Receive Hook
-%table.zebra-striped.borders
- - @hooks.each do |hook|
- %tr
- %td
- = link_to project_hook_path(@project, hook) do
- = hook.url
- %td
- = link_to 'Remove', project_hook_path(@project, hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small"
+-if @hooks.any?
+ %table.zebra-striped.borders
+ - @hooks.each do |hook|
+ %tr
+ %td
+ = link_to project_hook_path(@project, hook) do
+ = hook.url
+ %td
+ = link_to 'Remove', project_hook_path(@project, hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small"
-
-.alert-message.block-message
- We send some data with POST request when someone makes git push
-
-.well= render "data_ex"
+.ui-box
+ %h5 Hooks request example
+ .data= render "data_ex"
diff --git a/app/views/projects/files.html.haml b/app/views/projects/files.html.haml
index 48ceece772c..19252d423ee 100644
--- a/app/views/projects/files.html.haml
+++ b/app/views/projects/files.html.haml
@@ -13,7 +13,7 @@
= time_ago_in_words(note.created_at)
ago
- else
- .notice_holder
- %li All files attached to project wall, issues etc will be displayed here
+ .alert-message.block-message
+ %p All files attached to project wall, issues etc will be displayed here
diff --git a/app/views/projects/index.html.haml b/app/views/projects/index.html.haml
index 20f4f510cdd..e163851fd46 100644
--- a/app/views/projects/index.html.haml
+++ b/app/views/projects/index.html.haml
@@ -1,21 +1,36 @@
-.row
- .span4
- %div.leftbar.ui-box
- %h5
- Projects
- - if current_user.can_create_project?
- %span.right
- = link_to new_project_path, :class => "btn very_small info" do
- New Project
- .content_list
- - @projects.each do |project|
- = link_to project_path(project), :remote => true, :class => dom_class(project) do
- %h4
- %span.ico.project
- = truncate(project.name, :length => 22)
- .span12.right
- .show_holder.ui-box.padded
- .loading
+- if @projects.any?
+ .row
+ .span4
+ %div.leftbar.ui-box
+ %h5
+ Projects
+ - if current_user.can_create_project?
+ %span.right
+ = link_to new_project_path, :class => "btn very_small info" do
+ New Project
+ .content_list
+ - @projects.each do |project|
+ = link_to project_path(project), :remote => true, :class => dom_class(project) do
+ %h4
+ %span.ico.project
+ = truncate(project.name, :length => 22)
+ .span12.right
+ .show_holder.ui-box.padded
+ .loading
+
+- else
+ %h3 Nothing here
+ %br
+ - if current_user.can_create_project?
+ .alert-message.block-message.warning
+ You can create up to
+ = current_user.projects_limit
+ projects. Click on link below to add a new one
+ .link_holder
+ = link_to new_project_path, :class => "" do
+ New Project »
+ - else
+ If you will be added to project - it will be displayed here
:javascript
diff --git a/app/views/refs/tree.js.haml b/app/views/refs/tree.js.haml
index 97bc0b81350..f4f28adc369 100644
--- a/app/views/refs/tree.js.haml
+++ b/app/views/refs/tree.js.haml
@@ -1,5 +1,4 @@
:plain
- //$("#tree-content-holder").hide("slide", { direction: "left" }, 150, function(){
- $("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}");
- $("#tree-content-holder").show("slide", { direction: "right" }, 150);
- //});
+ $("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}");
+ $("#tree-content-holder").show("slide", { direction: "right" }, 150);
+ $('.project-refs-form #path').val("#{params[:path]}");