This commit is contained in:
sw 2014-08-22 10:30:39 +08:00
commit 273c932acf
13 changed files with 91 additions and 44 deletions

View File

@ -83,6 +83,10 @@ class IssuesController < ApplicationController
:limit => @limit)
@issue_count_by_group = @query.issue_count_by_group
respond_to do |format|
format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young
format.api {

View File

@ -37,16 +37,41 @@ class MyController < ApplicationController
}.freeze
def index
page
render :action => 'page'
end
end
# Show user's page
def page
@user = User.current
@Issues= Issue.visible.open.
where(:assigned_to_id => ([User.current.id] + User.current.group_ids))
@limit = 10
@feedback_count = @Issues.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset
@curse_attachments = @Issues[@offset, @limit]
@blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT
end
def page2
@limit = 10
@user = User.current
@Issues= Issue.visible.open.
where(:assigned_to_id => ([User.current.id] + User.current.group_ids))
@feedback_count = @Issues.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset
@curse_attachments = @Issues[@offset, @limit]
@state = false
@blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT
respond_to do |format|
format.js
end
end
# Edit user's account
def account
@user = User.current

View File

@ -4,7 +4,13 @@
<p><%= h("#{@attachment.description} - ") unless @attachment.description.blank? %>
<span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span></p>
<p><%= link_to_attachment @attachment, :text => l(:button_download), :download => true -%>
<span class="size">(<%= number_to_human_size @attachment.filesize %>)</span></p>
<span class="size">(<%= number_to_human_size @attachment.filesize %>)</span>&nbsp&nbsp&nbsp<span class="size">
<%= link = link_to(l(:button_add), {:controller => 'code_review',
:action => 'assign', :action_type => 'attachment',
:id=>@attachment.project,
:change_id => '', :attachment_id => @attachment.id,
}, :class => 'icon icon-add') %>
</span></p>
</div>
&nbsp;

View File

@ -63,7 +63,9 @@
<td>
<table width="640px" border="0">
<tr>
<td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), board_message_path(@board, topic) %></td>
<td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %>
<%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title: topic.subject.to_s %>
</td>
<td align="right" rowspan="3"><table class="borad-count"><tr><td align="center" class="borad-count-digit"><%=link_to (topic.replies_count), board_message_path(@board, topic) %></td></tr>
<tr><td align="center">回答</td></tr>
</table></td>

View File

@ -71,7 +71,9 @@
<td>
<table width="640px" border="0">
<tr>
<td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), board_message_path(@board, topic) %></td>
<td valign="top" width="500px" class=" <%= topic.sticky? ? 'sticky' : '' %>
<%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title:topic.subject.to_s %>
</td>
<td align="right" rowspan="3">
<table class="borad-count">
<tr>

View File

@ -3,7 +3,8 @@
<% attachmenttypes = @project.attachmenttypes %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %>
<table class="list files" id="ver-zebra">
<div class="autoscroll">
<table class="list files" id="ver-zebra" style="width: 100%;table-layout: fixed">
<colgroup>
<col class="vzebra-odd"/>
<col class="vzebra-even"/>
@ -40,17 +41,17 @@
<%next%>
<%end%>
<tr class="file <%= cycle("odd", "odd") %>">
<td class="filename" style="font-size: 13px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filename" style="font-size: 13px; "><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %></td>
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="attach_type">
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="attach_type">
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.typeName %></span>
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %>
</span>
</td>
<td class="content_type"><%= file.show_suffix_type %></td>
<td class="field_file_dense">
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="content_type"><%= file.show_suffix_type %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="field_file_dense">
<span id="field_file_dense_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.file_dense_str %></span>
&nbsp;
<span id="field_file_dense_id_edit<%= file.id %>" style="white-space:nowrap;">
@ -58,9 +59,9 @@
:attachment => file} %>
</span>
</td>
<td class="downloads"><%= file.downloads %></td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="downloads"><%= file.downloads %></td>
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td align="center">
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
</td>
@ -83,7 +84,7 @@
</tbody>
</table>
</div>
<!--分页-->
<div class="pagination" style="float:left;">
<ul>

View File

