commit
a7a8a5cb54
@ -1,42 +0,0 @@
|
||||
class DiscussDemosController < ApplicationController
|
||||
def index
|
||||
|
||||
@discuss_demo_list = DiscussDemo.where("body is not null").order("created_at desc").page(params[:page] || 1).per(10)
|
||||
end
|
||||
|
||||
def new
|
||||
@discuss_demo = DiscussDemo.create
|
||||
@discuss_demo.save!
|
||||
@discuss_demo
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
end
|
||||
|
||||
def update
|
||||
@discuss_demo = DiscussDemo.find(params[:id])
|
||||
@discuss_demo.update_attributes(:title => params[:discuss_demo][:title],:body => params[:discuss_demo][:body])
|
||||
redirect_to :controller=> 'discuss_demos',:action => 'show',:id => params[:id]
|
||||
end
|
||||
|
||||
def delete
|
||||
|
||||
end
|
||||
|
||||
def destroy
|
||||
asset = Kindeditor::Asset.find_by_owner_id(params[:id])
|
||||
if !asset.nil?
|
||||
filepath = File.join(Rails.root,"public","files","uploads",
|
||||
asset[:created_at].to_s.gsub("+0800","").to_datetime.strftime("%Y%m").to_s,
|
||||
asset[:asset].to_s)
|
||||
File.delete(filepath) if File.exist?filepath
|
||||
end
|
||||
DiscussDemo.destroy(params[:id])
|
||||
redirect_to :controller=> 'discuss_demos',:action => 'index'
|
||||
end
|
||||
|
||||
def show
|
||||
@discuss_demo = DiscussDemo.find(params[:id])
|
||||
end
|
||||
end
|
@ -1,4 +0,0 @@
|
||||
class DiscussDemo < ActiveRecord::Base
|
||||
attr_accessible :title, :body
|
||||
has_many_kindeditor_assets :assets, :dependent => :destroy
|
||||
end
|
@ -1,4 +1,4 @@
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<%= labelled_form_for @bid do |f| %>
|
||||
<%= labelled_form_for @bid,:html => { :multipart => true } do |f| %>
|
||||
<%= render :partial => 'new_homework_form', :locals => { :bid => @bid, :bid_id => "edit_bid_#{@bid.id}",:f=>f,:edit_mode => true} %>
|
||||
<% end %>
|
@ -1,2 +1,2 @@
|
||||
alert('关闭成功');
|
||||
$("#<%= @bid.id %>_anonymous_comment").html('<a href="javascript:" style="background:#8e8e8e;">匿评结束</a>');
|
||||
$("#<%= @bid.id %>_stop_anonymous_comment").replaceWith('<a class="fr pr_join_span mr10 span_wping_background" title="匿评结束">匿评结束</a>');
|
||||
|
@ -1,4 +1,4 @@
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
||||
<%= labelled_form_for @homework, :url => {:controller => 'bids', :action => 'create_homework',:course_id => "#{params[:id] || params[:course_id]}"} do |f| %>
|
||||
<%= labelled_form_for @homework, :html => { :multipart => true }, :url => {:controller => 'bids', :action => 'create_homework',:course_id => "#{params[:id] || params[:course_id]}"} do |f| %>
|
||||
<%= render :partial => 'bids/new_homework_form', :locals => { :bid => @homework,:bid_id => "new_bid",:f => f,:edit_mode => false } %>
|
||||
<% end %>
|
@ -1,25 +0,0 @@
|
||||
<h1 style="">文章列表</h1>
|
||||
<div>
|
||||
<table border="1px solid !important" >
|
||||
<% @discuss_demo_list.each do |e| %>
|
||||
|
||||
<tr align="left" height="20">
|
||||
<td width="30%" ><%= truncate(e.title,:length => 50) %></td>
|
||||
<td align="center" width="60%">
|
||||
<%= truncate(e.body,:length => 50) %>
|
||||
</td>
|
||||
<td style=" margin-right: 1" width="10%">
|
||||
<%= link_to '查看文章',{:controller => 'discuss_demos',:action => 'show',:id=>e.id} %>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<%= link_to '删除文章',discuss_demo_path(e.id), :method => :delete,:confirm => l(:text_are_you_sure) %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr height="20"></tr>
|
||||
<tr height="20"></tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<% paginate @discuss_demo_list %>
|
||||
<%= link_to '新建文章',new_discuss_demo_path %>
|
||||
</div>
|
@ -1,7 +0,0 @@
|
||||
<%= javascript_include_tag src='/assets/kindeditor/kindeditor' %>
|
||||
<h1>新建文章</h1>
|
||||
<%= form_for @discuss_demo,:url => {:controller => 'discuss_demos',:action => "show",:id =>@discuss_demo.id, :method => :put} do |f| %>
|
||||
<%= f.text_field :title %>
|
||||
<%= f.kindeditor :body ,:owner_id => @discuss_demo.id%>
|
||||
<%= f.submit :value=> '提交' %>
|
||||
<% end %>
|
@ -1,3 +0,0 @@
|
||||
<h1><%= @discuss_demo.title %></h1>
|
||||
<%= textAreailizable @discuss_demo.body %>
|
||||
<%=link_to "返回首页",discuss_demos_path %>
|
@ -1,7 +1,7 @@
|
||||
$('#message_subject').val("<%= raw escape_javascript(@subject) %>");
|
||||
$('#message_quote').html("<%= raw escape_javascript(@temp.content.html_safe) %>");
|
||||
//$('#message_content').val("<#%= raw escape_javascript(@content) %>");
|
||||
$('#quote_quote').html("<%= raw escape_javascript(@content) %>");
|
||||
$('#quote_quote').html("<%= raw escape_javascript(@temp.content.html_safe) %>");
|
||||
|
||||
showAndScrollTo("reply", "message_content");
|
||||
$('#message_content').scrollTop = $('#message_content').scrollHeight - $('#message_content').clientHeight;
|
||||
|
@ -0,0 +1,5 @@
|
||||
<% if @notifiable.value == "0"%>
|
||||
$("#hidden_non_project").replaceWith("<%= escape_javascript(link_to '显示非项目信息',settings_hidden_non_project_path,:id => 'hidden_non_project',:style => 'float: right;margin-right: 60px;margin-top: 9px;', :remote => true)%>");
|
||||
<% else%>
|
||||
$("#hidden_non_project").replaceWith("<%= escape_javascript(link_to '隐藏非项目信息',settings_hidden_non_project_path,:id => 'hidden_non_project',:style => 'float: right;margin-right: 60px;margin-top: 9px;', :remote => true)%>");
|
||||
<% end%>
|
@ -1,6 +1,9 @@
|
||||
|
||||
<%hidden_non_project = Setting.find_by_name("hidden_non_project")
|
||||
visiable = hidden_non_project && hidden_non_project.value == "0"%>
|
||||
<% unless visiable%>
|
||||
<div class="linkother" style="margin-left: 30%; float: left">
|
||||
<a href="http://<%= Setting.host_name%>" class="link_other_item"><%=l(:label_projects_management_platform)%></a>
|
||||
<a href="http://<%= Setting.host_course%>" class="link_other_item"><%=l(:label_courses_management_platform)%></a>
|
||||
<a href="http://<%= Setting.host_contest%>" class="link_other_item"><%=l(:label_contests_management_platform)%></a>
|
||||
</div>
|
||||
<% end%>
|
@ -1,9 +0,0 @@
|
||||
class CreateDiscussDemos < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :discuss_demos do |t|
|
||||
t.string :title
|
||||
t.text :body
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,8 @@
|
||||
// ---------------------------------------------------------------------- //
|
||||
// iPass - Iphone-like masked password input
|
||||
// version 1.0
|
||||
// author: pixelboi8 (pixelboi8@gmail.com)
|
||||
// created: 12/12/2010
|
||||
// ---------------------------------------------------------------------- //
|
||||
|
||||
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(8($){$.1e.1l=8(D){2 c={\'I\':1r,\'1a\':1q,\'e\':\'%1w\'};5(D){$.1p(c,D)}2 v=[];2 l=[];2 T=1n 1s(\'[^\'+c[\'e\']+\']\',\'1v\');2 i=0;4.W(8(6){2 G=\'-\'+6;2 t=$(4);2 3=4.3;2 q=4.q;2 h=3+G;2 11=3+G;5(!3||!q){1t("1m 1d 1c \'3\' 1b \'q\' 1f w 1g!");12 16}$(\'<a 3="\'+h+\'" q="\'+11+\'" 1i="Q" 1h="1u" />\').1M(t);2 A=$(\'#\'+h);2 g=$(\'#\'+h)[0];5(4.x){g.x=4.x}5(4.F){g.F=4.F}5(4.E){g.E=4.E}5(4.z&&4.z!=\'-1\'){g.z=4.z}5(4.N){g.N=4.N}5(4.H){g.H=4.H}5(4.B){g.B=4.B}5(4.L){g.L=4.L}4.x=\'\';4.B=\'\';t.1O();A.Z(\'1J\',8(){2 m=A.j();v[6]=V(8(){M(6,3,h,m)},c[\'I\'])});A.Z(\'1A\',8(){e(6,h);18(v[6])});$(\'X\').W(8(){5(4.J==3){4.J=h}n 5(t[0].13.1y.1C()==\'X\'){t[0].13.J=h}})});M=8(6,r,3,m){2 o=$(\'#\'+3).j();5(o!=m){19(6,r,3)}n{e(6,3)}m=o;v[6]=V(8(){M(6,r,3,m)},c[\'I\'])};19=8(6,r,3){2 7=P(3);2 K=16;2 p=$(\'#\'+3);2 C=$(\'#\'+r);2 9=p.j().17(\'\');2 d=C.j().17(\'\');5(l[6]){18(l[6]);l[6]=10}w(i=0;i<9.f;i++){5(9[i]!=d[i]){5(9[i]!=u(c[\'e\'])){d.O(i,0,9[i])}n{d[i]=d[i]}}n{d.O(i,0,9[i])}}5(9.f<d.f){d.O(7.k,d.f-9.f,\'\')}w(i=0;i<9.f;i++){5(9[i]!=u(c[\'e\'])){K=i}}w(i=0;i<9.f;i++){5(i<K){9[i]=u(c[\'e\'])}}p.j(9.15(\'\'));C.j(d.15(\'\'));R(3,7)};e=8(6,3){2 7=P(3);2 p=$(\'#\'+3);2 o=p.j();5(!l[6]&&o.1K(T)!=10){l[6]=V(8(){p.j(o.1j(T,u(c[\'e\'])));R(3,7)},c[\'1a\'])}};P=8(3){2 a=$(\'#\'+3)[0];2 7={k:0,s:0};5(a.S){7.k=a.1B;7.s=a.1D}n 5(a.y){2 Y=1H.b.1Q().1E();2 b=a.y();2 U=b.1F();b.1G(Y);U.1z(\'1I\',b);7.k=U.Q.f;7.s=7.k+b.Q.f}12 7};R=8(3,7){2 a=$(\'#\'+3)[0];5(a.S){a.S(7.k,7.s)}n 5(a.y){2 b=a.y();b.1L(1x);b.1N(\'14\',7.s);b.1k(\'14\',7.k);b.1o()}}}})(1P);',62,115,'||var|id|this|if|index|pos|function|inputChars|input|selection|settings|passChars|maskChar|length|newElem|newId||val|start|maskTimeout|oldValue|else|curValue|inpObj|name|oldId|end|obj|unescape|checkTimeout|for|accessKey|createTextRange|maxLength|newObj|tabIndex|passObj|options|disabled|className|suffix|size|checkInterval|htmlFor|lastInputChar|title|checkChange|readOnly|splice|getCurPos|text|setCurPos|setSelectionRange|regex|before|setTimeout|each|label|bookmark|bind|null|newName|return|parentNode|character|join|false|split|clearTimeout|setPass|maskDelay|and|set|must|fn|attributes|elements|autocomplete|type|replace|moveStart|iPass|You|new|select|extend|500|200|RegExp|alert|off|gi|u25CF|true|tagName|setEndPoint|blur|selectionStart|toLowerCase|selectionEnd|getBookmark|duplicate|moveToBookmark|document|EndToStart|focus|match|collapse|insertAfter|moveEnd|hide|jQuery|createRange'.split('|'),0,{}))
|
Loading…
Reference in new issue