Skip to content
This repository
  • 3 commits
  • 9 files changed
  • 0 comments
  • 1 contributor
2  .gitignore
@@ -19,4 +19,4 @@ public/json/
19 19 *.project
20 20 *.DS_Store
21 21 *.orig
22   -
  22 +config/schedule.rb
1  Gemfile
@@ -16,6 +16,7 @@ gem 'date_validator'
16 16 gem 'will_paginate', '~> 3.0.beta'
17 17 gem 'thinking-sphinx', '2.0.0', :require => 'thinking_sphinx'
18 18 gem 'exception_notification_rails3', :require => 'exception_notifier'
  19 +gem 'whenever', :require => false
19 20
20 21 #gem 'geokit'
21 22 #gem 'geokit-rails'
5 Gemfile.lock
... ... @@ -1,6 +1,7 @@
1 1 GEM
2 2 remote: http://rubygems.org/
3 3 specs:
  4 + aaronh-chronic (0.3.9)
4 5 abstract (1.0.0)
5 6 actionmailer (3.0.0)
6 7 actionpack (= 3.0.0)
@@ -111,6 +112,9 @@ GEM
111 112 polyglot (>= 0.3.1)
112 113 tzinfo (0.3.25)
113 114 watchr (0.7)
  115 + whenever (0.6.8)
  116 + aaronh-chronic (>= 0.3.9)
  117 + activesupport (>= 2.3.4)
114 118 will_paginate (3.0.pre2)
115 119
116 120 PLATFORMS
@@ -134,4 +138,5 @@ DEPENDENCIES
134 138 sqlite3-ruby
135 139 thinking-sphinx (= 2.0.0)
136 140 watchr
  141 + whenever
137 142 will_paginate (~> 3.0.beta)
4 app/views/site/index.html.erb
@@ -56,7 +56,9 @@
56 56 </div>
57 57 <div id="tasks" class="tabContents">
58 58 <% if logged_in? %>
59   - <%= button_to '发布任务',new_task_path,:class=>'gary',:method => :get,:style=>'text-align:right'%>
  59 + <div style="text-align:right;clear:both;padding:4px">
  60 + <%= button_to '发布任务',new_task_path,:class=>'gary',:method => :get%>
  61 + </div>
60 62 <% end %>
61 63 <%= render :partial => '/public/task',:collection => @tasks %>
62 64 <%= link_to('查看更多...',more_tasks_path(:page => 2),:class=> 'timeline_footer',:onclick => 'javascript:more_timeline($(this));return false;') %>
24 config/schedule.rb
... ... @@ -0,0 +1,24 @@
  1 +# Use this file to easily define all of your cron jobs.
  2 +#
  3 +# It's helpful, but not entirely necessary to understand cron before proceeding.
  4 +# http://en.wikipedia.org/wiki/Cron
  5 +
  6 +# Example:
  7 +#
  8 +# set :output, "/path/to/my/cron_log.log"
  9 +#
  10 +# every 2.hours do
  11 +# command "/usr/bin/some_great_command"
  12 +# runner "MyModel.some_method"
  13 +# rake "some:great:rake:task"
  14 +# end
  15 +#
  16 +# every 4.days do
  17 +# runner "AnotherModel.prune_old_records"
  18 +# end
  19 +
  20 +# Learn more: http://github.com/javan/whenever
  21 +
  22 +every 5.minutes do
  23 + command "/home/admin/igeey.com/scripts/sphinx_index.sh"
  24 +end
