This commit is contained in:
z9hang 2014-10-28 17:38:50 +08:00
commit f6ed31b1eb
12 changed files with 205 additions and 140 deletions

View File

@ -33,7 +33,7 @@
<% end %>
<% end %>
<% if options[:author] %>
<span class="author" title="attachment.author">
<span class="author" title="<%= attachment.author%>">
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author) %>,
<%= format_time(attachment.created_on) %>
</span>

View File

@ -1,6 +1,8 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% tip1 = (@bid.reward_type == 3) ? l(:label_student_response) : l(:label_user_response) %>
<p class="font_lighter" style="font-size: 15px; padding-left: 12px; "><%=tip1%></p>
<p class="font_lighter" style="font-size: 15px; padding-left: 12px; ">
<%=tip1%>
</p>
<div id='leave-message'>
<%= render :partial => 'new', :locals => {:bid => @bid, :sta => @state} %>
@ -22,24 +24,31 @@
<ul class="message-for-user">
<% for journal in journals%>
<li id='word_li_<%= journal.id.to_s %>' class="outer-message-for-user">
<span class="portrait"><%= image_tag(url_to_avatar(journal.user), :class => "avatar") %></span>
<span class="body">
<span class="user"><%= link_to journal.user, user_path(journal.user)%></span>
<span class="font_lighter"><%= label %></span>
<div> <%= textilizable journal.notes%> </div>
<span class="font_lighter">
<%= l(:label_bids_published) %>&nbsp;
<%= time_tag(journal.created_on).html_safe %>&nbsp;
<%= l(:label_bids_published_ago) %>
</span>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<span>
<span class="portrait">
<%= image_tag(url_to_avatar(journal.user), :class => "avatar") %>
</span>
<span class="body">
<span class="user">
<%= link_to journal.user, user_path(journal.user)%>
</span>
<span class="font_lighter">
<%= label %>
</span>
<div>
<%= textilizable journal.notes%>
</div>
<span class="font_lighter">
<%= l(:label_bids_published) %>&nbsp;
<%= time_tag(journal.created_on).html_safe %>&nbsp;
<%= l(:label_bids_published_ago) %>
</span>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<span>
<% if reply_allow %>
<%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal},
:remote => true,:method => 'post', :title => l(:button_quote))%>
<%= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"}
%>
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"} %>
<% end %>
<% if @user==User.current|| User.current.admin? %>
<%= link_to(l(:label_bid_respond_delete),
@ -47,14 +56,14 @@
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
:class => "delete", :title => l(:button_delete)) %>
<% end %>
</span>
</span>
<div style="clear: both;"></div>
</span>
<div style="clear: both;"></div>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<% if reply_allow %>
<div id='<%= ids %>' class="respond-form">
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
</div>
<div id='<%= ids %>' class="respond-form">
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
</div>
<% end %>
<div style="clear: both;"></div>
<div>

View File

@ -1,16 +1,34 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<div style="margin-left: 20px;">
<span class="portrait"><%= image_tag(url_to_avatar(@bid.author), :class => "avatar")%></span>
<span class="portrait">
<%= image_tag(url_to_avatar(@bid.author), :class => "avatar")%>
</span>
<span class="body" style="word-break: break-all;word-wrap: break-word;">
<h3><%= link_to(@bid.author.lastname+@bid.author.firstname, user_path(@bid.author))%><%= link_to(@bid.name,respond_path(@bid)) %></h3>
<h3>
<%= link_to(@bid.author.lastname+@bid.author.firstname, user_path(@bid.author))%>
<%= link_to(@bid.name,respond_path(@bid)) %>
</h3>
<% if @bid.reward_type.nil? or @bid.reward_type == 1%>
<p>
<strong><%= l(:label_bids_reward_method) %><span class="bonus"><%= l(:label_call_bonus) %>&nbsp; <%= l(:label_RMB_sign) %><%= @bid.budget %></span></strong>
<strong>
<%= l(:label_bids_reward_method) %>
<span class="bonus">
<%= l(:label_call_bonus) %>
&nbsp;
<%= l(:label_RMB_sign) %>
<%= @bid.budget %>
</span>
</strong>
</p>
<% elsif @bid.reward_type == 2%>
<p>
<strong><%= l(:label_bids_reward_method) %><span class="bonus"><%= @bid.budget%></span></strong>
</p>
<p>
<strong>
<%= l(:label_bids_reward_method) %>
<span class="bonus">
<%= @bid.budget%>
</span>
</strong>
</p>
<% else %>
<% end %>
<div class="bid_description">

View File

