# HG changeset patch # User Ludovic Chabant # Date 1391012372 28800 # Node ID 1e67c488240a6190df225bd35ad4fa1f51b49e63 # Parent 528778a7421f2a577f16eb7f9b2c422882db1e14 Frontend fixes: - page titles - alerts - login and 404 pages diff -r 528778a7421f -r 1e67c488240a wikked/assets/css/wikked/alerts.less --- a/wikked/assets/css/wikked/alerts.less Wed Jan 29 08:18:46 2014 -0800 +++ b/wikked/assets/css/wikked/alerts.less Wed Jan 29 08:19:32 2014 -0800 @@ -1,21 +1,3 @@ - -.tooltip { - font-size: @font-size-base*0.75; -} -.alert { - font-size: @font-size-small; -} - -// Page alerts -article .alert { - float: right; - margin-left: -100%; - position: relative; - width: 50%; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; -} // Corner ribbon .makeRibbon(@bgColor) { diff -r 528778a7421f -r 1e67c488240a wikked/assets/js/wikked.js --- a/wikked/assets/js/wikked.js Wed Jan 29 08:18:46 2014 -0800 +++ b/wikked/assets/js/wikked.js Wed Jan 29 08:19:32 2014 -0800 @@ -14,6 +14,7 @@ text: 'js/text', bootstrap_modal: 'bootstrap/js/modal', bootstrap_tooltip: 'bootstrap/js/tooltip', + bootstrap_alert: 'bootstrap/js/alert', bootstrap_collapse: 'bootstrap/js/collapse' }, shim: { diff -r 528778a7421f -r 1e67c488240a wikked/assets/js/wikked/models.js --- a/wikked/assets/js/wikked/models.js Wed Jan 29 08:18:46 2014 -0800 +++ b/wikked/assets/js/wikked/models.js Wed Jan 29 08:19:32 2014 -0800 @@ -54,6 +54,9 @@ doSearch: function(form) { this.navigate('/search/' + $(form.q).val(), { trigger: true }); }, + doNewPage: function(form) { + this.navigate('/edit/', { trigger: true }); + }, _onChangePath: function(path) { this.set({ url_home: '/', @@ -114,6 +117,7 @@ }); var LoginModel = exports.LoginModel = Backbone.Model.extend({ + title: 'Login', setApp: function(app) { this.app = app; }, diff -r 528778a7421f -r 1e67c488240a wikked/assets/js/wikked/views.js --- a/wikked/assets/js/wikked/views.js Wed Jan 29 08:18:46 2014 -0800 +++ b/wikked/assets/js/wikked/views.js Wed Jan 29 08:19:32 2014 -0800 @@ -7,6 +7,7 @@ 'backbone', 'handlebars', 'bootstrap_tooltip', + 'bootstrap_alert', 'bootstrap_collapse', 'js/wikked/client', 'js/wikked/models', @@ -31,7 +32,7 @@ 'text!tpl/special-changes.html', 'text!tpl/special-orphans.html' ], - function($, _, Backbone, Handlebars, BootstrapTooltip, BootstrapCollapse, Client, Models, Util, + function($, _, Backbone, Handlebars, BootstrapTooltip, BootstrapAlert, BootstrapCollapse, Client, Models, Util, tplReadPage, tplMetaPage, tplEditPage, tplHistoryPage, tplRevisionPage, tplDiffPage, tplInLinksPage, tplNav, tplFooter, tplSearchResults, tplLogin, tplErrorNotAuthorized, tplErrorNotFound, tplErrorUnauthorizedEdit, tplStateWarning, @@ -127,7 +128,7 @@ this.$el.html(tpl(this.model.toJSON())); }, renderTitle: function(formatter) { - var title = _.result(this, 'title'); + var title = _.result(this.model, 'title'); if (formatter !== undefined) { title = formatter.call(this, title); } @@ -154,6 +155,7 @@ }, events: { "submit #search": "_submitSearch", + "submit #newpage": "_submitNewPage", "input #search-query": "_previewSearch", "keyup #search-query": "_searchQueryChanged" }, @@ -162,6 +164,11 @@ this.model.doSearch(e.currentTarget); return false; }, + _submitNewPage: function(e) { + e.preventDefault(); + this.model.doNewPage(e.currentTarget); + return false; + }, _previewSearch: function(e) { var query = $(e.currentTarget).val(); if (query && query.length >= 3) { diff -r 528778a7421f -r 1e67c488240a wikked/assets/tpl/404.html --- a/wikked/assets/tpl/404.html Wed Jan 29 08:18:46 2014 -0800 +++ b/wikked/assets/tpl/404.html Wed Jan 29 08:19:32 2014 -0800 @@ -1,9 +1,10 @@ - +

Page Not Found

diff -r 528778a7421f -r 1e67c488240a wikked/assets/tpl/login.html --- a/wikked/assets/tpl/login.html Wed Jan 29 08:18:46 2014 -0800 +++ b/wikked/assets/tpl/login.html Wed Jan 29 08:19:32 2014 -0800 @@ -1,20 +1,22 @@ - +

Login

{{#if has_error}} -
+
+ Begone! Those credentials don't seem to work here.
{{/if}}
-
-
diff -r 528778a7421f -r 1e67c488240a wikked/assets/tpl/nav.html --- a/wikked/assets/tpl/nav.html Wed Jan 29 08:18:46 2014 -0800 +++ b/wikked/assets/tpl/nav.html Wed Jan 29 08:19:32 2014 -0800 @@ -31,5 +31,10 @@
  • Login
  • {{/if}} +