@ -96,9 +96,9 @@
<div class="memo-section">
<div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>">
<% if @project %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project) %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(24, omission: '...'), project_boards_path(@topic.project),title: @topic.subject.to_s %>
<% elsif @course %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, course_boards_path(@topic.course) %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(24,omission:'...'), course_boards_path(@topic.course),title: @topic.subject.to_s %>
<% end %>
</div>
<div class="memo-content">
@ -109,14 +109,8 @@
</div>
<div class="memo-timestamp">
<div style="float: left"><%= authoring @topic.created_on, @topic.author %></div>
<div style="float: right"><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></div>
</div>
</div>
<br />
</div>

View File

@ -95,11 +95,11 @@
</p>
</div>
<div class="memo-section" style="width: 100%;word-break: break-all;">
<div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>">
<div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>" style="width: 83%;word-break: break-all;">
<% if @project %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project) %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(24, omission: '...'), project_boards_path(@topic.project),title: @topic.subject.to_s %>
<% elsif @course %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, course_boards_path(@topic.course) %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(24,omission:'...'), course_boards_path(@topic.course),title: @topic.subject.to_s %>
<% end %>
</div>
<div class="memo-content">
@ -179,9 +179,6 @@
</div>
<% end %>
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
<div id="reply" style="display:none;">
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>

View File

@ -0,0 +1,26 @@
<% assigned_issues = issuesassignedtome_items %>
<%= render :partial => 'issues/list_simple', :locals => { :issues => assigned_issues } %>
<% if assigned_issues.length > 0 %>
<!--分页-->
<!--
<div class="pagination" style="float:left;">
<ul>
<%#= pagination_links_full(@feedback_pages,@feedback_count, :per_page_links => false){|text, parameters, options|
link_to text, my_page2_path(parameters.merge(:q => params[:q])) }%>
<%#= pagination_links_full @feedback_pages %>
</ul>
</div>
-->
<p class="small"><%= link_to l(:label_issue_view_all), :controller => 'issues',
:action => 'index',
:set_filter => 1,
:assigned_to_id => 'me',
:sort => 'priority:desc,updated_on:desc' %></p>
<% end %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom,
{:controller => 'issues', :action => 'index', :set_filter => 1,
:assigned_to_id => 'me', :format => 'atom', :key => User.current.rss_key},
{:title => l(:label_assigned_to_me_issues)}) %>
<% end %>

View File

@ -1,18 +1,4 @@
<h3><%=l(:label_assigned_to_me_issues)%> (<%= Issue.visible.open.count(:conditions => {:assigned_to_id => ([User.current.id] + User.current.group_ids)})%>)</h3>
<% assigned_issues = issuesassignedtome_items %>
<%= render :partial => 'issues/list_simple', :locals => { :issues => assigned_issues } %>
<% if assigned_issues.length > 0 %>
<p class="small"><%= link_to l(:label_issue_view_all), :controller => 'issues',
:action => 'index',
:set_filter => 1,
:assigned_to_id => 'me',
:sort => 'priority:desc,updated_on:desc' %></p>
<% end %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom,
{:controller => 'issues', :action => 'index', :set_filter => 1,
:assigned_to_id => 'me', :format => 'atom', :key => User.current.rss_key},
{:title => l(:label_assigned_to_me_issues)}) %>
<% end %>
<div id="asdsadwsc">
<%= render :partial => "my/blocks/assiagn_issue" %>
</div>

1
app/views/my/page.js.erb Normal file
View File

@ -0,0 +1 @@
$("#asdsadwsc").html("<%= escape_javascript(render :partial => 'my/blocks/assiagn_issue') %>");

View File

@ -0,0 +1 @@
$("#asdsadwsc").html("<%= escape_javascript(render :partial => 'my/blocks/assiagn_issue') %>");

View File

@ -275,6 +275,8 @@ RedmineApp::Application.routes.draw do
match 'my/remove_block', :controller => 'my', :action => 'remove_block', :via => :post
match 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :via => :post
get 'my/page2', :to => 'my#page2', :as => "my_page2"
resources :users
match 'users/:id/memberships/:membership_id', :to => 'users#edit_membership', :via => :put, :as => 'user_membership'
match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete