列表样式改进,时间显示样式调整,颜色调整

This commit is contained in:
nieguanghui 2013-08-03 16:54:48 +08:00
parent 868bb5baa0
commit c24320fda5
7 changed files with 200 additions and 135 deletions

View File

@ -94,6 +94,7 @@ module QueriesHelper
when 'String'
if column.name == :subject
link_to(h(value), :controller => 'issues', :action => 'show', :id => issue)
h(value)
elsif column.name == :description
issue.description? ? content_tag('div', textilizable(issue, :description), :class => "wiki") : ''
else
@ -106,9 +107,9 @@ module QueriesHelper
when 'Fixnum'
if column.name == :id
link_to value, issue_path(issue)
elsif column.name == :done_ratio
elsif column.name == :done_ratio
progress_bar(value, :width => '80px')
else
else
value.to_s
end
when 'Float'
@ -125,6 +126,7 @@ module QueriesHelper
l(:general_text_No)
when 'Issue'
value.visible? ? link_to_issue(value) : "##{value.id}"
"##{value.id}"
when 'IssueRelation'
other = value.other_issue(issue)
content_tag('span',
@ -134,6 +136,65 @@ module QueriesHelper
h(value)
end
end
#Added by nie
def column_content_new(column, issue)
value = column.value(issue)
if value.is_a?(Array)
value.collect {|v| column_value(column, issue, v)}.compact.join(', ').html_safe
else
column_value_new(column, issue, value)
end
end
def column_value_new(column, issue, value)
case value.class.name
when 'String'
if column.name == :subject
#link_to(h(value), :controller => 'issues', :action => 'show', :id => issue)
h(value)
elsif column.name == :description
issue.description? ? content_tag('div', textilizable(issue, :description), :class => "wiki") : ''
else
h(value)
end
when 'Time'
format_time(value)
when 'Date'
format_date(value)
when 'Fixnum'
#if column.name == :id
# link_to value, issue_path(issue)
# elsif column.name == :done_ratio
# progress_bar(value, :width => '80px')
# else
value.to_s
# end
when 'Float'
sprintf "%.2f", value
when 'User'
link_to_user value
when 'Project'
link_to_project value
when 'Version'
link_to(h(value), :controller => 'versions', :action => 'show', :id => value)
when 'TrueClass'
l(:general_text_Yes)
when 'FalseClass'
l(:general_text_No)
when 'Issue'
#value.visible? ? link_to_issue(value) : "##{value.id}"
"##{value.id}"
when 'IssueRelation'
other = value.other_issue(issue)
content_tag('span',
(l(value.label_for(issue)) + " " + link_to_issue(other, :subject => false, :tracker => false)).html_safe,
:class => value.css_classes_for(issue))
else
h(value)
end
end
#end
def csv_content(column, issue)
value = column.value(issue)

View File

@ -1,109 +1,111 @@
<%= form_tag({}) do -%>
<%= hidden_field_tag 'back_url', url_for(params), :id => nil %>
<div class="autoscroll">
<!-- <table class="list issues">
<thead>
<tr>
<th class="checkbox hide-when-print">
<%= link_to image_tag('toggle_check.png'), {},
:onclick => 'toggleIssuesSelection(this); return false;',
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
</th>
<% query.inline_columns.each do |column| %>
<%= column_header(column) %>
<% end %>
</tr>
</thead>
<% previous_group = false %>
<tbody>
<% issue_list(issues) do |issue, level| -%>
<% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %>
<% reset_cycle %>
<tr class="group open">
<td colspan="<%= query.inline_columns.size + 2 %>">
<span class="expander" onclick="toggleRowGroup(this);">&nbsp;</span>
<%= group.blank? ? l(:label_none) : column_content(@query.group_by_column, issue) %> <span class="count"><%= @issue_count_by_group[group] %></span>
<%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}",
"toggleAllRowGroups(this)", :class => 'toggle-all') %>
</td>
</tr>
<% previous_group = group %>
<% end %>
<tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<td class="checkbox hide-when-print"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td>
<%= raw query.inline_columns.map {|column| "<td class=\"#{column.css_classes}\">#{column_content(column, issue)}</td>"}.join %>
</tr>
<% @query.block_columns.each do |column|
if (text = column_content(column, issue)) && text.present? -%>
<tr class="<%= current_cycle %>">
<td colspan="<%= @query.inline_columns.size + 1 %>" class="<%= column.css_classes %>"><%= text %></td>
</tr>
<% end -%>
<% end -%>
<% end -%>
</tbody>
</table> -->
<!-- <table class="list issues">
<thead>
<tr>
<th class="checkbox hide-when-print">
<%= link_to image_tag('toggle_check.png'), {},
:onclick => 'toggleIssuesSelection(this); return false;',
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
</th>
<% query.inline_columns.each do |column| %>
<%= column_header(column) %>
<% end %>
</tr>
</thead>
<% previous_group = false %>
<tbody>
<% issue_list(issues) do |issue, level| -%>
<% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %>
<% reset_cycle %>
<tr class="group open">
<td colspan="<%= query.inline_columns.size + 2 %>">
<span class="expander" onclick="toggleRowGroup(this);">&nbsp;</span>
<%= group.blank? ? l(:label_none) : column_content(@query.group_by_column, issue) %> <span class="count"><%= @issue_count_by_group[group] %></span>
<%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}",
"toggleAllRowGroups(this)", :class => 'toggle-all') %>
</td>
</tr>
<% previous_group = group %>
<% end %>
<tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<td class="checkbox hide-when-print"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td>
<%= raw query.inline_columns.map {|column| "<td class=\"#{column.css_classes}\">#{column_content(column, issue)}</td>"}.join %>
</tr>
<% @query.block_columns.each do |column|
if (text = column_content(column, issue)) && text.present? -%>
<tr class="<%= current_cycle %>">
<td colspan="<%= @query.inline_columns.size + 1 %>" class="<%= column.css_classes %>"><%= text %></td>
</tr>
<% end -%>
<% end -%>
<% end -%>
</tbody>
</table> -->
<!-- <thead>
<tr>
<th class="checkbox hide-when-print">
<%= link_to image_tag('toggle_check.png'), {},
:onclick => 'toggleIssuesSelection(this); return false;',
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
</th>
<% query.inline_columns.each do |column| %>
<%= column_header(column) %>
<% end %>
</tr>
</thead>
<% previous_group = false %> -->
<!--Modified by nie-->
<ul>
<tbody>
<% issue_list(issues) do |issue, level| -%>
<% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %>
<% reset_cycle %>
<tr class="group open">
<td colspan="<%= query.inline_columns.size + 2 %>"><span class="expander" onclick="toggleRowGroup(this);">&nbsp;</span> <%= group.blank? ? l(:label_none) : column_content(@query.group_by_column, issue) %> <span class="count"><%= @issue_count_by_group[group] %></span> <%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}",
"toggleAllRowGroups(this)", :class => 'toggle-all') %> </td>
</tr>
<% previous_group = group %>
<% end %>
<!-- <thead>
<tr>
<th class="checkbox hide-when-print">
<%= link_to image_tag('toggle_check.png'), {},
:onclick => 'toggleIssuesSelection(this); return false;',
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
</th>
<% query.inline_columns.each do |column| %>
<%= column_header(column) %>
<% end %>
</tr>
</thead>
<% previous_group = false %> -->
<!--Modified by nie-->
<ul>
<tbody>
<% issue_list(issues) do |issue, level| -%>
<% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %>
<% reset_cycle %>
<tr class="group open">
<td colspan="<%= query.inline_columns.size + 2 %>">
<span class="expander" onclick="toggleRowGroup(this);">&nbsp;</span>
<%= group.blank? ? l(:label_none) : column_content(@query.group_by_column, issue) %> <span class="count"><%= @issue_count_by_group[group] %></span>
<%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}",
"toggleAllRowGroups(this)", :class => 'toggle-all') %>
</td>
</tr>
<% previous_group = group %>
<% end %>
<li id="issue-<%= issue.id %>" class="hascontextmenu <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<% column_content = ( query.inline_columns.map {|column| "<li class=\"#{column.css_classes}\">#{column_content(column, issue)}</li>"}) %>
<%= image_tag("/images/issues.png", :class => "img-tag-issues") %>
<ul class="issue_list">
<%= raw column_content[0] %>
<%= raw column_content[4] %>
<ul class="list-group-item-meta">
<span><%= l(:label_type_as)%></span><%= raw column_content[1] %>
<span><%= l(:label_status_as)%></span><%= raw column_content[2] %>
<span><%= l(:label_priority_as)%></span><%= raw column_content[3] %>
<% unless issue.assigned_to_id.nil? %>
<span><%= l(:field_assigned_to)%></span><%= raw column_content[5] %>
<% end %>
<!-- <%= raw column_content[6] %> -->
<%= l(:label_updated_time, time_tag(issue.updated_on)).html_safe %>
</ul>
</ul>
</li>
<% @query.block_columns.each do |column|
if (text = column_content(column, issue)) && text.present? -%>
<tr class="<%= current_cycle %>">
<td colspan="<%= @query.inline_columns.size + 1 %>" class="<%= column.css_classes %>"><%= text %></td>
</tr>
<% end -%>
<% end -%>
<% end -%>
</tbody>
</ul>
<li id="issue-<%= issue.id %>" class="hascontextmenu-1 <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %>
<%= image_tag("/images/issues.png", :class => "img-tag-issues") %>
<ul class="issue_list">
<ul class="list-group-item-meta">
<span><%= link_to issue.author.name, user_path(issue.author), :class => "bid_user" %></span><%= l(:label_post_on)%><span>
<% a = [] %>
<% a << column_content[1] %>
<% a << "##{column_content[0]}" << "(#{raw column_content[2]}):" << column_content[4] %>
<%= link_to a.join(' '), issue_path(issue) %>
</ul>
<ul class="list-group-item-meta">
<div class="issue-list-description">
<%= issue.description %>
</div>
</ul>
<ul class="list-group-item-meta">
<% unless issue.assigned_to_id.nil? %>
<span><%= l(:field_assigned_to)%></span><%= raw column_content[5] %>
<% end %>
<!-- <%= raw column_content[6] %> -->
<%= l(:label_updated_time_on, format_date(issue.updated_on)).html_safe %>
<div class="find-comment-class"><span><%= link_to l(:label_find_all_comments), issue_path(issue) %></span><%= l(:label_comments_count, :count => issue.journals.all.count) %></div>
</ul>
</ul>
</li>
<% @query.block_columns.each do |column|
if (text = column_content(column, issue)) && text.present? -%>
<tr class="<%= current_cycle %>">
<td colspan="<%= @query.inline_columns.size + 1 %>" class="<%= column.css_classes %>"><%= text %></td>
</tr>
<% end -%>
<% end -%>
<% end -%>
</tbody>
</ul>
</div>
<% end -%>

