首页定制修改

This commit is contained in:
z9hang 2014-07-25 10:01:02 +08:00
parent 6ad3a1128e
commit 3b54def1c7
7 changed files with 15 additions and 12 deletions

View File

@ -148,8 +148,8 @@ class AdminController < ApplicationController
elsif request.post?
@first_page = FirstPage.where("page_type = 'project'").first
@first_page.web_title = params[:web_title]
@first_page.description = params[:description]
@first_page.title = params[:title]
@first_page.description = params[:first_page][:description]
#@first_page.title = params[:title]
@first_page.sort_type = params[:sort_type]
if @first_page.save
respond_to do |format|

View File

@ -2,5 +2,5 @@ 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
#validates_length_of :description, maximum: 100
end

View File

@ -20,13 +20,15 @@
<%= render :partial=>"avatar/avatar_form",:style => "display:inline",:locals=> {source:@first_page} %>
</div>
<p style="margin-left:60px;padding-right: 20px;">
<label for='title'>&nbsp;&nbsp;&nbsp;<%= 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='title'>&nbsp;&nbsp;&nbsp;<#%= 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">&nbsp;&nbsp;&nbsp;<%= 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;" %>
<!-- <#%= text_area_tag 'description',@first_page.description,:rows => 8, :size => 30,:style => "font-size:small;width:490px;margin-left:10px;" %> -->
<%= text_area 'first_page', 'description', :value => @first_page.description,:cols => 80, :rows => 15, :class => 'wiki-edit' %>
<%= wikitoolbar_for 'first_page_description' %>
</p>
<p style="margin-left:60px;padding-right: 20px;">
<label for='sort_type' style="vertical-align: top">&nbsp;&nbsp;&nbsp;<%= l(:label_sort_type)%>:</label>

View File

@ -45,7 +45,8 @@
</div>
<div class="welcome_left" id="welcome_left">
<% unless @first_page.nil? %>
<span class="font_welcome_trustie"><%= @first_page.title %></span> <span class="font_welcome_tdescription">, <%= @first_page.description %></span>
<!-- <span class="font_welcome_trustie"><#%= @first_page.title %></span> <span class="font_welcome_tdescription">, <#%= @first_page.description %></span> -->
<%= @first_page.description.html_safe %>
<% end %>
</div>
<div class="search-bar" id="search-bar">

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140724080319) do
ActiveRecord::Schema.define(:version => 20140725013735) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -418,7 +418,7 @@ ActiveRecord::Schema.define(:version => 20140724080319) do
create_table "first_pages", :force => true do |t|
t.string "web_title"
t.string "title"
t.string "description"
t.text "description"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "page_type"

View File

View File

@ -1,4 +1,4 @@
desc "User Score description"
wdesc "User Score description"
task :user_score do
puts "user_score sync."
end