diff options
-rw-r--r-- | askbot/forms.py | 6 | ||||
-rw-r--r-- | askbot/media/js/live_search.js | 4 | ||||
-rw-r--r-- | askbot/media/style/style.less | 409 | ||||
-rw-r--r-- | askbot/templates/answer_edit.html | 2 | ||||
-rw-r--r-- | askbot/templates/base.html | 1 | ||||
-rw-r--r-- | askbot/templates/widgets/edit_post.html | 2 | ||||
-rw-r--r-- | askbot/templates/widgets/scope_nav.html | 2 | ||||
-rw-r--r-- | askbot/templates/widgets/search_bar.html | 25 | ||||
-rw-r--r-- | askbot/templates/widgets/secondary_header.html | 45 | ||||
-rw-r--r-- | askbot/templates/widgets/user_navigation.html | 6 |
10 files changed, 316 insertions, 186 deletions
diff --git a/askbot/forms.py b/askbot/forms.py index ed47e20e..55d864c3 100644 --- a/askbot/forms.py +++ b/askbot/forms.py @@ -1156,11 +1156,7 @@ class RevisionForm(forms.Form): """ Lists revisions of a Question or Answer """ - revision = forms.ChoiceField( - widget=forms.Select( - attrs={'style': 'width:520px'} - ) - ) + revision = forms.ChoiceField(widget=forms.Select()) def __init__(self, post, latest_revision, *args, **kwargs): super(RevisionForm, self).__init__(*args, **kwargs) diff --git a/askbot/media/js/live_search.js b/askbot/media/js/live_search.js index f7d89c2a..eb3f52c5 100644 --- a/askbot/media/js/live_search.js +++ b/askbot/media/js/live_search.js @@ -127,12 +127,12 @@ var liveSearch = function(query_string) { var refresh_x_button = function(){ if(query_val().length > 0){ if (query.hasClass('searchInput')){ - query.attr('class', 'searchInputCancelable'); + $('#searchBar').attr('class', 'cancelable'); x_button.show(); } } else { x_button.hide(); - query.attr('class', 'searchInput'); + $('#searchBar').removeClass('cancelable'); } }; diff --git a/askbot/media/style/style.less b/askbot/media/style/style.less index 69f4daf7..379879ba 100644 --- a/askbot/media/style/style.less +++ b/askbot/media/style/style.less @@ -395,45 +395,37 @@ body.user-messages { border-top:#fcfcfc 1px solid; margin-bottom:10px; font-family:@main-font; +} - #homeButton{ - border-right:#afaf9e 1px solid; - .sprites(-6px,-36px); - height:55px; - width:43px; - display:block; - float:left; - } +#homeButton{ + border-right: #afaf9e 1px solid; + .sprites(-6px,-36px); + height:55px; + width:43px; + display:block; + float:left; +} - #homeButton:hover{ - .sprites(-6px-45,-36px); - } - - #scopeWrapper{ - width:688px; - float:left; - - a{ - display:block; - float:left; - } +#homeButton:hover{ + .sprites(-51px,-36px); +} - .scope-selector{ - font-size:20px; - color:#7a7a6b; - height:55px; - line-height:55px; - margin-left:16px - } +.scope-selector { + display:block; + float:left; + font-size:20px; + color:#7a7a6b; + height:55px; + line-height:55px; + margin-left:16px +} - .on{ - background:url(../images/scopearrow.png) no-repeat center bottom; - } +.scope-selector.on { + background:url(../images/scopearrow.png) no-repeat center bottom; +} - .ask-message{ - font-size:24px; - } - } +.scope-selector.ask-message { + font-size:24px; } .validate-email-page { @@ -456,90 +448,69 @@ body.user-messages { } #searchBar { /* Main search form , check widgets/search_bar.html */ - display: inline-block; + display: block; background-color: #fff; - width: 400px; border: 1px solid #c9c9b5; - float:right; height:42px; - margin:6px 0px 0px 15px; - .searchInput, .searchInputCancelable{ - font-size: 26px; - height: 39px; - line-height: 39px; + input.searchInput { + font-size: 22px; + height: 26px; + line-height: 26px; font-weight:300; background:#FFF; border:0px; color:#484848; - padding-left:10px; - padding-top: 1px; font-family:@body-font; - vertical-align: top; - } - - .searchInput,{ - width: 340px; - } - - .searchInputCancelable { - width: 305px; - } - - .logoutsearch { - width: 337px; - } - - .searchBtn { - font-size: 10px; - color: #666; - background-color: #eee; - height: 42px; - border:#FFF 1px solid; - line-height: 22px; - text-align: center; - float:right; - margin: 0px; - width:48px; - .sprites(-98px,-36px); - cursor:pointer; - } - - .searchBtn:hover { - .sprites(-98px-48,-36px); - } - - .cancelSearchBtn { - font-size: 30px; - color: #ce8888; - background:#fff; - height: 42px; - line-height: 42px; - border:0px; - border-left:#deded0 1px solid; - text-align: center; - width: 35px; - cursor:pointer; + width: 100%; + margin: 8px 0 6px 0; + padding: 0; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; } +} - .cancelSearchBtn:hover { - color: #d84040; - } +input[type="submit"].searchBtn { + font-size: 10px; + color: #666; + background-color: #eee; + height: 42px; + border:#FFF 1px solid; + line-height: 22px; + text-align: center; + float:right; + margin: 7px 28px 0 0; + width: 48px; + .sprites(-98px,-36px); + cursor:pointer; +} +.ask-page input[type="submit"].searchBtn { + display: none; } -body.anon { - #searchBar { - width: 500px; - .searchInput { - width: 435px; - } +.searchBtn:hover { + .sprites(-98px-48,-36px); +} - .searchInputCancelable { - width: 405px; - } - } +.cancelSearchBtn { + font-size: 30px; + color: #ce8888; + background:#fff; + height: 42px; + line-height: 42px; + border:0px; + border-left:#deded0 1px solid; + text-align: center; + width: 35px; + cursor:pointer; + float: right; + margin-top: 7px; } +.cancelSearchBtn:hover { + color: #d84040; +} #askButton{ /* check blocks/secondary_header.html and widgets/ask_button.html*/ line-height:44px; @@ -554,6 +525,25 @@ body.anon { .button-style-hover; } +/* + Put the secondary navigation together: + 1) raise the search bar by 55px + 2) add padding to fit the buttons +*/ +#searchBar { + margin: 0 228px 0 327px; + width: auto; + margin-top: -49px; + padding: 0 49px 0 8px; +} +body.anon #searchBar { + margin-left: 227px;/* we don't have the "followed" scope */ +} +#searchBar.cancelable { + padding-right: 82px; +} + + /* ----- Content layout, check two_column_body.html or one_column_body.html ----- */ #ContentLeft { @@ -1423,10 +1413,11 @@ ul#related-tags li { #askFormBar { display:inline-block; - padding: 4px 7px 0px 0px; + padding: 4px 0 0 0; margin-top:0px; + width: 100%; - p{ + p { margin:0 0 5px 0; font-size:14px; color:@info-text-dark; @@ -1436,10 +1427,10 @@ ul#related-tags li { font-size: 24px; height: 36px; line-height: 36px; - margin: 0px; - padding: 0px 0 0 5px; + margin: 0; + padding: 0;/*-left: 5px;*/ border:#cce6ec 3px solid; - width:719px; + width: 100%;/*719px;*/ } } @@ -1483,11 +1474,13 @@ ul#related-tags li { } #id_tags { - border:#cce6ec 3px solid; - height:25px; - padding-left:5px; - font-size:14px; - width:395px; + box-sizing: border-box; + border: #cce6ec 3px solid; + height: 31px; + padding-left: 5px; + font-size: 14px; + width: 100%; + max-width: 395px; } } @@ -1646,9 +1639,14 @@ ul#related-tags li { .edit-answer-page { .wmd-container { width: 723px; + width: 100%; } #editor { - width: 710px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 100%; + height: 100%; padding: 6px; } .retagger-buttons { @@ -1784,6 +1782,7 @@ ul#related-tags li { font-size:14px; margin-top:5px; margin-bottom:5px; + width: 100%; } #id_title{ font-size: 24px; @@ -1792,7 +1791,7 @@ ul#related-tags li { margin: 0px; padding: 0px 0 0 5px; border:#cce6ec 3px solid; - width: 719px; + width: 100%; margin-bottom:10px; } #id_summary{ @@ -1838,7 +1837,7 @@ ul#related-tags li { vertical-align: top; } - .question-content{ + .question-content { float:right; width:682px; margin-bottom:10px; @@ -2511,7 +2510,10 @@ ul#related-tags li { form{ margin-bottom:15px; } - input[type="text"],input[type="password"],select{ + + input[type="text"], + input[type="password"], + select{ border:#cce6ec 3px solid; height:25px; line-height: 25px; @@ -3756,24 +3758,12 @@ pre.prettyprint { clear:both;padding: 3px; border: 0px solid #888; } /* language-specific fixes */ body.lang-es { #searchBar { - width: 398px; - .searchInput { - width: 337px; - } - .searchInputCancelable { - width: 302px; - } + /* need special left padding */ } } body.anon.lang-es { #searchBar { - width: 485px; - .searchInput { - width: 425px; - } - .searchInputCancelable { - width: 390px; - } + /* need special left padding */ } } @@ -4007,6 +3997,12 @@ textarea.tipped-input { /* modifications for small screens */ @media screen and (max-width: 960px) {/* content margins touch viewport */ + #homeButton { + .sprites(1px,-36px); + } + #homeButton:hover { + .sprites(-44px,-36px); + } } @media screen and (max-width: 480px) { .content-wrapper { @@ -4018,27 +4014,150 @@ textarea.tipped-input { #ContentLeft { width: 100%; } - #secondaryHeader #scopeWrapper { + .main-page h1, + #askButton, + #metaNav #navBadges, + .user-info, + .copyright, + .counts .views, + .counts .votes, + .help, + .rss, + .scope-selector, + .settings, + .tabBar, + .tags, + .userinfo, + .widgets { display: none; } - #askButton { - display: block; - float: none; - margin: auto; - margin-top: 5px; + + .ask-page, + .edit-question-page { + input[type="submit"].searchBtn { + display: none; + } } - #homeButton { + + .ask-page, + .edit-answer-page, + .edit-question-page { + .preview-toggle, + .proxy-user-info, + .answer-options, + .question-options, + .revision-comment, + .wmd-preview, + #wmd-hr-button, + #wmd-heading-button { + display: none; + } + } + + .edit-answer-page, + .edit-question-page { + label[for="id_title"], + label[for="id_revision"], + #id_revision { + display: none; + } + #fmedit #id_title { + margin: 15px 0 0 0; + } } - .main-page { - h1, - .counts .views, - .counts .votes, - .rss, - .tabBar, - .tags, - .userinfo { + + .question-page { + .comment-votes { display: none; } + .comments { + form.post-comments { + margin: 0 10px 0 0; + } + .comment .comment-body { + margin-left: 5px; + } + } + .post-update-info-container { + float: none; + width: 100%; + } + .post-update-info { + float: none; + margin-left: 0; + width: 100%-5; + + br, + .badge1, + .badge2, + .badge3, + .gravatar, + .reputation-score, + .badge-count { + display: none; + } + } + .question-content, + ul.post-retag input { + width: 100%-12; + } + .answer-table, + #question-table { + width: 100%-15; + } + } + + .users-page { + .userList td { + display: block; + width: 100%; + .user { + width: 100%; + } + } + } + + .user-profile-page { + td { + display: block; + } + } + + .footer-links, + .powered-link { + text-align: center; + width: 100%; + } + + #userToolsNav { + margin-left: 10px; + } + + #metaNav { + float: left; + a#navUsers, + a#navTags, + a#navGroups { + background: none; + color: #d0e296; + font-size: 16px; + text-decoration: underline; + margin-left: 20px; + padding-left: 0; + } + } + .powered-link { + margin-bottom: 15px; + } + .short-summary:first-child { + padding-top: 0; + } + #searchBar, + body.anon #searchBar { + margin: -49px 8px 0 52px; + } + input[type="submit"].searchBtn { + margin-right: 8px; } .short-summary { width: 100%; diff --git a/askbot/templates/answer_edit.html b/askbot/templates/answer_edit.html index 20c0684d..887714cb 100644 --- a/askbot/templates/answer_edit.html +++ b/askbot/templates/answer_edit.html @@ -25,6 +25,7 @@ editor_type = settings.EDITOR_TYPE ) }} + <div class="answer-options"> {% if settings.WIKI_ON and answer.wiki == False %} {{ macros.checkbox_in_div(form.wiki) }} {% endif %} @@ -34,6 +35,7 @@ %} {{ macros.checkbox_in_div(form.post_privately) }} {% endif %} + </div> <div class="after-editor"> <input id="edit_post_form_submit_button" type="submit" value="{% trans %}Save edit{% endtrans %}" class="submit" /> <input type="button" value="{% trans %}Cancel{% endtrans %}" class="submit" onclick="history.back(-1);" /> diff --git a/askbot/templates/base.html b/askbot/templates/base.html index 63d7115f..ffe3bf84 100644 --- a/askbot/templates/base.html +++ b/askbot/templates/base.html @@ -9,6 +9,7 @@ <meta name="keywords" content="{%block keywords%}{%endblock%},{{settings.APP_KEYWORDS|escape}}" /> {% if settings.GOOGLE_SITEMAP_CODE %} <meta name="google-site-verification" content="{{settings.GOOGLE_SITEMAP_CODE}}" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> {% endif %} <link rel="shortcut icon" href="{{ settings.SITE_FAVICON|media }}" /> {% block before_css %}{% endblock %} diff --git a/askbot/templates/widgets/edit_post.html b/askbot/templates/widgets/edit_post.html index b9bfa1e3..57770570 100644 --- a/askbot/templates/widgets/edit_post.html +++ b/askbot/templates/widgets/edit_post.html @@ -64,7 +64,7 @@ </div> {% endif %} {% if 'summary' in post_form['fields'] %} - <div class="form-item"> + <div class="form-item revision-comment"> <strong>{{ post_form.summary.label_tag() }}</strong> <br/> {{ post_form.summary }} <div class="title-desc"> diff --git a/askbot/templates/widgets/scope_nav.html b/askbot/templates/widgets/scope_nav.html index a6bda630..b68d899c 100644 --- a/askbot/templates/widgets/scope_nav.html +++ b/askbot/templates/widgets/scope_nav.html @@ -1,3 +1,4 @@ +<div id="scopeNav"> {% if active_tab != "ask" %} {% if not search_state %} {# get empty SearchState() if there's none #} {% set search_state=search_state|get_empty_search_state %} @@ -13,3 +14,4 @@ {% else %} <div class="scope-selector ask-message">{% trans %}Please ask your question here{% endtrans %}</div> {% endif %} +</div> diff --git a/askbot/templates/widgets/search_bar.html b/askbot/templates/widgets/search_bar.html index 59c4fd58..8c485c73 100644 --- a/askbot/templates/widgets/search_bar.html +++ b/askbot/templates/widgets/search_bar.html @@ -1,17 +1,7 @@ {% if active_tab != "ask" %} {% spaceless %} -<div id="searchBar"> +<div id="searchBar" {% if query %}class="cancelable"{% endif %}> {# url action depends on which tab is active #} - <form - {% if active_tab == "tags" %} - action="{% url tags %}" - {% elif active_tab == "users" %} - action="{% url users %}" - {% else %} - action="{% url questions %}" id="searchForm" - {% endif %} - method="get"> - <input type="submit" value="" name="search" class="searchBtn" /> {% if active_tab == "tags" %} <input type="hidden" name="t" value="tag"/> {% else %} @@ -21,26 +11,13 @@ {% endif %} {# class was searchInput #} <input - {% if query %} - class="searchInputCancelable" - {% else %} class="searchInput" - {% endif %} type="text" autocomplete="off" value="{{ query|default_if_none('') }}" name="query" id="keywords" /> - <input type="button" - value="X" - name="reset_query" - class="cancelSearchBtn" - {% if not query %}{# query is only defined by questions view (active_tab) #} - style="display: none;" - {% endif %} - /> - </form> </div> {% endspaceless %} {% endif %} diff --git a/askbot/templates/widgets/secondary_header.html b/askbot/templates/widgets/secondary_header.html index caf190bc..f0aca706 100644 --- a/askbot/templates/widgets/secondary_header.html +++ b/askbot/templates/widgets/secondary_header.html @@ -1,12 +1,45 @@ <!-- template secondary_header.html --> <div id="secondaryHeader"> <div class="content-wrapper"> - <a id="homeButton" href="{% url questions %}"></a> - <div id="scopeWrapper"> - {% include "widgets/scope_nav.html" %} + {# form is wrapping search buttons and the search bar inputs #} + <form + {% if active_tab == "tags" %} + action="{% url tags %}" + {% elif active_tab == "users" %} + action="{% url users %}" + {% else %} + action="{% url questions %}" id="searchForm" + {% endif %} + method="get"> + <div> + {# + Some or all contents of this div may be dropped + over the search bar via negative margins, + to make sure that the search bar can occupy 100% + of the content width. + Search bar may have padding on the left and right + to accomodate the buttons. + #} + <a id="homeButton" href="{% url questions %}"></a> + {% include "widgets/scope_nav.html" %} + {# + three buttons below are in the opposite order because + they are floated at the right + #} + {% include "widgets/ask_button.html" %} + <input type="submit" value="" name="search" class="searchBtn" /> + <input type="button" + value="X" + name="reset_query" + class="cancelSearchBtn" + {% if not query %}{# query is only defined by questions view (active_tab) #} + style="display: none;" + {% endif %} + /> + {# clears button floats #} + <div class="clearfix"></div> + </div> {% include "widgets/search_bar.html" %} {# include search form widget #} - </div> - {% include "widgets/ask_button.html" %} - <div class="clean"></div> + </form> </div> </div> diff --git a/askbot/templates/widgets/user_navigation.html b/askbot/templates/widgets/user_navigation.html index 06b0cdb9..4cb6314a 100644 --- a/askbot/templates/widgets/user_navigation.html +++ b/askbot/templates/widgets/user_navigation.html @@ -20,7 +20,7 @@ <a href="{{ settings.LOGIN_URL }}?next={{request.path|clean_login_url}}">{% trans %}Hi there! Please sign in{% endtrans %}</a> {% endif %} {% if request.user.is_authenticated() and request.user.is_administrator() %} - <a href="{% url site_settings %}">{% trans %}settings{% endtrans %}</a> - <a href="{% url widgets %}">{% trans %}widgets{% endtrans %}</a> + <a class="settings" href="{% url site_settings %}">{% trans %}settings{% endtrans %}</a> + <a class="widgets" href="{% url widgets %}">{% trans %}widgets{% endtrans %}</a> {% endif %} - <a href="{% url "help" %}" title="{% trans %}help{% endtrans %}">{% trans %}help{% endtrans %}</a> + <a class="help" href="{% url "help" %}" title="{% trans %}help{% endtrans %}">{% trans %}help{% endtrans %}</a> |