Commit 0a4222fb authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Bootstrap: Activities

parent e42dc64ebcd8
......@@ -133,9 +133,12 @@ aside.project-side
}
img.avatar {
width:32px;
float:left;
padding-right:5px;
margin-right:15px;
width:40px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.media-grid {
......@@ -147,6 +150,18 @@ img.avatar {
}
}
.wll {
background-color: #FFF;
margin-bottom: 10px;
padding: 5px;
min-height: 20px;
border-bottom: 1px solid #eee;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
.author { color: #999; }
&:last-child { border:none }
p { padding-top:5px;}
}
@import "reset_bootstrap.scss";
@import "top_panel.scss";
@import "projects.css.scss";
......
a {
color: $link_color;
&:hover { text-decoration:none; }
&:hover {
text-decoration:none;
color: $active_link_color;
}
}
.alert-message.entry {
background:#F1F1F1;
border-color:#ccc;
}
.main_links {
width:155px;
float:left;
a {
float:left;
}
}
.dashboard_links {
padding:7px;
float:left;
a {
margin: 0 14px;
float: left;
font-size: 14px;
&.active {
color:$active_link_color;
}
&:hover {
color:$active_link_color;
}
}
}
.top-tabs {
margin: 0;
padding: 5px;
font-size: 14px;
padding-bottom:10px;
margin-bottom:20px;
height:26px;
border-bottom:1px solid #ccc;
.tab {
font-weight: bold;
background:none;
padding: 10px;
float:left;
padding-left:0px;
padding-right:40px;
&.active {
color: $active_link_color;
}
}
}
body header {
position:absolute;
width:100%;
......@@ -54,12 +5,11 @@ body header {
margin:0;
top:0;
left:0;
background: #999; /* for non-css3 browsers */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#EAEAEA'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#FFFFFF), to(#EAEAEA)); /* for webkit browsers */
background: -moz-linear-gradient(top, #FFFFFF, #EAEAEA); /* for firefox 3.6+ */
background: -o-linear-gradient(top, #FFFFFF, #EAEAEA); /* for firefox 3.6+ */
background: #F1F1F1; /* for non-css3 browsers */
border-bottom: 1px solid #ccc;
box-shadow: 0 -1px 0 white inset;
-moz-box-shadow: 0 -1px 0 white inset;
-webkit-box-shadow: 0 -1px 0 white inset;
height:50px;
......@@ -105,6 +55,55 @@ body header {
}
}
}
.main_links {
width:155px;
float:left;
a {
float:left;
}
}
.dashboard_links {
padding:7px;
float:left;
a {
margin: 0 14px;
float: left;
font-size: 14px;
&.active {
color:$active_link_color;
}
&:hover {
color:$active_link_color;
}
}
}
.top-tabs {
margin: 0;
padding: 5px;
font-size: 14px;
padding-bottom:10px;
margin-bottom:20px;
height:26px;
border-bottom:1px solid #ccc;
.tab {
font-weight: bold;
background:none;
padding: 10px;
float:left;
padding-left:0px;
padding-right:40px;
&.active {
color: $active_link_color;
}
}
}
.top_panel_holder .chzn-container {
position:relative;
......@@ -138,7 +137,6 @@ body header {
.rss-icon {
margin:0 15px;
padding:3px;
border:1px solid #AAA;
border-radius:3px;
float:left;
}
......
......@@ -39,6 +39,8 @@ def show
@notes = @merge_request.notes.inc_author.order("created_at DESC").limit(20)
@note = @project.notes.new(:noteable => @merge_request)
render_full_content
respond_to do |format|
format.html
format.js { respond_with_notes }
......
......@@ -68,7 +68,8 @@ def update
def show
return render "projects/empty" unless @project.repo_exists? && @project.has_commits?
limit = (params[:limit] || 20).to_i
limit = (params[:limit] || 10).to_i
@activities = @project.activities(limit)#updates_wo_repo(limit)
end
......
......@@ -3,6 +3,7 @@ def dashboard_feed_path(project, object)
case object.class.name.to_s
when "Issue" then project_issue_path(project, project.issues.find(object.id))
when "Commit" then project_commit_path(project, project.repo.commits(object.id).first)
when "MergeRequest" then project_merge_request_path(project, object.id)
when "Note"
then
note = object
......@@ -26,6 +27,7 @@ def dashboard_feed_title(object)
when "Note" then markdown(object.note)
when "Issue" then object.title
when "Commit" then object.safe_message
when "MergeRequest" then object.title
else return "Project Wall"
end
......
class Commit
include ActiveModel::Conversion
extend ActiveModel::Naming
attr_accessor :commit
attr_accessor :head
......@@ -16,6 +18,10 @@ class Commit
:id,
:to => :commit
def persisted?
false
end
def initialize(raw_commit, head = nil)
@commit = raw_commit
@head = head
......
......@@ -4,16 +4,17 @@
%h5.underlined= day.stamp("28 Aug, 2010")
%ul.unstyled
- commits.each do |commit|
%li
%li.wll
%a{ :class => "update-item", :href => project_commit_path(@project, :id => commit.id) }
.right.btn
= truncate(commit.id.to_s, :length => 10)
»
= image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 32
%div
%strong
= truncate(commit.safe_message, :length => 50)
%span.update-author
%strong= commit.author_name
–
= time_ago_in_words(commit.committed_date)
ago
%p
%strong
= truncate(commit.safe_message, :length => 50)
#feeds_content_holder
- unless @issues.empty?
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
.data
- @issues.each do |update|
%a.project-update{:href => dashboard_feed_path(update.project, update)}
.avatar= image_tag gravatar_icon(update.assignee_email), :class => "avatar", :width => 32
%div
= truncate update.title, :length => 35
.right= truncate update.project.name
%span.update-author
%strong= update.author_name
authored
= time_ago_in_words(update.created_at)
ago
.right
- if update.critical
%span.label.important critical
- if update.today?
%span.label.new today
- else
%h2
No assigned
%span.tag.open open
issues
- @issues.each do |issue|
.alert-message.entry
= link_to [issue.project, issue] do
%p
%strong
= issue.project.name
–
Issue #
= issue.id
= truncate issue.title, :length => 50
#feeds_content_holder
- unless @merge_requests.empty?
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
.data
- @merge_requests.each do |update|
%a.project-update{:href => project_merge_request_path(update.project, update)}
= image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
%span.update-title
= truncate update.title, :length => 35
.right= truncate update.project.name
%span.update-author
%strong= update.author_name
authored
= time_ago_in_words(update.created_at)
ago
.right
%span.tag.commit= update.source_branch
→
%span.tag.commit= update.target_branch
- else
%h2
No authored or assigned
%span.tag.open open
merge requests
- @merge_requests.each do |merge_request|
.alert-message.entry
= link_to [merge_request.project, merge_request] do
%p
%strong
= merge_request.project.name
–
Issue #
= merge_request.id
= truncate merge_request.title, :length => 50
#feeds_content_holder
- @active_projects.first(3).each do |project|
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
= link_to project do
%h4= project.name
- project.updates(3).each do |update|
%a.project-update{:href => dashboard_feed_path(project, update)}
= image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32
%div
= dashboard_feed_title(update)
%span.update-author
%strong= update.author_name
authored
= time_ago_in_words(update.created_at)
ago
.right
- klass = update.class.to_s.split("::").last.downcase
%span.tag{ :class => klass }= klass
- @active_projects.first(3).each do |project|
= link_to project do
%h4= project.name
- project.updates(3).each do |update|
%a.project-update{:href => dashboard_feed_path(project, update)}
= image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32
%div
= dashboard_feed_title(update)
%span.update-author
%strong= update.author_name
authored
= time_ago_in_words(update.created_at)
ago
.right
- klass = update.class.to_s.split("::").last.downcase
%span.tag{ :class => klass }= klass
%h3
Issues
%small ( authored or assigned to you )
%small ( assigned to you )
%hr
.news-feed= render "dashboard/issues_feed"
= render "dashboard/issues_feed"
%h3 Merge Requests
%h3
Merge Requests
%small ( authored or assigned to you )
%hr
.news-feed= render "dashboard/merge_requests_feed"
= render "dashboard/merge_requests_feed"
.fixed
%aside
= link_to "Activities", dashboard_path, :class => "#{"active" if current_page?(dashboard_path) || current_page?(root_path) }"
-#= link_to "Activities", dashboard_path, :class => "#{"active" if current_page?(dashboard_path) || current_page?(root_path) }"
= link_to "Projects", projects_path, :class => "#{"active" if current_page?(projects_path)}"
= link_to "Issues", dashboard_issues_path, :class => "#{"active" if current_page?(dashboard_issues_path)}", :id => "issues_slide"
= link_to "Requests", dashboard_merge_requests_path, :class => "#{"active" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide"
......
%h3
= "Merge Request ##{@merge_request.id}:"
 
%span.label= @merge_request.source_branch
→
%span.label= @merge_request.target_branch
%span.right
- if can?(current_user, :admin_project, @project) || @merge_request.author == current_user
= link_to edit_project_merge_request_path(@project, @merge_request), :class => "btn small" do
Edit Merge Request
%hr
%div
%span.entity-info
- if can?(current_user, :admin_project, @project) || @merge_request.author == current_user
= link_to edit_project_merge_request_path(@project, @merge_request) do
.entity-button
Edit Merge Request
%i
= image_tag gravatar_icon(@merge_request.author_email), :class => "left", :width => 40, :style => "padding-right:5px;"
%span.commit-title
%strong
= "Merge Request ##{@merge_request.id}:"
 
.tag.commit.inline= @merge_request.source_branch
→
.tag.commit.inline= @merge_request.target_branch
%span.commit-author
%span.commit-author
%strong
= link_to project_team_member_path(@project, @project.team_member_by_id(@merge_request.author.id)) do
%span.author= @merge_request.author_name
→
= link_to project_team_member_path(@project, @project.team_member_by_id(@merge_request.assignee.id)) do
%span.author= @merge_request.assignee_name
 
 
%br
= @merge_request.created_at.stamp("Aug 21, 2011 9:23pm")
%hr
%div.well= simple_format @merge_request.title
%hr
.clearfix
%div.well= simple_format @merge_request.title
.tabs
......
- if update.kind_of?(Note)
%a.project-update.titled{:href => dashboard_feed_path(project, update)}
= image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32
%div
= dashboard_feed_title(update)
%span.update-author
%strong= update.author_name
= time_ago_in_words(update.created_at)
ago
- noteable = update.target
- if noteable.kind_of?(MergeRequest)
.title-block
%div
%span.commit.tag
Merge Request #
= noteable.id
%span.update-author
%span= noteable.source_branch
%li.wll
.row
.span9
= image_tag gravatar_icon(update.author_email), :class => "avatar thumb"
%p
%strong.author= update.author_name
%span
–
authored
= time_ago_in_words(update.created_at)
ago
- if update.kind_of? MergeRequest
= link_to project_merge_request_path(@project, update) do
= "Opened merge request ##{update.id}."
%span.label= update.source_branch
→
%span= noteable.target_branch
- elsif noteable.kind_of?(Issue)
.title-block
%div
%span.commit.tag
Issue #
= noteable.id
%span.update-author
.left= truncate noteable.title
- elsif noteable.kind_of?(Commit)
.title-block
%div
%span.commit.tag
commit
%span.update-author
.left= truncate noteable.id
- else
.title-block
%div
%span.commit.tag
Project Wall
- elsif update.kind_of?(MergeRequest)
%a.project-update.titled{:href => project_merge_request_path(project, update)}
= image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32
%div
Opened merge request
%span.update-author
%strong= update.author_name
= time_ago_in_words(update.created_at)
ago
.title-block
%div
%span.commit.tag
Merge Request #
= update.id
%span.update-author
%span= update.source_branch
→
%span= update.target_branch
- elsif update.kind_of?(Issue)
%a.project-update.titled{:href => dashboard_feed_path(project, update)}
= image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32
%div
Created new Issue
%span.update-author
%strong= update.author_name
= time_ago_in_words(update.created_at)
ago
.title-block
%div
%span.commit.tag
Issue #
= update.id
%span.update-author
.left= truncate update.title
%span.label= update.target_branch
- elsif update.kind_of? Issue
= link_to project_issue_path(@project, update) do
Opened new
%span.label.important= "issue ##{update.id}"
= truncate update.title
- else
= link_to [@project, update.target] do
%p
= update.target.class.name.titleize
= truncate(update.target.id.to_s, :length => 10)
 
= dashboard_feed_title(update)
......@@ -18,10 +18,10 @@
%cite= "http://#{GIT_HOST["host"]}/"
.input= 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:300px;")
- 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;")
.clearfix
......@@ -30,9 +30,9 @@
%br
.merge-tabs
.actions
= f.submit 'Save', :class => "btn primary"
 
= link_to 'Cancel', @project, :class => "btn"
- unless @project.new_record?
.right
= link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "btn"
= link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "btn danger"
= render "project_head"
= form_for(@project, :remote => true) do |f|
%div
%span.entity-info
= link_to info_project_path(@project) do
.entity-button
Info
%i
%h2= @project.name
%hr
%table.no-borders
-if @project.errors.any?
%tr
%td{:colspan => 2}
#error_explanation
- @project.errors.full_messages.each do |msg|
%span= msg
%br