diff --git a/.rspec b/.rspec index 4e1e0d2f7..8c18f1abd 100644 --- a/.rspec +++ b/.rspec @@ -1 +1,2 @@ +--format documentation --color diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 03d1454ef..54b8c6305 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -160,12 +160,15 @@ class ForumsController < ApplicationController def create @forum = Forum.new(params[:forum]) @forum.creator_id = User.current.id + if @forum.save + respond_to do |format| - respond_to do |format| - if @forum.save - format.html { redirect_to @forum, notice: l(:label_forum_create_succ) } - format.json { render json: @forum, status: :created, location: @forum } - else + format.html { redirect_to @forum, notice: l(:label_forum_create_succ) } + format.json { render json: @forum, status: :created, location: @forum } + end + + else + respond_to do |format| flash.now[:error] = "#{l :label_forum_create_fail}: #{@forum.errors.full_messages[0]}" format.html { render action: "new" } format.json { render json: @forum.errors, status: :unprocessable_entity } diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 8b9bf9099..8e69d1d72 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -26,6 +26,7 @@ class HomeworkAttachController < ApplicationController get_not_batch_homework_list sort,direction, @bid.id @cur_page = params[:page] || 1 @cur_type = 1 + @cur_sort,@cur_direction = params[:sort] || "s_socre", params[:direction] || "desc" @direction = direction == 'asc'? 'desc' : 'asc' respond_to do |format| format.js @@ -433,7 +434,7 @@ class HomeworkAttachController < ApplicationController #添加留言 def addjours @is_teacher,@is_anonymous_comments,@m_score = params[:is_teacher]=="true",params[:is_anonymous_comments]=="true",params[:stars_value] - @cur_page,@cur_type = params[:cur_page] || 1,params[:cur_type] || 5 + @cur_page,@cur_type = params[:page] || 1,params[:cur_type] || 5 @homework = HomeworkAttach.find(params[:homework_id]) @stars_reates = @homework.rates(:quality) homework = @homework @@ -479,7 +480,7 @@ class HomeworkAttachController < ApplicationController if @cur_type == "1" #如果当前是老师未批列表,需要刷新整个作业列表界面 @bid = @homework.bid - get_not_batch_homework_list "s_socre","desc",@homework.bid_id + get_not_batch_homework_list params[:cur_sort] || "s_socre",params[:cur_direction] || "desc",@homework.bid_id elsif @cur_type == "2" #老师已批列表 @result_homework = HomeworkAttach.find_by_sql("SELECT homework_attaches.*, (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score, diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index 739adfe1c..4abddaa5e 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -1,8 +1,8 @@ class PollController < ApplicationController - before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll] + before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll,:poll_result] before_filter :find_container, :only => [:new,:create, :index] - before_filter :is_member_of_course, :only => [:index,:show] - before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll] + before_filter :is_member_of_course, :only => [:index,:show,:poll_result] + before_filter :is_course_teacher, :only => [:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll] include PollHelper def index if @course @@ -40,7 +40,7 @@ class PollController < ApplicationController def new if @course option = { - :polls_name => l(:label_poll_new), + :polls_name => "", :polls_type => @course.class.to_s, :polls_group_id => @course.id, :polls_status => 1, @@ -187,7 +187,13 @@ class PollController < ApplicationController @poll.polls_status = 2 @poll.published_at = Time.now if @poll.save - redirect_to poll_index_url(:polls_type => "Course", :polls_group_id => @course.id) + if params[:is_remote] + redirect_to poll_index_url(:polls_type => "Course", :polls_group_id => @course.id) + else + respond_to do |format| + format.js + end + end end end @@ -311,6 +317,27 @@ class PollController < ApplicationController end end + #重新发布问卷 + def republish_poll + @poll.poll_questions.each do |poll_question| + poll_question.poll_votes.destroy_all + end + @poll.poll_users.destroy_all + @poll.polls_status = 1 + @poll.save + respond_to do |format| + format.js + end + end + + #显示某个学生某份问卷的填写结果 + def poll_result + @poll_questions = paginateHelper @poll.poll_questions,5 + respond_to do |format| + format.html{render :layout => 'base_courses'} + end + end + private def find_poll_and_course @poll = Poll.find params[:id] @@ -337,7 +364,8 @@ class PollController < ApplicationController end def is_course_teacher - render_403 unless(@course && User.current.allowed_to?(:as_teacher,@course)) + @is_teacher = User.current.allowed_to?(:as_teacher,@course) + render_403 unless(@course && @is_teacher) end #获取未完成的题目 diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index d3df57982..a2e793a10 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -35,7 +35,7 @@ class ProjectsController < ApplicationController # edit before_filter :authorize1, :only => [:show] # - before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches] + before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches,:join_project] # before_filter :authorize, :except => [:new_join, :new_homework, :homework, :statistics, :search, :watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file, # :statistics, :feedback, :course, :enterprise_course, :course_enterprise, :project_respond, :share, # :show_projects_score, :issue_score_index, :news_score_index, :file_score_index, :code_submit_score_index, :projects_topic_score_index] @@ -558,6 +558,11 @@ class ProjectsController < ApplicationController # Show @project def show + if(@project && !@project.is_public && !User.current.member_of?(@project)) + render_403 + return + end + @project_type = params[:project_type] # try to redirect to the requested menu item @@ -912,6 +917,14 @@ class ProjectsController < ApplicationController end end end + + #加入私有项目 + def join_project + respond_to do |format| + format.js + end + end + private def memberAccess diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 411de1dcf..22eb9bfae 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -111,6 +111,10 @@ module CoursesHelper #garble count # end + #获取课程所有成员 + def course_all_member course + course.members + end # 学生人数计算 # add by nwb def studentCount course diff --git a/app/helpers/poll_helper.rb b/app/helpers/poll_helper.rb index 17ef02a36..60d82c096 100644 --- a/app/helpers/poll_helper.rb +++ b/app/helpers/poll_helper.rb @@ -73,5 +73,5 @@ module PollHelper "多行主观题" end end - + end \ No newline at end of file diff --git a/app/models/forum.rb b/app/models/forum.rb index 61ba528a0..eb8bb19d2 100644 --- a/app/models/forum.rb +++ b/app/models/forum.rb @@ -18,7 +18,7 @@ class Forum < ActiveRecord::Base acts_as_taggable scope :by_join_date, order("created_at DESC") - + after_create :send_email def reset_counters! self.class.reset_counters!(id) end @@ -33,6 +33,11 @@ class Forum < ActiveRecord::Base self.creator == user || user.admin? end + def send_email + Thread.start do + Mailer.forum_add(self).deliver if Setting.notified_events.include?('forum_add') + end + end # Updates topic_count, memo_count and last_memo_id attributes for +board_id+ def self.reset_counters!(forum_id) forum_id = forum_id.to_i diff --git a/app/models/forum_observer.rb b/app/models/forum_observer.rb new file mode 100644 index 000000000..1c514d6ab --- /dev/null +++ b/app/models/forum_observer.rb @@ -0,0 +1,8 @@ +class ForumObserver < ActiveRecord::Observer + def after_create(forum) + Thread.start do + Mailer.forum_add(forum).deliver if Setting.notified_events.include?('forum_add') + end + + end +end diff --git a/app/models/journals_for_message_observer.rb b/app/models/journals_for_message_observer.rb index 093002a2c..0e5f29d03 100644 --- a/app/models/journals_for_message_observer.rb +++ b/app/models/journals_for_message_observer.rb @@ -1,7 +1,9 @@ # Added by young class JournalsForMessageObserver < ActiveRecord::Observer def after_create(journals_for_message) + thread1 = Thread.start do Mailer.journals_for_message_add(User.current, journals_for_message).deliver + end end end diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 72e60a0bf..23ac36054 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -26,7 +26,37 @@ class Mailer < ActionMailer::Base def self.default_url_options { :host => Setting.host_name, :protocol => Setting.protocol } end - + + # 贴吧新建贴吧发送邮件 + # example Mailer.forum(forum).deliver + def forum_add(forum) + + redmine_headers 'Forum' => forum.id + @forum = forum + @author = forum.creator + recipients = forum.creator.mail + # cc = wiki_content.page.wiki.watcher_recipients - recipients + + @forum_url = url_for(:controller => 'forums', :action => 'show', :id => forum.id) + mail :to => recipients,:subject => "[ #{l(:label_forum)} : #{forum.name} #{l(:notice_successful_create)}]" + + end + + def forum_message_added(memo) + @memo = memo + redmine_headers 'Memo' => memo.id + @forum = memo.forum + @author = memo.author + recipients ||= [] + mems = memo.self_and_siblings + mems.each do |mem| + recipients << mem.author.mail unless recipients.include? mem.author.mail + end + # cc = wiki_content.page.wiki.watcher_recipients - recipients + + @memo_url = url_for(forum_memo_url(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id))) + mail :to => recipients,:subject => "[ #{l(:label_message_plural)} : #{memo.subject} #{l(:label_memo_create_succ)}]" + end # Builds a Mail::Message object used to email recipients of the added journals for message. # 留言分为直接留言,和对留言人留言的回复 @@ -62,13 +92,13 @@ class Mailer < ActionMailer::Base course = journals_for_message.jour @author = journals_for_message.user #课程的教师 - @teachers = searchTeacherAndAssistant journals_for_message.jour + @members = course_all_member journals_for_message.jour #收件人邮箱 @recipients ||= [] - @teachers.each do |teacher| - if teacher.user.notify_about? journals_for_message + @members.each do |teacher| + @recipients << teacher.user.mail - end + end mail :to => @recipients, @@ -117,8 +147,10 @@ class Mailer < ActionMailer::Base @project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value) @user_url = url_for(my_account_url(user,:token => @token.value)) - - cc = issue.watcher_recipients - issue.recipients + cc = nil + if recipients == issue.recipients[0] + cc = issue.watcher_recipients - issue.recipients + end subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] (#{issue.status.name}) #{issue.subject}" mail(:to => recipients, :cc => cc, @@ -167,8 +199,11 @@ class Mailer < ActionMailer::Base # Watchers in cc + cc = nil + if recipients == journal.recipients[0] + cc = journal.watcher_recipients - journal.recipients + end - cc = journal.watcher_recipients - journal.recipients s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] " s << "(#{issue.status.name}) " if journal.new_value_for('status_id') s << issue.subject @@ -282,7 +317,7 @@ class Mailer < ActionMailer::Base recipients = container.notified_users.select { |user| user.allowed_to?(:view_files, container) }.collect { |u| u.mail } when 'Course' added_to_url = url_for(:controller => 'files', :action => 'index', :course_id => container) - added_to = "#{l(:label_course)}: #{container}" + added_to = "#{l(:label_course)}: #{container.name}" recipients = container.notified_users.select { |user| user.allowed_to?(:view_files, container) }.collect { |u| u.mail } when 'Version' added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container.project) @@ -323,13 +358,25 @@ class Mailer < ActionMailer::Base # news_added(news) => Mail::Message object # Mailer.news_added(news).deliver => sends an email to the news' project recipients def news_added(news) - redmine_headers 'Project' => news.project.identifier - @author = news.author - message_id news - @news = news - @news_url = url_for(:controller => 'news', :action => 'show', :id => news) - mail :to => news.recipients, - :subject => "[#{news.project.name}] #{l(:label_news)}: #{news.title}" + + if news.project + redmine_headers 'Project' => news.project.identifier + @author = news.author + message_id news + @news = news + @news_url = url_for(:controller => 'news', :action => 'show', :id => news) + mail :to => news.recipients, + :subject => "[#{news.project.name}] #{l(:label_news)}: #{news.title}" + elsif news.course + redmine_headers 'Course' => news.course.id + @author = news.author + message_id news + @news = news + recipients = news.course.notified_users.select { |user| user.allowed_to?(:view_files, news.course) }.collect { |u| u.mail } + @news_url = url_for(:controller => 'news', :action => 'show', :id => news) + mail :to => recipients, + :subject => "[#{news.course.name}] #{l(:label_news)}: #{news.title}" + end end # Builds a Mail::Message object used to email recipients of a news' project when a news comment is added. @@ -339,15 +386,28 @@ class Mailer < ActionMailer::Base # Mailer.news_comment_added(comment) => sends an email to the news' project recipients def news_comment_added(comment) news = comment.commented - redmine_headers 'Project' => news.project.identifier - @author = comment.author - message_id comment - @news = news - @comment = comment - @news_url = url_for(:controller => 'news', :action => 'show', :id => news) - mail :to => news.recipients, - :cc => news.watcher_recipients, - :subject => "Re: [#{news.project.name}] #{l(:label_news)}: #{news.title}" + if news.project + redmine_headers 'Project' => news.project.identifier + @author = comment.author + message_id comment + @news = news + @comment = comment + @news_url = url_for(:controller => 'news', :action => 'show', :id => news) + mail :to => news.recipients, + :cc => news.watcher_recipients, + :subject => "Re: [#{news.project.name}] #{l(:label_news)}: #{news.title}" + elsif news.course + redmine_headers 'Course' => news.course.id + @author = comment.author + message_id comment + @news = news + @comment = comment + @news_url = url_for(:controller => 'news', :action => 'show', :id => news) + recipients = news.course.notified_users.select { |user| user.allowed_to?(:view_files, news.course) }.collect { |u| u.mail } + + mail :to => recipients, + :subject => "[#{news.course.name}] #{l(:label_news)}: #{news.title}" + end end # Builds a Mail::Message object used to email the recipients of the specified message that was posted. @@ -356,18 +416,33 @@ class Mailer < ActionMailer::Base # message_posted(message) => Mail::Message object # Mailer.message_posted(message).deliver => sends an email to the recipients def message_posted(message) - redmine_headers 'Project' => message.project.identifier, - 'Topic-Id' => (message.parent_id || message.id) - @author = message.author - message_id message - references message.parent unless message.parent.nil? - recipients = message.recipients - cc = ((message.root.watcher_recipients + message.board.watcher_recipients).uniq - recipients) - @message = message - @message_url = url_for(message.event_url) - mail :to => recipients, - :cc => cc, - :subject => "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}" + if message.project + redmine_headers 'Project' => message.project.identifier, + 'Topic-Id' => (message.parent_id || message.id) + @author = message.author + message_id message + references message.parent unless message.parent.nil? + recipients = message.recipients + cc = ((message.root.watcher_recipients + message.board.watcher_recipients).uniq - recipients) + @message = message + @message_url = url_for(message.event_url) + mail :to => recipients, + :cc => cc, + :subject => "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}" + elsif message.course + redmine_headers 'Course' => message.course.id, + 'Topic-Id' => (message.parent_id || message.id) + @author = message.author + message_id message + references message.parent unless message.parent.nil? + recipients = message.course.notified_users.select { |user| user.allowed_to?(:view_files, message.course) }.collect { |u| u.mail } + cc = ((message.root.watcher_recipients + message.board.watcher_recipients).uniq - recipients) + @message = message + @message_url = url_for(message.event_url) + mail :to => recipients, + :cc => cc, + :subject => "[#{message.board.course.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}" + end end # Builds a Mail::Message object used to email the recipients of a project of the specified wiki content was added. diff --git a/app/models/memo.rb b/app/models/memo.rb index cfc509923..f9482911a 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -43,7 +43,7 @@ class Memo < ActiveRecord::Base "parent_id", "replies_count" - after_create :add_author_as_watcher, :reset_counters!#,:be_user_score -- 公共区发帖暂不计入得分 + after_create :add_author_as_watcher, :reset_counters!, :sendmail#,:be_user_score -- 公共区发帖暂不计入得分 # after_update :update_memos_forum after_destroy :reset_counters!#,:down_user_score -- 公共区发帖暂不计入得分 # after_create :send_notification @@ -54,6 +54,12 @@ class Memo < ActiveRecord::Base # includes(:forum => ).where() # } + def sendmail + thread1=Thread.new do + Mailer.forum_message_added(self).deliver if Setting.notified_events.include?('forum_message_added') + end + end + def cannot_reply_to_locked_topic errors.add :base, l(:label_memo_locked) if root.locked? && self != root end diff --git a/app/models/memo_observer.rb b/app/models/memo_observer.rb new file mode 100644 index 000000000..66cabe923 --- /dev/null +++ b/app/models/memo_observer.rb @@ -0,0 +1,8 @@ +class MemoObserver < ActiveRecord::Observer + def after_create(memo) + + thread1=Thread.new do + Mailer.forum_message_added(memo).deliver if Setting.notified_events.include?('forum_message_added') + end + end +end diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index 2d6c35555..1009f405f 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -56,18 +56,30 @@ <%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %> - + <% if User.current.logged? && is_cur_course_student(@course) %> <% cur_user_homework = cur_user_homework_for_bid(bid) %> + + <% if bid.open_anonymous_evaluation == 1 %> + <% case bid.comment_status %> + <% when 0 %> + 未开启匿评 + <% when 1 %> +   匿评中..   + <% when 2 %> +   匿评结束   + <% end %> + <% end%> + <% if cur_user_homework && cur_user_homework.empty? %> <%= link_to l(:label_commit_homework),new_exercise_book_path(bid) %> <% else %> - - <%= l(:lable_has_commit_homework)%> - + + 已 提 交 + <% end %> <% end %> <% if (User.current.admin?||User.current.allowed_to?(:as_teacher,@course)) %> diff --git a/app/views/courses/member.html.erb b/app/views/courses/member.html.erb index 2599760ad..803be3731 100644 --- a/app/views/courses/member.html.erb +++ b/app/views/courses/member.html.erb @@ -56,7 +56,7 @@ <%= stylesheet_link_tag 'course_group', :media => 'all' %> -
+
diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index b80206728..abb896b61 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -10,37 +10,43 @@ body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; back div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,ol{ margin:0; padding:0;} div,img,tr,td,table{ border:0;} table,tr,td{border:0;cellspacing:0; cellpadding:0;} -ol,ul,li{ list-style-type:none} -.cl{ clear:both; overflow:hidden; } -a{ text-decoration:none; } -a:hover{ text-decoration:underline; } -.mail_box,ul,li{ list-style-type:none} .mail{ width:600px; margin:20px; height:auto; color:#4b4b4b; font-size:14px; } +ol,ul,li{ list-style-type:none} +.cl{ clear:both; overflow:hidden; margin-top: 30px;} +.mail_box,ul,li{ list-style-type:none} .mail a{color:#1b55a7; font-weight: bold; } .mail_content{ margin-top:30px;} .c_blue{ color:#1b55a7;} .mail_box{ border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;} .mail_box_p{ float:left; display: block; width:527px;} -a.mail_reply{ display:block; float:right; width:80px; text-align:center; height:30px; background:#15bccf; color:#fff; font-weight:normal; font-size:14px;} -a:hover.mail_reply{ background:#06a9bc; text-decoration:none;} .mail_fujian{ float:left; width:527px; display: block; } .mail_fujian a{ font-weight:normal; font-size:12px;} .mail_foot a{ font-size:12px; font-weight:normal;} +a{ text-decoration:none; } +a:hover{ text-decoration:underline; } +a.mail_reply{ display:block; float:right; width:80px; text-align:center; height:30px; background:#15bccf; color:#fff; font-weight:normal; font-size:14px;} +a:hover.mail_reply{ background:#06a9bc; text-decoration:none;} + + + + + - -
-
-
-

亲爱的Trustie用户,您好!

+ + +
+
+
+

<%= l(:mail_issue_greetings)%>

<%= yield %>
- <%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_footer).html_safe %> + <%= Redmine::WikiFormatting.to_html(Setting.text_formatting, Setting.emails_footer).html_safe %>
-
+
diff --git a/app/views/mailer/_issue.html.erb b/app/views/mailer/_issue.html.erb index 5979877a3..cd5fbc091 100644 --- a/app/views/mailer/_issue.html.erb +++ b/app/views/mailer/_issue.html.erb @@ -1,32 +1,40 @@

