zy add picture function

This commit is contained in:
lovelyzhang 2016-12-26 14:24:20 +08:00
parent 7e0c882bb7
commit 80a4d13dbb
11 changed files with 10877 additions and 299 deletions

1
.gitignore vendored
View File

@ -52,6 +52,7 @@ build-iPhoneSimulator/
# JetBrain的忽略文件 # JetBrain的忽略文件
.idea/* .idea/*
public/data/*
# rails的忽略文件 # rails的忽略文件

View File

@ -2,9 +2,17 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="585b6f0a-0d20-4a3c-825b-5f85848cbf40" name="Default" comment=""> <list default="true" id="585b6f0a-0d20-4a3c-825b-5f85848cbf40" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/db/development.sqlite3" afterPath="$PROJECT_DIR$/db/development.sqlite3" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.gitignore" afterPath="$PROJECT_DIR$/.gitignore" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/helpers/users_helper.rb" afterPath="$PROJECT_DIR$/app/helpers/users_helper.rb" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/controllers/micro_posts_controller.rb" afterPath="$PROJECT_DIR$/app/controllers/micro_posts_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/helpers/micro_posts_helper.rb" afterPath="$PROJECT_DIR$/app/helpers/micro_posts_helper.rb" />
<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$/app/views/micro_posts/show.html.erb" afterPath="$PROJECT_DIR$/app/views/micro_posts/show.html.erb" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/log/development.log" afterPath="$PROJECT_DIR$/log/development.log" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/log/development.log" afterPath="$PROJECT_DIR$/log/development.log" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/stylesheets/mystyle.css" afterPath="$PROJECT_DIR$/public/stylesheets/mystyle.css" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/stylesheets/style.css" afterPath="$PROJECT_DIR$/public/stylesheets/style.css" />
</list> </list>
<ignored path="guoren.iws" /> <ignored path="guoren.iws" />
<ignored path=".idea/workspace.xml" /> <ignored path=".idea/workspace.xml" />
@ -22,7 +30,7 @@
<option name="LAST_RESOLUTION" value="IGNORE" /> <option name="LAST_RESOLUTION" value="IGNORE" />
</component> </component>
<component name="CoverageDataManager"> <component name="CoverageDataManager">
<SUITE FILE_PATH="coverage/guoren@Development__guoren.coverage" NAME="Development: guoren Coverage Results" MODIFIED="1482720275844" 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="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" />
</component> </component>
<component name="CreatePatchCommitExecutor"> <component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" /> <option name="PATCH_PATH" value="" />
@ -33,31 +41,64 @@
</component> </component>
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name=".gitignore" pinned="false" current-in-tab="false"> <file leaf-file-name="show.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/views/micro_posts/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="121">
<caret line="69" column="15" selection-start-line="69" selection-start-column="15" selection-end-line="69" selection-end-column="15" />
<folding>
<marker date="1482732443000" expanded="true" signature="3656:3662" ph=" " />
<marker date="1482732443000" expanded="true" signature="4276:4288" ph="..." />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="style.css" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/public/stylesheets/style.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="259">
<caret line="1898" column="0" selection-start-line="1898" selection-start-column="0" selection-end-line="1898" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name=".gitignore" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/.gitignore"> <entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1126"> <state relative-caret-position="264">
<caret line="0" column="6" selection-start-line="0" selection-start-column="0" selection-end-line="102" selection-end-column="0" /> <caret line="65" column="14" selection-start-line="65" selection-start-column="14" selection-end-line="65" selection-end-column="14" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="user.rb" pinned="false" current-in-tab="false"> <file leaf-file-name="main.html.erb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/models/user.rb"> <entry file="file://$PROJECT_DIR$/app/views/main/main.html.erb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="646">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="212" column="54" selection-start-line="212" selection-start-column="54" selection-end-line="212" selection-end-column="54" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="users_helper.rb" pinned="false" current-in-tab="true"> <file leaf-file-name="micro_posts_helper.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/helpers/users_helper.rb"> <entry file="file://$PROJECT_DIR$/app/helpers/micro_posts_helper.rb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="204">
<caret line="0" column="18" selection-start-line="0" selection-start-column="18" selection-end-line="0" selection-end-column="18" /> <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>
</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="226">
<caret line="74" column="22" selection-start-line="74" selection-start-column="22" selection-end-line="74" selection-end-column="22" />
<folding /> <folding />
</state> </state>
</provider> </provider>
@ -74,21 +115,22 @@
<option value="$PROJECT_DIR$/Gemfile" /> <option value="$PROJECT_DIR$/Gemfile" />
<option value="$PROJECT_DIR$/tmp/pids/server.pid" /> <option value="$PROJECT_DIR$/tmp/pids/server.pid" />
<option value="$PROJECT_DIR$/app/controllers/main_controller.rb" /> <option value="$PROJECT_DIR$/app/controllers/main_controller.rb" />
<option value="$PROJECT_DIR$/public/stylesheets/mystyle.css" />
<option value="$PROJECT_DIR$/log/development.log" /> <option value="$PROJECT_DIR$/log/development.log" />
<option value="$PROJECT_DIR$/app/views/main/main.html.erb" />
<option value="$PROJECT_DIR$/app/views/chat/index.html.erb" /> <option value="$PROJECT_DIR$/app/views/chat/index.html.erb" />
<option value="$PROJECT_DIR$/app/views/micro_posts/show.html.erb" />
<option value="$PROJECT_DIR$/app/helpers/main_helper.rb" />
<option value="$PROJECT_DIR$/app/helpers/micro_posts_helper.rb" />
<option value="$PROJECT_DIR$/app/controllers/micro_posts_controller.rb" />
<option value="$PROJECT_DIR$/app/controllers/application_controller.rb" /> <option value="$PROJECT_DIR$/app/controllers/application_controller.rb" />
<option value="$PROJECT_DIR$/app/controllers/comments_controller.rb" /> <option value="$PROJECT_DIR$/app/controllers/comments_controller.rb" />
<option value="$PROJECT_DIR$/app/controllers/users_controller.rb" /> <option value="$PROJECT_DIR$/app/controllers/users_controller.rb" />
<option value="$PROJECT_DIR$/app/helpers/chat_helper.rb" /> <option value="$PROJECT_DIR$/app/helpers/chat_helper.rb" />
<option value="$PROJECT_DIR$/app/helpers/application_helper.rb" /> <option value="$PROJECT_DIR$/app/helpers/application_helper.rb" />
<option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/app/helpers/users_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" />
</list> </list>
</option> </option>
</component> </component>
@ -108,7 +150,7 @@
<component name="ProjectFrameBounds"> <component name="ProjectFrameBounds">
<option name="y" value="23" /> <option name="y" value="23" />
<option name="width" value="1440" /> <option name="width" value="1440" />
<option name="height" value="804" /> <option name="height" value="873" />
</component> </component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false"> <component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" /> <OptionsSetting value="true" id="Add" />
@ -153,172 +195,6 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
</PATH> </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="tmp" />
<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="users" />
<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="micro_posts" />
<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="models" />
<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="helpers" />
<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> </subPane>
</pane> </pane>
<pane id="RailsProjectView" /> <pane id="RailsProjectView" />
@ -495,28 +371,28 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1482659541785</updated> <updated>1482659541785</updated>
<workItem from="1482659543437" duration="1781000" /> <workItem from="1482659543437" duration="1781000" />
<workItem from="1482662034465" duration="9803000" /> <workItem from="1482662034465" duration="17930000" />
</task> </task>
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="11584000" /> <option name="totallyTimeSpent" value="19711000" />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="0" y="23" width="1440" height="804" extended-state="0" /> <frame x="0" y="23" width="1440" height="873" extended-state="0" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.19670959" sideWeight="0.49292928" order="0" side_tool="false" content_ui="combo" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.19670959" sideWeight="0.49292928" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" 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="6" side_tool="false" content_ui="tabs" /> <window_info id="TODO" 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="6" side_tool="false" content_ui="tabs" />
<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.3292683" sideWeight="0.5028612" order="7" side_tool="true" content_ui="tabs" /> <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="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="Find" 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="1" side_tool="false" content_ui="tabs" /> <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="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="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="true" show_stripe_button="true" weight="0.3292683" sideWeight="0.49713877" order="2" 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.25" sideWeight="0.5" order="1" 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.3292683" sideWeight="0.49427754" 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="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.39972898" sideWeight="0.5" order="3" 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" />
<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="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="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="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" />
@ -542,7 +418,19 @@
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>
<option name="time" value="5" /> <breakpoints>
<line-breakpoint enabled="true" type="ruby-line">
<url>file://$PROJECT_DIR$/app/controllers/micro_posts_controller.rb</url>
<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" />
</breakpoint-manager> </breakpoint-manager>
<watches-manager> <watches-manager>
<configuration name="RailsRunConfigurationType"> <configuration name="RailsRunConfigurationType">
@ -578,22 +466,6 @@
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/tmp/pids/server.pid" /> <entry file="file://$PROJECT_DIR$/tmp/pids/server.pid" />
<entry file="file://$PROJECT_DIR$/public/stylesheets/style.css">
<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" />
<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="356">
<caret line="120" column="11" selection-start-line="120" selection-start-column="11" selection-end-line="120" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/views/layouts/_nav.html.erb"> <entry file="file://$PROJECT_DIR$/app/views/layouts/_nav.html.erb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
@ -634,14 +506,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/app/views/main/main.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="22" column="28" selection-start-line="22" selection-start-column="28" selection-end-line="22" selection-end-column="28" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/micro_post.rb"> <entry file="file://$PROJECT_DIR$/app/models/micro_post.rb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
@ -650,17 +514,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/app/views/micro_posts/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="334">
<caret line="78" column="0" selection-start-line="78" selection-start-column="0" selection-end-line="78" selection-end-column="0" />
<folding>
<marker date="1482720228000" expanded="true" signature="3425:3431" ph=" " />
<marker date="1482720228000" expanded="true" signature="4045:4057" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/helpers/login_helper.rb"> <entry file="file://$PROJECT_DIR$/app/helpers/login_helper.rb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
@ -669,30 +522,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/app/helpers/micro_posts_helper.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="323">
<caret line="19" column="11" selection-start-line="19" selection-start-column="11" selection-end-line="19" selection-end-column="11" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/micro_posts_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="204">
<caret line="12" column="24" selection-start-line="0" selection-start-column="0" selection-end-line="37" selection-end-column="0" />
<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="391">
<caret line="23" column="59" selection-start-line="0" selection-start-column="0" selection-end-line="31" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/users_controller.rb"> <entry file="file://$PROJECT_DIR$/app/controllers/users_controller.rb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="102"> <state relative-caret-position="102">
@ -757,14 +586,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1126">
<caret line="0" column="6" selection-start-line="0" selection-start-column="0" selection-end-line="102" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/models/user.rb"> <entry file="file://$PROJECT_DIR$/app/models/user.rb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
@ -775,8 +596,117 @@
</entry> </entry>
<entry file="file://$PROJECT_DIR$/app/helpers/users_helper.rb"> <entry file="file://$PROJECT_DIR$/app/helpers/users_helper.rb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="34">
<caret line="0" column="18" selection-start-line="0" selection-start-column="18" selection-end-line="0" selection-end-column="18" /> <caret line="2" column="0" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/data/e07e5193c08ec8095be0ca7f97ab044c.png">
<provider selected="true" editor-type-id="images">
<state />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/data/0feb2b9e089920216b1449b3047f6075.jpg">
<provider selected="true" editor-type-id="images">
<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/rescue.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="22" column="0" selection-start-line="22" selection-start-column="0" selection-end-line="22" 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="152">
<caret line="35" column="0" selection-start-line="35" selection-start-column="0" selection-end-line="35" 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/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="374">
<caret line="22" column="0" selection-start-line="22" selection-start-column="0" selection-end-line="22" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/micro_posts_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="204">
<caret line="12" column="0" selection-start-line="12" selection-start-column="0" selection-end-line="12" 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/activesupport-5.0.0.1/lib/active_support/callbacks.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="152">
<caret line="126" column="0" selection-start-line="126" selection-start-column="0" selection-end-line="126" selection-end-column="0" />
<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="374">
<caret line="24" column="63" selection-start-line="24" selection-start-column="63" selection-end-line="24" selection-end-column="63" />
<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/style.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="259">
<caret line="1898" column="0" selection-start-line="1898" selection-start-column="0" selection-end-line="1898" 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="226">
<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$/app/views/micro_posts/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="121">
<caret line="69" column="15" selection-start-line="69" selection-start-column="15" selection-end-line="69" selection-end-column="15" />
<folding>
<marker date="1482732443000" expanded="true" signature="3656:3662" ph=" " />
<marker date="1482732443000" expanded="true" signature="4276:4288" ph="..." />
</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="646">
<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$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="264">
<caret line="65" column="14" selection-start-line="65" selection-start-column="14" selection-end-line="65" selection-end-column="14" />
<folding /> <folding />
</state> </state>
</provider> </provider>

View File

@ -2,7 +2,6 @@ class MicroPostsController < ApplicationController
include MicroPostsHelper include MicroPostsHelper
before_action :logged_in_user before_action :logged_in_user
micro_posts_dir = "public/data"
def show def show
@user = current_user @user = current_user
@ -18,17 +17,17 @@ class MicroPostsController < ApplicationController
pictures = params[:pictures] pictures = params[:pictures]
if pictures if pictures
pic_path = Array.new
pictures.each do |pic| pictures.each do |pic|
pic.original_filename savename = savePicture(pic)
ext = File.extname(pic.original_filename) pic_path << savename
save_name = Digest::MD5::hexdigest(pic.original_filename) + ext
p save_name
end end
pic_path = pic_path.join(',')
end end
if post_type >= 1 and post_type <= 3 and !title.empty? and !content.empty? if post_type >= 1 and post_type <= 3 and !title.empty? and !content.empty?
micropost = @user.micro_posts.new(content: content, post_time: DateTime.now, title: title, micropost = @user.micro_posts.new(title: title, content: content, pic: pic_path,
post_type: post_type, engage_people: 0) post_time: DateTime.now, post_type: post_type, engage_people: 0)
micropost.save micropost.save
end end
redirect_to microposts_path redirect_to microposts_path

View File

@ -22,6 +22,7 @@ module MainHelper
x["type"] = "新鲜事" x["type"] = "新鲜事"
end end
x["time"] = utc_time_to_local(micro_post.post_time) 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 x["peo_num"] = micro_post.engage_people
micro_posts_array << x micro_posts_array << x
end end

View File

@ -1,5 +1,8 @@
module MicroPostsHelper module MicroPostsHelper
require 'fileutils'
@@micro_posts_dir = "public/data"
def read_each_post user def read_each_post user
micro_posts_array = [] micro_posts_array = []
micro_posts = user.micro_posts.all.order(post_time: :desc) micro_posts = user.micro_posts.all.order(post_time: :desc)
@ -19,6 +22,7 @@ module MicroPostsHelper
x["type"] = "新鲜事" x["type"] = "新鲜事"
end end
x["time"] = utc_time_to_local(micro_post.post_time) 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 x["peo_num"] = micro_post.engage_people
micro_posts_array << x micro_posts_array << x
end end
@ -26,5 +30,14 @@ module MicroPostsHelper
return micro_posts_array return micro_posts_array
end end
def savePicture pic
if !(File.directory? @@micro_posts_dir)
FileUtils.mkdir_p(@@micro_posts_dir)
end
ext = File.extname(pic.original_filename)
save_name = Digest::MD5::hexdigest(pic.original_filename) + ext
File.open(File.join(@@micro_posts_dir, save_name), 'wb') { |f| f.write(pic.read) }
return save_name
end
end end

View File

@ -23,7 +23,14 @@
</div> </div>
</div> </div>
<div class="padded"> <div class="padded">
<p class="content"><%= micro_post["content"] %></p> <p class="content postcontent"><%= micro_post["content"] %></p>
<% if micro_post["pics"] %>
<div class="text-center">
<% micro_post["pics"].each do |pic| %>
<img width="250" class="social-content-media" src="<%= "data/" + pic %>"/>
<% end %>
</div>
<% end %>
</div> </div>
<% if micro_post["type"] == "组团信息" %> <% if micro_post["type"] == "组团信息" %>
<div class="social-button"> <div class="social-button">
@ -206,7 +213,7 @@
success: function (data, textStatus, jqXHR) { success: function (data, textStatus, jqXHR) {
//console.log(data["total_num"]); //console.log(data["total_num"]);
var engage_people = data["total_num"]; var engage_people = data["total_num"];
var show_text = "已有" + engage_people + "参加"; var show_text = "已有" + engage_people + "参加该活动";
activity.text("取消报名"); activity.text("取消报名");
micropost.find(".activity-detail").text(show_text); micropost.find(".activity-detail").text(show_text);
} }

View File

@ -58,33 +58,35 @@
</div> </div>
</row> </row>
<row class="posts"> <div class="posts">
<% @micro_posts.each do |micro_post| %> <% @micro_posts.each do |micro_post| %>
<div class="widget-container fluid-height clearfix"> <div class="micro-post">
<button class="close" data-dismiss="alert" type="button">×</button> <button class="close" data-dismiss="alert" type="button">×</button>
<div class="heading"> <div class="widget-container fluid-height padded">
<i class="icon-tags"><%= micro_post["title"] %></i> <div class="heading col-md-12">
<div class="label label-default"></div> <i class="icon-tags"><%= micro_post["type"] %></i>
<div class="notifications label label-info"> <i class="icon-time"><%= micro_post["time"] %></i>
<%= micro_post["type"] %> </div>
<div class="col-md-12">
<p class="content"><%= micro_post["content"] %></p>
<% if micro_post["pics"] %>
<div class="text-center">
<% micro_post["pics"].each do |pic| %>
<img width="250" class="social-content-media" src="<%= "data/" + pic %>"/>
<% end %>
</div>
<% end %>
</div> </div>
<i class="icon-time"><%= micro_post["time"] %></i>
</div>
<div class="col-md-12"> <div class="col-md-12">
<p> <div class="btn btn-default btn-block">
<%= micro_post["content"] %> 查看详情
</p> </div>
</div>
<div class="col-md-12">
<div class="btn btn-default btn-block">
查看详情
</div> </div>
</div> </div>
</div> </div>
<% end %> <% end %>
</row> </div>
</div> </div>
</div> </div>

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -73,7 +73,6 @@
.social-wrapper .social-container .social-entry .padded { .social-wrapper .social-container .social-entry .padded {
margin-left: 5px; margin-left: 5px;
margin-right: 5px; margin-right: 5px;
padding: 5px;
} }
.social-wrapper .social-container .social-entry .padded { .social-wrapper .social-container .social-entry .padded {
@ -100,8 +99,8 @@
} }
#user-page { #user-page {
margin-left: 50px; margin-left: 25px;
margin-right: 50px; margin-right: 25px;
} }
.col-md-12.text-center { .col-md-12.text-center {
@ -120,3 +119,18 @@
.social-wrapper .social-container .social-entry .social-button { .social-wrapper .social-container .social-entry .social-button {
padding-bottom: 10px; padding-bottom: 10px;
} }
.social-wrapper .social-container .social-entry .padded p.content.postcontent {
margin-left: 25px;
margin-right: 25px;
font-size: 1.5em;
}
.posts p.content {
margin: 10px 10px 10px 10px;
font-size: 1.5em;
}
.widget-container .heading [class^="icon-"], .widget-container .heading [class*="icon-"] {
font-size: 20px;
}

View File

@ -1896,8 +1896,8 @@ th:active {
margin-right: 6px; margin-right: 6px;
} }
.social-wrapper .social-container .social-entry .social-content-media { .social-content-media {
/*display: block;*/ margin: 5px 5px 5px 5px;
} }
.social-wrapper .social-container .social-entry .btn { .social-wrapper .social-container .social-entry .btn {