zy:start upload file

This commit is contained in:
lovelyzhang 2016-12-25 22:18:43 +08:00
parent c0ba62107f
commit dcdd5a225a
4 changed files with 1887 additions and 141 deletions

View File

@ -2,18 +2,10 @@
<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="DELETED" beforePath="$PROJECT_DIR$/tmp/pids/server.pid" afterPath="" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/db/development.sqlite3" afterPath="$PROJECT_DIR$/db/development.sqlite3" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/guoren.iml" afterPath="$PROJECT_DIR$/.idea/guoren.iml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/runConfigurations/Development__guoren.xml" afterPath="$PROJECT_DIR$/.idea/runConfigurations/Development__guoren.xml" />
<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/controllers/main_controller.rb" afterPath="$PROJECT_DIR$/app/controllers/main_controller.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/views/chat/index.html.erb" afterPath="$PROJECT_DIR$/app/views/chat/index.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$/app/views/micro_posts/show.html.erb" afterPath="$PROJECT_DIR$/app/views/micro_posts/show.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" />
</list> </list>
<ignored path="guoren.iws" /> <ignored path="guoren.iws" />
<ignored path=".idea/workspace.xml" /> <ignored path=".idea/workspace.xml" />
@ -31,7 +23,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="1482664889771" 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="1482668881238" 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="" />
@ -42,8 +34,32 @@
</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="chat_controller.rb" 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/controllers/chat_controller.rb"> <entry file="file://$PROJECT_DIR$/app/views/micro_posts/show.html.erb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="153">
<caret line="117" column="83" selection-start-line="117" selection-start-column="83" selection-end-line="117" selection-end-column="83" />
<folding>
<element signature="n#style#0;n#div#1;n#div#0;n#div#0;n#div#3;n#div#0;n#row#0;n#div#0;n#div#0;n#!!top" expanded="true" />
<marker date="1482668271000" expanded="true" signature="3345:3351" ph=" " />
<marker date="1482668271000" expanded="true" signature="3965:3977" ph="..." />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="micro_posts_controller.rb" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/app/controllers/micro_posts_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51">
<caret line="3" column="2" selection-start-line="3" selection-start-column="2" selection-end-line="3" selection-end-column="2" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="user.rb" pinned="false" current-in-tab="false">
<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">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
@ -52,34 +68,21 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="index.html.erb" pinned="false" current-in-tab="false"> <file leaf-file-name="users_controller.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/views/chat/index.html.erb"> <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="463"> <state relative-caret-position="0">
<caret line="254" column="0" selection-start-line="254" selection-start-column="0" selection-end-line="254" selection-end-column="0" /> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="show.html.erb" pinned="false" current-in-tab="true"> <file leaf-file-name="users_helper.rb" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/views/micro_posts/show.html.erb"> <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="238"> <state relative-caret-position="34">
<caret line="41" column="63" selection-start-line="41" selection-start-column="63" selection-end-line="41" selection-end-column="63" /> <caret line="2" column="61" selection-start-line="2" selection-start-column="18" selection-end-line="2" selection-end-column="61" />
<folding>
<marker date="1482665241000" expanded="true" signature="3294:3300" ph=" " />
<marker date="1482665241000" expanded="true" signature="3908:3920" ph="..." />
</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="308">
<caret line="176" column="28" selection-start-line="176" selection-start-column="4" selection-end-line="176" selection-end-column="28" />
<folding /> <folding />
</state> </state>
</provider> </provider>
@ -102,6 +105,7 @@
<option value="$PROJECT_DIR$/app/views/main/main.html.erb" /> <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/views/micro_posts/show.html.erb" />
<option value="$PROJECT_DIR$/app/controllers/micro_posts_controller.rb" />
</list> </list>
</option> </option>
</component> </component>
@ -190,7 +194,15 @@
<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_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="log" /> <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" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
</PATH> </PATH>
@ -226,11 +238,21 @@
<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_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="views" /> <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" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="micro_posts" /> <option name="myItemId" value="app" />
<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>
@ -248,69 +270,7 @@
<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_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="views" /> <option name="myItemId" value="helpers" />
<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_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="chat" />
<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" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT> </PATH_ELEMENT>
</PATH> </PATH>
@ -431,6 +391,25 @@
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_PREREQS" VALUE="false" /> <RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_PREREQS" VALUE="false" />
<method /> <method />
</configuration> </configuration>
<configuration default="true" type="RubyRunConfigurationType" factoryName="Ruby">
<module name="" />
<RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
<RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="" />
<RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
<RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
<RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
<envs />
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
<COVERAGE_PATTERN ENABLED="true">
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
</COVERAGE_PATTERN>
</EXTENSION>
<RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="" />
<RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
<method />
</configuration>
<configuration default="true" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest"> <configuration default="true" type="TestUnitRunConfigurationType" factoryName="Test::Unit/Shoulda/Minitest">
<predefined_log_file id="RUBY_TESTUNIT" enabled="true" /> <predefined_log_file id="RUBY_TESTUNIT" enabled="true" />
<module name="" /> <module name="" />
@ -486,28 +465,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="3195000" /> <workItem from="1482662034465" duration="6870000" />
</task> </task>
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="4976000" /> <option name="totallyTimeSpent" value="8651000" />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="0" y="23" width="1440" height="804" extended-state="6" /> <frame x="0" y="23" width="1440" height="804" extended-state="6" />
<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.5" 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.3292683" sideWeight="0.5028612" 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.3292683" 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.5" 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.3292683" sideWeight="0.5" 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.25" 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.49713877" 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="false" show_stripe_button="true" weight="0.3292683" sideWeight="0.49713877" 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.33" sideWeight="0.5" 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.4" 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="true" show_stripe_button="true" weight="0.39972898" sideWeight="0.5" 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" />
@ -532,8 +511,23 @@
<option name="myLimit" value="2678400000" /> <option name="myLimit" value="2678400000" />
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager /> <breakpoint-manager>
<watches-manager /> <breakpoints>
<line-breakpoint enabled="true" type="ruby-line">
<url>file://$PROJECT_DIR$/app/controllers/micro_posts_controller.rb</url>
<line>18</line>
<option name="timeStamp" value="4" />
</line-breakpoint>
</breakpoints>
<option name="time" value="5" />
</breakpoint-manager>
<watches-manager>
<configuration name="RailsRunConfigurationType">
<watch expression="pictures.original_filename" language="ruby" />
<watch expression="pic.original_filename" language="ruby" />
<watch expression="save_name" language="ruby" />
</configuration>
</watches-manager>
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/Gemfile"> <entry file="file://$PROJECT_DIR$/Gemfile">
@ -609,14 +603,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/app/controllers/main_controller.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="306">
<caret line="18" column="8" selection-start-line="18" selection-start-column="8" selection-end-line="18" selection-end-column="8" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Gemfile"> <entry file="file://$PROJECT_DIR$/Gemfile">
<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">
@ -625,6 +611,22 @@
</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="529">
<caret line="176" column="28" selection-start-line="176" selection-start-column="4" selection-end-line="176" selection-end-column="28" />
<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="272">
<caret line="20" column="7" selection-start-line="20" selection-start-column="7" selection-end-line="20" selection-end-column="7" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/controllers/chat_controller.rb"> <entry file="file://$PROJECT_DIR$/app/controllers/chat_controller.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">
@ -633,32 +635,65 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/app/views/main/main.html.erb"> <entry file="file://$PROJECT_DIR$/app/views/chat/index.html.erb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="308"> <state relative-caret-position="3536">
<caret line="176" column="28" selection-start-line="176" selection-start-column="4" selection-end-line="176" selection-end-column="28" /> <caret line="235" column="35" selection-start-line="235" selection-start-column="35" selection-end-line="235" selection-end-column="35" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/app/views/chat/index.html.erb"> <entry file="file://$PROJECT_DIR$/config/routes.rb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="463"> <state relative-caret-position="357">
<caret line="254" column="0" selection-start-line="254" selection-start-column="0" selection-end-line="254" selection-end-column="0" /> <caret line="21" column="15" selection-start-line="21" selection-start-column="8" selection-end-line="21" selection-end-column="15" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/app/views/micro_posts/show.html.erb"> <entry file="file://$PROJECT_DIR$/app/views/micro_posts/show.html.erb">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="238"> <state relative-caret-position="153">
<caret line="41" column="63" selection-start-line="41" selection-start-column="63" selection-end-line="41" selection-end-column="63" /> <caret line="117" column="83" selection-start-line="117" selection-start-column="83" selection-end-line="117" selection-end-column="83" />
<folding> <folding>
<marker date="1482665241000" expanded="true" signature="3294:3300" ph=" " /> <element signature="n#style#0;n#div#1;n#div#0;n#div#0;n#div#3;n#div#0;n#row#0;n#div#0;n#div#0;n#!!top" expanded="true" />
<marker date="1482665241000" expanded="true" signature="3908:3920" ph="..." /> <marker date="1482668271000" expanded="true" signature="3345:3351" ph=" " />
<marker date="1482668271000" expanded="true" signature="3965:3977" ph="..." />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/app/models/user.rb">
<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$/app/controllers/users_controller.rb">
<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$/app/helpers/users_helper.rb">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34">
<caret line="2" column="61" selection-start-line="2" selection-start-column="18" selection-end-line="2" selection-end-column="61" />
<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="51">
<caret line="3" column="2" selection-start-line="3" selection-start-column="2" selection-end-line="3" selection-end-column="2" />
<folding />
</state>
</provider>
</entry>
</component> </component>
</project> </project>

