new project

This commit is contained in:
lovelyzhang 2016-12-22 20:05:38 +08:00
parent a7c044c53c
commit 9a221afbb0
81 changed files with 85441 additions and 500 deletions

8
.idea/.generators Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<Settings><!--This file was automatically generated by Ruby plugin.
You are allowed to:
1. Reorder generators
2. Remove generators
3. Add installed generators
To add new installed generators automatically delete this file and reload the project.
--><GeneratorsGroup><Generator name="active_record:migration" /><Generator name="active_record:model" /><Generator name="active_record:observer" /><Generator name="active_record:session_migration" /><Generator name="controller" /><Generator name="erb:controller" /><Generator name="erb:mailer" /><Generator name="erb:scaffold" /><Generator name="generator" /><Generator name="helper" /><Generator name="integration_test" /><Generator name="mailer" /><Generator name="metal" /><Generator name="migration" /><Generator name="model" /><Generator name="model_subclass" /><Generator name="observer" /><Generator name="performance_test" /><Generator name="plugin" /><Generator name="resource" /><Generator name="scaffold" /><Generator name="scaffold_controller" /><Generator name="session_migration" /><Generator name="stylesheets" /><Generator name="test_unit:controller" /><Generator name="test_unit:helper" /><Generator name="test_unit:integration" /><Generator name="test_unit:mailer" /><Generator name="test_unit:model" /><Generator name="test_unit:observer" /><Generator name="test_unit:performance" /><Generator name="test_unit:plugin" /><Generator name="test_unit:scaffold" /></GeneratorsGroup></Settings>

7
.idea/.rakeTasks Normal file

File diff suppressed because one or more lines are too long

192
.idea/guoren.iml Normal file
View File

@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="RUBY_MODULE" version="4">
<component name="FacetManager">
<facet type="RailsFacetType" name="Ruby on Rails">
<configuration>
<RAILS_FACET_CONFIG_ID NAME="RAILS_FACET_SUPPORT_REMOVED" VALUE="false" />
<RAILS_FACET_CONFIG_ID NAME="RAILS_TESTS_SOURCES_PATCHED" VALUE="true" />
<RAILS_FACET_CONFIG_ID NAME="RAILS_FACET_APPLICATION_ROOT" VALUE="$MODULE_DIR$" />
</configuration>
</facet>
</component>
<component name="ModuleRunConfigurationManager">
<configuration default="false" name="test: guoren" type="RakeRunConfigurationType" factoryName="Rake">
<module name="guoren" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
<envs>
<env name="RAILS_ENV" value="test" />
</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>
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_NAME" VALUE="test" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ARGS" VALUE="" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ATTACHED_TEST_FRAMEWORKS" VALUE=":test_unit " />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_TRACE" VALUE="false" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_DRYRUN" VALUE="false" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_PREREQS" VALUE="false" />
<method />
</configuration>
<configuration default="false" name="spec: guoren" type="RakeRunConfigurationType" factoryName="Rake">
<module name="guoren" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
<RAKE_RUN_CONFIG_SETTINGS_ID 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>
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_NAME" VALUE="spec" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ARGS" VALUE="" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ATTACHED_TEST_FRAMEWORKS" VALUE=":rspec " />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_TRACE" VALUE="false" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_DRYRUN" VALUE="false" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_PREREQS" VALUE="false" />
<method />
</configuration>
<configuration default="false" name="Production: guoren" type="RailsRunConfigurationType" factoryName="Rails">
<predefined_log_file id="RUBY_RAILS_SERVER" enabled="true" />
<module name="guoren" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
<RAILS_SERVER_CONFIG_SETTINGS_ID 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>
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="SCRIPT_ARGS" VALUE="" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="PORT" VALUE="3000" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="IP" VALUE="0.0.0.0" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="DUMMY_APP" VALUE="test/dummy" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="RAILS_SERVER_TYPE" VALUE="Default" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="ENVIRONMENT_TYPE" VALUE="production" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="LAUNCH_JS" VALUE="false" />
<method />
</configuration>
<configuration default="false" name="Development: guoren" type="RailsRunConfigurationType" factoryName="Rails">
<predefined_log_file id="RUBY_RAILS_SERVER" enabled="true" />
<module name="guoren" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
<RAILS_SERVER_CONFIG_SETTINGS_ID 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>
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="SCRIPT_ARGS" VALUE="" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="PORT" VALUE="3000" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="IP" VALUE="0.0.0.0" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="DUMMY_APP" VALUE="test/dummy" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="RAILS_SERVER_TYPE" VALUE="Default" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="ENVIRONMENT_TYPE" VALUE="development" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="LAUNCH_JS" VALUE="false" />
<method />
</configuration>
</component>
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.bundle" />
<excludeFolder url="file://$MODULE_DIR$/components" />
<excludeFolder url="file://$MODULE_DIR$/public/system" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
<excludeFolder url="file://$MODULE_DIR$/vendor/bundle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="actioncable (v5.0.0.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="actionmailer (v5.0.0.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="actionpack (v5.0.0.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="actionview (v5.0.0.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="activejob (v5.0.0.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="activemodel (v5.0.0.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="activerecord (v5.0.0.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="activesupport (v5.0.0.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="arel (v7.1.4, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="bcrypt (v3.1.11, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="builder (v3.2.2, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.13.6, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="byebug (v9.0.6, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="coffee-rails (v4.2.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="coffee-script (v2.4.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="coffee-script-source (v1.11.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.0.2, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="debug_inspector (v0.0.2, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="erubis (v2.7.0, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="execjs (v2.7.0, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="ffi (v1.9.14, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="globalid (v0.3.7, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="i18n (v0.7.0, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="jbuilder (v2.6.0, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="jquery-rails (v4.2.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="listen (v3.0.8, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="loofah (v2.0.3, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="mail (v2.6.4, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="method_source (v0.8.2, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="mime-types (v3.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="mime-types-data (v3.2016.0521, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="mini_portile2 (v2.1.0, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.9.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="multi_json (v1.12.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="nio4r (v1.2.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.6.8.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="puma (v3.6.2, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rack (v2.0.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rack-test (v0.6.3, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rails (v5.0.0.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rails-dom-testing (v2.0.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rails-html-sanitizer (v1.0.3, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="railties (v5.0.0.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rake (v11.3.0, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rb-fsevent (v0.9.8, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rb-inotify (v0.9.7, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="sass (v3.4.22, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="sass-rails (v5.0.6, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="spring (v2.0.0, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="spring-watcher-listen (v2.0.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="sprockets (v3.7.0, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="sprockets-rails (v3.2.0, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="sqlite3 (v1.3.12, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="thor (v0.19.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="thread_safe (v0.3.5, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="tilt (v2.0.5, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="turbolinks (v5.0.1, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="turbolinks-source (v5.0.0, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="tzinfo (v1.2.2, rbenv: 2.3.1) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="uglifier (v3.0.3, rbenv: 2.3.1) [gem]" level="application" />
<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" />
</component>
<component name="RModuleSettingsStorage">
<LOAD_PATH number="0" />
<I18N_FOLDERS number="1" string0="$MODULE_DIR$/config/locales" />
</component>
</module>

14
.idea/misc.xml Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="rbenv: 2.3.1" project-jdk-type="RUBY_SDK" />
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/guoren.iml" filepath="$PROJECT_DIR$/.idea/guoren.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

330
.idea/workspace.xml Normal file
View File

@ -0,0 +1,330 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="4563abd9-0b8d-4853-8d0b-b3f103aec2dd" name="Default" comment="">
<change type="DELETED" beforePath="$PROJECT_DIR$/test.txt" afterPath="" />
</list>
<ignored path="guoren.iws" />
<ignored path=".idea/workspace.xml" />
<ignored path="$PROJECT_DIR$/.bundle/" />
<ignored path="$PROJECT_DIR$/components/" />
<ignored path="$PROJECT_DIR$/public/system/" />
<ignored path="$PROJECT_DIR$/tmp/" />
<ignored path="$PROJECT_DIR$/vendor/bundle/" />
<ignored path=".idea/dataSources.local.xml" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="FavoritesManager">
<favorites_list name="guoren" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="Gemfile.lock" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/Gemfile.lock">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="147">
<caret line="90" column="13" selection-start-line="90" selection-start-column="12" selection-end-line="90" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectFrameBounds">
<option name="y" value="23" />
<option name="width" value="1440" />
<option name="height" value="808" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="guoren" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</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>
</subPane>
</pane>
<pane id="Scope" />
<pane id="Scratches" />
<pane id="RailsProjectView" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="WebServerToolWindowFactoryState" value="false" />
</component>
<component name="RunManager" selected="Rails.Development: guoren">
<configuration default="true" type="RailsRunConfigurationType" factoryName="Rails">
<predefined_log_file id="RUBY_RAILS_SERVER" enabled="true" />
<module name="" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
<RAILS_SERVER_CONFIG_SETTINGS_ID 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>
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="SCRIPT_ARGS" VALUE="" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="PORT" VALUE="3000" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="IP" VALUE="0.0.0.0" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="DUMMY_APP" VALUE="test/dummy" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="RAILS_SERVER_TYPE" VALUE="Default" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="ENVIRONMENT_TYPE" VALUE="development" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="LAUNCH_JS" VALUE="false" />
<method />
</configuration>
<configuration default="true" type="RakeRunConfigurationType" factoryName="Rake">
<module name="" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
<RAKE_RUN_CONFIG_SETTINGS_ID 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>
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_NAME" VALUE="" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ARGS" VALUE="" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ATTACHED_TEST_FRAMEWORKS" VALUE="" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_TRACE" VALUE="false" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_DRYRUN" VALUE="false" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_PREREQS" VALUE="false" />
<method />
</configuration>
<configuration default="false" name="test: guoren" type="RakeRunConfigurationType" factoryName="Rake">
<module name="guoren" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
<envs>
<env name="RAILS_ENV" value="test" />
</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>
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_NAME" VALUE="test" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ARGS" VALUE="" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ATTACHED_TEST_FRAMEWORKS" VALUE=":test_unit " />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_TRACE" VALUE="false" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_DRYRUN" VALUE="false" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_PREREQS" VALUE="false" />
<method />
</configuration>
<configuration default="false" name="spec: guoren" type="RakeRunConfigurationType" factoryName="Rake">
<module name="guoren" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
<RAKE_RUN_CONFIG_SETTINGS_ID 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>
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_NAME" VALUE="spec" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ARGS" VALUE="" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_ATTACHED_TEST_FRAMEWORKS" VALUE=":rspec " />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_TRACE" VALUE="false" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_DRYRUN" VALUE="false" />
<RAKE_RUN_CONFIG_SETTINGS_ID NAME="RAKE_TASK_OPTION_PREREQS" VALUE="false" />
<method />
</configuration>
<configuration default="false" name="Production: guoren" type="RailsRunConfigurationType" factoryName="Rails">
<predefined_log_file id="RUBY_RAILS_SERVER" enabled="true" />
<module name="guoren" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
<RAILS_SERVER_CONFIG_SETTINGS_ID 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>
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="SCRIPT_ARGS" VALUE="" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="PORT" VALUE="3000" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="IP" VALUE="0.0.0.0" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="DUMMY_APP" VALUE="test/dummy" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="RAILS_SERVER_TYPE" VALUE="Default" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="ENVIRONMENT_TYPE" VALUE="production" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="LAUNCH_JS" VALUE="false" />
<method />
</configuration>
<configuration default="false" name="Development: guoren" type="RailsRunConfigurationType" factoryName="Rails">
<predefined_log_file id="RUBY_RAILS_SERVER" enabled="true" />
<module name="guoren" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
<RAILS_SERVER_CONFIG_SETTINGS_ID 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>
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="SCRIPT_ARGS" VALUE="" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="PORT" VALUE="3000" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="IP" VALUE="0.0.0.0" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="DUMMY_APP" VALUE="test/dummy" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="RAILS_SERVER_TYPE" VALUE="Default" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="ENVIRONMENT_TYPE" VALUE="development" />
<RAILS_SERVER_CONFIG_SETTINGS_ID NAME="LAUNCH_JS" VALUE="false" />
<method />
</configuration>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="Rake.test: guoren" />
<item index="1" class="java.lang.String" itemvalue="Rake.spec: guoren" />
<item index="2" class="java.lang.String" itemvalue="Rails.Production: guoren" />
<item index="3" class="java.lang.String" itemvalue="Rails.Development: guoren" />
</list>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="4563abd9-0b8d-4853-8d0b-b3f103aec2dd" name="Default" comment="" />
<created>1482408182630</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1482408182630</updated>
<workItem from="1482408184281" duration="75000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="75000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1440" height="808" extended-state="6" />
<editor active="false" />
<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.24964234" sideWeight="0.5" 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="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32884097" sideWeight="0.5" order="-1" 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.33" sideWeight="0.5" order="-1" 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="-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="-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="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32884097" sideWeight="0.5" order="-1" 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="-1" side_tool="true" 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="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="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="Find" 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="1" 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.33" sideWeight="0.5" order="2" 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.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/Gemfile.lock">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="147">
<caret line="90" column="13" selection-start-line="90" selection-start-column="12" selection-end-line="90" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
</component>
</project>

View File

@ -1,11 +1,9 @@
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
@ -32,6 +30,7 @@ gem 'bcrypt', '~> 3.1.7'
# gem 'capistrano-rails', group: :development
group :development, :test do
gem 'sqlite3'
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri
end
@ -45,5 +44,9 @@ group :development do
gem 'spring-watcher-listen', '~> 2.0.0'
end
# group :production do
# gem 'pg','~> 0.18.4'
# end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

View File

@ -173,4 +173,4 @@ DEPENDENCIES
web-console
BUNDLED WITH
1.12.5
1.13.6

178
Gemfile.lock.bak Normal file
View File

@ -0,0 +1,178 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (5.0.0.1)
actionpack (= 5.0.0.1)
nio4r (~> 1.2)
websocket-driver (~> 0.6.1)
actionmailer (5.0.0.1)
actionpack (= 5.0.0.1)
actionview (= 5.0.0.1)
activejob (= 5.0.0.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.0.0.1)
actionview (= 5.0.0.1)
activesupport (= 5.0.0.1)
rack (~> 2.0)
rack-test (~> 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.0.1)
activesupport (= 5.0.0.1)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (5.0.0.1)
activesupport (= 5.0.0.1)
globalid (>= 0.3.6)
activemodel (5.0.0.1)
activesupport (= 5.0.0.1)
activerecord (5.0.0.1)
activemodel (= 5.0.0.1)
activesupport (= 5.0.0.1)
arel (~> 7.0)
activesupport (5.0.0.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (7.1.4)
bcrypt (3.1.11)
builder (3.2.2)
byebug (9.0.6)
coffee-rails (4.2.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.2.x)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.11.1)
concurrent-ruby (1.0.2)
debug_inspector (0.0.2)
erubis (2.7.0)
execjs (2.7.0)
ffi (1.9.14)
globalid (0.3.7)
activesupport (>= 4.1.0)
i18n (0.7.0)
jbuilder (2.6.0)
activesupport (>= 3.0.0, < 5.1)
multi_json (~> 1.2)
jquery-rails (4.2.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
mime-types (>= 1.16, < 4)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.9.1)
multi_json (1.12.1)
nio4r (1.2.1)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
pg (0.18.4)
puma (3.6.2)
rack (2.0.1)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.0.1)
actioncable (= 5.0.0.1)
actionmailer (= 5.0.0.1)
actionpack (= 5.0.0.1)
actionview (= 5.0.0.1)
activejob (= 5.0.0.1)
activemodel (= 5.0.0.1)
activerecord (= 5.0.0.1)
activesupport (= 5.0.0.1)
bundler (>= 1.3.0, < 2.0)
railties (= 5.0.0.1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.1)
activesupport (>= 4.2.0, < 6.0)
nokogiri (~> 1.6.0)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (5.0.0.1)
actionpack (= 5.0.0.1)
activesupport (= 5.0.0.1)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (11.3.0)
rb-fsevent (0.9.8)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
sass (3.4.22)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
spring (2.0.0)
activesupport (>= 4.2)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
spring (>= 1.2, < 3.0)
sprockets (3.7.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.0)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.12)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.5)
turbolinks (5.0.1)
turbolinks-source (~> 5)
turbolinks-source (5.0.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (3.0.3)
execjs (>= 0.3.0, < 3)
web-console (3.4.0)
actionview (>= 5.0)
activemodel (>= 5.0)
debug_inspector
railties (>= 5.0)
websocket-driver (0.6.4)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
PLATFORMS
ruby
DEPENDENCIES
bcrypt (~> 3.1.7)
byebug
coffee-rails (~> 4.2)
jbuilder (~> 2.5)
jquery-rails
listen (~> 3.0.5)
pg (~> 0.18.4)
puma (~> 3.0)
rails (~> 5.0.0, >= 5.0.0.1)
sass-rails (~> 5.0)
spring
spring-watcher-listen (~> 2.0.0)
sqlite3
turbolinks (~> 5)
tzinfo-data
uglifier (>= 1.3.0)
web-console
BUNDLED WITH
1.13.6

View File

@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

View File

@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the Comments controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the MicroPosts controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -2,6 +2,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
include LoginHelper
include UsersHelper
include MicroPostsHelper
# Confirms a logged-in user.

View File

@ -9,40 +9,44 @@ class ChatController < ApplicationController
@chat_with_users = get_chat_with_users(@user)
if !@current_chat_user_name.nil?
@current_chat_user = User.find_by(name: @current_chat_user_name)
if !@current_chat_user_name.nil?
messages = process_messages(@user, @current_chat_user)
render json: messages
# else
# if !@chat_with_users.empty?
# @current_chat_user_name = @chat_with_users[0]["username"]
# @current_chat_user = User.find_by(name: @current_chat_user_name)
# @current_messages = Message.where(send_user: [@user.id, @current_chat_user_id], recieve_user:
# [@user.id, @current_chat_user_id]).order(create_time: :asc)
# end
end
end
end
def new
# 用户发送新的消息
@user = current_user
username = @user.name
userpic = @user.picurl
msg = params[:msg]
current_chat_user_name = params[:chat_with]
current_chat_user = User.find_by(name: current_chat_user_name)
save_time = DateTime.now
msg_db = Message.new(content: msg, send_user: @user.id, recieve_user: current_chat_user.id, create_time: save_time, readed: false)
msg_db = Message.new(content: msg, send_user: @user.id, recieve_user: current_chat_user.id,
create_time: save_time, readed: false)
if msg_db.save
render json: {msg: msg, time: save_time}
render json: {username: username, userpic: userpic, content: msg, time: save_time}
else
render json: {msg: "error", time: save_time}
render json: {username: username, userpic: userpic, content: "error", time: save_time}
end
end
def notify
# 获取未读短信数
@user = current_user
# unreaded_lists = unread_msg_users(@uesr)
render json: {unreaded: unread_msg_num(@user)}
end
def online
# # 获取未读短信和对对应的联系人
@user = current_user
results = unread_msg_users(@user)
if results.empty?
@ -52,25 +56,42 @@ class ChatController < ApplicationController
end
def query
# 添加新的联系人
@user = current_user
query_name = params[:username]
all_user_names = params[:all]
query_pic = String.new()
if all_user_names.nil?
query_user = User.find_by(name: query_name)
if query_user.nil?
query_name = nil
ok = false
else
query_name = query_user.name
query_pic = query_user.picurl
ok = true
end
else
if all_user_names.include? query_name or query_name == @user.name
query_name = nil
ok = false
else
query_user = User.find_by(name: query_name)
if query_user.empty?
p "-----------here-------run----------"
if query_user.nil?
p "-----------here-------run----------"
query_name = nil
ok = false
else
query_name = query_user.name
query_pic = query_user.picurl
ok = true
end
end
render json: {username: query_name, ok: ok}
end
render json: {username: query_name, userpic: query_pic, ok: ok}
end
end

View File

@ -0,0 +1,23 @@
class CommentsController < ApplicationController
include CommentsHelper
def get
micropost_id = params["micropost_id"]
micropost_comments = get_micropost_comments micropost_id
render json: {comments:micropost_comments}
end
def new
@user = current_user
username = @user.name
userpic = @user.picurl
content = params[:content].to_s
micropost_id = params[:micropost_id]
if !content.empty? and !micropost_id.nil?
comments = @user.comments.new(content:content,micro_post_id:micropost_id,comment_time:DateTime.now)
comments.save
end
render json: {username: username, userpic: userpic}
end
end

View File

@ -1,15 +1,30 @@
class MainController < ApplicationController
include MainHelper
before_action :logged_in_user
def show
@user = current_user
p @user.email
p gravatar_for @user
offset = 0
@micro_posts_array = read_newest_post(offset)
render 'main'
end
def index
def activity
micro_post_id = params[:micropost_id]
join = params[:join].to_s
micro_post = MicroPost.find_by(id: micro_post_id)
if join == "true"
p "join activity"
micro_post.engage_people += 1
else
p "quit activity"
micro_post.engage_people -= 1
end
if micro_post.save
render json: {total_num: micro_post.engage_people}
end
end
end

View File

@ -0,0 +1,25 @@
class MicroPostsController < ApplicationController
before_action :logged_in_user
def show
@user = current_user
@micro_posts = read_each_post @user
end
def new
@user = current_user
post_type = params[:post_type].to_i
title = params[:title].to_s
content = params[:content].to_s
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,
post_type:post_type,engage_people:0)
micropost.save
end
redirect_to microposts_path
end
end

View File

@ -12,10 +12,16 @@ class UsersController < ApplicationController
end
end
def edit
@user = current_user
render 'edit'
end
private
def user_params
params.require(:user).permit(:name, :email, :password,
:password_confirmation)
end
end

View File

@ -1,2 +1,3 @@
module ApplicationHelper
end

View File

@ -34,15 +34,20 @@ module ChatHelper
Message.transaction do
messages = Message.lock.where(send_user: [user.id, chat_with.id],
recieve_user: [user.id, chat_with.id]).order(create_time: :asc)
if !messages.empty?
recieve_user: [user.id, chat_with.id])
if messages.length >= 1
p "==================================="
messages = messages.order(create_time: :asc)
messages.each do |message|
if message.send_user == user.id
x = {issend: true, send: user.name, recieve: chat_with.name, content: message.content, time: message.create_time}
x = {issend: true, name: user.name, userpic:user.picurl,
content: message.content, time: message.create_time}
else
message.readed = true
message.save
x = {issend: false, send: chat_with.name, recieve: user.name, content: message.content, time: message.create_time}
x = {issend: false, name: chat_with.name, userpic:chat_with.picurl,
content: message.content, time: message.create_time}
end
results << x
end
@ -56,17 +61,10 @@ module ChatHelper
end
def unread_msg_users user
# unreaded_lists = []
# unreaded_users = user.recieve_messages.where(readed: false).select(:send_user).distinct
# if !unreaded_users.empty?
# unreaded_users do |unreaded_id|
# unreaded_lists << User.find(unreaded_id).id
# end
# end
# unreaded_lists
return_user_msg = {}
results = user.recieve_messages.where(readed: false)
if results.count != 0
if results.length != 0
results.each do |result|
username = User.find(result.send_user).name
return_user_msg[username] = [];

View File

@ -0,0 +1,18 @@
module CommentsHelper
def get_micropost_comments micropost_id
comments_array = Array.new()
micropost = MicroPost.find_by(id: micropost_id)
comments = micropost.comments
if !comments.empty?
comments.each do |com|
temp = Hash.new()
temp["username"] = com.user.name
temp["userpic"] = com.user.picurl
temp["content"] = com.content
comments_array << temp
end
end
return comments_array
end
end

View File

@ -1,2 +1,31 @@
module MainHelper
def read_newest_post offset_num
micro_posts_array = []
micro_posts = MicroPost.all.order(post_time: :desc).limit(20).offset(offset_num)
if !micro_posts.empty?
micro_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"] = micro_post.post_time
x["peo_num"] = micro_post.engage_people
micro_posts_array << x
end
end
return micro_posts_array
end
end

View File

@ -0,0 +1,31 @@
module MicroPostsHelper
def read_each_post user
micro_posts_array = []
micro_posts = user.micro_posts.all.order(post_time: :desc)
if !micro_posts.empty?
micro_posts.each do |micro_post|
x = Hash.new()
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"] = micro_post.post_time
x["peo_num"] = micro_post.engage_people
micro_posts_array << x
end
end
return micro_posts_array
end
end

View File

@ -2,6 +2,6 @@ module UsersHelper
def gravatar_for(user, options = { size: 80 })
gravatar_id = Digest::MD5::hexdigest(user.email.downcase)
size = options[:size]
gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}?s=#{size}"
gravatar_url = "https://secure.gravatar.com/avatars/#{gravatar_id}?s=#{size}"
end
end

4
app/models/comment.rb Normal file
View File

@ -0,0 +1,4 @@
class Comment < ApplicationRecord
belongs_to :user, class_name: 'User', foreign_key: 'user_id'
belongs_to :micro_post, class_name: 'MicroPost', foreign_key: 'micro_post_id'
end

4
app/models/micro_post.rb Normal file
View File

@ -0,0 +1,4 @@
class MicroPost < ApplicationRecord
belongs_to :user, dependent: :destroy
has_many :comments, class_name: 'Comment', foreign_key: 'micro_post_id', dependent: :destroy
end

View File

@ -1,6 +1,14 @@
class User < ApplicationRecord
before_save :default_values
def default_values
self.picurl = 'images/avatars/default/avatar.png'
end
has_many :send_messages, class_name: 'Message', foreign_key: 'send_user'
has_many :recieve_messages, class_name: 'Message', foreign_key: 'recieve_user'
has_many :micro_posts, dependent: :destroy
has_many :comments, class_name: 'Comment', foreign_key: 'user_id', dependent: :destroy
VALID_EMAIL_REGEX = /\A[\w+\-.]+@([a-z\d\-]+\.)+[a-z]+\z/i
before_save { self.email = email.downcase }

View File

@ -1,3 +1,5 @@
<% provide(:title, @user.name) %>
<div class="modal-shiftfix">
<!-- Navigation -->
@ -5,10 +7,8 @@
<!-- End Navigation -->
<div class="container-fluid main-content">
<div class="row">
<!-- Conversation -->
<div class="col-lg-12">
<div class="widget-container scrollable chat chat-page">
<div class="widget-container scrollable chat chat-page row">
<div class="contact-list">
<div class="heading">
我的联系人<i class="icon-plus pull-right" data-toggle="modal" data-target="#addUser"></i>
@ -17,16 +17,14 @@
<% @chat_with_users.each do |name, readed| %>
<% if readed == false %>
<li class="user_entry">
<a href="#">
<img width="30" height="30" src="images/avatar-female.png"/>
<a>
<label class="user_name"><%= name.to_s %></label>
<i class="icon-circle text-success"></i>
<i class="icon-circle text-success">新短信</i>
</a>
</li>
<% else %>
<li class="user_entry">
<a href="#">
<img width="30" height="30" src="images/avatar-female.png"/>
<a>
<label class="user_name"><%= name.to_s %></label>
</a>
</li>
@ -38,7 +36,7 @@
<i class="icon-comments"></i>
<lable id="chatwith"></lable>
</div>
<div class="widget-content padded">
<div id="chatScroll" class="widget-content padded">
<ul id="chatList">
</ul>
</div>
@ -46,8 +44,7 @@
<input id="msg" class="form-control" placeholder="新信息..." type="text">
<input id="msgSubmit" type="submit" value="发送">
</div>
</div>
</div>
</div>
</div>
</div>
@ -72,11 +69,16 @@
<script>
function insertSend(content, time) {
function insertSend(name, pic, content, time) {
var from =
'<li class=" current-user"> ' +
'<img width="30" height="30" src="images/avatar-female.jpg"/>' +
'<img width="30" height="30" src="' +
pic +
'"/>' +
'<div class="bubble">' +
'<a class="user-name">' +
name +
'</a>' +
'<p class="message">' +
content +
'</p> <p class="time">' +
@ -87,13 +89,17 @@
}
function insertRecieve(name, content, time) {
var from = '<li>' +
'<img width="30" height="30" src="images/avatar-female.jpg"/>' +
function insertRecieve(name, pic, content, time) {
var from =
'<li>' +
'<img width="30" height="30" ' +
'src="' +
pic +
'"/>' +
'<div class="bubble">' +
'<label>' +
'<a class="user-name">' +
name +
'</label>' +
'</a>' +
'<p class="message">' +
content +
'</p>' +
@ -117,14 +123,15 @@
$('#chatwith').text(name);
for (var i = 0; i < data.length; i++) {
if (data[i]["issend"] == true) {
insertSend(data[i]["content"], data[i]["time"])
insertSend(data[i]["name"], data[i]["userpic"], data[i]["content"], data[i]["time"])
}
else {
insertRecieve(data[i]["send"], data[i]["content"], data[i]["time"]);
insertRecieve(data[i]["name"], data[i]["userpic"], data[i]["content"], data[i]["time"]);
}
}
notify();
$("#msg").attr("disabled", false);
$("#chatScroll").scrollTop($("#chatScroll")[0].scrollHeight);
}
});
$(this).find("i").remove();
@ -142,7 +149,8 @@
dataType: 'json',
url: '/newmsg',
success: function (data, textStatus, jqXHR) {
insertSend(data["msg"], data["time"]);
insertSend(data["username"], data["userpic"], data["content"], data["time"]);
$("#chatScroll").scrollTop($("#chatScroll")[0].scrollHeight);
}
});
$("#msg").val("");
@ -151,8 +159,7 @@
function append_user(name) {
var append_div = '<li class="user_entry">' +
'<a href="#">' +
'<img width="30" height="30" src="images/avatar-female.png"/>' +
'<a>' +
'<label class="user_name">' +
name +
'</label>' +
@ -203,7 +210,7 @@
function addOnlineLable(uniquename) {
var yuandian = '<i class="icon-circle text-success"></i>';
var yuandian = '<i class="icon-circle text-success">新消息</i>';
var results = $('.user_name:contains(' + uniquename + ')');
for (var i = 0; i < results.length; i++) {
if ($(results[i]).text() === uniquename) {
@ -222,8 +229,15 @@
success: function (data, textStatus, jqXHR) {
if (data["users"] != null) {
for (var key in data["users"]) {
console.log(key);
addOnlineLable(key);
var current_chat_with = $("#chatwith").text();
if (current_chat_with.length > 0 && current_chat_with == key) {
$(".user_name").each(function () {
if ($(this).text() == current_chat_with) {
$(this).click();
}
})
}
}
}
}
@ -232,10 +246,6 @@
}
setInterval('online()', 10000);
// clearInterval(notify_num_ticker);
</script>

View File

@ -1,165 +0,0 @@
<div class="modal-shiftfix">
<!-- Navigation -->
<%= render 'layouts/nav' %>
<!-- End Navigation -->
<div class="container-fluid main-content">
<div class="row">
<!-- Conversation -->
<div class="col-lg-12">
<div class="widget-container scrollable chat chat-page">
<div class="contact-list">
<div class="heading">
我的联系人<i class="icon-plus pull-right"></i>
</div>
<ul>
<% @chat_with_users.each do |name,readed| %>
<% if readed == false%>
<li>
<a href="#">
<img width="30" height="30" src="images/avatar-female.png"/>
<%=name.to_s%>
<i class="icon-circle text-success"></i>
</a>
</li>
<% else %>
<li>
<a href="#">
<img width="30" height="30" src="images/avatar-female.png"/>
<%=name.to_s%>
</a>
</li>
<% end %>
<% end %>
</ul>
</div>
<div class="heading">
<i class="icon-comments"></i>
<lable id="chatwith"><%= @current_chat_user.name %></lable>
</div>
<div class="widget-content padded">
<% if !@current_chat_user.nil? %>
<ul id="chatList">
<% @current_messages.each do |message| %>
<% if message.send_user == @user.id %>
<li class="current-user">
<img width="30" height="30" src="images/avatar-female.jpg"/>
<div class="bubble">
<p class="message">
<%= message.content %>
</p>
<p class="time">
<%= message.create_time %>
</p>
</div>
</li>
<% else %>
<li>
<img width="30" height="30" src="images/avatar-female.jpg"/>
<div class="bubble">
<label><%= @current_chat_user.name %></label>
<p class="message">
<%= message.content %>
</p>
<p class="time">
<%= message.create_time %>
</p>
</div>
</li>
<% end %>
<% end %>
</ul>
<% end %>
</div>
<div class="post-message">
<input id="msg" class="form-control" placeholder="新信息..." type="text">
<input id="msgSubmit" type="submit" value="发送">
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function insertSend(content, time) {
var from =
'<li class=" current-user"> ' +
'<img width="30" height="30" src="images/avatar-female.jpg"/>' +
'<div class="bubble">' +
'<p class="message">' +
content +
'</p> <p class="time">' +
time +
'</p> </div> </li>'
;
$("#chatList").append(from);
}
function insertRecieve(name, content, time) {
var from = '<li>' +
'<img width="30" height="30" src="images/avatar-female.jpg"/>' +
'<div class="bubble">' +
'<label>' +
name +
'</label>' +
'<p class="message">' +
content +
'</p>' +
'<p class="time">' +
time +
'</p>' +
'</div>' +
'</li>';
$("#chatList").append(from);
}
$('.contact-list a').bind("click", function () {
name = $(this).text();
$.ajax({
type: 'get',
dataType: 'json',
data: {chat_with: name},
url: '/chat',
success: function (data, textStatus, jqXHR) {
$("#chatList").empty();
$('#chatwith').text(name);
for (var i = 0; i < data.length; i++) {
if (data[i]["issend"] == true) {
insertSend(data[i]["content"], data[i]["time"])
}
else {
insertRecieve(data[i]["send"], data[i]["content"], data[i]["time"]);
}
}
}
})
});
$("#msgSubmit").click(function () {
var text = $("#msg").val();
var chat_with_user = $("#chatwith").text();
console.log(chat_with_user);
$.ajax({
type: 'post',
data: {msg: text, chat_with: chat_with_user, authenticity_token: AUTH_TOKEN},
dataType: 'json',
url: '/newmsg',
success: function (data, textStatus, jqXHR) {
insertSend(data["msg"], data["time"]);
}
});
return false;
});
// var tock = setInterval('$(".icon-plus").click()',1000);
// $(document).ready(function () {
//
// });
</script>

View File

@ -3,9 +3,9 @@
<div class="pull-right">
<ul class="nav navbar-nav pull-right">
<li class="dropdown user hidden-xs"><a data-toggle="dropdown" class="dropdown-toggle" href="/logout">
<img width="34" height="34" src="<%= gravatar_for(@user) %>"/><%= @user.name %><b class="caret"></b></a>
<img width="34" height="34" src="<%= @user.picurl %>"/><%= @user.name %><b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="/users">
<li><a href="#">
<i class="icon-user"></i>个人设置</a>
</li>
<li><a href="/logout">
@ -15,16 +15,21 @@
</li>
</ul>
</div>
<a class="logo" href="#"></a>
<a class="logo" href="/main"></a>
<button class="navbar-toggle"><span class="icon-bar"></span><span class="icon-bar"></span><span
class="icon-bar"></span></button>
</div>
<div class="container-fluid main-nav clearfix">
<div class="nav-collapse">
<ul class="nav">
<li class="dropdown"><a data-toggle="dropdown" href="#">
<span aria-hidden="true" class="se7en-star"></span>随便看看<b class="caret"></b></a>
<li class="dropdown">
<a data-toggle="dropdown" href="#">
<span aria-hidden="true" class="se7en-star"></span>随便看看<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="/main">果仁动态</a>
</li>
<li>
<a href="#">失物信息</a>
</li>
@ -34,7 +39,7 @@
</ul>
</li>
<li>
<a href="#"><span aria-hidden="true" class="se7en-home"></span>我的动态</a>
<a href="/microposts"><span aria-hidden="true" class="se7en-home"></span>我的动态</a>
</li>
<li>
<a href="/chat">
@ -43,6 +48,9 @@
<div id="msgNum" class="label label-info">0</div>
</a>
</li>
<li>
<a href="/logout"><span aria-hidden="true" class="se7en-pages"></span>退出</a>
</li>
</ul>
</div>
</div>

View File

@ -1,3 +1,8 @@
<!--自定义CSS文件-->
<link href="stylesheets/mystyle.css" media="all" rel="stylesheet" type="text/css"/>
<!--自定义CSS文件-->
<!--引入文件-->
<link href="stylesheets/bootstrap.min.css" media="all" rel="stylesheet" type="text/css"/>
<link href="stylesheets/font-awesome.css" media="all" rel="stylesheet" type="text/css"/>
<link href="stylesheets/se7en-font.css" media="all" rel="stylesheet" type="text/css"/>
@ -24,8 +29,10 @@
<link href="stylesheets/color/magenta.css" media="all" rel="alternate stylesheet" title="magenta-theme"
type="text/css"/>
<link href="stylesheets/color/gray.css" media="all" rel="alternate stylesheet" title="gray-theme" type="text/css"/>
<!--引入文件-->
<script src="javascripts/jquery.min.js" type="text/javascript"></script>
<script src="http://cdn.bootcss.com/jqueryui/1.10.3/jquery-ui.min.js" type="text/javascript"></script>
<script src="javascripts/jquery-ui-1.12.1.min.js" type="text/javascript"></script>
<script src="javascripts/bootstrap.min.js" type="text/javascript"></script>
<script src="javascripts/raphael.min.js" type="text/javascript"></script>
<script src="javascripts/selectivizr-min.js" type="text/javascript"></script>

View File

@ -3,7 +3,7 @@
<!-- Login Screen -->
<div class="login-wrapper">
<a href="#"><img width="210" height="70" src="images/logo/guoke.png"/></a>
<a href="#"><img width="210" height="70" src="images/logo/guoren.png"/></a>
<%= form_tag(controller: "login", action: "login", method: "post") do %>
<div class="form-group">

View File

@ -1,193 +1,93 @@
<% provide(:title, @user.name) %>
<div class="modal-shiftfix">
<div class="container-fluid main-content">
<%= render 'layouts/nav' %>
<div class="row">
<div class="col-lg-12">
<div class="col-lg-8">
<% @micro_posts_array.each do |micro_post| %>
<div class="social-wrapper">
<div class="social-container">
<div class="social-entry">
<div class="social-entry" id="postid_<%= micro_post["postid"] %>">
<div class="widget-container fluid-height isotope-item">
<div class="profile-info clearfix padded">
<div class="profile-info clearfix" style="padding: 20px 20px 0 20px">
<img width="50" height="50" class="social-avatar pull-left"
src="images/avatar-male2.png">
src="<%= micro_post["userpic"] %>">
<a class="user-name"><i class="icon-user"></i><%= micro_post["username"] %></a><br>
<div class="profile-details">
<a class="user-name" href="#">用户名称</a>
<p>
<em>发布时间</em>
</p>
</div>
</div>
<img width="300" height="200" class="social-content-media"
src="images/social-image.jpg">
<div class="padded">
<p class="content">发布的内容</p>
</div>
</div>
<div class="comments padded">
<div class="comment">
<img width="40" height="40" class="social-avatar pull-left"
src="images/avatar-female.png">
<div class="profile-details clearfix">
<a class="user-name" href="#">评论用户</a>
<p>
<em>评论时间</em>
</p>
</div>
<p class="content">
评论内容
</p>
</div>
<form role="form">
<div class="form-group">
<input class="form-control" placeholder="Add a comment..." type="text">
</div>
</form>
</div>
</div>
</div>
</div>
<div class="social-wrapper">
<div class="social-container">
<div class="social-entry">
<div class="widget-container fluid-height isotope-item">
<div class="profile-info clearfix padded">
<img width="50" height="50" class="social-avatar pull-left"
src="images/avatar-male2.png">
<div class="profile-details">
<a class="user-name" href="#">用户名称</a>
<p>
<em>发布时间</em>
</p>
</div>
</div>
<img width="300" height="200" class="social-content-media"
src="images/social-image.jpg">
<div class="padded">
<p class="content">发布的内容</p>
</div>
</div>
<div class="comments padded">
<div class="comment">
<img width="40" height="40" class="social-avatar pull-left"
src="images/avatar-female.png">
<div class="profile-details clearfix">
<a class="user-name" href="#">评论用户</a>
<p>
<em>评论时间</em>
</p>
</div>
<p class="content">
评论内容
</p>
</div>
<form role="form">
<div class="form-group">
<div class="form-group">
<input class="form-control" placeholder="Add a comment..." type="text">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="social-wrapper">
<div class="social-container">
<div class="social-entry">
<div class="widget-container fluid-height isotope-item">
<div class="profile-info clearfix padded">
<img width="50" height="50" class="social-avatar pull-left"
src="images/avatar-male2.png">
<div class="profile-details">
<a class="user-name" href="#">用户名称</a>
<p>
<em>发布时间</em>
<label class="label label-info" style="margin: 0"><%= micro_post["type"] %></label>
<i class="icon-time"><em><%= micro_post["time"] %></em></i>
</p>
</div>
</div>
<div class="padded">
<p class="content">
的积分卡开始大家了解法律考试大家分开了贾老师的空间发了卡死了的解放军爱上的龙卷风阿斯兰的减肥了婕拉抗衰老的减肥了加拉克是大家拉来的解放军垃圾收来的快放假了阿里山的记录发来看埃里克圣诞节福利及拉得少两块街坊邻居拉来的减肥了垃圾是来得及 </p>
</div>
</div>
<div>
<button class="btn btn-block">显示评论</button>
</div>
<div class="comments padded hidden">
<div class="comment">
<img width="40" height="40" class="social-avatar pull-left"
src="images/avatar-female.png">
<div class="profile-details clearfix">
<a class="user-name" href="#">评论用户</a>
<p>
<em>评论时间</em>
</p>
</div>
<p class="content">
评论内容
</p>
</div>
<form role="form">
<div class="form-group">
<input class="form-control" id="exampleInputEmail1"
placeholder="Add a comment..."
type="email">
</div>
</form>
</div>
</div>
</div>
</div>
<div class="social-wrapper">
<div class="social-container">
<div class="social-entry">
<div class="widget-container fluid-height isotope-item">
<div class="profile-info clearfix padded">
<img width="50" height="50" class="social-avatar pull-left"
src="images/avatar-male2.png">
<div class="profile-details">
<a class="user-name" href="#">用户名称</a>
<p>
<em>发布时间</em>
</p>
</div>
</div>
<div class="padded">
<p class="content">
的积分卡开始大家了解法律考试大家分开了贾老师的空间发了卡死了的解放军爱上的龙卷风阿斯兰的减肥了婕拉抗衰老的减肥了加拉克是大家拉来的解放军垃圾收来的快放假了阿里山的记录发来看埃里克圣诞节福利及拉得少两块街坊邻居拉来的减肥了垃圾是来得及 </p>
<p class="content"><%= micro_post["content"] %></p>
</div>
<% if micro_post["type"] == "组团信息" %>
<div class="social-button">
<button class="btn btn-success-outline" style="margin: 10px 10px 10px 10px">报名参加
<button id="activity" class="btn btn-lg btn-success-outline">报名参加
</button>
</div>
<div id="activity-datail">
</div>
<% end %>
<% if micro_post["type"] == "失物招领" %>
<div class="social-button">
<button id="lost" class="btn btn-success-outline">跟ta联系
</button>
</div>
<% end %>
</div>
<div>
<button class="btn btn-block btn-default-outline showcomment">
显示评论
</button>
</div>
<div class="comments padded hidden">
<div class="comment">
<img width="40" height="40" class="social-avatar pull-left"
src="images/avatar-female.png">
<div class="profile-details clearfix">
<a class="user-name" href="#">评论用户</a>
<p>
<em>评论时间</em>
</p>
</div>
<p class="content">
评论内容
</p>
</div>
<form role="form">
<div class="form-group">
<input class="form-control" id="exampleInputEmail1"
placeholder="Add a comment..."
type="email">
</div>
</form>
<input class="form-control makecomment" placeholder="写评论..." type="text">
</div>
</div>
</div>
</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">
@ -197,14 +97,128 @@
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
<li><a href="#">5</a></li>
<li><a href="#">&raquo;</a></li>
</ul>
</nav>
</div>
</div>
</div>
<script>
function comment_process(username, userpic, comment) {
var commentElem = '<div class="comment">' +
'<img width="40" height="40" class="social-avatars pull-left"' +
'src=' +
userpic +
'/>' +
'<div class="profile-details clearfix">' +
'<a class="user-name">' +
username +
'</a>' +
'<p class="content">' +
comment +
'</p>' +
'</div>' +
'</div>';
return commentElem;
}
function getComments(id) {
$.ajax({
type: 'get',
dataType: 'json',
data: {micropost_id: id},
url: '/comments',
success: function (data, textStatus, jqXHR) {
var micro_post_id = "#" + "postid_" + id;
var comments = $(micro_post_id.toString()).parent().next();
var comments = $(micro_post_id.toString()).find(".comments")
comments.find(".comment").remove();
comments.find("p").remove();
if (data["comments"].length == 0) {
comments.prepend("<p style='text-align: center'>无评论</p>");
}
else {
var comments_array = data["comments"];
for (var i = 0; i < comments_array.length; i++) {
comments.prepend(comment_process(comments_array[i]["username"],
comments_array[i]["userpic"], comments_array[i]["content"]))
}
}
}
});
}
$(".showcomment").bind("click", function () {
var text = $(this).text();
if (text == "隐藏评论") {
$(this).parent().next(".comments").addClass("hidden");
$(this).text("显示评论");
}
else {
$(this).parent().next(".comments").removeClass("hidden");
$(this).text("隐藏评论");
var micropost_id = $(this).parent().parent().attr("id");
if (micropost_id.indexOf('_') > 0) {
var id = micropost_id.slice(micropost_id.indexOf('_') + 1);
getComments(id);
}
}
});
$(".makecomment").bind("keyup", function (e) {
var inputText = $(this).val();
var username = "";
var userpic = "";
var enterObject = $(this);
var micropost = $(this).parent().parent().attr("id");
var micropost_id = micropost.slice(micropost.indexOf("_") + 1)
if (e.keyCode == "13") {
$.ajax({
type: 'post',
dataType: 'json',
data: {micropost_id: micropost_id, content: inputText, authenticity_token: AUTH_TOKEN},
url: '/newcomment',
success: function (data, textStatus, jqXHR) {
if (data["username"] && data["userpic"]) {
enterObject.before(comment_process(data["username"], data["userpic"], inputText));
}
}
});
}
});
$("#activity").bind("click", function () {
var text = $(this).text().trim();
var micropost_id = $(this).parent().parent().parent().attr("id");
if (micropost_id.indexOf('_') > 0) {
var id = micropost_id.slice(micropost_id.indexOf('_') + 1);
}
if (text == "报名参加") {
$.ajax({
type: 'get',
dataType: 'json',
data: {micropost_id: id, join: true},
url: '/activity',
success: function (data, textStatus, jqXHR) {
console.log(data["total_num"]);
$("#activity").text("取消报名");
}
});
}
else {
$.ajax({
type: 'get',
dataType: 'json',
data: {micropost_id: id, join: false},
url: '/activity',
success: function (data, textStatus, jqXHR) {
console.log(data["total_num"]);
$("#activity").text("报名参加");
}
});
}
});
</script>

View File

@ -0,0 +1,83 @@
<% provide(:title, @user.name) %>
<div class="modal-shiftfix">
<!-- Navigation -->
<%= render 'layouts/nav' %>
<!-- End Navigation -->
<div class="container-fluid main-content padded" id="user-page">
<row id="new-post">
<div class="widget-container fluid-height clearfix">
<div class="heading">
<i class="icon-reorder"></i>发布新信息
</div>
<%= form_tag("/newpost", method: "post", class: "form-horizontal") do %>
<div class="form-group ">
<div class="col-md-2">
<select class="form-control" name="post_type">
<option value="1">新鲜事</option>
<option value="2">组团信息</option>
<option value="3">失物招领</option>
</select>
</div>
<div class="col-md-10">
<input class="form-control" placeholder="标题" type="text" name="title">
</div>
</div>
<div class="form-group">
<div class="col-md-12">
<textarea class="form-control" rows="3" name="content"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-md-12">
<p>
图片
</p>
</div>
</div>
<div class="form-group">
<div class="col-md-12 text-center">
<button class="btn btn-primary" type="submit">发布</button>
</div>
</div>
<% end %>
</div>
</row>
<row class="posts">
<% @micro_posts.each do |micro_post| %>
<div class="widget-container fluid-height clearfix">
<div class="heading">
<i class="icon-tags"><%= micro_post["title"] %></i>
<div class="label label-default"></div>
<div class="notifications label label-info">
<%= micro_post["type"] %>
</div>
<i class="icon-time"><%= micro_post["time"] %></i>
</div>
<div class="col-md-12">
<p>
<%= micro_post["content"]%>
</p>
</div>
<div class="col-md-12">
<div class="btn btn-default btn-block">
查看详情
</div>
</div>
</div>
<% end %>
</row>
</div>
</div>

View File

@ -0,0 +1 @@
<% provide(:title, @user.name) %>

View File

@ -2,7 +2,7 @@
<% provide(:body_class, 'login2') %>
<div class="login-wrapper">
<a href="#"><img width="210" height="70" src="images/logo/guoke.png"/></a>
<a href="#"><img width="210" height="70" src="images/logo/guoren.png"/></a>

View File

@ -1,12 +0,0 @@
Message.create(content:"hello",send_user:5,recieve_user:6,create_time:DateTime.now,readed:false)
user.send_messages.find_by(send_user:user.id)[:recieve_user]
user.send_messages.select("recieve_user").
user.send_messages.select(:recieve_user).find(1).recieve_user
Message.where(send_user:5,recieve_user:6)
Message.where(send_user:[6,8],recieve_user:[6,8]).select(:send_user,:recieve_user)
user.recieve_messages.where(readed: false).count

View File

@ -7,8 +7,10 @@ Rails.application.routes.draw do
get 'logout', to: 'login#logout'
get '/signup', to: 'users#new'
get '/profile' ,to: 'users#edit'
get '/main', to: 'main#show'
get '/activity',to: 'main#activity'
get '/chat', to: 'chat#index'
post '/newmsg', to: 'chat#new'
@ -16,6 +18,13 @@ Rails.application.routes.draw do
get '/query', to: 'chat#query'
get '/online', to: 'chat#online'
get '/microposts', to: 'micro_posts#show'
post 'newpost', to: 'micro_posts#new'
get '/comments', to: 'comments#get'
post '/newcomment', to: 'comments#new'
resource :users
resource :micro_posts
end

Binary file not shown.

View File

@ -6,7 +6,7 @@ class CreateMessages < ActiveRecord::Migration[5.0]
t.integer :recieve_user
t.datetime :create_time
t.boolean :readed
t.timestampcs
t.timestamps
end
end
end

View File

@ -0,0 +1,12 @@
class CreateMicroPosts < ActiveRecord::Migration[5.0]
def change
create_table :micro_posts do |t|
t.text :content
t.text :pic
t.datetime :post_time
t.integer :type
t.timestamps
end
end
end

View File

@ -0,0 +1,5 @@
class AddUserIdToMicroPosts < ActiveRecord::Migration[5.0]
def change
add_column :micro_posts, :user_id, :integer
end
end

View File

@ -0,0 +1,12 @@
class CreateComments < ActiveRecord::Migration[5.0]
def change
create_table :comments do |t|
t.string :content
t.integer :user_id
t.integer :micro_post_id
t.datetime :comment_time
t.timestamps
end
end
end

View File

@ -0,0 +1,5 @@
class FixMicroPost < ActiveRecord::Migration[5.0]
def change
rename_column :micro_posts, :type, :post_type
end
end

View File

@ -0,0 +1,5 @@
class AddEngagePeopleToMicroPosts < ActiveRecord::Migration[5.0]
def change
add_column :micro_posts, :engage_people, :integer
end
end

View File

@ -0,0 +1,5 @@
class AddTitleToMicroPosts < ActiveRecord::Migration[5.0]
def change
add_column :micro_posts, :title, :string
end
end

View File

@ -10,7 +10,16 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20161126121451) do
ActiveRecord::Schema.define(version: 20161129085653) do
create_table "comments", force: :cascade do |t|
t.string "content"
t.integer "user_id"
t.integer "micro_post_id"
t.datetime "comment_time"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "messages", force: :cascade do |t|
t.text "content"
@ -22,6 +31,18 @@ ActiveRecord::Schema.define(version: 20161126121451) do
t.datetime "updated_at", null: false
end
create_table "micro_posts", force: :cascade do |t|
t.text "content"
t.text "pic"
t.datetime "post_time"
t.integer "post_type"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "user_id"
t.integer "engage_people"
t.string "title"
end
create_table "users", force: :cascade do |t|
t.string "name"
t.string "email"

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 494 KiB

File diff suppressed because one or more lines are too long

View File

@ -63,3 +63,51 @@
padding-left: 30px;
padding-right: 30px;
}
#activity-datail {
font-size: 15px;
text-align: center;
padding-bottom: 5px;
}
.social-wrapper .social-container .social-entry .padded p.content {
font-size: 15px;
}
#lost {
margin-bottom: 5px;
}
.social-wrapper .social-container .social-entry .padded {
margin-left: 5px;
margin-right: 5px;
padding: 5px;
}
.social-wrapper .social-container .social-entry .padded {
margin: 0;
margin-left: 15px;
margin-right: 15px;
}
.social-wrapper .social-container .social-entry .comments.padded {
margin-left: 0;
margin-right: 0;
}
.col-lg-4 .widget-container {
margin-top: 15px;
margin-left: 25px;
margin-right: 25px;
}
.alert.alert-info {
margin-bottom: 0;
text-align: center;
height: 100px;
}
#user-page {
margin-left: 50px;
margin-right: 50px;
}

View File

@ -410,7 +410,7 @@ body.login2 .login-wrapper .social-login .twitter:hover {
}
.navbar .container-fluid.top-bar .logo {
background: url("../images/logo/guoren-small.png") no-repeat 0 0;
background: url("../images/logo/guoren.png") no-repeat 0 0;
width: 54px;
height: 16px;
float: left;
@ -420,7 +420,7 @@ body.login2 .login-wrapper .social-login .twitter:hover {
@media (min--moz-device-pixel-ratio: 1.3), (-o-min-device-pixel-ratio: 2.6 / 2), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx) {
.navbar .container-fluid.top-bar .logo {
background-image: url("../images/logo/guoren-xs.png");
background-image: url("../images/logo/guoren-small.png");
background-size: 54px 16px;
}
}
@ -1940,6 +1940,11 @@ th:active {
padding-top: 8px;
}
.profile-info {
padding: 20px 20px 0px 20px;
}
/*----------------------------------------------------------------------------------- */
/* Social Communities Widget */
/*----------------------------------------------------------------------------------- */

View File

@ -1 +0,0 @@
1231231

View File

@ -0,0 +1,7 @@
require 'test_helper'
class CommentsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end

View File

@ -0,0 +1,7 @@
require 'test_helper'
class MicroPostsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end

13
test/fixtures/comments.yml vendored Normal file
View File

@ -0,0 +1,13 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
content: MyString
user_id: 1
micro_post_id: 1
comment_time: 2016-11-29 10:22:12
two:
content: MyString
user_id: 1
micro_post_id: 1
comment_time: 2016-11-29 10:22:12

13
test/fixtures/micro_posts.yml vendored Normal file
View File

@ -0,0 +1,13 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
content: MyText
pic: MyText
post_time: 2016-11-29 10:07:37
type: 1
two:
content: MyText
pic: MyText
post_time: 2016-11-29 10:07:37
type: 1

View File

@ -0,0 +1,7 @@
require 'test_helper'
class CommentTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View File

@ -0,0 +1,7 @@
require 'test_helper'
class MicroPostTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

View File

@ -1,21 +0,0 @@
id 5
test
test@test.com
testtest
id 6
test2
test2@test.com
12345678
id 8
test3
test2@test.com
12345678
test110
test110@test.com
12345678