cthit / hubbIT-old

Former WhoIsInTheHub
https://hubbit.chalmers.it
MIT License
2 stars 9 forks source link

Design fixes and mobile optimization #120

Closed jesperlindstrom closed 8 years ago

jesperlindstrom commented 8 years ago

Some fixes to #119 where some styles weren't properly applied and/or not overriding previous styles. Also some mobile optimization, primarily for the stats page.

Untested, since I can't run the Rails app locally.

Before After
skarmavbild 2016-02-14 kl 11 13 44 skarmavbild 2016-02-14 kl 11 13 55
skarmavbild 2016-02-14 kl 11 09 41 skarmavbild 2016-02-14 kl 11 10 05
skarmavbild 2016-02-14 kl 11 13 05 skarmavbild 2016-02-14 kl 11 12 59
skarmavbild 2016-02-14 kl 11 25 02 skarmavbild 2016-02-14 kl 11 24 34
skarmavbild 2016-02-14 kl 11 38 27 skarmavbild 2016-02-14 kl 11 38 18
lindskogen commented 8 years ago

@jesperlindstrom what problems did you have trying to run it yourself?

jesperlindstrom commented 8 years ago

@lindskogen Can't start the Rails server for some reason. Works fine in other projects. I'm new to Rails/Ruby, so might have forgotten to do something. Getting this on rails s:

$ rails s
bin/rails:6: warning: already initialized constant APP_PATH
/Users/jesper/Development/hubbIT/bin/rails:6: warning: previous definition of APP_PATH was here
lindskogen commented 8 years ago

Try this? rake rails:update:bin from http://stackoverflow.com/a/23445914/823725

jesperlindstrom commented 8 years ago

@lindskogen thanks, that resulted in some new errors but I managed to find a solution to those, which then fixed the "update:bin" part, which in turn fixed rails s. Seems like it was related to OS X and MySQL somehow.

New problem though (haha), when trying to run the database migrations:

== 20150905130024 CreateTotalTimeView: migrating ==============================
-- execute("      CREATE VIEW users_total_time AS\n      SELECT `id`, `user_id`, SUM(TIMESTAMPDIFF(SECOND, `start_time`, `end_time`)) as `total_time`\n      FROM user_sessions GROUP BY `user_id` ORDER BY `total_time` DESC\n")
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

SQLite3::SQLException: no such column: SECOND:       CREATE VIEW users_total_time AS
      SELECT `id`, `user_id`, SUM(TIMESTAMPDIFF(SECOND, `start_time`, `end_time`)) as `total_time`
      FROM user_sessions GROUP BY `user_id` ORDER BY `total_time` DESC
/Users/jesper/.rvm/gems/ruby-2.2.1/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `initialize'
lindskogen commented 8 years ago

Same problem as @Kalior, you're using sqlite3 instead of mysql

Kalior commented 8 years ago

Yeah, apparently this project only supports mysql.

jesperlindstrom commented 8 years ago

@lindskogen switched to MySQL and migrations went fine. New problem is that the auth part redirects to https://account.chalmers.it/?redirect_to=http://localhost:3000/ , but it doesn't take me back to localhost afterwards. Is it possible to get the auth part working with the local dev server, or can I disable it somehow?

lindskogen commented 8 years ago

Not sure about the redirect, but you can set up local.chalmers.it to point to your local ip to get the cookie to work. (In your /etc/hosts file)

jesperlindstrom commented 8 years ago

I (somewhat) solved it by bypassing the auth and forcing a current_user object haha. I mainly wanted to see the design as a whole anyway. Thanks for all the help! :)