Commit Graph

7667 Commits

Author SHA1 Message Date
Pragati Agrawal bf1c9420df org_settings: Refactor `build_realm_logo_widget` function.
This commit deduplicates the code for `build_realm_logo_widget` and
`build_realm_night_logo_widget`. It deduplicates the common code for
`build_realm_day_mode_logo_widget` & `build_realm_night_mode_logo_widget`
into tthe function `build_realm_logo_widget`.
2019-03-07 12:12:00 -08:00
Steve Howell 1b065d811a me messages: Avoid empty "message_content" div.
We no longer have an empty message_content div for
messages like this:

    /me gets some coffee

This requires a minor change in how we compute the
position of the message for editing.
2019-03-07 11:39:38 -08:00
Steve Howell 9aa7ebadd7 me messages: Turn off collapse feature.
This is totally broken on master.  If you "collapse" a /me
message, it adds the "More..." link without actually
hiding any content.

I have another branch related to collapse/condense that
will make this easier to resurrect.
2019-03-07 11:32:09 -08:00
Tim Abbott 00903a19c0 Revert "templates: Avoid empty message_content div for /me messages."
This reverts commit 3a73d03e8e.

This was making casper test 08 fail.
2019-03-06 18:28:27 -08:00
Rishi Gupta 99ea5f4e32 popovers: Remove a few entries from stream popover.
These options are pretty low-value, since clicking the stream does the
narrow, and it's likely that almost nobody sends messages via these
buttons.
2019-03-06 17:36:06 -08:00
Steve Howell 3a73d03e8e templates: Avoid empty message_content div for /me messages.
This also makes the template a bit more readable.

(As an aside, copy/paste is broken for /me messages,
but that precedes this commit.)
2019-03-06 12:55:02 -08:00
Anders Kaseorg d7c8d11586 templates: Remove dead <div class="messagebox-border">.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-03-06 12:47:42 -08:00
Harshit Bansal 3610aaece3 refactor: De-duplicate login button code in portico templates. 2019-03-05 14:02:12 -08:00
Vishnu Ks 6af885bd5c attachments: Export bytes_to_size function. 2019-03-04 18:46:13 -08:00
Tim Abbott 25f6eccc65 css: Deduplicate some blocks for stream-privacy. 2019-03-04 16:05:16 -08:00
Steve Howell aaf92a8977 css: Tweak the gutter below the top-left corner.
I think 16px is still enough to offset STREAMS,
and putting STREAMS slightly higher gives it more
emphasis.
2019-03-04 15:59:35 -08:00
Steve Howell ed30b45afd css: Clean up top-left icons and margins.
Making the icons slightly smaller helps us align the
icons and text in the top-left corner to the icons
and text in the streams section.
2019-03-04 15:59:35 -08:00
Steve Howell c3a5a1d3d7 css: Simplify hash/lock icon geometry in left sidebar.
Instead of lining these up with margin tweaks, we just
set the min-width on their common parent.
2019-03-04 15:58:33 -08:00
Steve Howell 38e3e22606 css: Make right sidebar fonts be 14px.
They were slightly taller before.  Now they match other
elements on the page.
2019-03-04 15:58:33 -08:00
Steve Howell c57d6b22ec css: Simplify font sizes for left sidebar elements.
Most elements, apart from chevrons, now have explicit
font sizes.

In some cases I chose integer values that were close
to the calculated values you would get with all the
ratio calculations.

And then I tweaked how the hashtag/lock icons get
aligned.

The alignment for those icons if off in this version; it'll be fixed
in an upcoming commit.
2019-03-04 15:58:33 -08:00
Steve Howell c40597b5f5 fonts: Make STREAMS and USERS be 14px.
Before this they were 14.2px due to a complex set of
calculations.
2019-03-04 15:58:33 -08:00
Steve Howell 6be5129056 fonts: Use 14px for top left corner.
The fonts there used to be 14.2px due to an arcane
calculation.  Now we explicity set a value.

If you expand Private Messages, the font inside now
is explicitly set to 13px.  It used to be 12.8px due
to a complex calculation.
2019-03-04 15:58:32 -08:00
Steve Howell 028715099e minor: Remove unneeded "arrow" class.
The previous commits made the "arrow" class no longer
necessary for these left sidebar elements.

The "arrow" class was always a bit dangerous, as bootstrap
has a class by the same name for a different concept.

We weren't really using consistent styling for "arrow"
across all our chevrons, so even without bootstrap in
play, it was just creating complexity.
2019-03-04 15:35:40 -08:00
Steve Howell 9b616e2411 css: Use more specific selectors for sidebar icons.
This paves the way to tweak chevron geometry on an
individual basis without accidentally breaking other
stuff.  It's also more self-documenting CSS.
2019-03-04 15:35:40 -08:00
Steve Howell 2cf898a0a5 css: Make "All messages" chevron normal size.
14px was too big. (I confirmed on chat that this
was no longer wanted.)
2019-03-04 15:35:40 -08:00
Steve Howell 194619c667 css: Clean up left sidebar chevrons.
This is a fairly big commit, but at the end
it simplifies a lot of things.

It's difficult to fix highly coupled code in
incremental steps because, well, it's highly
coupled code.

The main thing this does is give each type of
chevron in the left sidebar its own class

    * all-messages-arrow (NEW)
    * stream-sidebar-arrow
    * topic-sidebar-arrow

Before this change, the "All messages" chevron
was using stream-sidebar-arrow, which was a
strange name for something that's not actually
in the stream sidebar. Obviously this was
cargo culted.

There was not much JS to change here--we just
fix the click handler for "All messsages".

And then there's a one-line change to the template,
and the rest is re-organizing the CSS.
2019-03-04 15:35:40 -08:00
Steve Howell 0a848e412f buddy list: Use user-list-arrow class.
Using a more specific class avoids confusion related
to the .arrow class, which is not only a popover concept,
but also a Zulip concept in the left sidebar.
2019-03-04 15:35:40 -08:00
Steve Howell 0551b36053 css: Add comment explaining chevron markup.
The way we build chevrons is super messy and highly
coupled.  This comment reflects an audit I did on the
code in its current state.

Subsequent commits will make things a bit easier to
understand.
2019-03-04 15:35:40 -08:00
Steve Howell 3222f170c9 minor: Remove dead code in PM template.
The topic-sidebar-arrow chevron never shows
here--it was just cargo-culted code from
the topic lists.

It's also a landmine--we don't want to
accidentally build a topic-related sidebar
menu for PMs.
2019-03-04 15:35:40 -08:00
Steve Howell 9820b07616 minor: Introduce zero-pm-unreads.
We could arguably just use zero-unreads everywhere,
but we definitely don't want zero-topic-unreads
inside our PM list.

I prefer to just have these two concepts:

    zero-pm-unreads
    zero-topic-unreads

And it's super easy to share CSS properties for both.
2019-03-04 15:35:40 -08:00
Tim Abbott ddb965110f CSS: Remove manual antialiasing configuration.
The antialiasing decisions we made for the webapp should be constant
over the entire page, not limited to particular subsections or themes.

If we wanted antialiasing, we should do it on the entire page, not
individual random widgets.  But it's not clear we actually want to do
it on the entire page.  The `-moz-osx-font-smoothing: grayscale`
setting now happens by default in OSX Mojave (40% world market share
right now and growing), so there's no reason to override it.  And
without retina displays, generally, subpixel rendering provides better
results than antialiasing (which overrides subpixel rendering).

Thanks to Anders Kaseorg for advice on this issue.
2019-03-04 15:12:48 -08:00
okmanl ec869f51b9 admin: Display email addresses in user-edit widget.
When the user logs in as an admin, and clicks on the 'edit user'
button under the url path #organization/user-list-admin, the modal
that was displayed didn't contain the user's email address under the
list of information. This commit adds the email input as a readonly
element, which at the very least provides helpful confirmation that
you have the right user.

Fixes part of #11453.
2019-03-04 09:17:05 -08:00
Alexandra Ciobica dc24efde24 css: Set padding for the testimonials section directly.
This fixes a visual issue with looking at the testimonials in the
mobile /for/open-source page.
2019-03-03 19:52:52 -08:00
Alexandra Ciobica f260a5fea8 css: Remove class hello from testimonials section scss.
This allows us to use this CSS on other pages.
2019-03-03 19:50:47 -08:00
Tim Abbott 16123c9a58 realm_logo: Fix synchronization of realm night logo.
The night logo synchronization on the settings page was perfect, but
the actual display logic had a few problems:

* We were including the realm_logo in context_processors, even though
  it is only used in home.py.
* We used different variable names for the templating in navbar.html
  than anywhere else the codebase.

* The behavior that the night logo would default to the day logo if
  only one was uploaded was not correctly implemented for the navbar
  position, either in the synchronization for updates code or the
  logic in the navbar.html templates.
2019-03-02 09:45:50 -08:00
varunvaruns9 b4f35bd54e poll_widget: Add highlight for vote count if current user votes.
Add a background highlight to vote count button if currently
logged in user votes on that option.

