paginate finished

This commit is contained in:
lovelyzhang 2016-12-26 15:36:00 +08:00
parent a7cae21e7c
commit b8a5cea995
10 changed files with 376 additions and 141 deletions

View File

@ -185,6 +185,7 @@
<orderEntry type="library" scope="PROVIDED" name="web-console (v3.4.0, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="websocket-driver (v0.6.4, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="websocket-extensions (v0.1.2, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="will_paginate (v3.1.5, rbenv: 2.3.1) [gem]" level="application" />
</component>
<component name="RModuleSettingsStorage">
<LOAD_PATH number="0" />

View File

@ -2,9 +2,15 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="585b6f0a-0d20-4a3c-825b-5f85848cbf40" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.gitignore" afterPath="$PROJECT_DIR$/.gitignore" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/guoren.iml" afterPath="$PROJECT_DIR$/.idea/guoren.iml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/高级软件工程TODOList.md" afterPath="$PROJECT_DIR$/高级软件工程TODOList.md" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Gemfile" afterPath="$PROJECT_DIR$/Gemfile" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Gemfile.lock" afterPath="$PROJECT_DIR$/Gemfile.lock" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/controllers/main_controller.rb" afterPath="$PROJECT_DIR$/app/controllers/main_controller.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/helpers/main_helper.rb" afterPath="$PROJECT_DIR$/app/helpers/main_helper.rb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/layouts/_nav.html.erb" afterPath="$PROJECT_DIR$/app/views/layouts/_nav.html.erb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/views/main/main.html.erb" afterPath="$PROJECT_DIR$/app/views/main/main.html.erb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/stylesheets/mystyle.css" afterPath="$PROJECT_DIR$/public/stylesheets/mystyle.css" />
</list>
<ignored path="guoren.iws" />
<ignored path=".idea/workspace.xml" />
@ -22,7 +28,7 @@
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CoverageDataManager">
<SUITE FILE_PATH="coverage/guoren@Development__guoren.coverage" NAME="Development: guoren Coverage Results" MODIFIED="1482723939894" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="guoren" />
<SUITE FILE_PATH="coverage/guoren@Development__guoren.coverage" NAME="Development: guoren Coverage Results" MODIFIED="1482735933552" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="guoren" />
</component>
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
@ -33,15 +39,104 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="高级软件工程TODOList.md" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/高级软件工程TODOList.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="119">
<caret line="7" column="11" selection-start-line="7" selection-start-column="11" selection-end-line="7" selection-end-column="11" />
<file leaf-file-name="Gemfile" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Gemfile">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="303">
<caret line="34" column="0" selection-start-line="34" selection-start-column="0" selection-end-line="34" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="main.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/views/main/main.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="629">
<caret line="91" column="16" selection-start-line="91" selection-start-column="16" selection-end-line="91" selection-end-column="16" />
<folding>
<element signature="n#div#0;n#div#0;n#div#0;n#div#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="action_view.rb" pinned="false" current-in-tab="false">
<entry file="file://$USER_HOME$/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/will_paginate-3.1.5/lib/will_paginate/view_helpers/action_view.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="425">
<caret line="25" column="8" selection-start-line="25" selection-start-column="8" selection-end-line="25" selection-end-column="8" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="view_helpers.rb" pinned="false" current-in-tab="false">
<entry file="file://$USER_HOME$/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/will_paginate-3.1.5/lib/will_paginate/view_helpers.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-241">
<caret line="76" column="95" selection-start-line="76" selection-start-column="87" selection-end-line="76" selection-end-column="95" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="micro_posts_helper.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/helpers/micro_posts_helper.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="408">
<caret line="24" column="0" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="_nav.html.erb" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/app/views/layouts/_nav.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="37" column="17" selection-start-line="37" selection-start-column="17" selection-end-line="37" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="main_controller.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/controllers/main_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="357">
<caret line="21" column="5" selection-start-line="21" selection-start-column="5" selection-end-line="21" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="main_helper.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/helpers/main_helper.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="643">
<caret line="60" column="0" selection-start-line="60" selection-start-column="0" selection-end-line="60" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="instrumentation.rb" pinned="false" current-in-tab="false">
<entry file="file://$USER_HOME$/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_controller/metal/instrumentation.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="322">
<caret line="45" column="0" selection-start-line="45" selection-start-column="0" selection-end-line="45" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="mystyle.css" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/public/stylesheets/mystyle.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="651">
<caret line="139" column="1" selection-start-line="139" selection-start-column="1" selection-end-line="139" selection-end-column="1" />
<folding />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
@ -54,9 +149,7 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/Gemfile" />
<option value="$PROJECT_DIR$/tmp/pids/server.pid" />
<option value="$PROJECT_DIR$/app/controllers/main_controller.rb" />
<option value="$PROJECT_DIR$/log/development.log" />
<option value="$PROJECT_DIR$/app/views/chat/index.html.erb" />
<option value="$PROJECT_DIR$/app/controllers/application_controller.rb" />
@ -66,14 +159,18 @@
<option value="$PROJECT_DIR$/app/helpers/application_helper.rb" />
<option value="$PROJECT_DIR$/app/helpers/users_helper.rb" />
<option value="$PROJECT_DIR$/app/controllers/micro_posts_controller.rb" />
<option value="$PROJECT_DIR$/app/helpers/main_helper.rb" />
<option value="$PROJECT_DIR$/app/helpers/micro_posts_helper.rb" />
<option value="$PROJECT_DIR$/app/views/micro_posts/show.html.erb" />
<option value="$PROJECT_DIR$/public/stylesheets/style.css" />
<option value="$PROJECT_DIR$/public/stylesheets/mystyle.css" />
<option value="$PROJECT_DIR$/app/views/main/main.html.erb" />
<option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/高级软件工程TODOList.md" />
<option value="$PROJECT_DIR$/Gemfile" />
<option value="$PROJECT_DIR$/app/helpers/main_helper.rb" />
<option value="$USER_HOME$/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/will_paginate-3.1.5/lib/will_paginate/view_helpers.rb" />
<option value="$PROJECT_DIR$/public/stylesheets/mystyle.css" />
<option value="$PROJECT_DIR$/app/views/main/main.html.erb" />
<option value="$PROJECT_DIR$/app/controllers/main_controller.rb" />
<option value="$PROJECT_DIR$/app/views/layouts/_nav.html.erb" />
</list>
</option>
</component>
@ -140,6 +237,100 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="guoren" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="guoren" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="app" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="views" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="guoren" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="guoren" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="app" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="views" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="main" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="guoren" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="guoren" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="app" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="views" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="layouts" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="guoren" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="guoren" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="app" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="guoren" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="guoren" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="app" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="controllers" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="Scratches" />
@ -322,12 +513,12 @@
<workItem from="1482659543437" duration="1781000" />
<workItem from="1482662034465" duration="18070000" />
<workItem from="1482733701322" duration="75000" />
<workItem from="1482733804592" duration="462000" />
<workItem from="1482733804592" duration="3749000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="20388000" />
<option name="totallyTimeSpent" value="23675000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1440" height="873" extended-state="6" />
@ -338,19 +529,19 @@
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.30111524" sideWeight="0.50858366" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3283767" sideWeight="0.49713877" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24964234" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.30111524" sideWeight="0.4914163" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.30111524" sideWeight="0.4914163" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.19670959" sideWeight="0.5070707" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39900866" sideWeight="0.49570817" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3292683" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3283767" sideWeight="0.49713877" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3283767" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.39900866" sideWeight="0.49570817" order="3" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="UnknownFeatures">
@ -375,19 +566,16 @@
<line>21</line>
<option name="timeStamp" value="5" />
</line-breakpoint>
<line-breakpoint enabled="true" type="ruby-line">
<url>file://$PROJECT_DIR$/app/helpers/micro_posts_helper.rb</url>
<line>24</line>
<option name="timeStamp" value="6" />
</line-breakpoint>
</breakpoints>
<option name="time" value="7" />
<option name="time" value="8" />
</breakpoint-manager>
<watches-manager>
<configuration name="RailsRunConfigurationType">
<watch expression="pictures.original_filename" language="ruby" />
<watch expression="!page_num" language="ruby" />
<watch expression="pic.original_filename" language="ruby" />
<watch expression="save_name" language="ruby" />
<watch expression="page_num" language="ruby" />
</configuration>
</watches-manager>
</component>
@ -420,7 +608,9 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3604">
<caret line="212" column="54" selection-start-line="212" selection-start-column="54" selection-end-line="212" selection-end-column="54" />
<folding />
<folding>
<element signature="n#div#0;n#div#0;n#div#0;n#div#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
@ -468,7 +658,9 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3604">
<caret line="212" column="54" selection-start-line="212" selection-start-column="54" selection-end-line="212" selection-end-column="54" />
<folding />
<folding>
<element signature="n#div#0;n#div#0;n#div#0;n#div#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
@ -506,22 +698,7 @@
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tmp/pids/server.pid" />
<entry file="file://$PROJECT_DIR$/app/views/layouts/_nav.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/log/development.log" />
<entry file="file://$PROJECT_DIR$/Gemfile">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="28" column="0" selection-start-line="28" selection-start-column="0" selection-end-line="28" selection-end-column="51" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/chat/index.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3536">
@ -600,13 +777,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/main_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="13" column="23" selection-start-line="0" selection-start-column="0" selection-end-line="28" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/user.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
@ -634,13 +804,6 @@
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_controller/metal/instrumentation.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="152">
<caret line="35" column="0" selection-start-line="35" selection-start-column="0" selection-end-line="35" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
@ -663,13 +826,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/helpers/main_helper.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="24" column="63" selection-start-line="24" selection-start-column="63" selection-end-line="24" selection-end-column="63" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/stylesheets/style.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="32266">
@ -694,40 +850,106 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/main/main.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="476">
<caret line="212" column="54" selection-start-line="212" selection-start-column="54" selection-end-line="212" selection-end-column="54" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/helpers/micro_posts_helper.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="204">
<caret line="12" column="41" selection-start-line="12" selection-start-column="41" selection-end-line="12" selection-end-column="41" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/stylesheets/mystyle.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="476">
<caret line="74" column="22" selection-start-line="74" selection-start-column="22" selection-end-line="74" selection-end-column="22" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/高级软件工程TODOList.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="119">
<caret line="7" column="11" selection-start-line="7" selection-start-column="11" selection-end-line="7" selection-end-column="11" />
<first_editor relative-caret-position="17">
<caret line="1" column="24" selection-start-line="1" selection-start-column="24" selection-end-line="1" selection-end-column="24" />
<folding />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_controller/metal/basic_implicit_render.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51">
<caret line="3" column="0" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_controller/metal/instrumentation.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="322">
<caret line="45" column="0" selection-start-line="45" selection-start-column="0" selection-end-line="45" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/will_paginate-3.1.5/lib/will_paginate/view_helpers/action_view.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="425">
<caret line="25" column="8" selection-start-line="25" selection-start-column="8" selection-end-line="25" selection-end-column="8" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/helpers/main_helper.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="643">
<caret line="60" column="0" selection-start-line="60" selection-start-column="0" selection-end-line="60" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/stylesheets/mystyle.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="651">
<caret line="139" column="1" selection-start-line="139" selection-start-column="1" selection-end-line="139" selection-end-column="1" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Gemfile">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="303">
<caret line="34" column="0" selection-start-line="34" selection-start-column="0" selection-end-line="34" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/will_paginate-3.1.5/lib/will_paginate/view_helpers.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-241">
<caret line="76" column="95" selection-start-line="76" selection-start-column="87" selection-end-line="76" selection-end-column="95" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/helpers/micro_posts_helper.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="408">
<caret line="24" column="0" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/main_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="357">
<caret line="21" column="5" selection-start-line="21" selection-start-column="5" selection-end-line="21" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/main/main.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="629">
<caret line="91" column="16" selection-start-line="91" selection-start-column="16" selection-end-line="91" selection-end-column="16" />
<folding>
<element signature="n#div#0;n#div#0;n#div#0;n#div#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/layouts/_nav.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="37" column="17" selection-start-line="37" selection-start-column="17" selection-end-line="37" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
</component>
</project>

View File

@ -27,6 +27,8 @@ gem 'jbuilder', '~> 2.5'
gem 'bcrypt', '~> 3.1.7'
# for windows
gem 'bcrypt-ruby', '~> 3.0.0', :require => "bcrypt"
# will_paginate
gem 'will_paginate', '~> 3.1.0'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

View File

@ -158,6 +158,7 @@ GEM
websocket-driver (0.6.4)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
will_paginate (3.1.5)
PLATFORMS
ruby
@ -182,6 +183,7 @@ DEPENDENCIES
tzinfo-data
uglifier (>= 1.3.0)
web-console
will_paginate (~> 3.1.0)
BUNDLED WITH
1.13.6

View File

@ -5,9 +5,20 @@ class MainController < ApplicationController
def show
@user = current_user
offset = 0
@micro_posts_array = read_newest_post(offset)
page_num = params[:page]
post_type = params[:type]
if !page_num
page_num = 1
end
if !post_type
post_type=[1,2,3]
end
@posts = MicroPost.where(post_type: post_type).paginate(:page => page_num, :per_page => 10).order(post_time: :desc)
@micro_posts_array = get_post(@posts)
render 'main'
end
def activity

View File

@ -29,4 +29,34 @@ module MainHelper
end
return micro_posts_array
end
def get_post posts
micro_posts_array = []
if !posts.empty?
posts.each do |micro_post|
x = Hash.new()
x["username"] = micro_post.user.name
x["userpic"] = micro_post.user.picurl
x["postid"] = micro_post.id
x["title"] = micro_post.title
x["content"] = micro_post.content
case micro_post.post_type
when 1
x["type"] = "新鲜事"
when 2
x["type"] = "组团信息"
when 3
x["type"] = "失物招领"
else
x["type"] = "新鲜事"
end
x["time"] = utc_time_to_local(micro_post.post_time)
x["pics"] = micro_post.pic.split(',') if micro_post.pic
x["peo_num"] = micro_post.engage_people
micro_posts_array << x
end
end
return micro_posts_array
end
end

View File

@ -31,10 +31,10 @@
<a href="/main">果仁动态</a>
</li>
<li>
<a href="#">失物信息</a>
<a href="/main?type=2">组团信息</a>
</li>
<li>
<a href="#">组团信息</a>
<a href="/main?type=3">失物信息</a>
</li>
</ul>
</li>

View File

@ -60,52 +60,10 @@
</div>
<% end %>
</div>
<div class="col-lg-4">
<div class="widget-container">
<div class="heading">
<i class="icon-archive">公告</i>
</div>
<div class="alert alert-info">
通知
</div>
</div>
</div>
<div class="col-lg-4">
<div class="widget-container">
<div class="heading">
<i class="icon-archive">热门状态</i>
</div>
<div class="alert alert-success">
状态1
</div>
<div class="alert alert-warning">
状态2
</div>
</div>
</div>
<div class="col-lg-4">
<div class="widget-container">
<div class="heading">
<i class="icon-archive">热门组团活动</i>
</div>
<div class="alert alert-success">
组团活动1
</div>
<div class="alert alert-warning">
组团活动2
</div>
</div>
</div>
</div>
<div class="row">
<nav style="text-align: center">
<ul class="pagination">
<li><a href="#">&laquo;</a></li>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">&raquo;</a></li>
</ul>
<nav class="text-center">
<%= will_paginate @posts, :page_links => false, :previous_label => "前一页", :next_label => "后一页" %>
</nav>
</div>
</div>

Binary file not shown.

View File

@ -134,3 +134,12 @@
.widget-container .heading [class^="icon-"], .widget-container .heading [class*="icon-"] {
font-size: 20px;
}
.pagination .previous_page {
font-size: 2em;
margin-right: 20px;
}
.pagination .next_page {
font-size: 2em;
margin-left: 20px;
}