- - <%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url) %> - 在 - <%= link_to(h("#{@issue.project.name}"),@project_url) %>中有了一个与您相关的最新活动,请您关注!

-
-
    -
  • 标题:<%= link_to(issue.subject, issue_url) %>
  • -
  • 来源:<%= issue.project.name %>项目<%= issue.tracker.name%>
  • -
  • 内容: - <%= issue.description %> + + <%= link_to(h("#{@issue.author}(#{@issue.author.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %> + <%= l(:mail_issue_title_userin)%> + <%= link_to(h("#{@issue.project.name}"), @project_url, :style=>'color:#1b55a7; font-weight:bold;') %><%= l(:mail_issue_title_active)%>

    +
    +
      +
    • <%= l(:mail_issue_subject)%><%= link_to(issue.subject, issue_url, :style=>'color:#1b55a7; font-weight:bold;') %>
    • +
    • <%= l(:mail_issue_sent_from)%><%= issue.project.name %><%= l(:mail_issue_from_project)%>
    • +
    • <%= l(:mail_issue_content)%> + + <% if @journal.nil? %> + <%= issue.description %> + <% else %> + <%= @journal.notes %> + <% end%> +
    • -
    • +
    • - <% unless @issue.attachments.nil? %> - 附件: - + <% unless @issue.attachments.nil? %> + <%= l(:mail_issue_attachments)%> + <% @issue.attachments.each do |attach| %> -

      <%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false) %>

      - <% end %>
      - <% end %> +

      <%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false, :style=>'color:#1b55a7; font-weight:bold;')%>

      + <% end %>
      + <% end %> -
    • +
    -
    - -
    +
    + +
