]> git.parisson.com Git - mezzo.git/commitdiff
Sidebar, user styles
authorPhilippe Barbosa <contact@philippebarbosa.com>
Thu, 3 Mar 2016 18:25:47 +0000 (19:25 +0100)
committerPhilippe Barbosa <contact@philippebarbosa.com>
Thu, 3 Mar 2016 18:25:47 +0000 (19:25 +0100)
app/festival/static/scss/components/_sidebar.scss [new file with mode: 0755]
app/festival/static/scss/modules/user.scss [new file with mode: 0644]
app/templates/accounts/includes/user_panel.html
app/templates/agenda/includes/filter_panel.html
app/templates/includes/language_selector.html
app/templates/includes/user_panel.html

diff --git a/app/festival/static/scss/components/_sidebar.scss b/app/festival/static/scss/components/_sidebar.scss
new file mode 100755 (executable)
index 0000000..70cb9e8
--- /dev/null
@@ -0,0 +1,17 @@
+// ****************************************************************
+// _Sidebar
+// ****************************************************************
+
+.sidebar__title {
+  text-transform: uppercase;
+  display: block;
+  font-size: 1rem;
+  margin: 1.3rem 0 0.5rem;
+  &:after {
+    content: "";
+    display: block;
+    width: 100%;
+    height: 1px;
+    background: $main_color;
+  }
+}
\ No newline at end of file
diff --git a/app/festival/static/scss/modules/user.scss b/app/festival/static/scss/modules/user.scss
new file mode 100644 (file)
index 0000000..2dd10a9
--- /dev/null
@@ -0,0 +1,5 @@
+.user__panel {
+  margin: 1rem auto;
+  padding: .5rem 1rem;
+  background: #fff;
+}
\ No newline at end of file
index 4ae18505c6992002f8bb3243f4ecc03d06eb9168..600a07e2fc00211ffa89533b1471e0e6613c440c 100644 (file)
@@ -1,24 +1,33 @@
 {% load i18n mezzanine_tags accounts_tags %}
 
 {% if request.user.is_authenticated %}
-    <p>
-    {% trans "Logged in as: " %}
-    {% url "profile" request.user.username as profile_url %}
-    {% if profile_url %}
-        <a href="{{ profile_url }}">{{ request.user|username_or:"email" }}</a>
-    </p>
-        <a href="{% url "profile_update" %}" class="btn btn-default btn-sm btn-account">
-            <span class="glyphicon glyphicon-edit"></span> {% trans "Update profile" %}</a>
-    {% else %}
-        <a href="{% url "profile_update" %}">{{ request.user|username_or:"email" }}</a>
-    </p>
-    {% endif %}
-    <a href="{% url "logout" %}?next={{ request.path }}" class="btn btn-sm btn-danger btn-account">
-        <span class="glyphicon glyphicon-log-out"></span> {% trans "Log out" %}</a>
+    <div class="user__panel">
+        {% trans "Logged in as: " %}
+        {% url "profile" request.user.username as profile_url %}
+        {% if profile_url %}
+            <a href="{{ profile_url }}">{{ request.user|username_or:"email" }}</a>
+        </p>
+            <a href="{% url "profile_update" %}" class="btn btn-default btn-sm btn-account">
+                <span class="glyphicon glyphicon-edit"></span> {% trans "Update profile" %}</a>
+        {% else %}
+            <a href="{% url "profile_update" %}">{{ request.user|username_or:"email" }}</a>
+        </p>
+        {% endif %}
+        <a href="{% url "logout" %}?next={{ request.path }}" class="btn btn-sm btn-danger btn-account">
+            <span class="glyphicon glyphicon-log-out"></span> {% trans "Log out" %}</a>
+    </div>
 {% else %}
-    <a href="{% url "login" %}?next={{ request.path }}" class="btn btn-default btn-sm btn-account">
-        <span class="glyphicon glyphicon-log-in"></span> {% trans "Log in" %}</a>
-    &nbsp;{% trans "or" %}&nbsp;
-    <a href="{% url "signup" %}?next={{ request.path }}" class="btn btn-default btn-sm btn-account">
-        <span class="glyphicon glyphicon-edit"></span> {% trans "Sign up" %}</a>
+    <div class="user__panel">
+        <div class="this-or-this">
+            <a href="{% url "login" %}?next={{ request.path }}" class="this-or-this__this">
+                <span class="glyphicon glyphicon-log-in"></span> {% trans "Log in" %}
+            </a>
+           <span class="this-or-this__or  one-fifth">
+               {% trans "or" %}
+           </span>
+           <a href="{% url "signup" %}?next={{ request.path }}" class="this-or-this__this  two-fifths">
+               {% trans "Sign up" %}
+           </a>
+        </div>
+    </div>
 {% endif %}
index e8eab0f33669094914fee63b20a7f1b79f0b40ec..fbc0cd6cb11d1c8f2db26cfeece925a2ecc740c4 100644 (file)
@@ -3,10 +3,10 @@
 {% block upcoming_events %}
 {% upcoming_events 5 as upcoming_events %}
 {% if upcoming_events %}
-<h3>{% trans "Upcoming Events" %}</h3>
+<h2 class="sidebar__title">{% trans "Upcoming Events" %}</h2>
 <ul class="list-unstyled upcoming-events">
 {% for upcoming_event in upcoming_events %}
-<li><a href="{{ upcoming_event.get_absolute_url }}"
+    <li><a href="{{ upcoming_event.get_absolute_url }}"
     >{{ upcoming_event.title }}</a></li>
 {% endfor %}
 </ul>
@@ -16,7 +16,7 @@
 {% block recent_events %}
 {% recent_events 5 as recent_events %}
 {% if recent_events %}
-<h3>{% trans "Recent Events" %}</h3>
+<h2 class="sidebar__title">{% trans "Recent Events" %}</h2>
 <ul class="list-unstyled recent-events">
 {% for recent_event in recent_events %}
 <li><a href="{{ recent_event.get_absolute_url }}"
@@ -29,7 +29,7 @@
 {% block event_months %}
 {% event_months as months %}
 {% if months %}
-<h3>{% trans "Archive" %}</h3>
+<h2 class="sidebar__title">{% trans "Archive" %}</h2>
 {% for month in months %}
     {% ifchanged month.date.year %}
         {% if not forloop.first %}</ul>{% endif %}
@@ -45,7 +45,7 @@
 {% block event_locations %}
 {% event_locations as locations %}
 {% if locations %}
-<h3>{% trans "Locations" %}</h3>
+<h2 class="sidebar__title">{% trans "Locations" %}</h2>
 <ul class="list-unstyled">
 {% for location in locations %}
 <li><a href="{% url "event_list_location" location.slug %}"
@@ -58,7 +58,7 @@
 {% block event_keywords %}
 {% keywords_for mezzanine_agenda.event as tags %}
 {% if tags %}
-<h3>{% trans "Tags" %}</h3>
+<h2 class="sidebar__title">{% trans "Tags" %}</h2>
 <ul class="list-inline tag-cloud">
 {% for tag in tags %}
 <li>
@@ -74,7 +74,7 @@
 {% block event_authors %}
 {% event_authors as authors %}
 {% if authors %}
-<h3>{% trans "Authors" %}</h3>
+<h2 class="sidebar__title">{% trans "Authors" %}</h2>
 <ul class="list-unstyled">
 {% for author in authors %}
     <li><a href="{% url "event_list_author" author.username %}"
@@ -86,7 +86,7 @@
 {% endblock %}
 
 {% block event_feeds %}
-<h3>{% trans "Feeds" %}</h3>
+<h2 class="sidebar__title">{% trans "Feeds" %}</h2>
 {% if tag %}
     <a href="{% url "event_feed_tag" tag.slug "rss" %}">{% trans "RSS" %}</a> /
     <a href="{% url "event_feed_tag" tag.slug "atom" %}">{% trans "Atom" %}</a>
index e2525b202a18e74aba64dd18083bb0a503918307..e0b0338ff77acf243f708c837e1cbb6212a81dae 100644 (file)
@@ -2,19 +2,19 @@
 {% get_language_info_list for LANGUAGES as languages %}
 {% if settings.USE_MODELTRANSLATION and languages|length > 1 %}
 <div>
-<form action="{% url "set_language" %}" method="post" id="language_selector_form">
-  {% csrf_token %}
-  <div class="form-group">
-    <select name="language" class="form-control">
-      {% for language in languages %}
-      <option value="{{ language.code }}"
-      {% if language.code == LANGUAGE_CODE %}selected="selected"{% endif %}>
-      {{ language.name_local }}
-      </option>
-      {% endfor %}
-    </select>
-  </div>
-  <input type="submit" class="btn btn-default" value="{% trans "Change" %}" />
-</form>
+  <form action="{% url "set_language" %}" method="post" id="language_selector_form">
+    {% csrf_token %}
+      <div class="select">
+        <select name="language" class="form-control">
+          {% for language in languages %}
+          <option value="{{ language.code }}"
+          {% if language.code == LANGUAGE_CODE %}selected="selected"{% endif %}>
+          {{ language.name_local }}
+          </option>
+          {% endfor %}
+        </select>
+      </div>
+    <input type="submit" class="btn btn-default" value="{% trans "Change" %}" />
+  </form>
 </div>
 {% endif %}
index 8bd874aaa31e93e9e75f63f6c279dbb4328d1476..cfbab248ab44db7be94c702bf7e9237077138c8b 100644 (file)
@@ -1,12 +1,12 @@
 {% load mezzanine_tags %}
 <div class="panel panel-default user-panel">
-<div class="panel-body">
-{% ifinstalled cartridge.shop %}
-{% include "shop/includes/user_panel.html" %}
-{% endifinstalled %}
-{% ifinstalled mezzanine.accounts %}
-{% ifinstalled cartridge.shop %}<br>{% endifinstalled %}
-{% include "accounts/includes/user_panel.html" %}
-{% endifinstalled %}
-</div>
+    <div class="panel-body">
+        {% ifinstalled cartridge.shop %}
+            {% include "shop/includes/user_panel.html" %}
+                {% endifinstalled %}
+                {% ifinstalled mezzanine.accounts %}
+                    {% ifinstalled cartridge.shop %}<br>{% endifinstalled %}
+            {% include "accounts/includes/user_panel.html" %}
+        {% endifinstalled %}
+    </div>
 </div>