0  public/images/icon/faild.png → public/images/icon/failed.png
File renamed without changes
75 public/javascripts/application.js
@@ -16,7 +16,7 @@ function redirect_clear(id, type){
16 16 };
17 17
18 18
19   -$(document).ready(function(){
  19 +(function($){
20 20
21 21 $('.timeago').live('replace.time', function() {
22 22 $(this).html('(' + jQuery.timeago($(this).html()) + ')').removeClass('timeago');
@@ -56,52 +56,57 @@ $(document).ready(function(){
56 56 .live('mouseover', function() {$(this).html('取消关注')})
57 57 .live('mouseout', function() {$(this).html("正在关注")});
58 58
59   - $(".open_dialog").click(function(e) {
  59 + $(".open_dialog").live('click', function(e) {
60 60 IG.dialog.init({title: $(this).attr('title'),url: $(this).attr('href')});
61 61 e.preventDefault();
62 62 });
63 63
64   - $(".answer").click(function(e) {
  64 + $(".answer").live('click', function(e) {
65 65 var id = $(this).attr('href');
66 66 IG.dialog.init({title: $(this).attr('title'),content: $(id).html()});
67 67 e.preventDefault();
68 68 });
69 69
70   - $('.with_tip').poshytip({
71   - className: 'tip-yellowsimple',
72   - showOn: 'focus',
73   - alignTo: 'target',
74   - alignX: 'right',
75   - alignY: 'center',
76   - offsetX: 5
77   - });
  70 +
  71 + $(document).ready(function(){
78 72
79   - $('.with_explain').poshytip({
80   - className: 'tip-yellowsimple',
81   - showTimeout: 1,
82   - alignTo: 'target',
83   - alignX: 'center',
84   - offsetY: 5,
85   - allowTipHover: false
86   - });
  73 + $('.with_tip').poshytip({
  74 + className: 'tip-yellowsimple',
  75 + showOn: 'focus',
  76 + alignTo: 'target',
  77 + alignX: 'right',
  78 + alignY: 'center',
  79 + offsetX: 5
  80 + });
87 81
88   - $('textarea').autoResize()
  82 + $('.with_explain').poshytip({
  83 + className: 'tip-yellowsimple',
  84 + showTimeout: 1,
  85 + alignTo: 'target',
  86 + alignX: 'center',
  87 + offsetY: 5,
  88 + allowTipHover: false
  89 + });
  90 +
  91 + $('textarea').autoResize()
89 92
90   - if(!('placeholder' in document.createElement('input'))){
91   - $('input[placeholder!=""]').hint();
92   - };
  93 + if(!('placeholder' in document.createElement('input'))){
  94 + $('input[placeholder!=""]').hint();
  95 + };
93 96
94   - $(".tabContents").hide().first().show();
95   - $("#tabNav li a:first").addClass("active");
96   - $("#tabNav li a").click(function(){
97   - var activeTab = $(this).attr("href");
98   - $("#tabNav li a").removeClass("active");
99   - $(this).addClass("active");
100   - $(".tabContents").hide();
101   - $(activeTab).fadeIn();
102   - return false;
103   - });
  97 + $(".tabContents").hide().first().show();
  98 + $("#tabNav li a:first").addClass("active");
  99 + $("#tabNav li a").click(function(){
  100 + var activeTab = $(this).attr("href");
  101 + $("#tabNav li a").removeClass("active");
  102 + $(this).addClass("active");
  103 + $(".tabContents").hide();
  104 + $(activeTab).fadeIn();
  105 + return false;
  106 + });
104 107
105   - $('#dialog_flash a').click();
  108 + $('#dialog_flash a').click();
  109 +
  110 + });
106 111
107   -});
  112 +}( jQuery ));
2  public/stylesheets/site.css
@@ -582,7 +582,7 @@ input.reply_submit{float:right;margin-top:1px}
582 582
583 583 .reply{font-size:12px;border-bottom:1px dashed #d6d6d6;text-align:left}
584 584 .reply_reply{float:right}
585   -.reply_tail{position:relative;top:6px;right:20px;}
  585 +.reply_tail{position:relative;top:5px;right:20px;}
586 586 .replys{text-align:right;clear:both;}
587 587
588 588 .photo_box{
58 spec/models/saying_spec.rb
... ... @@ -0,0 +1,58 @@
  1 +require 'spec_helper'
  2 +
  3 +describe Saying do
  4 + before do
  5 + @user1 = makestory
  6 + end
  7 + describe 'validation' do
  8 + it 'should be created by user_id' do
  9 + @saying = Saying.new(:venue_id=>1, :content=>'saying')
  10 + @saying.should_not be_valid
  11 +
  12 + @saying = Saying.new(:user_id=>@user1.id, :venue_id=>1, :content=>'saying')
  13 + @saying.should be_valid
  14 + end
  15 +
  16 + it 'should be created by venue_id' do
  17 + @saying = Saying.new(:user_id=>@user1.id, :content=>'saying')
  18 + @saying.should_not be_valid
  19 +
  20 + @saying = Saying.new(:user_id=>@user1.id, :venue_id=>1, :content=>'saying')
  21 + @saying.should be_valid
  22 + end
  23 +
  24 + it 'should be created by content' do
  25 + @saying = Saying.new(:user_id=>@user1.id, :venue_id=>1)
  26 + @saying.should_not be_valid
  27 +
  28 + @saying = Saying.new(:user_id=>@user1.id, :venue_id=>1, :content=>'saying')
  29 + @saying.should be_valid
  30 + end
  31 +
  32 + it 'should be created from 1 to 140 words of content' do
  33 + content = ''
  34 + @saying = Saying.new(:user_id=>@user1.id, :venue_id=>1, :content=>content)
  35 + @saying.should_not be_valid
  36 +
  37 + content = '@'
  38 + @saying = Saying.new(:user_id=>@user1.id, :venue_id=>1, :content=>content)
  39 + @saying.should be_valid
  40 +
  41 + content = '@'*140
  42 + @saying = Saying.new(:user_id=>@user1.id, :venue_id=>1, :content=>content)
  43 + @saying.should be_valid
  44 +
  45 + content = '@'*141
  46 + @saying = Saying.new(:user_id=>@user1.id, :venue_id=>1, :content=>content)
  47 + @saying.should_not be_valid
  48 + end
  49 + end
  50 +
  51 + it 'should be commented' do
  52 + @saying = Saying.new(:user_id=>@user1.id, :venue_id=>1, :content=>'saying')
  53 + @saying.save
  54 +
  55 + @comment = Comment.new(:user_id=>@user1.id, :content=>'comment', :commentable_type=>@saying.class.to_s, :commentable_id=>@saying.id)
  56 + @comment.should be_valid
  57 + end
  58 +end

No commit comments for this range

Something went wrong with that request. Please try again.