diff --git a/app/views/poll/_new_MCQ.html.erb b/app/views/poll/_new_MCQ.html.erb index de9dc9f08..027a1c1f6 100644 --- a/app/views/poll/_new_MCQ.html.erb +++ b/app/views/poll/_new_MCQ.html.erb @@ -3,7 +3,7 @@
- +
diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb new file mode 100644 index 000000000..c53f09361 --- /dev/null +++ b/app/views/poll/_poll.html.erb @@ -0,0 +1,68 @@ +<% has_commit = has_commit_poll?(poll.id ,User.current)%> +<% poll_name = poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name%> +
  • + <% if @is_teacher %> + <% if has_commit %> + + <%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl", :style => "max-width: 550px;width: 550px;" %> + + <% else %> + <%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_w fl" %> + <% end %> + <% else %> + <% if has_commit && poll.polls_status == 2 %> + <%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl", :style => "max-width: 500px;width: auto;" %> + <% elsif !has_commit && poll.polls_status == 2 %> + <%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_w fl", :style => "max-width: 550px;width: 550px;" %> + <% end %> + <% end %> +
  • +<% if !@is_teacher && has_commit && poll.polls_status == 2%> +
  • 已答
  • +<% end %> + +<%if @is_teacher%> + <% if poll.polls_status == 1 %> +
  • 统计结果
  • + <% elsif poll.polls_status == 2%> +
  • + <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%> +
  • + <% end%> +<% end%> + +
  • + <%if @is_teacher %> + <% if poll.polls_status == 1 %> + 发布问卷 + <% elsif poll.polls_status == 2%> + 取消发布 + <% end%> + <% end%> +
  • +
  • + <% if @is_teacher %> + + <%= link_to(l(:button_delete), poll, + method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %> + <% end%> +
  • +
  • + <% if @is_teacher%> + <% if poll.polls_status == 1 %> + <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%> + <% elsif poll.polls_status == 2%> +
  • 编辑
  • + <% end%> + <% end%> + + + + + + + + +
  • + <%= format_time poll.created_at%> +
  • \ No newline at end of file diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb index bbf71e0ce..df4859613 100644 --- a/app/views/poll/_poll_form.html.erb +++ b/app/views/poll/_poll_form.html.erb @@ -57,9 +57,9 @@ function poll_submit() { - $('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { poll: @poll}) %>'); + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { :poll => @poll,:is_remote => false}) %>'); showModal('ajax-modal', '310px'); - $('#ajax-modal').css('height','110px'); + $('#ajax-modal').css('height','115px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + ""); diff --git a/app/views/poll/_poll_republish.html.erb b/app/views/poll/_poll_republish.html.erb new file mode 100644 index 000000000..3f93b6b3d --- /dev/null +++ b/app/views/poll/_poll_republish.html.erb @@ -0,0 +1,32 @@ + + + + + + + +
    +
    +
    +

    + 问卷取消发布后学生提交的问卷答案将会被清空, +
    + 是否确定取消发布该问卷? +

    +
    + <%= link_to "确 定",republish_poll_poll_path(poll.id), :class => "upload_btn", :onclick => "clickCanel();" %> + + 取  消 + +
    +
    +
    + +
    + +
    + + + diff --git a/app/views/poll/_poll_submit.html.erb b/app/views/poll/_poll_submit.html.erb index cdc41dd9d..af3ca2d42 100644 --- a/app/views/poll/_poll_submit.html.erb +++ b/app/views/poll/_poll_submit.html.erb @@ -2,18 +2,6 @@ @@ -27,16 +15,14 @@ 是否确定发布该问卷?

    - <%= link_to "确 定",publish_poll_poll_path(poll.id), :class => "upload_btn", :onclick => "clickCanel();" %> + <%= link_to "确 定",publish_poll_poll_path(poll.id,:is_remote => is_remote), :class => "upload_btn", :onclick => "clickCanel();" %> 取  消
    -
    -
    diff --git a/app/views/poll/_show_MCQ_result.html.erb b/app/views/poll/_show_MCQ_result.html.erb new file mode 100644 index 000000000..f46882881 --- /dev/null +++ b/app/views/poll/_show_MCQ_result.html.erb @@ -0,0 +1,26 @@ +
  • +
    + + 第<%= poll_question.question_number%>题: + + <%= poll_question.question_title %> + [多选题] + <%if poll_question.is_necessary == 1%> + * + <%end%> +
    +
    +
    + + + <% poll_question.poll_votes.where("user_id = #{User.current.id}").each do |answer|%> + + + + <% end%> + +
    + <%= answer.poll_answer.answer_text %> +
    +
    +
  • \ No newline at end of file diff --git a/app/views/poll/_show_MC_result.html.erb b/app/views/poll/_show_MC_result.html.erb new file mode 100644 index 000000000..7f2cbbd83 --- /dev/null +++ b/app/views/poll/_show_MC_result.html.erb @@ -0,0 +1,27 @@ +
  • +
    + + 第<%= poll_question.question_number%>题: + + <%= poll_question.question_title %> + [单选题] + <%if poll_question.is_necessary == 1%> + * + <%end%> +
    +
    +
    + + + <% poll_question.poll_votes.where("user_id = #{User.current.id}").each do |answer|%> + + + + <% end%> + + +
    + <%= answer.poll_answer.answer_text %> +
    +
    +
  • \ No newline at end of file diff --git a/app/views/poll/_show_head.html.erb b/app/views/poll/_show_head.html.erb index ce74dc10a..7ab16b24d 100644 --- a/app/views/poll/_show_head.html.erb +++ b/app/views/poll/_show_head.html.erb @@ -1,7 +1,7 @@

    - <%= poll.polls_name%> + <%= poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name%>

    <%= @poll.polls_description%> diff --git a/app/views/poll/_show_mulit_result.html.erb b/app/views/poll/_show_mulit_result.html.erb new file mode 100644 index 000000000..786ed9460 --- /dev/null +++ b/app/views/poll/_show_mulit_result.html.erb @@ -0,0 +1,20 @@ +

  • +
    +
    + + 第<%= poll_question.question_number%>题: + + <%= poll_question.question_title %> + [多行主观] + <%if poll_question.is_necessary == 1%> + * + <%end%> +
    +
    +
    +

    + <%= get_anwser_vote_text(poll_question.id,User.current.id).html_safe%> +

    +
    +
    +
  • \ No newline at end of file diff --git a/app/views/poll/_show_single_result.html.erb b/app/views/poll/_show_single_result.html.erb new file mode 100644 index 000000000..07559773d --- /dev/null +++ b/app/views/poll/_show_single_result.html.erb @@ -0,0 +1,18 @@ +
  • +
    + + 第<%= poll_question.question_number%>题: + + <%= poll_question.question_title %> + [单行主观] + <%if poll_question.is_necessary == 1%> + * + <%end%> +
    +
    +
    +

    + <%= get_anwser_vote_text poll_question.id,User.current.id%> +

    +
    +
  • \ No newline at end of file diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb index e57674c7a..a8aca1308 100644 --- a/app/views/poll/index.html.erb +++ b/app/views/poll/index.html.erb @@ -1,4 +1,55 @@ <%= stylesheet_link_tag 'polls', :media => 'all' %> +

    所有问卷 @@ -12,44 +63,7 @@
    <% @polls.each do |poll|%>
      -
    • - <% if @is_teacher %> - <% if has_commit_poll?(poll.id ,User.current) %> - <%= poll.polls_name %> - <% else %> - <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %> - <% end %> - <% else %> - <% if has_commit_poll?(poll.id ,User.current) && poll.polls_status == 2 %> - - <%= poll.polls_name %> - - <% elsif (!has_commit_poll?(poll.id ,User.current)) && poll.polls_status == 2 %> - <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %> - <% end %> - <% end %> -
    • -
    • - <%if @is_teacher && poll.polls_status == 2%> - <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%> - <% end%> -
    • -
    • - <% if @is_teacher %> - - <%= link_to(l(:button_delete), poll, - method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %> - <% end%> -
    • -
    • - <% if @is_teacher && poll.polls_status == 1%> - - <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%> - <% end%> -
    • -
    • - <%= format_time poll.created_at%> -
    • + <%= render :partial => 'poll', :locals => {:poll => poll} %>
    <% end%> diff --git a/app/views/poll/poll_result.html.erb b/app/views/poll/poll_result.html.erb new file mode 100644 index 000000000..a7cb415b3 --- /dev/null +++ b/app/views/poll/poll_result.html.erb @@ -0,0 +1,36 @@ +<%= stylesheet_link_tag 'polls', :media => 'all' %> +
    +
    +

    + <%= @poll.polls_name.empty? ? l(:label_poll_new) : @poll.polls_name %> +

    +

    + <%= @poll.polls_description%> +

    +
    +
    +
      + <% @poll_questions.each do |poll_question|%> + <% if poll_question.question_type == 1%> + <%= render :partial => 'show_MC_result', :locals => {:poll_question => poll_question} %> + <% elsif poll_question.question_type == 2%> + <%= render :partial => 'show_MCQ_result', :locals => {:poll_question => poll_question} %> + <% elsif poll_question.question_type == 3%> + <%= render :partial => 'show_single_result', :locals => {:poll_question => poll_question} %> + <% elsif poll_question.question_type == 4%> + <%= render :partial => 'show_mulit_result', :locals => {:poll_question => poll_question} %> + <% end%> + <% end%> +
    +
    +
    + + +
    +
      + <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> +
    +
    +
    +
    + diff --git a/app/views/poll/publish_poll.js.erb b/app/views/poll/publish_poll.js.erb new file mode 100644 index 000000000..ad052f8f2 --- /dev/null +++ b/app/views/poll/publish_poll.js.erb @@ -0,0 +1,2 @@ +$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>"); +alert("发布成功"); \ No newline at end of file diff --git a/app/views/poll/republish_poll.js.erb b/app/views/poll/republish_poll.js.erb new file mode 100644 index 000000000..a2d8e28fa --- /dev/null +++ b/app/views/poll/republish_poll.js.erb @@ -0,0 +1,2 @@ +$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>"); +alert("取消成功"); \ No newline at end of file diff --git a/app/views/projects/_join_project.html.erb b/app/views/projects/_join_project.html.erb new file mode 100644 index 000000000..c7ce29dae --- /dev/null +++ b/app/views/projects/_join_project.html.erb @@ -0,0 +1,83 @@ + + + + + 快速进入项目通道 + + + + + +
    +
    +
    +

    快速进入项目通道

    +

    只要持有项目的ID,就可快速申请加入所在项目。项目页面搜索不到的私有项目只能从此通道进入哦!

    +
    +
    + <%= form_tag({:controller => 'applied_project', + :action => 'applied_join_project'}, + :remote => true, + :method => :post, + :id => 'new-watcher-form') do %> + + <% end%> +
    +
    +
    + + + diff --git a/app/views/projects/join_project.js.erb b/app/views/projects/join_project.js.erb new file mode 100644 index 000000000..f3bdfb50a --- /dev/null +++ b/app/views/projects/join_project.js.erb @@ -0,0 +1,9 @@ +$('#ajax-modal').html('<%= escape_javascript(render :partial => 'projects/join_project') %>'); +showModal('ajax-modal', '510px'); +$('#ajax-modal').css('height','260px'); +$('#ajax-modal').siblings().remove(); +$('#ajax-modal').before("" + + ""); +$('#ajax-modal').parent().removeClass("alert_praise"); +$('#ajax-modal').parent().css("top","").css("left",""); +$('#ajax-modal').parent().addClass("alert_box"); diff --git a/app/views/users/_mail_notifications.html.erb b/app/views/users/_mail_notifications.html.erb index a8d3edc55..7dd4ad77f 100644 --- a/app/views/users/_mail_notifications.html.erb +++ b/app/views/users/_mail_notifications.html.erb @@ -1,5 +1,5 @@

    -<%= label_tag "user_mail_notification", l(:description_user_mail_notification), :class => "hidden-for-sighted_bak" %> +<%= label_tag "user_mail_notification", l(:description_user_mail_notification), :class => "hidden-for-sighted_bak" , :style=> 'margin-right: 5px;'%> <%= select_tag( 'user[mail_notification]', options_for_select( diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 927734b24..d427a9aea 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -122,6 +122,7 @@ else course_term = "春季学期" end%> + <%break if Time.new.strftime("%Y").to_i - year_now >= 2%> <% all_new_hot_course += find_all_new_hot_course(course_count-all_new_hot_course.count, @school_id, year_now, course_term)%> <% end%> <%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %> @@ -152,6 +153,7 @@ else course_term = "春季学期" end%> + <%break if Time.new.strftime("%Y").to_i - year_now >= 2%> <% all_new_hot_course += find_all_new_hot_course(9-(all_new_hot_course.count + cur_school_course.count), @school_id, year_now, course_term)%> <% end%> <%= render :partial => 'course_list', :locals => {:course_list => all_new_hot_course} %> diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 0dc62c6a3..3e341bd27 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -66,6 +66,9 @@ :course => 0, :project_type =>( @project_type||=0)}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> +      + <%= link_to l(:label_join_project), join_project_projects_path ,:remote => true, :class => 'icon icon-add' %> +      <% end %>

    diff --git a/config/application.rb b/config/application.rb index 716e3875d..2f1534d00 100644 --- a/config/application.rb +++ b/config/application.rb @@ -21,6 +21,16 @@ module RedmineApp config.verifier_email = "lizanle521@126.com" end + config.generators do |g| + g.test_framework :rspec, + fixtures: true, + view_specs: false, + helper_specs: false, + routing_specs: false, + controller_specs: true, + request_specs: false + g.fixture_replacement :factory_girl, dir: "spec/factories" + end # Custom directories with classes and modules you want to be autoloadable. config.autoload_paths += %W(#{config.root}/lib) diff --git a/config/configuration.yml b/config/configuration.yml index 7e5381406..9a9373e45 100644 --- a/config/configuration.yml +++ b/config/configuration.yml @@ -87,12 +87,12 @@ default: - address: smtp.126.com + address: smtp.163.com port: 25 - domain: smtp.126.com + domain: smtp.163.com authentication: :plain - user_name: "alanlong9278@126.com" - password: "alanlong8788786" + user_name: mcb592@163.com + password: 'mcb1989822' # Absolute path to the directory where attachments are stored. # The default is the 'files' directory in your Redmine instance. diff --git a/config/locales/en.yml b/config/locales/en.yml index d25ba6ae2..a7d98a21c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -235,7 +235,21 @@ en: mail_body_wiki_content_added: "The '%{id}' wiki page has been added by %{author}." mail_subject_wiki_content_updated: "'%{id}' wiki page has been updated" mail_body_wiki_content_updated: "The '%{id}' wiki page has been updated by %{author}." - + + # edit by meng + # emailer + mail_issue_greetings: "Dear user , Greetings from Trustie" + mail_issue_footer: "Unsubscribe this message?" + mail_issue_title_userin: "in" + mail_issue_title_active: "has a new activity which relevants to you , please pay more attention to this!" + mail_issue_subject: "Title:" + mail_issue_content: "Content:" + mail_issue_sent_from: "From:" + mail_issue_from_project: "project issue" + mail_issue_attachments: "Attachments:" + mail_issue_reply: "Want reply" + #end + field_name: Name field_description: Description field_summary: Summary @@ -568,6 +582,8 @@ en: label_document_new: New document label_document_plural: Documents label_document_added: Document added + label_forum_message_added: Message added + label_forum_add: Forum added label_document_public_info: "If you don't choose public, only the project's members can see the document." label_role: Role label_role_plural: Roles diff --git a/config/locales/zh.yml b/config/locales/zh.yml index bd6c6dc22..77a5b4a1b 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -250,6 +250,21 @@ zh: mail_body_wiki_content_added: "'%{id}' wiki页面已由 %{author} 添加。" mail_subject_wiki_content_updated: "'%{id}' wiki页面已更新。" mail_body_wiki_content_updated: "'%{id}' wiki页面已由 %{author} 更新。" + + # edit by meng + # emailer + mail_issue_greetings: "亲爱的Trustie用户,您好!" + mail_issue_footer: "退订该邮件!" + mail_issue_title_userin: "在" + mail_issue_title_active: "中有了一个与您相关的最新活动,请您关注!" + mail_issue_subject: "标题:" + mail_issue_content: "内容:" + mail_issue_sent_from: "来源:" + mail_issue_from_project: "项目问题跟踪" + mail_issue_attachments: "附件:" + mail_issue_reply: "我要回复" + #end + field_name: 名称 #added by huang field_tea_name: 教师 @@ -581,6 +596,8 @@ zh: label_document_new: 新建文档 label_document_plural: 文档 label_document_added: 文档已添加 + label_forum_message_added: 发帖成功 + label_forum_add: 贴吧创建成功 label_document_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该文档。) label_role: 角色 label_role_plural: 角色 @@ -2282,4 +2299,7 @@ zh: label_answer: 答案: label_poll_answer_valid_result: 以上为有效问答题答案! label_answer_total: 总计: + label_join_project: 加入项目 + label_technical_support: 技术支持: + label_feedback: 意见反馈 diff --git a/config/routes.rb b/config/routes.rb index bd1b27dee..65498e4ec 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -65,6 +65,8 @@ RedmineApp::Application.routes.draw do post 'create_poll_question' post 'commit_poll' get 'publish_poll' + get 'republish_poll' + get 'poll_result' end collection do delete 'delete_poll_question' @@ -375,6 +377,10 @@ RedmineApp::Application.routes.draw do match 'copy', :via => [:get, :post] end + collection do + match 'join_project', :via => [:get, :post] + end + #by young match '/member', :to => 'projects#member', :as => 'member', :via => :get match '/file', :to => 'projects#file', :as => 'file', :via => :get diff --git a/db/migrate/20150121030451_add_initial_products.rb b/db/migrate/20150121030451_add_initial_products.rb new file mode 100644 index 000000000..cb6006068 --- /dev/null +++ b/db/migrate/20150121030451_add_initial_products.rb @@ -0,0 +1,11 @@ +class AddInitialProducts < ActiveRecord::Migration + def up + Forum.create(:name =>"new forum", :description => "", :topic_count => "0", + :memo_count => "0", :last_memo_id =>"0", :creator_id =>"2", + :sticky =>"0", :locked =>"0") + end + + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 2120080a0..d0d755bd3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150114022710) do +ActiveRecord::Schema.define(:version => 20150121030451) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -23,6 +23,18 @@ ActiveRecord::Schema.define(:version => 20150114022710) do add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type" add_index "activities", ["user_id"], :name => "index_activities_on_user_id" + create_table "api_keys", :force => true do |t| + t.string "access_token" + t.datetime "expires_at" + t.integer "user_id" + t.boolean "active", :default => true + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" + add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" + create_table "applied_projects", :force => true do |t| t.integer "project_id", :null => false t.integer "user_id", :null => false diff --git a/lib/redmine/notifiable.rb b/lib/redmine/notifiable.rb index 88ca9d776..42a81980f 100644 --- a/lib/redmine/notifiable.rb +++ b/lib/redmine/notifiable.rb @@ -20,6 +20,8 @@ module Redmine notifications << Notifiable.new('message_posted') notifications << Notifiable.new('wiki_content_added') notifications << Notifiable.new('wiki_content_updated') + notifications << Notifiable.new('forum_add') + notifications << Notifiable.new('forum_message_added', 'forum_add') notifications end end diff --git a/public/images/blue_line.png b/public/images/blue_line.png new file mode 100644 index 000000000..4ae87f343 Binary files /dev/null and b/public/images/blue_line.png differ diff --git a/public/images/sidebar_bg.png b/public/images/sidebar_bg.png new file mode 100644 index 000000000..e41ea789d Binary files /dev/null and b/public/images/sidebar_bg.png differ diff --git a/public/stylesheets/course_group.css b/public/stylesheets/course_group.css index b6c7f4f8c..c160e1730 100644 --- a/public/stylesheets/course_group.css +++ b/public/stylesheets/course_group.css @@ -1,4 +1,4 @@ -body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;} +#member_of_course{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;} div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,textarea,form{ margin:0; padding:0;} div,img,tr,td,textarea,form{ border:0;} table,tr,td{border:0; cellspacing:0; cellpadding:0;} diff --git a/public/stylesheets/images/icons.png b/public/stylesheets/images/icons.png index 2d2b33fe1..e0ba4f4e6 100644 Binary files a/public/stylesheets/images/icons.png and b/public/stylesheets/images/icons.png differ diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css index c532e7112..ac7142c71 100644 --- a/public/stylesheets/nyan.css +++ b/public/stylesheets/nyan.css @@ -1433,8 +1433,8 @@ ul.contest-notification-list li span{ } .xls { - background: url('../images/icon_excel.gif') no-repeat scroll 1px 50% transparent; - padding: 2px 0px 3px 16px; + /*background: url('../images/icon_excel.gif') no-repeat scroll 1px 50% transparent;*/ + /*padding: 2px 0px 3px 16px;*/ font-family:微软雅黑 !important; font-size: 12px !important; color: #136b3b !important; diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css index 58ae913b0..a4e2010f0 100644 --- a/public/stylesheets/polls.css +++ b/public/stylesheets/polls.css @@ -14,20 +14,20 @@ div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margi #polls .fr{ float:right;} /*问卷按钮*/ -.polls_btn{ height:33px;border-top:1px solid #15bed1; border-bottom:1px solid #15bed1;border-right:1px solid #cee6e6; width:225px; padding:7px 0 0 15px; } -.polls_btn a{font-size:14px; color:#444444;font-weight:bold;} -.polls_btn span{ color:#15bed1; font-size:12px; font-weight:normal;} +/*.polls_btn{ height:33px;border-top:1px solid #15bed1; border-bottom:1px solid #15bed1;border-right:1px solid #cee6e6; width:225px; padding:7px 0 0 15px; }*/ +/*.polls_btn a{font-size:14px; color:#444444;font-weight:bold;}*/ +/*.polls_btn span{ color:#15bed1; font-size:12px; font-weight:normal;}*/ /*问卷列表*/ -.polls_content{ width:615px;} +.polls_content{ width:615px;padding-left: 6px;} .polls_head{ width:677px; height:48px; background:#eaeaea;} .polls_head h2{ float:left; font-size:14px; color:#585858; margin:11px 0 0 10px;} .polls_head span{ font-weight:normal; color:#15bccf;} a.newbtn{ float:right; display:block; width:80px; height:30px; background:#64bdd9; color:#fff; font-size:14px; margin:10px; text-align:center;} a:hover.newbtn{ background:#55a1b9; text-decoration:none;} .polls_list ul{ padding-left:10px; border-bottom:1px dashed #c9c9c9; height:32px; padding-top:8px;} -a.polls_title{ font-weight:bold; color:#3e6d8e;max-width: 350px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} -.polls_title{ font-weight:bold; color:#3e6d8e;} +a.polls_title{ font-weight:bold; color:#3e6d8e;max-width: 300px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +.polls_title{ font-weight:bold; color:#3e6d8e;max-width: 300px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} a.pollsbtn{ display:block; width:66px; height:22px; text-align:center; border:1px solid #64bdd9; color:#64bdd9;} a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;} .polls_date{ color:#666666;} @@ -53,7 +53,7 @@ ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;} .ur_inputs label{ padding-left:10px;word-break: break-all; word-wrap: break-word;} .ur_inputs input{ margin-right:5px;} .ur_text{ height:30px;} -.ur_textbox{ border:1px solid #dcdcdc !important; color:#676765;} +.ur_textbox{ border:1px solid #dcdcdc !important; color:#676765; word-break:break-all; word-wrap:break-word;} .ur_buttons{ width:250px; margin:20px auto 10px;} a.ur_button{ display:block; width:106px; height:37px; background:#15bccf; color:#fff; font-size:16px; text-align:center; padding-top:3px; float:left; margin-right:15px;} a:hover.ur_button{ background:#0fa9bb; text-decoration:none;} @@ -134,3 +134,14 @@ a:hover.upload_btn_grey{background:#8a8a8a;} .upload_con a:hover{ text-decoration:none;} .polls_btn_box{ width:145px; margin:0 auto; padding-left:10px;} .polls_btn_box02{ width:80px; margin:0 auto; padding-left:10px;} + +/***新增20150120***/ +.pollsbtn_tip{ width:30px; height:17px; display:block;background:url(images/icons.png) 0 -372px no-repeat;padding-left:7px; color:#fff;} +a.btn_de{ border:1px solid #ff5d31; color:#ff5d31; } +a:hover.btn_de{ background:#ff5d31;} +a.btn_pu{ border:1px solid #3cb761; color:#3cb761; } +a:hover.btn_pu{ background:#3cb761;} +.pollsbtn_grey{ border:1px solid #b1b1b1; color:#b1b1b1; padding:0px 9px; } +.polls_title_w { width:330px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;} +.polls_de_grey{ color:#b1b1b1;} +.ml5{ margin-left:5px;} diff --git a/spec/models/forum_observer_spec.rb b/spec/models/forum_observer_spec.rb new file mode 100644 index 000000000..76d68fafa --- /dev/null +++ b/spec/models/forum_observer_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe ForumObserver do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/models/memo_observer_spec.rb b/spec/models/memo_observer_spec.rb new file mode 100644 index 000000000..82603ba7a --- /dev/null +++ b/spec/models/memo_observer_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe MemoObserver do + pending "add some examples to (or delete) #{__FILE__}" +end