Conflicts: app/views/welcome/index.html.erbcompetition
commit
b7c4f87a8f
@ -0,0 +1,39 @@
|
|||||||
|
# More info at https://github.com/guard/guard#readme
|
||||||
|
|
||||||
|
# guard 'rails' do
|
||||||
|
# watch('Gemfile.lock')
|
||||||
|
# watch(%r{^(config|lib)/.*})
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
guard 'spork', :test_unit => true, :test_unit_env => {'RAILS_ENV' => 'test'}, :wait => 60 do
|
||||||
|
watch('config/application.rb')
|
||||||
|
watch('config/environment.rb')
|
||||||
|
watch('config/environments/test.rb')
|
||||||
|
watch(%r{^config/initializers/.+\.rb$})
|
||||||
|
watch('Gemfile.lock')
|
||||||
|
watch('spec/spec_helper.rb') { :rspec }
|
||||||
|
watch('test/test_helper.rb') { :test_unit }
|
||||||
|
watch(%r{features/support/}) { :cucumber }
|
||||||
|
end
|
||||||
|
|
||||||
|
guard :test, :drb => true, :all_after_pass => false, :all_on_start => false do
|
||||||
|
watch(%r{^test/.+_test\.rb$})
|
||||||
|
watch('test/test_helper.rb') { 'test' }
|
||||||
|
|
||||||
|
# Non-rails
|
||||||
|
watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
|
||||||
|
|
||||||
|
# Rails 4
|
||||||
|
# watch(%r{^app/(.+)\.rb}) { |m| "test/#{m[1]}_test.rb" }
|
||||||
|
# watch(%r{^app/controllers/application_controller\.rb}) { 'test/controllers' }
|
||||||
|
# watch(%r{^app/controllers/(.+)_controller\.rb}) { |m| "test/integration/#{m[1]}_test.rb" }
|
||||||
|
# watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
|
||||||
|
# watch(%r{^lib/(.+)\.rb}) { |m| "test/lib/#{m[1]}_test.rb" }
|
||||||
|
|
||||||
|
# Rails < 4
|
||||||
|
watch(%r{^app/models/(.+)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
|
||||||
|
watch(%r{^app/controllers/(.+)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
|
||||||
|
watch(%r{^app/views/(.+)/.+\.erb$}) { |m| "test/functional/#{m[1]}_controller_test.rb" }
|
||||||
|
watch(%r{^app/views/.+$}) { 'test/integration' }
|
||||||
|
watch('app/controllers/application_controller.rb') { ['test/functional', 'test/integration'] }
|
||||||
|
end
|
@ -0,0 +1,6 @@
|
|||||||
|
class FirstPage < ActiveRecord::Base
|
||||||
|
attr_accessible :description, :title, :web_title,:page_type,:sort_type
|
||||||
|
validates_presence_of :web_title, :title, :description,:page_type
|
||||||
|
validates_length_of :web_title,:title, maximum: 30
|
||||||
|
validates_length_of :description, maximum: 100
|
||||||
|
end
|
@ -0,0 +1,39 @@
|
|||||||
|
<h3><%=l(:label_first_page_made)%></h3>
|
||||||
|
|
||||||
|
<%= form_tag(:controller => 'admin', :action => 'contest_page_made') do %>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='web_title'><%= l(:label_web_title) %>:</label>
|
||||||
|
<%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<div class="tabs">
|
||||||
|
<ul>
|
||||||
|
<li><%= link_to l(:label_project_first_page), {:action => 'first_page_made'} %></li>
|
||||||
|
<li><%= link_to l(:label_course_first_page), {:action => 'course_page_made'} %></li>
|
||||||
|
<li><%= link_to l(:label_contest_first_page), {:action => 'contest_page_made'} , :class => 'selected'%></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h4><%=l(:label_contest_first_page)%></h4>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='attachments_fields'> <%= l(:label_site_image) %>:</label>
|
||||||
|
</p>
|
||||||
|
<div style="margin-left: 82px;" id="avatar">
|
||||||
|
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@contest_page} %>
|
||||||
|
</div>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='contest_title'> <%= l(:label_site_title) %>:</label>
|
||||||
|
<%= text_field_tag 'contest_title', params[:label_site_title], :value => @contest_page.title,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='contest_description' style="vertical-align: top"> <%= l(:label_site_description)%>:</label>
|
||||||
|
<%= text_area_tag 'contest_description',@contest_page.description,:rows => 8, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<%= submit_tag l(:button_save), :class => "small", :name => nil %>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
@ -0,0 +1,37 @@
|
|||||||
|
<h3><%=l(:label_first_page_made)%></h3>
|
||||||
|
|
||||||
|
<%= form_tag(:controller => 'admin', :action => 'course_page_made') do %>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='web_title'><%= l(:label_web_title) %>:</label>
|
||||||
|
<%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<div class="tabs">
|
||||||
|
<ul>
|
||||||
|
<li><%= link_to l(:label_project_first_page), {:action => 'first_page_made'} %></li>
|
||||||
|
<li><%= link_to l(:label_course_first_page), {:action => 'course_page_made'}, :class => 'selected' %></li>
|
||||||
|
<li><%= link_to l(:label_contest_first_page), {:action => 'contest_page_made'} %></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<h4><%=l(:label_course_first_page)%></h4>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='attachments_fields'> <%= l(:label_site_image) %>:</label>
|
||||||
|
</p>
|
||||||
|
<div style="margin-left: 82px;" id="avatar">
|
||||||
|
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@course_page} %>
|
||||||
|
</div>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='course_title'> <%= l(:label_site_title) %>:</label>
|
||||||
|
<%= text_field_tag 'course_title', params[:label_site_title], :value => @course_page.title,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='course_description' style="vertical-align: top"> <%= l(:label_site_description)%>:</label>
|
||||||
|
<%= text_area_tag 'course_description',@course_page.description,:rows => 8, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<%= submit_tag l(:button_save), :class => "small", :name => nil %>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
@ -0,0 +1,46 @@
|
|||||||
|
<h3><%=l(:label_first_page_made)%></h3>
|
||||||
|
|
||||||
|
<%= form_tag(:controller => 'admin', :action => 'first_page_made') do %>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='web_title'><%= l(:label_web_title) %>:</label>
|
||||||
|
<%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<div class="tabs">
|
||||||
|
<ul>
|
||||||
|
<li><%= link_to l(:label_project_first_page), {:action => 'first_page_made'}, :class => 'selected' %></li>
|
||||||
|
<li><%= link_to l(:label_course_first_page), {:action => 'course_page_made'} %></li>
|
||||||
|
<li><%= link_to l(:label_contest_first_page), {:action => 'contest_page_made'} %></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<h4><%=l(:label_project_first_page)%></h4>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='attachments_fields'> <%= l(:label_site_image) %>:</label>
|
||||||
|
</p>
|
||||||
|
<div style="margin-left: 82px;" id="avatar">
|
||||||
|
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@first_page} %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='title'> <%= l(:label_site_title) %>:</label>
|
||||||
|
<%= text_field_tag 'title', params[:label_site_title], :value => @first_page.title,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='description' style="vertical-align: top"> <%= l(:label_site_description)%>:</label>
|
||||||
|
<%= text_area_tag 'description',@first_page.description,:rows => 8, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='sort_type' style="vertical-align: top"> <%= l(:label_sort_type)%>:</label>
|
||||||
|
<select name="sort_type" id="sort_type" style="font-size:small;width:496px;margin-left:80px;">
|
||||||
|
<option value="1" <%= "selected=selected" if @first_page.sort_type == 1 %>><%= l(:label_sort_by_active) %></option>
|
||||||
|
<option value="2" <%= "selected=selected" if @first_page.sort_type == 2 %>><%= l(:label_sort_by_influence) %></option>
|
||||||
|
<option value="0" <%= "selected=selected" if @first_page.sort_type == 0 %>><%= l(:label_sort_by_time) %></option>
|
||||||
|
</select>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<%= submit_tag l(:button_save), :class => "small", :name => nil %>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
@ -0,0 +1,31 @@
|
|||||||
|
<h3><%=l(:label_first_page_made)%></h3>
|
||||||
|
|
||||||
|
<%= form_tag(:controller => 'admin', :action => 'first_page_made') do %>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='web_title'><%= l(:label_web_title) %>:</label>
|
||||||
|
<%= text_field_tag 'web_title', params[:wbe_title],:value => @first_page.web_title, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<h4><%=l(:label_project_first_page)%></h4>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='attachments_fields'> <%= l(:label_site_image) %>:</label>
|
||||||
|
</p>
|
||||||
|
<div style="margin-left: 82px;">
|
||||||
|
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@first_page} %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='title'> <%= l(:label_site_title) %>:</label>
|
||||||
|
<%= text_field_tag 'title', params[:label_site_title], :value => @first_page.title,:size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
<p style="margin-left:60px;padding-right: 20px;">
|
||||||
|
<label for='description' style="vertical-align: top"> <%= l(:label_site_description)%>:</label>
|
||||||
|
<%= text_area_tag 'description',@first_page.description,:rows => 8, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<%= submit_tag l(:button_save), :class => "small", :name => nil %>
|
||||||
|
<% end %>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
@ -0,0 +1,5 @@
|
|||||||
|
var avatardiv = $('#avatardiv');
|
||||||
|
avatardiv.replaceWith("<%= escape_javascript(render :partial=>'avatar/avatar_form',:style => 'display:inline',:locals=> {source:@source}) %>");
|
||||||
|
//var imgSpan = $('#avatar_image');
|
||||||
|
|
||||||
|
//imgSpan.attr({"src":'<#%= @urlfile.to_s << "?" << Time.now.to_s%>'});
|
@ -1,5 +1,5 @@
|
|||||||
<%= l(:label_user_grade)%>:
|
<%= l(:label_user_grade)%>:
|
||||||
<%= link_to(format("%.2f" , user.user_score_attr.total_score).to_f, {:controller => 'users',
|
<%= link_to(format("%.2f" , user.user_score_attr.total_score).to_i, {:controller => 'users',
|
||||||
:action => 'show_new_score',
|
:action => 'show_new_score',
|
||||||
:remote => true,
|
:remote => true,
|
||||||
:id => user.id
|
:id => user.id
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
# -*coding:utf-8 -*-
|
||||||
|
class CreateFirstPages < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :first_pages do |t|
|
||||||
|
t.string :web_title
|
||||||
|
t.string :title
|
||||||
|
t.string :description
|
||||||
|
t.string :page_type
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
fp = FirstPage.new
|
||||||
|
fp.web_title = "Trustie - 为大学生技术创新筑巢"
|
||||||
|
fp.title = "Trustie在线项目托管平台"
|
||||||
|
fp.description = "面向中国大学生与软件从业者,提供社交化的项目管理、代码托管、资源共享、合作交流。"
|
||||||
|
fp.page_type = "project"
|
||||||
|
|
||||||
|
fp.save
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,9 @@
|
|||||||
|
class AddCloumnToFirstPage < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
#add_column :first_pages,:type,:string
|
||||||
|
|
||||||
|
#fr = FirstPage.all.first
|
||||||
|
#fr.type = "project"
|
||||||
|
#fr.save
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
class AltColumnName < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
#rename_column :first_pages,:type,:page_type
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,17 @@
|
|||||||
|
# -*coding:utf-8 -*-
|
||||||
|
class AddContestAndCourseFirstPage < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
fp = FirstPage.new
|
||||||
|
fp.web_title = ""
|
||||||
|
fp.title = "Trustie在线课程实践平台"
|
||||||
|
fp.description = "面向中国高校教师与大学生,提供社交化的课程管理、资源共享、合作实验、协同研究。"
|
||||||
|
fp.page_type = "course"
|
||||||
|
fp.save
|
||||||
|
fp1 = FirstPage.new
|
||||||
|
fp1.web_title = ""
|
||||||
|
fp1.title = "Trustie在线竞赛实战平台"
|
||||||
|
fp1.description = "面向中国大学生与编程爱好者,提供社交化的竞赛管理、应用管理、代码托管、合作交流。"
|
||||||
|
fp1.page_type = "contest"
|
||||||
|
fp1.save
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddIsPublicToDocuments < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :documents, :is_public, :integer,:default => 1
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,9 @@
|
|||||||
|
# -*coding:utf-8 -*-
|
||||||
|
class SetWebTitle < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
FirstPage.all.each do |fp|
|
||||||
|
fp.web_title = "Trustie - 为大学生技术创新筑巢"
|
||||||
|
fp.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,9 @@
|
|||||||
|
class DstTest < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
add_column :projects, :dts_test, :integer, :default => 0
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
remove_column :projects, :dts_test
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddColumnForFirstPage < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column("first_pages","sort_type",:integer)
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,8 @@
|
|||||||
|
class SetSortType < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
FirstPage.all.each do |fp|
|
||||||
|
fp.sort_type = 1
|
||||||
|
fp.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue