Skip to content

Commit

Permalink
Merge pull request #2740 from hypothesis/trello-178-new-homepage
Browse files Browse the repository at this point in the history
Move front page from WordPress into app
  • Loading branch information
robertknight committed Nov 27, 2015
2 parents 1e8fcae + ffb9032 commit a1ba8dc
Show file tree
Hide file tree
Showing 23 changed files with 2,824 additions and 51 deletions.
1 change: 0 additions & 1 deletion h/accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ def _logout(self):
if self.request.authenticated_userid is not None:
self.request.registry.notify(LogoutEvent(self.request))
self.request.session.invalidate()
self.request.session.flash(_('You have logged out.'), 'success')
headers = forget(self.request)
return headers

Expand Down
1 change: 1 addition & 0 deletions h/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def includeme(config):
config.include('h.badge')
config.include('h.claim')
config.include('h.groups')
config.include('h.home')
config.include('h.notification')
config.include('h.queue')
config.include('h.streamer')
Expand Down
16 changes: 15 additions & 1 deletion h/assets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ angulartics_ga:
contents: ../../node_modules/angulartics/src/angulartics-ga.js


# Bootstrap (for admin areas only)
# Bootstrap
bootstrap:
filters: uglifyjs
output: scripts/vendor/bootstrap.min.js
Expand Down Expand Up @@ -227,6 +227,20 @@ site_css:
depends:
- h:static/styles/*.scss

# Assets needed for the H website front page only.
front_page_js:
contents:
- jquery

front_page_css:
output: styles/front-page.min.css
contents:
- h:static/styles/front-page/main.css
- output: h:static/styles/front-page.css
filters: cleancss
contents:
- h:static/styles/vendor/css/font-awesome.css

# Help page
help_page_css:
output: styles/help-page.min.css
Expand Down
24 changes: 24 additions & 0 deletions h/home.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""The home/front page of the //hypothes.is/ site."""
from pyramid import view


@view.view_config(route_name='index',
request_method='GET',
renderer='h:templates/home.html.jinja2')
def index(context, request):
if request.authenticated_user:
username = request.authenticated_user.username
user_profile_link = (
request.route_url("stream")
+ "?q=user:{username}".format(username=username))
return {
"username": username,
"user_profile_link": user_profile_link
}
else:
return {}


def includeme(config):
config.add_route('index', '/')
config.scan(__name__)
Binary file added h/static/images/apple-touch-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added h/static/images/browser-chrome-64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added h/static/images/favicons/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added h/static/images/favicons/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added h/static/images/favicons/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added h/static/images/favicons/favicon.ico
Binary file not shown.
2 changes: 2 additions & 0 deletions h/static/styles/front-page/main.css

Large diffs are not rendered by default.

Loading

0 comments on commit a1ba8dc

Please sign in to comment.