dashboard v1

This commit is contained in:
Dmitriy Zaporozhets 2011-12-08 22:17:53 +02:00
parent 4107f2cc2e
commit cd779e56e1
22 changed files with 189 additions and 184 deletions

View file

@ -1,28 +1,31 @@
#news-feed.news-feed
%div
= link_to dashboard_path, :class => "left" do
.box-arrow
←
%h2{:style => "width:86%; text-align:center"}
Issues
= link_to merge_requests_path, :class => "right" do
.box-arrow
→
%div
= link_to dashboard_path, :remote => true, :class => "left" do
.box-arrow
←
%h2{:style => "width:86%; text-align:center"}
Issues
= link_to dashboard_merge_requests_path, :remote => true, :class => "right" do
.box-arrow
→
#feeds_content_holder
.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)}
= image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
%span.update-title
= dashboard_feed_title(update)
= truncate update.title, :length => 50
.right= update.project.name
%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
- if update.critical
%span.tag.high critical
- if update.today?
%span.tag.today today

View file

@ -1,27 +1,28 @@
#news-feed.news-feed
%div
= link_to issues_path, :class => "left" do
.box-arrow
←
%h2{:style => "width:86%; text-align:center"}
Merge Requests
= link_to dashboard_path, :class => "right" do
.box-arrow
→
%div
= link_to dashboard_issues_path, :remote => true, :class => "left" do
.box-arrow
←
%h2{:style => "width:86%; text-align:center"}
Merge Requests
= link_to dashboard_path, :remote => true, :class => "right" do
.box-arrow
→
#feeds_content_holder
.project-box.project-updates.ui-box.ui-box-small.ui-box-big
.data
- @merge_requests.each do |update|
%a.project-update{:href => dashboard_feed_path(update.project, 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
= dashboard_feed_title(update)
= truncate update.title, :length => 70
.right= update.project.name
%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
%span.tag.commit= update.source_branch
→
%span.tag.commit= update.target_branch

View file

@ -1,14 +1,14 @@
#news-feed.news-feed
%div
= link_to merge_requests_path, :class => "left" do
.box-arrow
←
%h2{:style => "width:86%; text-align:center"}
Activities
= link_to issues_path, :class => "right" do
.box-arrow
→
%div
= link_to dashboard_merge_requests_path, :remote => true, :class => "left", :id => "merge_requests_slide" do
.box-arrow
←
%h2{:style => "width:86%; text-align:center"}
Activities
= link_to dashboard_issues_path, :remote => true, :class => "right", :id => "issues_slide" do
.box-arrow
→
#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

View file

@ -0,0 +1,15 @@
%aside
%h4
- if current_user.can_create_project?
%a.button-small.button-green{:href => new_project_path} New Project
Your Projects
%ol.project-list
- @projects.each do |project|
%li
%a{:href => project_path(project)}
%span.arrow →
%span.project-name= project.name
%span.time
%strong Last activity:
= project.last_activity_date ? time_ago_in_words(project.last_activity_date) + " ago" : "Never"

View file

@ -1,18 +1,5 @@
- content_for(:body_class, "dashboard-page")
#dashboard-content.dashboard-content.content
%aside
%h4
- if current_user.can_create_project?
%a.button-small.button-green{:href => new_project_path} New Project
Your Projects
%ol.project-list
- @projects.each do |project|
%li
%a{:href => project_path(project)}
%span.arrow →
%span.project-name= project.name
%span.time
%strong Last activity:
= project.last_activity_date ? time_ago_in_words(project.last_activity_date) + " ago" : "Never"
= render "dashboard/projects_feed"
= render "dashboard/sidebar"
#news-feed.news-feed= render "dashboard/projects_feed"

View file

@ -0,0 +1,7 @@
:plain
$("#feeds_content_holder").hide("slide", { direction: "left" }, 150, function(){
$("#news-feed").html("#{escape_javascript(render(:partial => "projects_feed"))}");
$("#feeds_content_holder").show("slide", { direction: "right" }, 150);
history.pushState({ path: this.path }, '', '#{dashboard_path}')
});

View file

@ -0,0 +1,24 @@
xml.instruct!
xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do
xml.title "#{@user.name} issues"
xml.link :href => dashboard_issues_url(:atom, :private_token => @user.private_token), :rel => "self", :type => "application/atom+xml"
xml.link :href => dashboard_issues_url(:private_token => @user.private_token), :rel => "alternate", :type => "text/html"
xml.id dashboard_issues_url(:private_token => @user.private_token)
xml.updated @issues.first.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") if @issues.any?
@issues.each do |issue|
xml.entry do
xml.id project_issue_url(issue.project, issue)
xml.link :href => project_issue_url(issue.project, issue)
xml.title truncate(issue.title, :length => 80)
xml.updated issue.created_at.strftime("%Y-%m-%dT%H:%M:%SZ")
xml.media :thumbnail, :width => "40", :height => "40", :url => gravatar_icon(issue.author_email)
xml.author do |author|
xml.name issue.author_name
xml.email issue.author_email
end
xml.summary issue.title
end
end
end

View file

@ -0,0 +1,5 @@
- content_for(:body_class, "dashboard-page")
#dashboard-content.dashboard-content.content
= render "dashboard/sidebar"
#news-feed.news-feed= render "dashboard/issues_feed"

View file

@ -0,0 +1,7 @@
:plain
$("#feeds_content_holder").hide("slide", { direction: "left" }, 150, function(){
$("#news-feed").html("#{escape_javascript(render(:partial => "issues_feed"))}");
$("#feeds_content_holder").show("slide", { direction: "right" }, 150);
history.pushState({ path: this.path }, '', '#{dashboard_issues_path}')
});

View file

@ -0,0 +1,5 @@
- content_for(:body_class, "dashboard-page")
#dashboard-content.dashboard-content.content
= render "dashboard/sidebar"
#news-feed.news-feed= render "dashboard/merge_requests_feed"

View file

@ -0,0 +1,7 @@
:plain
$("#feeds_content_holder").hide("slide", { direction: "left" }, 150, function(){
$("#news-feed").html("#{escape_javascript(render(:partial => "merge_requests_feed"))}");
$("#feeds_content_holder").show("slide", { direction: "right" }, 150);
history.pushState({ path: this.path }, '', '#{dashboard_merge_requests_path}')
});