This commit is contained in:
huang 2015-03-06 15:27:32 +08:00
commit b2b978d540
13 changed files with 38 additions and 45 deletions

23
.gitignore vendored
View File

@ -1,23 +0,0 @@
*.swp
/.project
/.idea
/.bundle
*.swp
/config/database.yml
/config/configuration.yml
/files/*
/log/*
/public/tmp/*
/tmp/*
/public/cache/*
.gitignore
/config/newrelic.yml
/public/images/avatars/*
/Gemfile
/Gemfile.lock
/db/schema.rb
/Gemfile.lock
/lib/plugins/acts_as_versioned/test/debug.log
.rbenv-gemsets
.DS_Store
public/api_doc/

View File

@ -156,7 +156,7 @@ class IssuesController < ApplicationController
call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue })
@issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads]))
# 给该issue在它所在的项目中所有的issues中所在的位置给一个序号
@issue.project_issues_index = @issue.project.issues.last.project_issues_index + 1
@issue.project_issues_index = @issue.project.issues.last.nil? ? 1 : @issue.project.issues.last.project_issues_index + 1
if @issue.save
call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})
respond_to do |format|

View File

@ -1841,7 +1841,7 @@ module ApplicationHelper
# course_all_course_link = link_to l(:label_course_all), {:controller => 'courses', :action => 'index'}
course_teacher_all_link = link_to l(:label_teacher_all), {:controller => 'users', :action => 'index', :role => 'teacher', :host => Setting.course_domain}
# courses_link = link_to l(:label_course_practice), {:controller => 'courses', :action => 'index'}
users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index', :host => Setting.user_domain}
#users_link = link_to l(:label_software_user), {:controller => 'users', :action => 'index', :host => Setting.user_domain}
# contest_link = link_to l(:label_contest_innovate), {:controller => 'contests', :action => 'index'}
bids_link = link_to l(:label_requirement_enterprise), {:controller => 'bids', :action => 'index'}
forum_link = link_to l(:label_forum_all), {:controller => "forums", :action => "index"}
@ -1860,7 +1860,7 @@ module ApplicationHelper
nav_list.push(courses_link) if @nav_dispaly_course_label && @show_course == 1
# nav_list.push(projects_link) if @nav_dispaly_project_label
nav_list.push(users_link) if @nav_dispaly_user_label
#nav_list.push(users_link) if @nav_dispaly_user_label
# nav_list.push(contest_link) if @nav_dispaly_contest_label && @show_contest == 1
nav_list.push(bids_link) if @nav_dispaly_bid_label
nav_list.push(forum_link) if @nav_dispaly_forum_label

View File

@ -164,8 +164,11 @@ class Message < ActiveRecord::Base
# Author lizanle
# Description
def act_as_forge_activity
self.forge_acts << ForgeActivity.new(:user_id => self.author_id,
:project_id => self.board.project.id)
# 如果project为空那么就是课程相关的消息
if !self.board.project.nil?
self.forge_acts << ForgeActivity.new(:user_id => self.author_id,
:project_id => self.board.project.id)
end
end
#更新用户分数 -by zjc

View File

@ -98,8 +98,11 @@ class News < ActiveRecord::Base
# Author lizanle
# Description 公用表中也要记录
def act_as_forge_activity
self.forge_acts << ForgeActivity.new(:user_id => self.author_id,
:project_id => self.project.id)
# 如果是project为空那么是课程相关的不需要保存
if !self.project.nil?
self.forge_acts << ForgeActivity.new(:user_id => self.author_id,
:project_id => self.project.id)
end
end
end

View File

@ -4,9 +4,14 @@
<input type="text" maxlength="100" name="polls_name" id="polls_title" value="<%= @poll.polls_name %>" class="input_title" placeholder="问卷标题"/>
</div>
<div class="ur_title_editor_prefix">
<textarea name="polls_description" maxlength="300" id="polls_description" class="textarea_editor"><%= @poll.polls_description%></textarea>
<div contenteditable="true" id="polls_description_div" class="ur_textbox" style="min-height: 150px;width: 100%;background-color: #ffffff" onkeyup="edit_head();">
<%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%>
</div>
<textarea name="polls_description" maxlength="300" id="polls_description" class="textarea_editor" style="display: none">
<%= @poll.polls_description%>
</textarea>
</div>
<div class="ur_editor_footer">
<div class="ur_editor_footer" style="padding-top: 10px;">
<a class="btn_submit" data-button="ok" onclick="pollsSubmit($(this));">
<%= l(:label_button_ok)%>
</a>

View File

@ -7,6 +7,11 @@
<%#= javascript_include_tag "polls" %>
<script type="text/javascript">
//编辑问卷描述之后
function edit_head(){
$("#polls_description").val($("#polls_description_div").html());
}
function add_MC(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MC') %>");
$("#poll_questions_title").focus();

View File

@ -3,8 +3,6 @@
<h1 class="ur_page_title" id="polls_name_h">
<%= poll.polls_name%>
</h1>
<p class="ur_prefix_content" id="polls_description_p">
<%= @poll.polls_description%>
</p>
<%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%>
<div class="cl"></div>
</div><!--头部显示 end-->

View File

@ -1,6 +1,6 @@
$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>");
$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_memo_create_succ)}) %>");
showModal('ajax-modal', '180px');
showModal('ajax-modal', '250px');
$('#ajax-modal').css('height','111px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +

View File

@ -1,6 +1,6 @@
$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>");
$('#ajax-modal').html("<%= escape_javascript(render :partial => 'alert', locals: { :message => l(:label_poll_republish_success)}) %>");
showModal('ajax-modal', '180px');
showModal('ajax-modal', '250px');
$('#ajax-modal').css('height','80px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +

View File

@ -34,7 +34,7 @@
<%= @poll.polls_name%>
</h1>
<p class="ur_prefix_content">
<%= @poll.polls_description %>
<%= @poll.polls_description.html_safe %>
</p>
</div>

View File

@ -1,6 +1,4 @@
$("#polls_title").val("<%= @poll.polls_name%>");
$("#polls_description").val("<%= @poll.polls_description %>");
$("#polls_name_h").html("<%= @poll.polls_name %>");
$("#polls_description_p").html("<%= @poll.polls_description %>");
$("#polls_head_show").html("<%= escape_javascript(render :partial => 'show_head', :locals => {:poll => @poll}) %>");
$("#polls_head_edit").html("<%= escape_javascript(render :partial => 'edit_head', :locals => {:poll => @poll}) %>");
$("#polls_head_edit").hide();
$("#polls_head_show").show();

View File

@ -94,9 +94,13 @@
<% @organization_projects.map do |project| %>
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
<% end %>
<div id="errorExplanation">
<%= l(:label_part_enterprise_tips) %>
</div>
<li>
<h1></h1>
<div id="errorExplanation">
<%= l(:label_part_enterprise_tips) %>
</div>
<h1></h1>
</li>
<% @part_projects.map do |project| %>
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
<% end %>