@ -202,18 +202,18 @@
<% unless @course.teacher.user_extensions.nil? || @course.teacher.user_extensions.school.nil? %>
<tr>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_teacher_work_unit) %> :
<%= l(:label_course_organizers) %> :
</td>
<td class="font_lighter_sidebar">
<a href="http://<%= Setting.host_course%>/?school_id=<%= @course.teacher.user_extensions.school.id%>">
<%= @course.teacher.user_extensions.school %>
<a href="http://<%= Setting.host_course%>/?school_id=<%= @course.school.id%>">
<%= @course.school %>
</a>
</td>
</tr>
<% else %>
<tr>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_teacher_work_unit) %> :
<%= l(:label_course_organizers) %> :
</td>
<td class="font_lighter_sidebar">
<%= l(:field_course_un) %>

View File

@ -126,7 +126,7 @@
</tr>
<tr>
<td valign="top" style="padding-left: 8px; width:60px">
<td valign="top" style="padding-left: 8px; width:62px;">
<%= l(:lable_course_teacher) %> :
</td>
<td class="font_lighter_sidebar">

View File

@ -7,79 +7,93 @@
<%= render :partial => 'breadcrumbs',
:locals => { :path => @path, :kind => 'dir', :revision => @rev } %>
<div style="font-size:15px;">
<%if @repository.type.to_s=="Repository::Git"%>
<%= @repos_url%>
<%else %>
<td><%=h @repository.url %></td>
<% end %>
<%if @repository.type.to_s=="Repository::Git"%>
<%= @repos_url%>
<%else %>
<td>
<%=h @repository.url %>
</td>
<% end %>
</div>
<p style=" word-wrap: break-word; word-break: break-all">
(<%= l(:label_all_revisions) %><%= @repositories.sort.collect {|repo|
link_to h(repo.name),
{:controller => 'repositories', :action => 'show',
:id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil},
:class => 'repository' + (repo == @repository ? ' selected' : '')
}.join('&nbsp|&nbsp').html_safe %>)</p>
<h3>项目代码请设置好正确的编码方式utf-8否则中文会出现乱码</h3>
<h3>建立版本库文件夹,打开命令行执行如下:</h3>
<div class="repos_explain">
<p>git init</p>
<p>git add *</p>
<p>git commit -m "first commit"</p>
<p>git remote add origin <%= @repos_url%></p>
<p style=" word-wrap: break-word; word-break: break-all">
(<%= l(:label_all_revisions) %><%= @repositories.sort.collect {|repo|
link_to h(repo.name),
{:controller => 'repositories', :action => 'show',
:id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil},
:class => 'repository' + (repo == @repository ? ' selected' : '')
}.join('&nbsp|&nbsp').html_safe %>)
</p>
<h3>项目代码请设置好正确的编码方式utf-8否则中文会出现乱码</h3>
<h3>建立版本库文件夹,打开命令行执行如下:</h3>
<div class="repos_explain">
<p>git init</p>
<p>git add *</p>
<p>git commit -m "first commit"</p>
<p>git remote add origin
<%= @repos_url%>
</p>
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
<p>git push -u origin master:master</p>
</div>
<h3>已经有本地库,还没有配置远程地址,打开命令行执行如下:</h3>
<div class="repos_explain">
<p>git remote add origin <%= @repos_url%></p>
<p>git push -u origin master:master</p>
</div>
<h3>已经有本地库,还没有配置远程地址,打开命令行执行如下:</h3>
<div class="repos_explain">
<p>git remote add origin <%= @repos_url%></p>
<p>git add .</p>
<p>git commit -m "first commit"</p>
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
<p>git push -u origin master:master</p>
</div>
<p>git push -u origin master:master</p>
</div>
<h3>已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:</h3>
<div class="repos_explain">
<p>git clone <%= @repos_url%></p>
<p>git push</p>
<p>git checkout -b branch_name</p>
<p>git push origin branch_name</p>
</div>
</h3>
<h3>从网上获取别人的开源版本库转交到trustie网站上打开命令行执行如下</h3>
<div class="repos_explain">
<p>git remote add trustie <%= @repos_url%></p>
<p>git add .</p>
<p>git commit -m "first commit"</p>
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
<p>git push -u trustie master:master</p>
<p><%= link_to "李海提供", user_path(646)%></p>
</div>
</h3>
<div class="repos_explain">
<p>git remote add trustie
<%= @repos_url%>
</p>
<p>git add .</p>
<p>git commit -m "first commit"</p>
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
<p>git push -u trustie master:master</p>
<p><%= link_to "李海", user_path(646)%>提供</p>
</div>
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<%= render :partial => 'dir_list' %>
<% end %>
<%= render_properties(@properties) %>
<% if authorize_for('repositories', 'revisions') %>
<% if @changesets && !@changesets.empty? %>
<h3><%= l(:label_latest_revision_plural) %></h3>
<h3>
<%= l(:label_latest_revision_plural) %>
</h3>
<%= render :partial => 'revisions',
:locals => {:project => @project, :path => @path,
:revisions => @changesets, :entry => nil }%>
<% end %>
<p>
<% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0)
sep = '' %>
<% if @repository.supports_all_revisions? && @path.blank? %>
<%= link_to l(:label_view_all_revisions), :action => 'revisions', :id => @project,
:repository_id => @repository.identifier_param %>
<% sep = '|' %>
<% end %>
<% if @repository.supports_directory_revisions? &&
( has_branches || !@path.blank? || !@rev.blank? ) %>
<%= sep %>
<%= link_to l(:label_view_revisions),
:action => 'changes',
:path => to_path_param(@path),
:id => @project,
:repository_id => @repository.identifier_param,
:rev => @rev %>
<% end %>
<% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0)
sep = '' %>
<% if @repository.supports_all_revisions? && @path.blank? %>
<%= link_to l(:label_view_all_revisions), :action => 'revisions', :id => @project,
:repository_id => @repository.identifier_param %>
<% sep = '|' %>
<% end %>
<% if @repository.supports_directory_revisions? && ( has_branches || !@path.blank? || !@rev.blank? ) %>
<%= sep %>
<%= link_to l(:label_view_revisions),
:action => 'changes',
:path => to_path_param(@path),
:id => @project,
:repository_id => @repository.identifier_param,
:rev => @rev %>
<% end %>
</p>
<% if @repository.supports_all_revisions? %>
<% content_for :header_tags do %>
@ -99,7 +113,15 @@
<% end %>
<!-- added by bai -->
<strong><span style="color: #099;"><%= l(:label_how_commit_code) %></span></strong>&nbsp;<%= link_to(l(:label_how_commit_code_chinese), ch_usage_path, :class => "usage")%>&nbsp;|&nbsp;<%= link_to('English', en_usage_path, :class => "usage")%>
<strong>
<span style="color: #099;">
<%= l(:label_how_commit_code) %>
</span>
</strong>
&nbsp;
<%= link_to(l(:label_how_commit_code_chinese), ch_usage_path, :class => "usage")%>
&nbsp;|&nbsp;
<%= link_to('English', en_usage_path, :class => "usage")%>
<!-- end -->