View File

@ -1,11 +1,9 @@
<!--Added by nie-->
<div class="project-block">
<div class="img-tag">
<%= tag('img', {:src => '../images/logo-only_med.png', :class => 'img_ta'}, false, false) %>
<%= image_tag(url_to_avatar(project), :class => "avatar2") %>
</div>
<div class="wiki-description">
<p>
<span>Claimed by </span><%= content_tag('a', project.name) %> | <span>Analyzed about 11 hours ago</span>
</p>
<p>
<%= textilizable(project.short_description, :project => project) %>
</p>
@ -24,12 +22,6 @@
<%= content_tag('a', "#{@project.repository.nil? ? '0' : @project.repository.changesets.count }") %><%= content_tag('span', l(:label_commit_on)) %>
</p>
</div>
<!-- <div class="reviews">
<%= content_tag('a', tag('img', {:src => '../images/pai.png', :class => 'img-ta'}, false, false), :class => 'img-tag3') %>
<%= content_tag('div', "Vert High Activity", :class => 'img-tag4') %>
<%= content_tag('div', tag('img', {:src => '../images/stars_ro.png', :class => 'img-ta'}, false, false), :class => 'img-tag2') %>
<%= content_tag('div', "#{WatchersOfProjects.watcher_count(project)}Reviews", :class => 'img-tag1') %>
</div> -->
</div>
<div class="add-info">
<div class="main-language">
@ -51,7 +43,7 @@
<div class="tags">
<!-- added by william -for tag -->
<div id="tags">
<%= tag('img', {:src => "../images/user.png"}, false, false) %>
<%= tag('img', {:src => "/images/sidebar/tags.png"}, false, false) %>
<%= render :partial => 'layouts/tag_name', :locals => {:obj => @project,:object_flag => "2",:non_list_all => true }%>
</div>

