From cf480947d33bcbb9ff93a33a31c3fafc24da4fc9 Mon Sep 17 00:00:00 2001 From: Azareal Date: Wed, 1 Mar 2017 11:36:50 +0000 Subject: [PATCH] I'm still working on alerts. I've worked out the client-side UI for Cosmo, the UI will be tweaked for the other themes shortly. The client-side JS also now pulls the alerts from the server. The errors are now sent properly via JSON. The success JSON messages are now sent properly. Optimised the message for guests. Added the opthead class for adding a nice Cosmo specific enhancement. --- errors.go | 16 +-- general_test.go | 2 +- mod_routes.go | 12 +- mysql.go | 6 +- public/global.js | 61 +++++++++- reply.go | 2 +- routes.go | 26 ++++- template_forum.go | 4 - template_forums.go | 6 +- template_list.go | 10 +- template_profile.go | 4 - template_topic.go | 4 - template_topic_alt.go | 4 - template_topics.go | 4 - templates/forums.html | 3 + templates/menu.html | 5 +- themes/cosmo-conflux/public/main.css | 158 +++++++++++--------------- themes/cosmo/public/main.css | 133 ++++++++-------------- themes/tempra-conflux/public/main.css | 54 ++++++++- themes/tempra-simple/public/main.css | 49 ++++++++ 20 files changed, 332 insertions(+), 231 deletions(-) diff --git a/errors.go b/errors.go index 3b3c79e6..52aa61e6 100644 --- a/errors.go +++ b/errors.go @@ -36,14 +36,14 @@ func InternalErrorJSQ(err error, w http.ResponseWriter, r *http.Request, is_js s if is_js == "0" { w.Write(error_internal) } else { - w.Write([]byte(`{'errmsg': 'A problem has occured in the system.'}`)) + w.Write([]byte(`{"errmsg":"A problem has occured in the system."}`)) } log.Fatal(err) } func InternalErrorJS(err error, w http.ResponseWriter, r *http.Request) { w.WriteHeader(500) - w.Write([]byte(`{'errmsg': 'A problem has occured in the system.'}`)) + w.Write([]byte(`{"errmsg":"A problem has occured in the system."}`)) log.Fatal(err) } @@ -81,7 +81,7 @@ func PreErrorJSQ(errmsg string, w http.ResponseWriter, r *http.Request, is_js st templates.ExecuteTemplate(&b,"error.html", pi) fmt.Fprintln(w,b.String()) } else { - w.Write([]byte(`{'errmsg': '` + errmsg + `'}`)) + w.Write([]byte(`{"errmsg":"` + errmsg + `"}`)) } } @@ -93,7 +93,7 @@ func LocalErrorJSQ(errmsg string, w http.ResponseWriter, r *http.Request, user U templates.ExecuteTemplate(&b,"error.html", pi) fmt.Fprintln(w,b.String()) } else { - w.Write([]byte(`{'errmsg': '` + errmsg + `'}`)) + w.Write([]byte(`{"errmsg":"` + errmsg + `"}`)) } } @@ -119,7 +119,7 @@ func NoPermissionsJSQ(w http.ResponseWriter, r *http.Request, user User, is_js s templates.ExecuteTemplate(&b,"error.html", pi) fmt.Fprintln(w,b.String()) } else { - w.Write([]byte("{'errmsg': 'You don't have permission to do that.'}")) + w.Write([]byte(`{"errmsg":"You don't have permission to do that."}`)) } } @@ -139,7 +139,7 @@ func BannedJSQ(w http.ResponseWriter, r *http.Request, user User, is_js string) templates.ExecuteTemplate(&b,"error.html", pi) fmt.Fprintln(w,b.String()) } else { - w.Write([]byte("{'errmsg': 'You have been banned from this site.'}")) + w.Write([]byte(`{"errmsg":"You have been banned from this site."}`)) } } @@ -151,7 +151,7 @@ func LoginRequiredJSQ(w http.ResponseWriter, r *http.Request, user User, is_js s templates.ExecuteTemplate(&b,"error.html", pi) fmt.Fprintln(w,b.String()) } else { - w.Write([]byte("{'errmsg': 'You need to login to do that.'}")) + w.Write([]byte(`{"errmsg":"You need to login to do that."}`)) } } @@ -184,6 +184,6 @@ func CustomErrorJSQ(errmsg string, errcode int, errtitle string, w http.Response templates.ExecuteTemplate(&b,"error.html", pi) fmt.Fprintln(w,b.String()) } else { - w.Write([]byte(`{'errmsg': '` + errmsg + `'}`)) + w.Write([]byte(`{"errmsg":"` + errmsg + `"}`)) } } diff --git a/general_test.go b/general_test.go index b2900fd3..7ec9ec4e 100644 --- a/general_test.go +++ b/general_test.go @@ -1387,7 +1387,7 @@ func TestForumGuestRoute(t *testing.T) { } db = db_test alert_w := httptest.NewRecorder() - alert_req := httptest.NewRequest("get","/api/?action=get&module=alerts",bytes.NewReader(nil)) + alert_req := httptest.NewRequest("get","/api/?action=get&module=alerts&format=json",bytes.NewReader(nil)) alert_handler := http.HandlerFunc(route_api) //testdb.StubQuery() testdb.SetQueryFunc(func(query string) (result sql.Rows, err error) { diff --git a/mod_routes.go b/mod_routes.go index b1a74d99..fe6692d6 100644 --- a/mod_routes.go +++ b/mod_routes.go @@ -66,7 +66,7 @@ func route_edit_topic(w http.ResponseWriter, r *http.Request) { if is_js == "0" { http.Redirect(w,r,"/topic/" + strconv.Itoa(tid),http.StatusSeeOther) } else { - fmt.Fprintf(w,"{'success': '1'}") + fmt.Fprintf(w,`{"success":"1"}`) } } @@ -255,7 +255,7 @@ func route_reply_edit_submit(w http.ResponseWriter, r *http.Request) { if is_js == "0" { http.Redirect(w,r, "/topic/" + strconv.Itoa(tid) + "#reply-" + strconv.Itoa(rid), http.StatusSeeOther) } else { - fmt.Fprintf(w,"{'success': '1'}") + fmt.Fprintf(w,`{"success":"1"}`) } } @@ -316,7 +316,7 @@ func route_reply_delete_submit(w http.ResponseWriter, r *http.Request) { if is_js == "0" { //http.Redirect(w,r, "/topic/" + strconv.Itoa(tid), http.StatusSeeOther) } else { - fmt.Fprintf(w,"{'success': '1'}") + fmt.Fprintf(w,`{"success":"1"}`) } wcount := word_count(content) @@ -382,7 +382,7 @@ func route_profile_reply_edit_submit(w http.ResponseWriter, r *http.Request) { if is_js == "0" { http.Redirect(w,r, "/user/" + strconv.Itoa(uid) + "#reply-" + strconv.Itoa(rid), http.StatusSeeOther) } else { - fmt.Fprintf(w,"{'success': '1'}") + fmt.Fprintf(w,`{"success":"1"}`) } } @@ -433,7 +433,7 @@ func route_profile_reply_delete_submit(w http.ResponseWriter, r *http.Request) { if is_js == "0" { //http.Redirect(w,r, "/user/" + strconv.Itoa(uid), http.StatusSeeOther) } else { - fmt.Fprintf(w,"{'success': '1'}") + fmt.Fprintf(w,`{"success":"1"}`) } } @@ -878,7 +878,7 @@ func route_panel_forums_edit_submit(w http.ResponseWriter, r *http.Request) { if is_js == "0" { http.Redirect(w,r,"/panel/forums/",http.StatusSeeOther) } else { - fmt.Fprintf(w,"{'success': '1'}") + fmt.Fprintf(w,`{"success":"1"}`) } } diff --git a/mysql.go b/mysql.go index 922a8ef8..1c970743 100644 --- a/mysql.go +++ b/mysql.go @@ -19,7 +19,7 @@ var get_topic_stmt *sql.Stmt var get_topic_by_reply_stmt *sql.Stmt var get_topic_replies_stmt *sql.Stmt var get_topic_replies_offset_stmt *sql.Stmt -var get_post_stmt *sql.Stmt +var get_reply_stmt *sql.Stmt var get_forum_topics_stmt *sql.Stmt var get_forum_topics_offset_stmt *sql.Stmt var create_topic_stmt *sql.Stmt @@ -154,8 +154,8 @@ func init_database(err error) { log.Fatal(err) } - log.Print("Preparing get_post statement.") - get_post_stmt, err = db.Prepare("select content, createdBy, createdAt, lastEdit, lastEditBy, ipaddress, likeCount from replies where rid = ?") + log.Print("Preparing get_reply statement.") + get_reply_stmt, err = db.Prepare("select content, createdBy, createdAt, lastEdit, lastEditBy, ipaddress, likeCount from replies where rid = ?") if err != nil { log.Fatal(err) } diff --git a/public/global.js b/public/global.js index 1fea6ecf..3638e1c0 100644 --- a/public/global.js +++ b/public/global.js @@ -5,7 +5,7 @@ function post_link(event) event.preventDefault(); var form_action = $(event.target).closest('a').attr("href"); //console.log("Form Action: " + form_action); - $.ajax({ url: form_action, type: "POST", dataType: "json", data: { js: "1" } }); + $.ajax({ url: form_action, type: "POST", dataType: "json", data: {js: "1"} }); } $(document).ready(function(){ @@ -162,6 +162,65 @@ $(document).ready(function(){ } }); + $(".menu_alerts").click(function(event) { + if($(this).hasClass("selectedAlert")) return; + var menu_alerts = $(this); + + this.className += " selectedAlert"; + $.ajax({ + type: 'get', + dataType: 'json', + url:'/api/?action=get&module=alerts&format=json', + success: function(data) { + if("errmsg" in data) { + console.log(data.errmsg); + menu_alerts.find(".alertList").html("
"+data.errmsg+"
"); + return; + } + + var alist = ""; + for(var i in data.msgs) { + var msg = data.msgs[i]; + var mmsg = msg.msg; + + if("sub" in msg) { + for(var i = 0; i < msg.sub.length; i++) { + mmsg = mmsg.replace("\{"+i+"\}", msg.sub[i]); + console.log("Sub #" + i); + console.log(msg.sub[i]); + } + } + + if("avatar" in msg) { + alist += "
"+mmsg+"
"; + console.log(msg.avatar); + } else { + alist += "
"+mmsg+"
"; + } + console.log(msg); + console.log(mmsg); + } + + if(alist == "") { + alist = "
You don't have any alerts
" + } + menu_alerts.find(".alertList").html(alist); + }, + error: function(magic,theStatus,error) { + try { + var data = JSON.parse(magic.responseText); + if("errmsg" in data) + { + console.log(data.errmsg); + errtxt = data.errmsg; + } + else errtxt = "Unable to get the alerts" + } catch(e) { errtxt = "Unable to get the alerts"; } + menu_alerts.find(".alertList").html("
"+errtxt+"
"); + } + }); + }); + this.onkeyup = function(event){ if(event.which == 37) this.querySelectorAll("#prevFloat a")[0].click(); if(event.which == 39) this.querySelectorAll("#nextFloat a")[0].click(); diff --git a/reply.go b/reply.go index b567f141..86602ca2 100644 --- a/reply.go +++ b/reply.go @@ -45,6 +45,6 @@ type ReplyShort struct func get_reply(id int) (*ReplyShort, error) { reply := ReplyShort{ID:id} - err := get_post_stmt.QueryRow(id).Scan(&reply.Content, &reply.CreatedBy, &reply.CreatedAt, &reply.LastEdit, &reply.LastEditBy, &reply.IpAddress, &reply.LikeCount) + err := get_reply_stmt.QueryRow(id).Scan(&reply.Content, &reply.CreatedBy, &reply.CreatedAt, &reply.LastEdit, &reply.LastEditBy, &reply.IpAddress, &reply.LikeCount) return &reply, err } diff --git a/routes.go b/routes.go index b00af8c3..9bb7c54f 100644 --- a/routes.go +++ b/routes.go @@ -1606,10 +1606,14 @@ func route_register_submit(w http.ResponseWriter, r *http.Request) { http.Redirect(w,r, "/", http.StatusSeeOther) } +var phrase_login_alerts []byte = []byte(`{"msgs":[{"msg":"Login to see your alerts","path":"/accounts/login"}]}`) func route_api(w http.ResponseWriter, r *http.Request) { err := r.ParseForm() - is_js := r.PostFormValue("js") - if is_js == "" { + format := r.FormValue("format") + var is_js string + if format == "json" { + is_js = "1" + } else { // html is_js = "0" } if err != nil { @@ -1631,9 +1635,14 @@ func route_api(w http.ResponseWriter, r *http.Request) { module := r.FormValue("module") switch(module) { case "alerts": // A feed of events tailored for a specific user + if format != "json" { + PreError("You can only fetch alerts in the JSON format!",w,r) + return + } + w.Header().Set("Content-Type","application/json") if !user.Loggedin { - w.Write([]byte(`{"msgs":[{"msg":"Login to see your alerts","path":"/accounts/login"}]}`)) + w.Write(phrase_login_alerts) return } @@ -1675,7 +1684,7 @@ func route_api(w http.ResponseWriter, r *http.Request) { }*/ if event == "friend_invite" { - msglist += `{"msg":"You received a friend invite from {0}","sub":["` + actor.Name + `"],"path":"/user/`+strconv.Itoa(actor.ID)+`"},` + msglist += `{"msg":"You received a friend invite from {0}","sub":["` + actor.Name + `"],"path":"\/user\/`+strconv.Itoa(actor.ID)+`","avatar":"`+strings.Replace(actor.Avatar,"/","\\/",-1)+`"},` continue } @@ -1767,7 +1776,7 @@ func route_api(w http.ResponseWriter, r *http.Request) { } } - msglist += `{"msg":"{0} ` + start_frag + act + post_act + ` {1}` + end_frag + `","sub":["` + actor.Name + `","` + area + `"],"path":"` + url + `"},` + msglist += `{"msg":"{0} ` + start_frag + act + post_act + ` {1}` + end_frag + `","sub":["` + actor.Name + `","` + area + `"],"path":"` + url + `","avatar":"` + actor.Avatar + `"},` } err = rows.Err() @@ -1781,10 +1790,17 @@ func route_api(w http.ResponseWriter, r *http.Request) { msglist = msglist[0:len(msglist)-1] } w.Write([]byte(`{"msgs":[`+msglist+`]}`)) + //fmt.Println(`{"msgs":[`+msglist+`]}`) //case "topics": //case "forums": //case "users": //case "pages": + // This might not be possible. We might need .xml paths for sitemaps + /*case "sitemap": + if format != "xml" { + PreError("You can only fetch sitemaps in the XML format!",w,r) + return + }*/ default: PreErrorJSQ("Invalid Module",w,r,is_js) } diff --git a/template_forum.go b/template_forum.go index 383046b6..55a5e609 100644 --- a/template_forum.go +++ b/template_forum.go @@ -32,10 +32,6 @@ w.Write(menu_5) w.Write(menu_6) } w.Write(menu_7) -if !tmpl_forum_vars.CurrentUser.Loggedin { -w.Write(menu_8) -} -w.Write(menu_9) w.Write(header_3) if len(tmpl_forum_vars.NoticeList) != 0 { for _, item := range tmpl_forum_vars.NoticeList { diff --git a/template_forums.go b/template_forums.go index d8b4beb7..d912d703 100644 --- a/template_forums.go +++ b/template_forums.go @@ -1,7 +1,7 @@ /* This file was automatically generated by the software. Please don't edit it as your changes may be overwritten at any moment. */ package main -import "io" import "strconv" +import "io" func init() { template_forums_handle = template_forums @@ -32,10 +32,6 @@ w.Write(menu_5) w.Write(menu_6) } w.Write(menu_7) -if !tmpl_forums_vars.CurrentUser.Loggedin { -w.Write(menu_8) -} -w.Write(menu_9) w.Write(header_3) if len(tmpl_forums_vars.NoticeList) != 0 { for _, item := range tmpl_forums_vars.NoticeList { diff --git a/template_list.go b/template_list.go index 92f35c9a..ae8162f9 100644 --- a/template_list.go +++ b/template_list.go @@ -40,9 +40,10 @@ var menu_6 []byte = []byte(` `) var menu_7 []byte = []byte(` - + @@ -403,6 +404,9 @@ var profile_36 []byte = []byte(` `) var forums_0 []byte = []byte(` +
+ +
`) var forums_1 []byte = []byte(`
diff --git a/template_profile.go b/template_profile.go index 76525d1c..71e1c103 100644 --- a/template_profile.go +++ b/template_profile.go @@ -32,10 +32,6 @@ w.Write(menu_5) w.Write(menu_6) } w.Write(menu_7) -if !tmpl_profile_vars.CurrentUser.Loggedin { -w.Write(menu_8) -} -w.Write(menu_9) w.Write(header_3) if len(tmpl_profile_vars.NoticeList) != 0 { for _, item := range tmpl_profile_vars.NoticeList { diff --git a/template_topic.go b/template_topic.go index 1fb4187c..80201881 100644 --- a/template_topic.go +++ b/template_topic.go @@ -32,10 +32,6 @@ w.Write(menu_5) w.Write(menu_6) } w.Write(menu_7) -if !tmpl_topic_vars.CurrentUser.Loggedin { -w.Write(menu_8) -} -w.Write(menu_9) w.Write(header_3) if len(tmpl_topic_vars.NoticeList) != 0 { for _, item := range tmpl_topic_vars.NoticeList { diff --git a/template_topic_alt.go b/template_topic_alt.go index 15ecdb3d..c8518fc9 100644 --- a/template_topic_alt.go +++ b/template_topic_alt.go @@ -32,10 +32,6 @@ w.Write(menu_5) w.Write(menu_6) } w.Write(menu_7) -if !tmpl_topic_alt_vars.CurrentUser.Loggedin { -w.Write(menu_8) -} -w.Write(menu_9) w.Write(header_3) if len(tmpl_topic_alt_vars.NoticeList) != 0 { for _, item := range tmpl_topic_alt_vars.NoticeList { diff --git a/template_topics.go b/template_topics.go index d44be385..e42c7c91 100644 --- a/template_topics.go +++ b/template_topics.go @@ -32,10 +32,6 @@ w.Write(menu_5) w.Write(menu_6) } w.Write(menu_7) -if !tmpl_topics_vars.CurrentUser.Loggedin { -w.Write(menu_8) -} -w.Write(menu_9) w.Write(header_3) if len(tmpl_topics_vars.NoticeList) != 0 { for _, item := range tmpl_topics_vars.NoticeList { diff --git a/templates/forums.html b/templates/forums.html index b4a85967..261cfee7 100644 --- a/templates/forums.html +++ b/templates/forums.html @@ -1,4 +1,7 @@ {{template "header.html" . }} +
+ +
{{range .ItemList}}
{{.Name}} diff --git a/templates/menu.html b/templates/menu.html index 4bda3987..4120edbe 100644 --- a/templates/menu.html +++ b/templates/menu.html @@ -15,7 +15,10 @@ {{end}} - +
diff --git a/themes/cosmo-conflux/public/main.css b/themes/cosmo-conflux/public/main.css index 600700a0..2e12aadd 100644 --- a/themes/cosmo-conflux/public/main.css +++ b/themes/cosmo-conflux/public/main.css @@ -87,17 +87,76 @@ li:hover padding-right: 10px; height: 38px; text-align: center; + border-left: 1px solid #7a7a7a; } -.menu_right:hover -{ - border: #282828 1px solid; - background: #282828; - padding-left: 10px; - padding-right: 10px; - height: 38px; +.menu_alerts .alert_counter { + position: relative; + font-size: 9px; + top: -24px; + background-color: rgb(140,0,0); + color: white; + padding: 3px; + width: 14px; + left: 10px; + line-height: 8px; + border-radius: 20px; + padding-top: 2.5px; + height: 14px; + opacity: 0.8; text-align: center; } +.menu_alerts .alert_counter:empty { + display: none; +} + +.selectedAlert { + background: white; + color: black; +} +.selectedAlert:hover { + background: white; + color: black; +} +.menu_alerts .alertList { + display: none; +} +.selectedAlert .alertList { + position: absolute; + top: 41px; + display: block; + background: white; + font-size: 10px; + line-height: 16px; + width: 135px; + right: -15px; + border-top: 1px solid #ccc; + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; +} +.alertItem { + padding: 8px; + overflow: hidden; + text-overflow: ellipsis; +} +.alertItem.withAvatar { + /*background-image: url('/uploads/avatar_1.jpg');*/ + background-size: auto 56px; + background-repeat: no-repeat; + text-align: right; + padding-right: 12px; + height: 46px; +} +.alertItem.withAvatar:not(:last-child) { + border-bottom: 1px solid rgb(230,230,230); +} +.alertItem.withAvatar .text { + overflow: hidden; + text-overflow: ellipsis; + float: right; + width: calc(100% - 20px); + height: 30px; +} #footer { @@ -626,18 +685,7 @@ blockquote p .options:last-child { border-left: 1px solid rgba(100,100,110,0.75); } .right_most { margin-right: 10%; border-right: 1px solid rgba(100,100,110,0.75); } - #alertFeed { background: url('../../images/bell.png') no-repeat center center / 24px, rgba(30,30,30,0.75); } - #alertFeed:hover { background: url('../../images/bell.png') no-repeat center center / 24px, rgba(90, 90, 90, 0.4); } - #mailFeed { background: url('../../images/mail.png') no-repeat center center / 24px, rgba(30,30,30,0.75); } - #mailFeed:hover { background: url('../../images/mail.png') no-repeat center center / 24px, rgba(90, 90, 90, 0.4); } - #awardFeed { background: url('../../images/emblem.png') no-repeat center center / 24px, rgba(30,30,30,0.75); } - #awardFeed:hover { background: url('../../images/emblem.png') no-repeat center center / 24px, rgba(90, 90, 90, 0.4); } - - .selectedAlert { background: url('../../images/bell.png') no-repeat center center / 24px, rgba(250,250,250, 1) !important; } - .selectedMail { background: url('../../images/mail.png') no-repeat center center / 24px, rgba(250,250,250, 1) !important; } - .selectedAward { background: url('../../images/emblem.png') no-repeat center center / 24px, rgba(250,250,250, 1) !important; } - - .options > .counter + /*.options > .counter { background: red; border-radius: 5px; @@ -651,77 +699,7 @@ blockquote p position: absolute; right: 0px; - } - - .options > .alertList - { - display: none; - position: absolute; - display: block; - width: 250px; - left: -250%; - top: 40px; - opacity: 0; - visibility: hidden; - overflow: hidden; - - background: rgba(250,250,250,1); - word-wrap: none; - box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); - padding: 0px; - z-index: 50; - } - - .options > .alertList > h2 - { - font-weight: normal; - padding-top: 10px; - padding-left: 0px; - padding-right: 0px; - padding-bottom: 0px; - margin-left: 10px; - margin-top: 0px; - margin-right: 0px; - margin-bottom: 5px; - font-size: 20px; - line-height: 30px; - border: none; - } - - .options > .alertList > hr - { - border: 0.5px solid rgba(220,220,220,1); - width: 100%; - margin: 0px; - padding: 0px; - } - - .options > .alertList > .alertItem - { - display: block; - font-size: 13px; - margin-left: 0px; - margin-top: 0px; - margin-right: 0px; - margin-bottom: 3px; - padding-top: 10px; - padding-bottom: 10px; - padding-left: 10px; - padding-right: 0px; - overflow: hidden; - - border-bottom: 1px solid rgb(220, 220, 220); - } - - .options > .alertList > .alertItem:last-child { border: none; } - .options > .alertList > .alertItem > a { color: rgba(25,25,25,1); } - - .options > .alertList > .alertItem > .alertAvatar - { - float: left; - border-radius: 3px; - margin-right: 2px; - } + }*/ } @media (max-width: 800px) diff --git a/themes/cosmo/public/main.css b/themes/cosmo/public/main.css index 78dc2468..510f1907 100644 --- a/themes/cosmo/public/main.css +++ b/themes/cosmo/public/main.css @@ -99,6 +99,54 @@ li:hover display: none; } +.selectedAlert { + background: white; + color: black; +} +.selectedAlert:hover { + background: white; + color: black; +} +.menu_alerts .alertList { + display: none; +} +.selectedAlert .alertList { + position: absolute; + top: 41px; + display: block; + background: white; + font-size: 10px; + line-height: 16px; + width: 135px; + right: -15px; + border-top: 1px solid #ccc; + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; +} +.alertItem { + padding: 8px; + overflow: hidden; + text-overflow: ellipsis; +} +.alertItem.withAvatar { + /*background-image: url('/uploads/avatar_1.jpg');*/ + background-size: auto 56px; + background-repeat: no-repeat; + text-align: right; + padding-right: 12px; + height: 46px; +} +.alertItem.withAvatar:not(:last-child) { + border-bottom: 1px solid rgb(230,230,230); +} +.alertItem.withAvatar .text { + overflow: hidden; + text-overflow: ellipsis; + float: right; + width: calc(100% - 20px); + height: 30px; +} + #footer { clear: left; @@ -672,18 +720,7 @@ blockquote p .options:last-child { border-left: 1px solid rgba(100,100,110,0.75); } .right_most { margin-right: 10%; border-right: 1px solid rgba(100,100,110,0.75); } - #alertFeed { background: url('../../images/bell.png') no-repeat center center / 24px, rgba(30,30,30,0.75); } - #alertFeed:hover { background: url('../../images/bell.png') no-repeat center center / 24px, rgba(90, 90, 90, 0.4); } - #mailFeed { background: url('../../images/mail.png') no-repeat center center / 24px, rgba(30,30,30,0.75); } - #mailFeed:hover { background: url('../../images/mail.png') no-repeat center center / 24px, rgba(90, 90, 90, 0.4); } - #awardFeed { background: url('../../images/emblem.png') no-repeat center center / 24px, rgba(30,30,30,0.75); } - #awardFeed:hover { background: url('../../images/emblem.png') no-repeat center center / 24px, rgba(90, 90, 90, 0.4); } - - .selectedAlert { background: url('../../images/bell.png') no-repeat center center / 24px, rgba(250,250,250, 1) !important; } - .selectedMail { background: url('../../images/mail.png') no-repeat center center / 24px, rgba(250,250,250, 1) !important; } - .selectedAward { background: url('../../images/emblem.png') no-repeat center center / 24px, rgba(250,250,250, 1) !important; } - - .options > .counter + /*.options > .counter { background: red; border-radius: 5px; @@ -697,77 +734,7 @@ blockquote p position: absolute; right: 0px; - } - - .options > .alertList - { - display: none; - position: absolute; - display: block; - width: 250px; - left: -250%; - top: 40px; - opacity: 0; - visibility: hidden; - overflow: hidden; - - background: rgba(250,250,250,1); - word-wrap: none; - box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); - padding: 0px; - z-index: 50; - } - - .options > .alertList > h2 - { - font-weight: normal; - padding-top: 10px; - padding-left: 0px; - padding-right: 0px; - padding-bottom: 0px; - margin-left: 10px; - margin-top: 0px; - margin-right: 0px; - margin-bottom: 5px; - font-size: 20px; - line-height: 30px; - border: none; - } - - .options > .alertList > hr - { - border: 0.5px solid rgba(220,220,220,1); - width: 100%; - margin: 0px; - padding: 0px; - } - - .options > .alertList > .alertItem - { - display: block; - font-size: 13px; - margin-left: 0px; - margin-top: 0px; - margin-right: 0px; - margin-bottom: 3px; - padding-top: 10px; - padding-bottom: 10px; - padding-left: 10px; - padding-right: 0px; - overflow: hidden; - - border-bottom: 1px solid rgb(220, 220, 220); - } - - .options > .alertList > .alertItem:last-child { border: none; } - .options > .alertList > .alertItem > a { color: rgba(25,25,25,1); } - - .options > .alertList > .alertItem > .alertAvatar - { - float: left; - border-radius: 3px; - margin-right: 2px; - } + }*/ } @media (max-width: 800px) diff --git a/themes/tempra-conflux/public/main.css b/themes/tempra-conflux/public/main.css index 359d3539..c940f343 100644 --- a/themes/tempra-conflux/public/main.css +++ b/themes/tempra-conflux/public/main.css @@ -82,6 +82,54 @@ li a display: none; } +.selectedAlert { + background: white; + color: black; +} +.selectedAlert:hover { + background: white; + color: black; +} +.menu_alerts .alertList { + display: none; +} +.selectedAlert .alertList { + position: absolute; + top: 41px; + display: block; + background: white; + font-size: 10px; + line-height: 16px; + width: 135px; + right: -15px; + border-top: 1px solid #ccc; + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; +} +.alertItem { + padding: 8px; + overflow: hidden; + text-overflow: ellipsis; +} +.alertItem.withAvatar { + /*background-image: url('/uploads/avatar_1.jpg');*/ + background-size: auto 56px; + background-repeat: no-repeat; + text-align: right; + padding-right: 12px; + height: 46px; +} +.alertItem.withAvatar:not(:last-child) { + border-bottom: 1px solid rgb(230,230,230); +} +.alertItem.withAvatar .text { + overflow: hidden; + text-overflow: ellipsis; + float: right; + width: calc(100% - 20px); + height: 30px; +} + .container { width: 90%; @@ -154,10 +202,8 @@ li a text-decoration: none; color: black; } -.rowitem a:hover -{ - color: silver; -} +.rowitem a:hover { color: silver; } +.opthead { display: none; } .col_left { diff --git a/themes/tempra-simple/public/main.css b/themes/tempra-simple/public/main.css index 05dc82be..47336c79 100644 --- a/themes/tempra-simple/public/main.css +++ b/themes/tempra-simple/public/main.css @@ -80,6 +80,54 @@ li a display: none; } +.selectedAlert { + background: white; + color: black; +} +.selectedAlert:hover { + background: white; + color: black; +} +.menu_alerts .alertList { + display: none; +} +.selectedAlert .alertList { + position: absolute; + top: 41px; + display: block; + background: white; + font-size: 10px; + line-height: 16px; + width: 135px; + right: -15px; + border-top: 1px solid #ccc; + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; +} +.alertItem { + padding: 8px; + overflow: hidden; + text-overflow: ellipsis; +} +.alertItem.withAvatar { + /*background-image: url('/uploads/avatar_1.jpg');*/ + background-size: auto 56px; + background-repeat: no-repeat; + text-align: right; + padding-right: 12px; + height: 46px; +} +.alertItem.withAvatar:not(:last-child) { + border-bottom: 1px solid rgb(230,230,230); +} +.alertItem.withAvatar .text { + overflow: hidden; + text-overflow: ellipsis; + float: right; + width: calc(100% - 20px); + height: 30px; +} + .container { width: 90%; @@ -144,6 +192,7 @@ li a color: black; } .rowitem a:hover { color: silver; } +.opthead { display: none; } .col_left {