View File

@ -1,6 +1,7 @@
class MicroPostsController < ApplicationController class MicroPostsController < ApplicationController
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
@ -13,6 +14,13 @@ class MicroPostsController < ApplicationController
post_type = params[:post_type].to_i post_type = params[:post_type].to_i
title = params[:title].to_s title = params[:title].to_s
content = params[:content].to_s content = params[:content].to_s
pictures = params[:pictures]
pictures.each do |pic|
pic.original_filename
ext = File.extname(pic.original_filename)
save_name = Digest::MD5::hexdigest(pic.original_filename) + ext
p save_name
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(content:content,post_time:DateTime.now,title:title,

View File

@ -14,7 +14,7 @@
<i class="icon-reorder"></i>发布新信息 <i class="icon-reorder"></i>发布新信息
</div> </div>
<%= form_tag("/newpost", method: "post", class: "form-horizontal") do %> <%= form_tag("/newpost", method: "post", class: "form-horizontal", enctype: "multipart/form-data") do %>
<div class="form-group "> <div class="form-group ">
<div class="col-md-2"> <div class="col-md-2">
@ -39,10 +39,12 @@
<div class="col-md-12"> <div class="col-md-12">
<div id="image-upload"> <div id="image-upload">
<div id="total">当前选择上传0个图片</div> <div id="total">当前选择上传0个图片</div>
<input type="file" name="picture" value="图片">
<input class="btn btn-default" type="button" value="添加图片" id="btnAdd" onclick="selectAttachment();">&nbsp; <input class="btn btn-default" type="button" value="添加图片" id="btnAdd" onclick="selectAttachment();">&nbsp;
<input class="btn btn-default" type="button" value="清空图片" id="btnClear" style="display:none" onclick="clearAttachment();"> <input class="btn btn-default" type="button" value="清空图片" id="btnClear" style="display:none" onclick="clearAttachment();">
<div id="attachmentList" style="display: none"></div> <div id="attachmentList" style="display: none"></div>
<div id="pics">
</div>
</div> </div>
</div> </div>
</div> </div>
@ -86,14 +88,15 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var i = 0; // 用来动态生成span,upfile的id var pic_num = 0; // 用来动态生成span,upfile的id
function addAttachmentToList() { function addAttachmentToList() {
if (findAttachment(event.srcElement.value)) return; //如果此文档已在图片列表中则不再添加 if (findAttachment(event.srcElement.value)) return; //如果此文档已在图片列表中则不再添加
if(extractFileName(event.srcElement.value)) { if (extractFileName(event.srcElement.value)) {
// 动态创建图片信息栏并添加到图片列表中 // 动态创建图片信息栏并添加到图片列表中
var span = document.createElement('span'); var span = document.createElement('span');
span.id = '_attachment' + i; span.id = '_attachment' + pic_num;
span.innerHTML = extractFileName(event.srcElement.value) + '&nbsp;<a href="javascript:delAttachment(' + (i++) + ')">删除</a><br/>'; span.innerHTML = extractFileName(event.srcElement.value) +
'&nbsp;<a href="javascript:delAttachment(' + (pic_num++) + ')">删除</a><br/>';
span.title = event.srcElement.value; span.title = event.srcElement.value;
G('attachmentList').appendChild(span); G('attachmentList').appendChild(span);
} }
@ -112,15 +115,15 @@
cleanInvalidUpfile(); cleanInvalidUpfile();
// 动态创建上传控件并与span对应 // 动态创建上传控件并与span对应
var upfile = '<input type="file" style="display:none" name="picturefiles" onchange="addAttachmentToList();" id="_upfile' + i + '">'; var upfile = '<input type="file" style="display:none" multiple name="pictures[]" onchange="addAttachmentToList();" id="_upfile' + pic_num + '">';
document.body.insertAdjacentHTML('beforeEnd', upfile); G('pics').insertAdjacentHTML('beforeEnd', upfile);
G('_upfile' + i).click(); G('_upfile' + pic_num).click();
} }
function extractFileName(fn) { function extractFileName(fn) {
var index = fn.substr(fn.lastIndexOf('.')).toLowerCase(); var index = fn.substr(fn.lastIndexOf('.')).toLowerCase();
if (index == '.png' || index == '.jpg' || index == '.jpeg') { if (index == '.png' || index == '.jpg' || index == '.jpeg') {
return fn.substr(fn.lastIndexOf('\\')+1); return fn.substr(fn.lastIndexOf('\\') + 1);
} }
else { else {
alert('请上传.png或.jpg格式的图片!'); alert('请上传.png或.jpg格式的图片!');
@ -137,7 +140,7 @@
function delAttachment(id) { function delAttachment(id) {
G('attachmentList').removeChild(G('_attachment' + id)); G('attachmentList').removeChild(G('_attachment' + id));
document.body.removeChild(G('_upfile' + id)); G('pics').removeChild(G('_upfile' + id));
// 当图片列表为空则不显示并且变化添加图片按钮文本 // 当图片列表为空则不显示并且变化添加图片按钮文本
if (G('attachmentList').childNodes.length == 0) { if (G('attachmentList').childNodes.length == 0) {
@ -154,7 +157,7 @@
for (var i = o.length - 1; i >= 0; i--) for (var i = o.length - 1; i >= 0; i--)
if (o[i].type == 'file' && o[i].id.indexOf('_upfile') == 0) { if (o[i].type == 'file' && o[i].id.indexOf('_upfile') == 0) {
if (!G('_attachment' + o[i].id.substr(7))) if (!G('_attachment' + o[i].id.substr(7)))
document.body.removeChild(o[i]); G('pics').removeChild(o[i]);
} }
} }
@ -176,10 +179,6 @@
} }
function getAttachmentInfo() {
// 已知的js获取本地文件大小的三种方式
}
function G(id) { function G(id) {
return document.getElementById(id); return document.getElementById(id);

File diff suppressed because it is too large Load Diff