View File

@ -10,7 +10,7 @@
<% next if member.new_record? %>
<% unless member.created_on.nil? %>
<%= content_tag "p", "#{format_time(member.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %>
<%= content_tag "p", "#{format_date(member.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %>
<% end %>
<%= member.user.nil? ? '' : (link_to image_tag(url_to_avatar(member.user), :class => 'avatar'), :class => "avatar") %>
<%= content_tag "div", link_to_user(member.principal), :class => "nomargin avatar_name" %>

View File

@ -96,7 +96,7 @@
<div class="autoscroll">
<% for user in @users -%>
<div class="well">
<%= content_tag "p", "#{date_format_local(user.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %>
<%= content_tag "p", "#{format_date(user.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %>
<%= get_avatar?(user) ? (link_to image_tag(avatar_image(user), :class => 'avatar'), :class => "avatar") : (link_to image_tag("/images/12_50.png", :class => 'avatar'), :class => "avatar") %>
<%= content_tag "div", link_to_user(user), :class => "nomargin avatar_name" %>
<%= content_tag "div", content_tag("p", user.firstname), :class => "clear avatar_name" %>

View File

@ -1113,7 +1113,6 @@ zh:
field_closed_on: Closed
setting_default_projects_tracker_ids: Default trackers for new projects
label_total_time: 合计
label_create_time: 创建时间 #Customer added
label_current_contributors: 位当前贡献者
label_lines_of_code: 行代码
@ -1130,8 +1129,12 @@ zh:
label_status_as: 状态为
label_priority_as: 优先级为
label_member_list: 成员列表
#added by liuping
label_author_name: 由%{author_name}发表了
label_comments_count: (%{count}条评论)
label_post_on: 发表了
label_find_all_comments: 查看所有评论
label_updated_time_on: " 更新于 %{value} "
#added by liuping
button_unfollow: 取消关注
button_follow: 关注
label_delete_confirm: 确认删除?