Tweaked by tabbott to use better variable names and Rishi for better
styling.
2019-03-01 16:35:18 -08:00
Tim Abbott 63815c2916 message_list_view: Use self in render more consistently.
This just puts the style more clearly that one shouldn't be using
`this` to refer to the outer MessageListview object, because that
breaks unexpectedly when inside a loop.
2019-03-01 16:26:28 -08:00
Tim Abbott 64717d8a45 copy: Fix extra space before > in copy-paste styling. 2019-03-01 16:26:28 -08:00
Steve Howell b5b9c82f81 refactor: Extract _render_group in MessageListView.
Tweaked by tabbott to use self._render_group for correctness.

This will make sense in an upcoming commit.
2019-03-01 16:26:15 -08:00
Steve Howell b38ab9a142 Remove redundant sender_info_hover class.
This class exist on the parent element, and the popover
code that relies on it can use the parent div.
2019-03-01 15:53:47 -08:00
Steve Howell bb5880bf19 refactor: Extract message_avatar partial. 2019-03-01 15:53:47 -08:00
Steve Howell 3ae4d305de minor: Remove noisy comment.
I don't think anybody is actually going to follow that link.
We know avatars are used in multiple places.
2019-03-01 15:53:47 -08:00
Steve Howell 153d65c01f refactor: Extract message_body.handlebars.
This is the real guts of how we render messages.
It only excludes the border effects, which we
leave in single_message.handlebars.

This is a pure code move, and should remove a lot of nesting that
would otherwise clutter one's view.
2019-03-01 15:53:32 -08:00
Steve Howell 3b30ddc4e4 refactor: Remove unnecessary check for include_sender.
The bool `include_sender` will always be `true`
for status messages.  Here is the relevant
excerpt from MLV:

        message_container.status_message = // ...
        message_container.include_sender = true;

We don't need the `include_sender` check in the template.

We could probably also fix the above code, but it's
semantically correct.  I mostly care about simplifying
the template.
2019-03-01 15:42:12 -08:00
Steve Howell d743d56f1c refactor: Extract me_message template.
This is for:

    /me goes to lunch

Which renders to something like:

    <b>Steve Howell</b> goes to lunch [EDITED]
2019-03-01 15:42:12 -08:00
Steve Howell 7412a097b5 refactor: Extract edited_notice template.
This is a pure code move.  All three places where we use
this partial had the exact same markup, except one place
where I think `auto-select` was inadvertently left off.
2019-03-01 15:42:12 -08:00
Steve Howell 76e379bd4f refactor: Extract message_controls template.
This is a pretty coherent chunk of template code
related to these icons:

    - edit pencil
    - reactions
    - chevron
    - star

Moving it to a partial will simplify future diffs
where we re-work the message HTML.

This is a pure code move.
2019-03-01 15:42:12 -08:00
Steve Howell 386dde2923 refactor: Clean up single_message template.
Some changes here:

    * more whitespace
    * avoid else, and just re-state the condition
    * avoid long if blocks, just re-state the condition
    * use standard `{{#if foo}}` construct

The refactoring of conditionals here will make more
sense in subsequent commits.
2019-03-01 15:42:12 -08:00
vinitS101 2dddf8d8b9 refactor: Move user_last_seen_time_status() to buddy_data.
This is a pure data function, so it shouldn't be in popovers.js file

(Steve Howell added test coverage here, and tabbott removed an
accidental functional change.)
2019-03-01 15:32:14 -08:00
overide 0dcfc22406 markdown: Fix numbered list handling of blank lines between blocks.
This fixes an issue where blank lines between blocks were causing
auto-numbering of list to stop before the blank line resulting
in two separate numbered list instead of one.

Edited significantly by tabbott to explain the tricky details in the
comments.

Fixes: #11651.
2019-03-01 15:29:07 -08:00
Boris Yankov 9edc39c8be user status: Make "unavailable" status circle grey.
After discussion, we decided that the red color is too distinct
and does not convey the idea of "almost offline".

This changes the new "unavailable" status circle's color from dark
red to grey, the same color used by the "offline" status circle.
2019-03-01 22:51:07 +02:00
Boris Yankov 31536a48ef user status: Add icon for "unavailable".
Fixes #11589.

Adds SCSS style for the "unavailable" user status and enables its
usage in `buddy_data.js`.

The style is a red circle with a horizontal line. The values might
look a bit 'magic' but they were considered carefully ` height` of
1px was too thin, 2px was too thick, thus 1.5px was chosen.
2019-03-01 09:56:09 -08:00
Tim Abbott f450a5ceaa i18n: Update translation data from Transifex. 2019-03-01 09:28:08 -08:00
Rishi Gupta 2c0b291902 portico: Add ninth logo to /for/open-source testimonial section. 2019-03-01 09:12:50 -08:00
Rishi Gupta f8c8b41ad8 portico: Fix media parameters for hiding last testimonial logo.
Tested both /hello and /for/open-source.
2019-03-01 09:12:50 -08:00