View File

@ -56,7 +56,9 @@
<div id="J_Slide" class="d-p-index-box d-p-index-hot">
<h3 style="margin-left: 5px; color: #e8770d;">
<strong><%= l(:lable_hot_projects)%></strong>
<strong>
<%= l(:lable_hot_projects)%>
</strong>
</h3>
<span style="margin-top: -20px;float: right; display: block;">
<% if User.current.logged? %>
@ -83,14 +85,16 @@
<!-- 上左下右 -->
<div style="float: left; margin-left: 10px; width: 380px;">
<% unless project.is_public %>
<span class="private_project"><%= l(:label_private) %></span>
<span class="private_project">
<%= l(:label_private) %>
</span>
<% end %>
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
(<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
(<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
</div>
<div style=" float: left;margin:5px; margin-left: 10px; width: 380px;">
<div style=" float: left;margin:5px; margin-left: 10px; width: 380px;min-height: 42px;">
<span class='font_lighter' title ='<%=project.short_description%>'>
<%=project.description.truncate(100, omission: '...')%>
<%=project.description.truncate(90, omission: '...')%>
</span>
</div>
<div >
@ -109,33 +113,37 @@
<div id="J_Slide" class="d-p-index-box d-p-index-Dynamic">
<ul class="user-welcome-message-list">
<h3 style="color: rgb(21, 188, 207)"><strong><%= l(:lable_user_active)%></strong></h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to l(:label_more), { :controller => 'users', :action => 'index'}, :target => "_blank" %></span>
<h3 style="color: rgb(21, 188, 207)">
<strong>
<%= l(:lable_user_active)%>
</strong>
</h3>
<span style="margin-top: -20px;float: right; display: block;">
<%= link_to l(:label_more), { :controller => 'users', :action => 'index'}, :target => "_blank" %>
</span>
<div class="user-message-box-list" style="margin-top: 10px;">
<%activities = find_all_activities%>
<% activities.each do |event| %>
<!--<%# cache cache_key_for_event(event) do %> -->
<li style="display: block;height:60px; padding-bottom: 4px;">
<div class="inner-right" style="float: left; height: 100%; ">
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
</div>
<div class="inner-right" style="float: right; width:86%; height: 100%; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" >
<span style="color: green;">
<%= link_to event.event_author, (user_path(event.event_author) if event.event_author),
:style => "color:green;", :target => "_blank" %>
</span>
<%= show_user_content event %>
<p style="margin-top: 4px;">
<span style="color: rgb(172, 174, 177)">
<%= l(:field_updated_on) %>
<%= time_tag_welcome event.event_datetime %>前
</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="float: right; color: rgb(172, 174, 177);">
<%= show_event_reply event %>
</span>
</p>
<p style="margin-top: 4px;">
<span style="color: rgb(172, 174, 177)">
<%= l(:field_updated_on) %>
<%= time_tag_welcome event.event_datetime %>前
</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="float: right; color: rgb(172, 174, 177);">
<%= show_event_reply event %>
</span>
</p>
</div>
</li>
<% end %>
@ -148,14 +156,18 @@
<!--<%# cache 'forum_links' do %> -->
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;">
<h3 style="color: rgb(21, 188, 207);">
<strong><%= l(:lable_bar_active)%></strong>
<strong>
<%= l(:lable_bar_active)%>
</strong>
<%= link_to l(:label_my_question) , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
<%= link_to l(:label_my_feedback) , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
</h3>
<span style="margin-top: -30px;float: right; display: block;"><%= link_to l(:label_more), forums_path %></span>
<span style="margin-top: -30px;float: right; display: block;">
<%= link_to l(:label_more), forums_path %>
</span>
</div>
<div class="welcome-box-list-new memo_activity">
<% topics = find_new_forum_topics(7) %>
<% topics = find_new_forum_topics(6) %>
<% topics.includes(:forum, :last_reply, :author).each do |topic|%>
<!--<%# cache cache_key_for_topic(topic) do %> -->
<li class="message-brief-intro">

View File

@ -1,7 +1,7 @@
<% id = "journal_reply_ul_" + journal.id.to_s%>
<ul class="messages-for-user-reply" id = '<%= id %>' >
<% fetch_user_leaveWord_reply(journal).each do |reply|%>
<%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply} %>
<% end %>
<% fetch_user_leaveWord_reply(journal).each do |reply|%>
<%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply} %>
<% end %>
</ul>