View File

@ -1082,6 +1082,7 @@ div.wiki-description {
/*text-overflow: ellipsis;
-o-text-overflow: ellipsis;*/
}
.information {
margin-top: 0px;
margin-left: 607px;
@ -1199,10 +1200,6 @@ a.img-tag3{
width: 908px;
margin-bottom: 5px;
}
.add-info a {
margin-left: 60px;
}
.main-language {
float: left;
height: 18px;
@ -1425,9 +1422,10 @@ div.autoscroll li.hascontextmenu-1{
display: block;
margin-bottom: -1px;
margin-left: 10px;
padding: 8px 10px 10px 10px;/*by young*/
border: 1px solid rgb(229,229,229);
padding: 8px 10px 0px 10px;/*by young*/
border-bottom: 1px dashed rgb(229,229,229);
width: 600px;/*by young*/
height: auto;
}
.hascontextmenu-1 a {
@ -1435,14 +1433,11 @@ div.autoscroll li.hascontextmenu-1{
}
div.autoscroll li.id {
position: relative;
top: 2px;
float: right;
margin-left: 12px;
font-size: 13px;
}
div.autoscroll li.id a {
color: rgb(153, 153, 153);
color: rgb(172, 174, 177);
}
div.autoscroll li.subject {
@ -1455,10 +1450,10 @@ div.autoscroll li.subject a{
color: rgb(51, 51, 51);
}
div.autoscroll ul.list-group-item-meta{
font-size: 11px;
font-size: 12px;
line-height: 17px;
overflow: hidden;
color: rgb(153, 153, 153);
color: rgb(172, 174, 177);
}
div.autoscroll ul.list-group-item-meta li {
@ -1468,18 +1463,30 @@ div.autoscroll ul.list-group-item-meta li {
div.autoscroll li.tracker, div.autoscroll li.status, div.autoscroll li.priority{
color: rgb(51, 51, 51);
font: 10px/1.4 Helvetica,arial,freesans,clean,sans-serif;
font: 13px/1.4 Helvetica,arial,freesans,clean,sans-serif;
}
div.autoscroll ul.list-group-item-meta a {
color: rgb(51, 51, 51);
div.autoscroll ul.list-group-item-meta {
margin-bottom: 10px;
}
li.issue img.img-tag-issues {
float: left;
height: 24px;
width: 24px;
margin-top: -4px;
}
div.issue-list-description {
margin-left: 0px;
color: rgb(72, 72, 72);
overflow: hiddedn;
word-wrap: nowrap;
font-size: small;
}
div.find-comment-class {
float: right;
}
/*
*/