From b432be0e6cf978652d5c2c97f1205efead11ccb3 Mon Sep 17 00:00:00 2001 From: Boshu Liu Date: Sat, 19 May 2012 20:02:06 -0400 Subject: [PATCH] boshu first commit --- app/models/project.rb | 3 +- app/views/ind_users/_navigation.html.haml | 8 +-- app/views/job_searches/_form.html.haml | 17 +++-- app/views/job_searches/show.html.haml | 62 ++++++++++-------- app/views/layouts/_header.html.haml | 2 +- app/views/org_users/_side_nav.html.haml | 2 +- app/views/shared/_skill_picker.html.haml | 5 +- app/views/shouts/index.html.haml | 6 +- config/.routes.rb.swp | Bin 12288 -> 0 bytes config/locales/mongoid.yml | 4 ++ db/seeds/school.seeds.rb | 2 +- .../themes/advanced/skins/default/content.css | 2 +- 12 files changed, 65 insertions(+), 48 deletions(-) delete mode 100644 config/.routes.rb.swp diff --git a/app/models/project.rb b/app/models/project.rb index 721ae55..063b1ca 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -55,7 +55,8 @@ class Project validates :people_count, :title, :intro, :province,:province_id, :stage, :presence =>true validates_inclusion_of :has_patent, :in => [true, false] validates_presence_of :project_field_ids - + validates_numericality_of :people_count, :only_integer=>true, :greater_than=>0 + accepts_nested_attributes_for :photos, :allow_destroy => true def add_admin user diff --git a/app/views/ind_users/_navigation.html.haml b/app/views/ind_users/_navigation.html.haml index c513c61..5bc8941 100644 --- a/app/views/ind_users/_navigation.html.haml +++ b/app/views/ind_users/_navigation.html.haml @@ -3,15 +3,15 @@ %li{:class=>"#{params[:controller]=='ind_users' && params[:action]=='overview' ? 'active':''}"} =link_to "工作圈主页", ind_user_overview_path - %li{:class=>is_active?('job_searches#show')}=link_to '搜职位',default_jobs_path - %li{:class=>is_active?('company_searches#show')}=link_to '搜公司',default_companies_path + %li{:class=>is_active?('job_searches#show')}=link_to '职位信息',default_jobs_path + %li{:class=>is_active?('company_searches#show')}=link_to '公司信息',default_companies_path %li{:class=>"dropdown #{is_active?("job_posts#new")} #{is_active?("ind_users#job_posts")}",:"data-dropdown"=>"dropdown" } - =link_to_function "职位发布",'$(".dropdown-menu.job_navigation").toggle()', :class=>"dropdown-toggle" + =link_to_function "职位管理",'$(".dropdown-menu.job_navigation").toggle()', :class=>"dropdown-toggle" %ul.dropdown-menu.job_navigation %li=link_to "发布职位",new_job_post_path - %li=link_to "发布存档",ind_user_job_posts_path(current_user) + %li=link_to "查看历史",ind_user_job_posts_path(current_user) diff --git a/app/views/job_searches/_form.html.haml b/app/views/job_searches/_form.html.haml index 88aa917..2dd6ab7 100644 --- a/app/views/job_searches/_form.html.haml +++ b/app/views/job_searches/_form.html.haml @@ -1,13 +1,18 @@ =semantic_form_for @search do |f| =f.inputs do .row - .span2=f.input :keywords + .span3 + =f.input :keywords + + =submit_tag "搜索",:class=>"btn" + + %h4.span3 附加选项 .span3=f.input :industry_id, :as=>:select, :collection=>Industry.all - .span2=f.input :province_id, :as=>:select, :collection=>Province.all - .span2=f.input :salary, :as=>:select, :collection => JobPost.salaries_for_select(:value) - .span2=f.input :years_required, :as=>:select, :collection => JobPost.years_requireds_for_select(:value) - .span2 + .span3=f.input :province_id, :as=>:select, :collection=>Province.all + .span3=f.input :salary, :as=>:select, :collection => JobPost.salaries_for_select(:value) + .span3=f.input :years_required, :as=>:select, :collection => JobPost.years_requireds_for_select(:value) + .span3 =submit_tag "搜索全部职位",:class=>"btn" - .span2 + .span3 =link_to "查看默认匹配",default_jobs_path,:class=>"btn" diff --git a/app/views/job_searches/show.html.haml b/app/views/job_searches/show.html.haml index 85f2d91..6e4cec2 100644 --- a/app/views/job_searches/show.html.haml +++ b/app/views/job_searches/show.html.haml @@ -1,31 +1,35 @@ =render 'ind_users/navigation' -=render 'job_searches/form' -%h4 - =@is_new ? "自动匹配职位" : "搜索结果" +.row + .span3.search + %h3 搜索选项 + =render 'job_searches/form' + .span12 + %h4 + =@is_new ? "自动匹配职位" : "搜索结果" --if @job_posts.empty? - -if @is_new - 没有找到匹配您技能的职位。请添加技能获取匹配! - =link_to "添加技能",user_edit_path(current_user.id,"skill"),:class=>"btn" - -else - 搜索结果为0,请试试别的搜索参数! --else - %table.zebra-striped - %tr - %th 公司/机构 - %th 职位 - %th 月薪 - %th 地点 - %th 截止日期 - %th - %th - - for job_post in @job_posts - %tr - %td= job_post.company_name - %td=link_to job_post.title,job_post - %td= job_post.salary ||'面议' - %td= job_post.city.name - %td= l job_post.expiration,:format=>:long unless job_post.expiration.nil? - %td.span3= bookmark_code job_post - %td= view_code job_post - =paginate @job_posts + -if @job_posts.empty? + -if @is_new + 没有找到匹配您技能的职位。请添加技能获取匹配! + =link_to "添加技能",user_edit_path(current_user.id,"skill"),:class=>"btn" + -else + 搜索结果为0,请试试别的搜索参数! + -else + %table.zebra-striped + %tr + %th 公司/机构 + %th 职位 + %th 月薪 + %th 地点 + %th 截止日期 + %th + %th + - for job_post in @job_posts + %tr + %td= job_post.company_name + %td=link_to job_post.title,job_post + %td= job_post.salary ||'面议' + %td= job_post.city.name + %td= l job_post.expiration,:format=>:long unless job_post.expiration.nil? + %td.span3= bookmark_code job_post + %td= view_code job_post + =paginate @job_posts diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 50733bc..d1bfd4d 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -5,7 +5,6 @@ =link_to image_tag('logo.png',height: 60),root_path, :class=>"brand" %ul.nav - %li{:class=>is_active?("shouts#index")}=link_to "悟空微博",myshouts_path %li{:class=>"#{is_active?("job#.")}#{is_active?("company_searches#.")}"}=link_to '工作圈',ind_user_overview_path || root_path @@ -33,6 +32,7 @@ %li{:class=>"#{params[:action]=='bookmarked_jobs' ? 'active':''}"}=link_to "收藏的职位",bookmarked_jobs_path %ul{class: "nav", style: "float: right;"} + %li{:class=>is_active?("shouts#index")}=link_to "悟空微博",myshouts_path %li{:class=>"dropdown #{is_active?("users#edit")}",:"data-dropdown"=>"dropdown"} =link_to_function "我的账户",'$(".dropdown-menu.setting").toggle()', :class=>"dropdown-toggle" %ul.dropdown-menu.setting diff --git a/app/views/org_users/_side_nav.html.haml b/app/views/org_users/_side_nav.html.haml index c7a332c..3939bc7 100644 --- a/app/views/org_users/_side_nav.html.haml +++ b/app/views/org_users/_side_nav.html.haml @@ -5,6 +5,6 @@ %li{:class=>"#{params[:info]=='account'? "active":""}"}=link_to "修改密码",org_user_edit_path(current_user.id,'account') %ul.side_nav %li 修改机构信息 - %li{:class=>"#{params[:info]=='profile'? "active":""}"}=link_to "基本信息",org_user_edit_path(current_user.id,'profile') + %li{:class=>"#{params[:info]=='profile'? "active":""}"}=link_to "必填信息",org_user_edit_path(current_user.id,'profile') /%li{:class=>"#{params[:info]=='skill'? "active":""}"}=link_to "寻求技能",org_user_edit_path(current_user.id,'skill') diff --git a/app/views/shared/_skill_picker.html.haml b/app/views/shared/_skill_picker.html.haml index 89cd680..01e7b36 100644 --- a/app/views/shared/_skill_picker.html.haml +++ b/app/views/shared/_skill_picker.html.haml @@ -1,7 +1,10 @@ .row .span10 %b 技能选择: - 您同时使用下方列表选择。如果您的技能不在列表之中,请用Tab键添加。 + .help-block + %strong 提示 + 您同时使用下方列表选择。 + 如果您的技能不在列表之中,请用Tab键添加。 %br %br .span10.skills=text_field_tag :skills diff --git a/app/views/shouts/index.html.haml b/app/views/shouts/index.html.haml index ba54910..52256f4 100644 --- a/app/views/shouts/index.html.haml +++ b/app/views/shouts/index.html.haml @@ -1,8 +1,8 @@ %ul{:class=>"tabs",:"data-tabs"=>"tabs"} - %li{:class=>"#{params[:type]==nil ? 'active':''}"}=link_to "大家的微博", myshouts_path - %li{:class=>"#{params[:type]=="follow" ? 'active':''}"}=link_to "我关注的微博", myshouts_path("follow") - %li{:class=>"#{params[:type]=="me" ? 'active':''}"}=link_to "我写的微博", myshouts_path("me") + %li{:class=>"#{params[:type]==nil ? 'active':''}"}=link_to "大家正在说", myshouts_path + %li{:class=>"#{params[:type]=="follow" ? 'active':''}"}=link_to "我的关注", myshouts_path("follow") + %li{:class=>"#{params[:type]=="me" ? 'active':''}"}=link_to "我的发言", myshouts_path("me") diff --git a/config/.routes.rb.swp b/config/.routes.rb.swp deleted file mode 100644 index 995d16760489eb524f67b2184b585000b616744c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeHNON$&;6uvPUpQ93mhzM4?7HzO+DkckK>jYE~6lE4hK_nE_RkwR8Q(e`mTRoFD zs7nQxDhMv!i~0uyMGoL^^vkTs)KWgfnd%rsOJLf){smbZr zUwp-Ta_cO^=YGas{_M-07fyI=`Zi-#8Krre&!p?$J{L^8&8N1qB95|kZQminK$LM% zMH$blO~Iow-VNd+pQf{*ES41)TjgXOhqF5coB}tXz_OZdp4(t&&pdHj_Vx!Sy$6oJ zb^}DNi&MZU;1qBQI0c*nP64NYQ@|;3vno(6j<9zT{4Hhx&zb9y&ehzyi&MZU;1qBQ zI0c*nP64NYQ@|YrZ+P#c@ z3hV&KfG;)}OMnP?3AlC-V?O~u0x>WFc7SuhNniu`}S1i%RR^>)Te;6dQKV~l+Rd<|RywtzoxW9$>)W8iV%uUi@W z3b+j9z{9}z81J{h2f+KlHt-DaH1H_!2p}~%0l3fqP65vIgn1smWl>b#xGKEu^WJa~ z&A9M)i#Z>9(8TlRQ5Elc!%0!>&7*QJ7+0$W55{RS+&*uu!YBW5+@kZX2VCW zu=do0E6UkgPU}0&Nv<|$OlQu4 z*4fXFK?SOEWW+SWdfDJ+Qul?dx`k5|*>#?QIbJ`5Cj5VRhK#%=w&hT3jjc>;?o=k( z4_796bO|&n(>l79NsgY%Bv)T$T3@R&$=a<y?PS|`dTXUEk`soOO8 znxQwzn)Y5MH9hNTSnTt1KgANP_F$4(_|{IlD!D@I0m+P4-Y|~xm}hD$iWZA3jiV|p za#^@?#>s#hX5lAXRAsR;i|U}ix111ibM=M-r-d%J+zbx!#wEvoF`#&R`?Xo;TnHRG zB%AqD_xl*@WL-7&N7@;WLmF|OFqMar&Nhira{XhMN9Mjw5l86L}TxV zcwf02D%R__RBKu$WPDm0l^S(2Qj3=|4ot?B*;gjK{2c1Crkz`+R5l1Zep&Vnp{SXB zBEGT)2UyrH@wf`~Y(`r2A7PrD!lQ@AE!x?kUP2xA8oNiEO(xe8XkMA${WRJ>|K?Z* zJQ^>S)kS^&AX2li^sw3q)a12Bs$cWO)^yYQQZV71&nHOnZn{uHUtZ!=2AyrJ(qQKU z@u^leSL?VE9%pH;riP_6Hp&(eQq${lVihPc%vOlT*5#z8hd9+h<#Mv>(qyYcL)GoT z(I_4o4P-9zY$Y?OW-RXIQjQDGKBKW-25=`&RHLyzPU6-qUKbg=pthay_}O~N+cIz1 LCuMZtB?bEj3eC(s diff --git a/config/locales/mongoid.yml b/config/locales/mongoid.yml index 71e65b1..c6583d9 100644 --- a/config/locales/mongoid.yml +++ b/config/locales/mongoid.yml @@ -4,6 +4,10 @@ ch: messages: blank: 不能为空 + not_a_number: + 需要填写数字 + greater_than: + 需要大于%{count} callbacks: "Calling %{method} on %{klass} resulted in a false return from a callback." taken: diff --git a/db/seeds/school.seeds.rb b/db/seeds/school.seeds.rb index ca563ff..3df2582 100644 --- a/db/seeds/school.seeds.rb +++ b/db/seeds/school.seeds.rb @@ -1 +1 @@ -School.populate +#School.populate diff --git a/public/assets/tinymce/themes/advanced/skins/default/content.css b/public/assets/tinymce/themes/advanced/skins/default/content.css index 2fd94a1..3370366 100644 --- a/public/assets/tinymce/themes/advanced/skins/default/content.css +++ b/public/assets/tinymce/themes/advanced/skins/default/content.css @@ -1,4 +1,4 @@ -body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:13px; margin:8px;} body {background:#FFF;} body.mceForceColors {background:#FFF; color:#000;} body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;}