diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-12-14 20:20:56 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-12-14 20:20:56 +0100 |
| commit | 245ce015f565da0626c70340d6e1710056245c52 (patch) | |
| tree | 124d8fb0921d29407264c367320fcd4bb00e9978 | |
| parent | 3a42fe7ad797a6f9cf747d2d358015ac992765a7 (diff) | |
css
| -rw-r--r-- | bucky-schema.sql | 2 | ||||
| -rw-r--r-- | public/assets/css/bucky.css | 26 | ||||
| -rw-r--r-- | public/assets/js/lib/views/index/index.js | 1 | ||||
| -rw-r--r-- | public/assets/js/lib/views/login/login.js | 1 | ||||
| -rw-r--r-- | public/assets/js/lib/views/login/signup.js | 1 | ||||
| -rw-r--r-- | public/assets/js/lib/views/profile/profile.js | 57 | ||||
| -rw-r--r-- | views/pages/profile.ejs | 2 | ||||
| -rw-r--r-- | views/partials/header.ejs | 2 |
8 files changed, 78 insertions, 14 deletions
diff --git a/bucky-schema.sql b/bucky-schema.sql index b6ec8d6..9095d66 100644 --- a/bucky-schema.sql +++ b/bucky-schema.sql @@ -188,7 +188,7 @@ CREATE TABLE `users` ( `lastseen` int(11) DEFAULT NULL, `phone` varchar(64) DEFAULT NULL, `location` varchar(64) DEFAULT NULL, - `twitter` varchar(255) DEFAULT NULL, + `twitter` varchar(256) DEFAULT NULL, `website` varchar(255) DEFAULT NULL, `avatar` varchar(255) DEFAULT NULL, `keywords` varchar(512) DEFAULT '', diff --git a/public/assets/css/bucky.css b/public/assets/css/bucky.css index c4792af..1b50fb2 100644 --- a/public/assets/css/bucky.css +++ b/public/assets/css/bucky.css @@ -832,9 +832,18 @@ pre br { line-height: 15px; padding: 20px; } -header .search_form { +.login header .search_form, +.signup header .search_form, +.index header .search_form { display: none; } +header .search_form { + float: right; + margin-top: 10px; +} +header .search_form input[type=text] { + width: 150px; +} /* PROFILE */ @@ -901,6 +910,17 @@ header .search_form { font-size: 16px; } +@media (min-width: 700px) and (max-width: 1000px) { + #sidebar { + display: none; + } + #content { + width: 100%; + } + .index header .search_form { + display: block; + } +} @media (max-width: 700px) { body { padding: 10px 10px; @@ -923,8 +943,10 @@ header .search_form { #sidebar .search_form { display: none; } - header .search_form { + header .search_form, + .index header .search_form { display: block; + margin-top: 0; } .search_form input[type='text'] { width: 250px; diff --git a/public/assets/js/lib/views/index/index.js b/public/assets/js/lib/views/index/index.js index 4e1a801..fdc7a29 100644 --- a/public/assets/js/lib/views/index/index.js +++ b/public/assets/js/lib/views/index/index.js @@ -25,6 +25,7 @@ var IndexView = View.extend({ this.threadbox.options.latest = true this.threadbox.options.welcome = true $.get(this.action, this.populate.bind(this)) + $("body").addClass("index") } }, diff --git a/public/assets/js/lib/views/login/login.js b/public/assets/js/lib/views/login/login.js index 0144006..6e810d6 100644 --- a/public/assets/js/lib/views/login/login.js +++ b/public/assets/js/lib/views/login/login.js @@ -8,6 +8,7 @@ var LoginView = FormView.extend({ this.__super__.initialize.call(this) $("body").removeClass("loading") this.$("[name=username]").focus() + $("body").addClass("login") }, showErrors: function(err){ diff --git a/public/assets/js/lib/views/login/signup.js b/public/assets/js/lib/views/login/signup.js index d3d407d..f37696f 100644 --- a/public/assets/js/lib/views/login/signup.js +++ b/public/assets/js/lib/views/login/signup.js @@ -8,6 +8,7 @@ var SignupView = FormView.extend({ this.__super__.initialize.call(this) $("body").removeClass("loading") this.$("[name=username]").focus() + $("body").addClass("signup") }, validate: function(){ diff --git a/public/assets/js/lib/views/profile/profile.js b/public/assets/js/lib/views/profile/profile.js index 1b3e496..077db4e 100644 --- a/public/assets/js/lib/views/profile/profile.js +++ b/public/assets/js/lib/views/profile/profile.js @@ -26,19 +26,58 @@ var ProfileView = View.extend({ $(".edit_profile").hide() } this.$("img").attr("src", profile_image(username)) - var fields = "username realname phone location".split(" ").map((key) => { + var fields = [ + ["username", "Username"], + ["realname", "Real Name"], + ["location", "Location"], + ["phone", "Phone"], + ].map(pair => { + var key = pair[0], label = pair[1] if (! user[key]) return; - var t = this.template.replace(/{{key}}/, sanitize(key)) - .replace(/{{value}}/, sanitize(user[key])) - $table.append(t) + return [key, sanitize(user[key])] }) - var fields = "firstseen lastseen".split(" ").map((key) => { + + if (user.email) { + fields.push([ + 'Email', + '<a href="mailto:' + sanitize(user.email) + '">' + sanitize(user.email) + '</a>' + ]) + } + if (user.twitter) { + if (user.twitter.match(/^http/)) { + var partz = user.twitter.split('/') + if (partz.length > 2) { + var handle = sanitize(partz[3]) + fields.push([ + 'Twitter', + '<a href="https://twitter.com/' + handle + '">@' + handle + '</a>' + ]) + } + } else { + var handle = sanitize(user.twitter) + fields.push([ + 'Twitter', + '<a href="https://twitter.com/' + handle + '">@' + handle + '</a>' + ]) + } + } + if (user.website) { + var websit = sanitize(user.website) + fields.push([ + 'Website', + '<a href="https://twitter.com/' + website + '">' + website + '</a>' + ]) + } + + fields = [ + ["firstseen", "First Seen"], + ["lastseen", "Last Seen"], + ].split(" ").map((key) => { + var key = pair[0], label = pair[1] if (! user[key]) return; var date = verbose_date(user[key]) - var t = this.template.replace(/{{key}}/, sanitize(key)) - .replace(/{{value}}/, date[0] + ' <small>' + date[1] + '</small>') - $table.append(t) - }) + return [key, date[0] + ' <small>' + date[1] + '</small>'] + }).concat(fields) var t = this.template.replace(/{{key}}/, " ") .replace(/{{value}}/, '<a href="/mail/compose/' + username + '">send ' + username + ' a message</a>') diff --git a/views/pages/profile.ejs b/views/pages/profile.ejs index 86c17f6..7cb7d87 100644 --- a/views/pages/profile.ejs +++ b/views/pages/profile.ejs @@ -9,7 +9,7 @@ <table> <script type="text/html" class="template"> <tr> - <td>{{key}}</td> + <td>{{label}}</td> <td>{{value}}</td> </tr> </script> diff --git a/views/partials/header.ejs b/views/partials/header.ejs index c810114..f31594b 100644 --- a/views/partials/header.ejs +++ b/views/partials/header.ejs @@ -10,7 +10,7 @@ <body class="loading"> <header> - <h1><%= title %></h1> <% include ../partials/searchform %> + <h1><%= title %></h1> </header> <content>
\ No newline at end of file |