View File

@ -2,33 +2,39 @@
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
<li id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()">
<span class="portrait">
<%= image_tag url_to_avatar(reply.user), :class => "avatar-3" %>
<%= image_tag url_to_avatar(reply.user), :class => "avatar-3" %>
</span>
<div class="message-body">
<% id = 'project_respond_form_'+ reply.id.to_s %>
<% id = 'project_respond_form_'+ reply.id.to_s %>
<p>
<span><%= link_to reply.user.name, user_path(reply.user) %>:&nbsp;</span>
<span class="message-notes"> <%= reply.notes %></span>
<span>
<%= link_to reply.user.name, user_path(reply.user) %>
:&nbsp;
</span>
<span class="message-notes">
<%= reply.notes %>
</span>
</p>
<p>
<span class="time"><%= format_time reply.created_on %></span>
<span style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
<% if reply_allow %>
<%= link_to l(:label_projects_feedback_respond),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{m_reply_id.user.name}: '); return false;"}
%>
<% end %>
<% if @user == User.current || User.current.admin? || reply.user.id == User.current.id %>
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
<% end %>
</span>
<span class="time">
<%= format_time reply.created_on %>
</span>
<span style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
<% if reply_allow %>
<%= link_to l(:label_projects_feedback_respond),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{m_reply_id.user.name}: '); return false;"} %>
<% end %>
<% if @user == User.current || User.current.admin? || reply.user.id == User.current.id %>
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
<% end %>
</span>
</p>
</div>
<div id='<%=id%>' class="respond-form">
<% if reply_allow %>
<% if reply_allow %>
<%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id} %>
<% end %>
<% end %>
</div>
<div style="clear: both;"></div>
</li>

View File

@ -1,5 +1,5 @@
<%= form_tag({:controller => 'words', :action => 'create_reply'}, :remote => true) do %>
<%= form_tag(words_create_reply_path, :remote => true) do %>
<%= text_area_tag 'user_notes', "", :class => 'noline',
:style => "resize: none;", :rows => 4,
:placeholder => l(:label_projects_feedback_respond_content),

View File

@ -5,15 +5,12 @@
) %>').hide();
$('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append);
pre_append.fadeIn(600);
var textarea = $('#project_respond_form_<%=@jfm.m_reply_id.to_s%> textarea');
textarea.val('');
$('#project_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
var textarea1 = $('#course_respond_form_<%=@jfm.m_reply_id.to_s%> textarea');
textarea1.val('');
$('#course_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
var textarea = $('#project_respond_form_<%=@jfm.m_reply_id.to_s%> textarea');
textarea.val('');
$('#project_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
var textarea1 = $('#course_respond_form_<%=@jfm.m_reply_id.to_s%> textarea');
textarea1.val('');
$('#course_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
setMaxLengthItem(pre_append.find('textarea')[0]);
<% else %>
alert("<%= l(:label_feedback_fail) %>");

View File

@ -2169,3 +2169,4 @@ zh:
label_no_contest_news_title: 竞赛标题不能为空
label_contest_news_title_condition: 竞赛标题超过255个汉字
label_subject_empty: 主题不能为空
label_course_organizers: 开设单位