Permalink
Browse files

New look and feel for my page and project show page

  • Loading branch information...
1 parent 6d99cc5 commit 007e6884b4cc8131c8cd092eb72ce54571935d01 @shereefb shereefb committed Jan 25, 2011
@@ -211,7 +211,7 @@ def show
redirect_to_project_menu_item(@project, params[:jump]) && return
end
- @subprojects = @project.children.active.find(:all, :order => 'name ASC')
+ @subprojects = @project.descendants.active
@news = @project.news.find(:all, :conditions => " (created_at > '#{Time.now.advance :days => (Setting::DAYS_FOR_LATEST_NEWS * -1)}')", :limit => 5, :include => [ :author, :project ], :order => "#{News.table_name}.created_at DESC")
@trackers = @project.rolled_up_trackers
@@ -22,16 +22,17 @@ def index
unless @my_projects.nil?
@news = News.find(:all,
- :limit => 10,
+ :limit => 30,
:order => "#{News.table_name}.created_at DESC",
:conditions => "#{News.table_name}.project_id in (#{User.current.projects.collect{|m| m.id}.join(',')}) AND (created_at > '#{Time.now.advance :days => (Setting::DAYS_FOR_LATEST_NEWS * -1)}')",
:include => [:project, :author]) unless User.current.projects.empty?
- # @assigned_issues = Issue.visible.open.find(:all,
- # :conditions => {:assigned_to_id => User.current.id},
- # # :limit => 10,
- # :include => [:project, :tracker ],
- # :order => "#{Issue.table_name}.subject ASC")
+ @assigned_issues = Issue.visible.open.find(:all,
+ :conditions => ["#{IssueVote.table_name}.user_id = ? AND #{IssueVote.table_name}.vote_type = ? AND #{Issue.table_name}.assigned_to_id != ? AND #{Issue.table_name}.status_id = ?", User.current.id, IssueVote::JOIN_VOTE_TYPE, User.current.id, IssueStatus.assigned.id],
+ # :conditions => {:assigned_to_id => User.current.id},
+ # :limit => 10,
+ :include => [:project, :tracker, :issue_votes ],
+ :order => "#{Project.table_name}.name ASC")
#
# @watched_issues = Issue.visible.find(:all,
# :include => [:project, :tracker, :watchers],
@@ -31,7 +31,7 @@
</table>
<% unless activities_by_item.empty? %>
<div id="activity_stream_bottom" class="activity-bottom">
- <%= link_to_remote "Load more", {
+ <%= link_to_remote "... show more ...", {
:url => {:controller => :activity_streams,
:action => :index,
:user_id => user_id,
@@ -6,15 +6,14 @@
<% for issue in issues %>
<tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %>">
<td class="id">
+ <% unless defined? no_workstream %>
<%#= check_box_tag("ids[]", issue.id, false, :style => 'display:none;') %>
<%= link_to(h(issue.project), :controller => 'projects', :action => 'show', :id => issue.project) %>
- </td>
+ <% end %>
+ </td>
<td class="icon icon-<%= issue.tracker.to_s.downcase %> id">
- <%= link_to "#{h(issue.tracker)} ##{issue.id}", {:controller => 'issues', :action => 'show', :id => issue}, {:class => "fancyframe"} %>
- </td>
- <!-- <td class="project"></td> -->
- <td class="subject">
- <%= link_to h(truncate(issue.subject, :length => 120)), {:controller => 'issues', :action => 'show', :id => issue}, :class => "fancyframe" %>
+ <%#= link_to "#{h(issue.tracker)} ", {:controller => 'issues', :action => 'show', :id => issue}, {:class => "fancyframe"} %>
+ <%= link_to "#{issue.id} - " + h(truncate(issue.subject, :length => 120)) , {:controller => 'issues', :action => 'show', :id => issue}, :class => "fancyframe" %>
</td>
</tr>
<% end %>
@@ -131,7 +131,25 @@
<!-- / head -->
<!-- body -->
-<%= tag('div', {:id => 'main', :class => (has_content?(:sidebar) ? 'gt-bd gt-cols clearfix' : 'gt-bd clearfix')}, true) %>
+<%
+
+if (has_content?(:actionmenu))
+ cssclass = has_content?(:sidebar) ? 'gt-bd gt-cols-2 clearfix' : 'gt-bd gt-cols-3 clearfix'
+elsif
+ cssclass = has_content?(:sidebar) ? 'gt-bd gt-cols clearfix' : 'gt-bd clearfix'
+end
+
+
+ %>
+<%= tag('div', {:id => 'main', :class => cssclass }, true) %>
+
+
+ <!-- sidebar -->
+ <% if (has_content?(:actionmenu)) %>
+ <div class="gt-actionmenu">
+ <%= yield :actionmenu %>
+ </div>
+ <% end %>
<!-- main content -->
<div class="gt-content" id="content">
@@ -1,23 +1,28 @@
-<tr>
- <td>
- <h4>
- <%= link_to(h(motions.project.name), :controller => 'projects', :action => 'show', :id => motions.project) + ': ' unless @project %>
- <%= link_to h(motions.title), project_motion_path(motions.project,motions) %>
- </h4>
- <p><%=h motions.description %></p>
- <!-- <p class="gt-table-edit"><a href="">Edit</a></p> -->
- </td>
- <td>
- <!-- Categories Sub Table -->
- <table border="0" class="gt-table-categories">
- <tr>
- <th>Author:</th>
- <td><%= link_to_user(motions.author) %></td>
- </tr>
- <tr>
- <th>Created:</th>
- <td><%= since_tag(motions.created_at) %> ago</td>
- </tr>
- </table>
- </td>
-</tr>
+<%
+ count = 0
+ %>
+ <table border="0" class="gt-table gt-user-table">
+ <tbody>
+ <% @motions.each do |motion|
+ count = count + 1
+ %>
+ <tr class="motions-row <%= "hidden" if count > max_count %>">
+ <td>
+ <p><strong>
+ <%= link_to(h(motion.project.name), :controller => 'projects', :action => 'show', :id => motion.project) + ': ' unless @project %>
+ <%= link_to h(motion.title), project_motion_path(motion.project_id,motion) %></strong><br><span class="small-text">by <%= link_to_user(motion.author) %> <%= since_tag(motion.created_at) %> ago</span></p>
+
+ <!-- <p><%#=make_expandable (h motion.description), 30 %></p> -->
+ <!-- <p class="gt-table-edit"><a href="">Edit</a></p> -->
+ </td>
+ </tr>
+ <% end %>
+
+ <tr class="motions-show-more show-more <%= "hidden" unless count > max_count %>">
+ <td colspan="2">
+ <a href="" onclick="$('.motions-row').show();$('.motions-show-more').hide();return false;">... show <%= count - max_count %> more ...</a>
+ </td>
+ </tr>
+
+ </tbody>
+</table>
@@ -1,9 +1,6 @@
-<% unless news.nil? || news.length == 0 %>
-<h2 class="gt-table-head"><%=l(:label_news_latest)%></h2>
-
-<div class="gt-content-box padded">
-
-<%= render :partial => 'news/news', :collection => news %>
-
+<% if @news.any? %>
+<h2 class="gt-table-head icon icon-news"><%=l(:label_news_latest)%></h2>
+<div class="news gt-content-box">
+ <%= render :partial => 'news/news', :locals => {:max_count => 1} %>
</div>
-<% end %>
+<% end %>
@@ -1,22 +1,32 @@
- <tr>
- <td>
- <h4>
- <%= link_to(h(news.project.name), :controller => 'projects', :action => 'show', :id => news.project) + ': ' unless @project %>
- <%= link_to h(news.title), :controller => 'news', :action => 'show', :id => news %>
- </h4>
- <p><%=h news.summary %></p>
- <!-- <p class="gt-table-edit"><a href="">Edit</a></p> -->
- </td>
- <td>
- <!-- Categories Sub Table -->
- <table border="0" class="gt-table-categories">
- <tr>
- <td><%= link_to_user(news.author) %>, <%= since_tag(news.created_at) %> ago
- <% if news.comments_count > 0 %>
- , <%=link_to l(:label_x_comments, :count => news.comments_count), :controller => 'news', :action => 'show', :id => news %>
- <% end %>
- </td>
- </tr>
- </table>
- </td>
- </tr>
+<%
+ count = 0
+ %>
+ <table border="0" class="gt-table gt-user-table">
+ <tbody>
+ <% @news.each do |news_item|
+ count = count + 1
+ %>
+ <tr class="news-row <%= "hidden" if count > max_count %>">
+ <td>
+ <span class="small-text right">&nbsp;&nbsp;<%= link_to_user(news_item.author) %>, <%= since_tag(news_item.created_at) %> ago
+ <% if news_item.comments_count > 0 %>
+ , <%=link_to l(:label_x_comments, :count => news_item.comments_count), :controller => 'news', :action => 'show', :id => news %>
+ <% end %>
+ </span>
+ <p><strong>
+ <%= link_to(h(news_item.project.name), :controller => 'projects', :action => 'show', :id => news_item.project) + ': ' unless @project %>
+ <%= link_to h(news_item.title), :controller => 'news', :action => 'show', :id => news %></strong>&nbsp;<%=h news_item.summary %>
+ </p>
+ <!-- <p class="gt-table-edit"><a href="">Edit</a></p> -->
+ </td>
+ </tr>
+ <% end %>
+ <tr class="news-show-more show-more <%= "hidden" unless count > max_count %>">
+ <td colspan="2">
+ <a href="" onclick="$('.news-row').show();$('.news-show-more').hide();return false;">... show <%= count - max_count %> more ...</a>
+ </td>
+ </tr>
+
+ </tbody>
+ </table>
+
@@ -3,7 +3,7 @@
if @members_active.any?
%>
<!-- Shows active members -->
-<h2 class="gt-table-head"><%=l(:label_active_team)%><%= help_bubble(:text_active_team_explanation) %></h2>
+<h2 class="gt-table-head icon icon-users"><%=l(:label_active_team)%><%= help_bubble(:text_active_team_explanation) %></h2>
<div class="members gt-content-box">
<table border="0" class="gt-table gt-user-table">
<tbody>
@@ -0,0 +1,34 @@
+<%
+@members_active = @project.active_members
+if @members_active.any?
+ %>
+<!-- Shows active members -->
+<h2 class="gt-table-head icon icon-users"><%=l(:label_active_team)%><%= help_bubble(:text_active_team_explanation) %></h2>
+<div class="members gt-content-box">
+ <table border="0" class="gt-table gt-user-table">
+ <tbody>
+ <tr>
+ <td>
+ <% @members_active.each do |member| %>
+ <div class="gt-avatar-box">
+ <%= avatar(member.user) %><br>
+ <%= link_to_user member.user, {:format => :firstname} %><br>
+ </div>
+ <% end %>
+ </td>
+ </tr>
+ <% if User.current.allowed_to?(:send_invitations, @project) && @project.root? %>
+ <tr><td colspan=2 style="text-align:center">
+ <%= link_to l(:label_invitation_others), new_project_invitation_url(@project) %>
+ </td></tr>
+ </li>
+ <% end %>
+ <% unless @hide_view_team_link %>
+ <tr><td colspan=3 style="text-align:center">
+ <%= link_to l(:label_team_view_all_enterprise), {:controller => 'projects', :action => 'team', :id => @project.root} %>
+ </td></tr>
+ <% end %>
+ </tbody>
+ </table>
+</div>
+<% end %>
@@ -3,7 +3,7 @@
@users_by_role = @project.root.users_by_role
if @users_by_role.any?
%>
-<h2 class="gt-table-head"><%=l(:label_team)%></h2>
+<h2 class="gt-table-head icon icon-users"><%=l(:label_team)%></h2>
<div class="members gt-content-box">
<table border="0" class="gt-table gt-user-table">
<tbody>
@@ -11,7 +11,7 @@
</table>
<span id="project_index_bottom_<%= index_type %>">
<div class="learn-more">
- <%= link_to_remote "Load more", {
+ <%= link_to_remote "... load more ...", {
:url => {:controller => :projects,
:action => "index_#{index_type}",
:offset => offset
@@ -0,0 +1,24 @@
+<% count = 0
+ max_count = 5
+ %>
+ <table class="gt-table gt-user-table project-table" id="my_projects_table">
+ <% project_tree_sorted(projects) do |p, level|
+ name_prefix = (level > 0 ? ('&nbsp;' * 4 * level + '&#187; ') : '')
+ count = count + 1
+ %>
+ <tr class="active-project-row <%= "hidden" if count > max_count %>">
+ <td>
+ <%=link_to(name_prefix + h(p), :controller => 'projects', :action => 'show', :id => p) %><%= volunteering p %><%= privacy p %>
+ <% if !p.active? %>
+ <%= link_to_remote(l(:label_unarchive_project_brackets), :url => {:controller => 'projects', :action => 'unarchive', :id => p}, :confirm => l(:text_confirm_unarchive_project)) %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ <tr class="active-project-show-more show-more <%= "hidden" unless count > max_count %>">
+ <td>
+ <a href="" onclick="$('.active-project-row').show();$('.active-project-show-more').hide();return false;">... show <%= count - max_count %> more ...</a>
+ </td>
+ </tr>
+ </table>
+
@@ -27,22 +27,6 @@
<%#= link_to l(:label_browse_workstreams), {:controller => :projects, :action => :index}, :class => "gt-btn-blue-large" %>
</div> -->
<% end %>
-
- <%# if @news.any? %>
- <!-- <h2 class="gt-table-head"><%#=l(:label_news_latest)%></h2>
- <div class="news gt-content-box">
- <table border="0" class="gt-table gt-user-table">
- <tbody>
- <%#= render :partial => 'news/news', :collection => @news %>
- </tbody>
- </table>
- </div>
- <div class="gt-table-buttons">
- <%#= link_to l(:label_news_view_all), {:controller => 'news'} , :class => "gt-btn-blue-large" %>
- </div> -->
- <%# end %>
-
-
</div>
Oops, something went wrong.

0 comments on commit 007e688

Please sign in to comment.