Commit Graph

8632 Commits

Author SHA1 Message Date
Pragati Agrawal 707e012af0 realm_logo: Refactor `realm_logo.rerender` function to be more clean.
This creates/extract a function `change_logo_delete_button`.
2019-08-21 15:49:25 -07:00
Pragati Agrawal 34d2616158 org settings: Use `.realm-logo-file-input-error` to identify input errors.
This replaces `realm_logo_file_input_error` and
`realm_night_logo_file_input_error` with one class.
2019-08-21 15:49:25 -07:00
Pragati Agrawal c214d184d0 org settings: Replace logo's file input ids with `.realm-logo-file-input`. 2019-08-21 15:49:25 -07:00
Pragati Agrawal a6cd0b8788 org settings: Use `realm-logo-img` class as identifier of realm logo image.
This replaces previously being used ids, `realm-settings-logo` and
`realm-settings-night-logo` with a common class `realm-logo-img`.
2019-08-21 15:49:25 -07:00
Pragati Agrawal 6ab2dcf4ac settings_org: Add ids to the section of day and night logos.
- These ids will further be used to represent each section concisely and
  deduplicating code.

- Also, removed `realm-night-logo-section` class as it was redundant.
2019-08-21 15:49:25 -07:00
Vaibhav c20f1945d7 css: Nest .help-table inside .modal-body. 2019-08-20 12:00:22 -07:00
Vaibhav a3c6bd68f0 css: Use SCSS nesting for .hotkeys_table. 2019-08-20 12:00:22 -07:00
Vaibhav c9b8de9cc1 css: Use SCSS nesting for .informational-overlays. 2019-08-20 12:00:22 -07:00
Vaibhav ba0f377273 css: Reorder informational_overlays.scss so similar elems in same place.
Also some whitespace changes. (No separate commit required).
2019-08-20 12:00:22 -07:00
Alexandra Ciobica 96cdfd676b css: Add bottom margin to titles in the register pages. 2019-08-18 12:57:25 -07:00
Pragati Agrawal eedcdf7f3b settings/styles: Reorder `.settings-section .table-striped` to same place. 2019-08-18 12:44:40 -07:00
Pragati Agrawal 78d6ecfa08 settings/styles: Use `.settings-section` for settings `.table-striped`.
We have used `.settings-section .table-striped` for other rules to refer the same elements
which are referred by `#settings_page .table-striped`.
2019-08-18 12:44:40 -07:00
Pragati Agrawal aac9a7a4b1 settings/styles: Remove redundant rules for `.table-striped thead th`.
This rule is already specified at
 `.settings-section .table-striped thead th`.
2019-08-18 12:44:40 -07:00
Pragati Agrawal a858d51a85 settings/styles: Nest all `.settings-section` rules. 2019-08-18 12:44:40 -07:00
Pragati Agrawal 9acd8caa59 settings/styles: Remove redundant specificity. 2019-08-18 12:44:40 -07:00
Pragati Agrawal 2c846774c0 settings/styles: Reorder styles in more sensible order.
Rather just putting rules in any order it makes more sense to have an order
of basic to more advanced/specific CSS.
2019-08-18 12:44:40 -07:00
Pragati Agrawal 94d867cd11 settings/scss: Reorder `.settings-section` to have them in same place. 2019-08-18 12:44:40 -07:00
Pragati Agrawal b0b1435a18 settings/scss: Remove now redundant `settings-wrapper` class.
No class like this is rendered to page.
2019-08-18 12:44:40 -07:00
Pragati Agrawal 378c1a5994 settings/scss: Reorder to have `.settings-section-title` at same place. 2019-08-18 12:44:40 -07:00
Wyatt Hoodes 5ee7553214 popovers: Fix broken user popover behavior.
If we call `popovers.hide_all` with a smaller browser
window, this breaks the functionality that the
conditional is attempting to handle.  We instead use
`hide_all_except_sidebars` to prevent the user list
from being closed.

If the display setting to show the user list in the
left sidebar is enabled, the behavior is even worse.
We add a conditional to maintain the streamlist
sidebar when clicking the chevron to show and hide
the popover here as well.
2019-08-18 12:12:52 -07:00
Priyank Patel 0e337c015a message_fetch: Use stream ID for stream operand.
Fixes part of #9474
2019-08-17 11:20:51 -07:00
Priyank Patel 1f8f8867cd message_fetch: Rename handle_user_ids_supported_operators.
This renames handle_user_ids_supported_operators to
handle_operators_supporting_id_based_api.
2019-08-17 11:10:00 -07:00
Priyank Patel 1edde4a989 Rename user_id(s)_supported_operators -> operators_supporting_id(s). 2019-08-17 11:10:00 -07:00
Pragati Agrawal 13d5a21430 settings/scss: Nest many rules inside `#user-groups`. 2019-08-16 10:47:33 -07:00
Pragati Agrawal 44d6123c26 settings/scss: Nest `.user-group` inside `#user-groups`. 2019-08-16 10:46:12 -07:00
Pragati Agrawal df31238fb7 settings/scss: Make `#user-groups .user-group` rules at same place. 2019-08-16 10:46:12 -07:00
Vaibhav 262e5c6400 css: Use SCSS media queries nesting in drafts.scss. 2019-08-15 22:39:39 -07:00
Vaibhav 2c4f4b0e38 css: Nest .draft-controls inside .draft-info-box. 2019-08-15 22:39:39 -07:00
Vaibhav ab30295a39 css: Nest .draft-info-box inside .draft-row. 2019-08-15 22:39:39 -07:00
Vaibhav f94f4ac48e css: Nest .drafts-list inside .drafts-container. 2019-08-15 22:39:39 -07:00
Vaibhav 4e7f3eba85 css: Nest .exit-sign inside .exit. 2019-08-15 22:39:39 -07:00
Vaibhav 7ed9d10016 css: Nest .exit and .exit-sign inside .drafts-header. 2019-08-15 22:39:39 -07:00
Vaibhav d20204826d css: Nest .drafts-header inside .drafts-container. 2019-08-15 22:39:39 -07:00
Vaibhav 591ebb22bf css: Use SCSS nesting for .draft- row, info-box and controls. 2019-08-15 22:39:39 -07:00
Vaibhav 585b6680ae css: Reorder drafts.scss so .draft-row are together. 2019-08-15 22:39:39 -07:00
Vaibhav 067c9040e7 css: Use SCSS nesting for .drafts- container, header and list. 2019-08-15 22:39:39 -07:00
Vaibhav b940406877 css: Reorder drafts.scss so .drafts-container are in same place. 2019-08-15 22:39:39 -07:00
Pragati Agrawal 693df05ca7 settings_users: Refactor and extract function for last active.
This just done to improves code readability and removes some code too.
2019-08-15 16:54:28 -07:00
Pragati Agrawal c0c11fe226 settings_users: Refactor logic for "last active" column in users table.
This uses "last_active" attribute of `user` (`item`) object and makes code
much more readable.
2019-08-15 16:54:28 -07:00
Pragati Agrawal a3ef8856a8 settings_users: Add last_active to active_users for "users" table.
This is a preliminary step for refactoring the logic for rendering
"last_active" in the users table and later we can use this for sorting the
column.
2019-08-15 16:54:28 -07:00
Pragati Agrawal ba5564fec7 settings_users: Remove `if` condition for showing current user time stamp.
It seems `presence.presence_info[item.user_id]` works fine for the current
user as well and there is no need to hardcode extra condition for the
current user.
2019-08-15 16:54:28 -07:00
Pragati Agrawal 6b5e98d554 settings_panel_menu: Fix the switching behavior for hidden section panels.
For organization settings page there are few sections' panels which are not
visible (unless you click on 'show more') but when we use up-down arrows to
navigate between sections, sections of hidden panels also get visible which
leads to confusion.

Fixes: #13008.
2019-08-15 16:51:19 -07:00
Alexandra Ciobica f7e88fb2c1 css: Add color variables to integrations.scss. 2019-08-15 16:12:15 -07:00
Alexandra Ciobica 43d11285fa css: Add background to integrations categories. 2019-08-15 16:12:15 -07:00
Alexandra Ciobica da9a092d39 css: Refactor integrations to use SCSS nesting.
While refactoring, I tested all the rules and removed the CSS that was
not needed or duplicated.

I removed the `$("#integration-list-link").css('display', 'block');` and
moved it to css because there is no case in which the back link is
hidden.
2019-08-15 16:12:15 -07:00
Alexandra Ciobica 84e0327d10 integrations: Fix arrangement of left sidebar `back to list` button.
I rearranged the elements of the left sidebar in HTML in order to appear
in the order they are displayed and removed the absolute positioning,
because it was not needed if the elements are arranged correctly. I used
`flex` display to arrange them on column.

I removed the styling that positioned the elements absolutely.

Then I tweaked the margins in order to make the elements look good.

Fixes: #12929
2019-08-15 16:12:15 -07:00
Thomas Ip cbae51db63 settings: Move API key form into its own modal.
The modal is rendered dynamically to avoid password managers
inserting passwords into the input field too aggressively.

Fixes #12523.
2019-08-14 10:50:45 -07:00
Thomas Ip 75db8fecf8 refactor: Remove redundant dataType option to channel.post(). 2019-08-14 10:50:45 -07:00
Akash Nimare 2e47e35edc desktop: Update desktop app to v4.0.0. 2019-08-13 12:36:40 -07:00
Wyatt Hoodes f623540409 data export: Add UI to trigger data export.
This commit serves as the frontend piece for the "public export"
webapp feature.

Fixes: #11930
2019-08-12 18:21:38 -07:00
Alexandra Ciobica 4c08a840d0 accounts/go: Change class of bottom text to be consistent.
I changed the class of the two bottom texts to use the same styling as
(`/new` and `/complete/github`)
2019-08-08 11:12:51 -07:00
Alexandra Ciobica 196185db03 css: Remove unused css from register page.
After removing the `bottom-text` from `new organization`, this css from
the register page is not used anymore.
2019-08-08 11:12:51 -07:00
Alexandra Ciobica eb6c5e1962 auth: Style the GitHub auth email selection page.
I added the `white-box` as it was in the other similar pages
(`/accounts/go`).

In order to be able to style it better, I removed the buttons and added
`div`s instead, then added click handler for submitting the form.

If the email is associated to a Zulip account, the avatar of the account
is displayed and the text `Log in`, otherwize a `+` sign is
displayed and the text `Create new account`.
2019-08-08 11:12:51 -07:00
Alexandra Ciobica e5e45c9a25 auth: Change page title and add description for the list.
I changed the class of the title in order to use the same styling as the
 other similar pages (like `/accounts/go` or `/login`).

Changed the related test.
2019-08-08 11:12:51 -07:00
Vaibhav aa29ef0317 css: Use SCSS nesting for 700px media queries in subscriptions.scss. 2019-08-07 17:42:10 -07:00
Vaibhav 5aa22f4acd css: Reorder so `.subscriptions-container` are in same place. 2019-08-07 17:42:10 -07:00
Vaibhav 7019b8a4c6 css: Use SCSS nesting in subscriptions.scss media queries. 2019-08-07 17:42:10 -07:00
Vaibhav 1b1e74bc24 css: Use SCSS nesting for `ul.grey-box`. 2019-08-07 17:42:10 -07:00
Anders Kaseorg c3a83a82c5 echo: Consistently send local_id as string, convert it back to number.
Fixes: #2734.

`local_id` was being transmitted to the server as a string by the AJAX
transmission path, and as a number by by the WebSocket transmission
path.  Then, one of the two racing success callback paths would use
the original number, while the other would use the type returned by
the server.  Depending on which transmission path was used and which
callback path won the race, `reify_message_id` would sometimes be
passed a string that would fail to compare equal to the numerical
selection id.  If the locally echoed message was selected, this would
cause the selection to disappear.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-08-07 17:17:25 -07:00
Vaibhav 30af846095 css: Use SCSS nesting for `.poll-edit-question`. 2019-08-07 17:16:49 -07:00
Vaibhav 241015e3e6 css: Use SCSS nesting for `.poll-question-*`. 2019-08-07 17:16:49 -07:00
Vaibhav 1fb5e36e7a css: Use SCSS nesting for button.task*. 2019-08-07 17:16:49 -07:00
Vaibhav 911e438a14 css: Use SCSS nesting for add-task, poll-question and poll-option. 2019-08-07 17:16:49 -07:00
Vaibhav 6f0f4647ec css: Nest `.poll-vote` inside `.poll-widget`. 2019-08-07 17:16:49 -07:00
Vaibhav 13293c702e css: Use SCSS nesting for `.poll-vote`. 2019-08-07 17:16:49 -07:00
Vaibhav 7b77cc936a css: Reorder widgets.scss so `.poll-vote` are in same place. 2019-08-07 17:16:49 -07:00
Vaibhav 39b1665237 css: Use SCSS nesting for `.poll-widget`, `.todo-widget`. 2019-08-07 17:16:49 -07:00
Vaibhav 11b2748bce css: Nest `.widget-choices-heading` inside `.widget-choices`. 2019-08-07 17:16:49 -07:00
Vaibhav 27223b258d css: Use SCSS nesting for `.widget-choices`. 2019-08-07 17:16:49 -07:00
Vinit Singh a2f9211384 message_view: Show edit history when EDITED notice is clicked.
Open the edit history of a message when a user clicks on it's
EDITED notice.
Also, added on-hover darkening for the EDITED notice.

Resolves #12615.
2019-08-07 16:59:24 -07:00
vinitS101 3d01921e1a user status: Changes to Last active field of Full User Profile.
If a user was active within the last 90 days,
show number of days (23 Days ago).
If the user was active more than 90 days ago and in the same year,
then show MMM DD (Mar 15).
In any other case show MMM DD YYYY (Nov 10 2018),
Change timerender.js test to accomodate changes.
2019-08-07 16:20:19 -07:00
vinitS101 232f588d4e user status: Change Online now to Active now in full user profile.
Change "Online now" to "Active now" in Last seen field of
full user profile.
2019-08-07 16:20:19 -07:00
vinitS101 a82ad468f9 user status: Change Last online to Last active.
Change "Last online" to "Last active" in the full user profile.
2019-08-07 16:20:19 -07:00
Anders Kaseorg becef760bf cleanup: Delete leading newlines.
Previous cleanups (mostly the removals of Python __future__ imports)
were done in a way that introduced leading newlines.  Delete leading
newlines from all files, except static/assets/zulip-emoji/NOTICE,
which is a verbatim copy of the Apache 2.0 license.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-08-06 23:29:11 -07:00
Rishi Gupta a0ebd9276d portico: Fix bug with .warn on /integrations.
Was causing an extra 10px of margin-top on .warn.

In general styles applied to .tip and .keyboard-tip should also be applied
to .warn.
2019-08-05 17:33:05 -07:00
Rishi Gupta bc220aefdf help: Document topic links. 2019-08-02 16:33:27 -07:00
Rishi Gupta 3fbd0026a4 compose: Update topic list tip_text.
It was a bit confusing to have this appear even after you typed `>`.

Also, removed the word "mention", since mention has a specific meaning in
Zulip.
2019-08-02 16:33:27 -07:00
Pragati Agrawal 5b324e50ca users: Apply email_address_visibility policy on the users list.
In the emails-hidden case, for non-admins, we should remove the email
field from "Users" list in the organization settings page.

Tweaked by tabbott to correctly handle the bots and deactivated users pages.
2019-08-02 15:28:36 -07:00
Pragati Agrawal ac2f1cea9c settings_org: Enhance `show_emails` for admins only case too.
This adds on the `is_admin` clause to show_emails.
2019-08-02 15:20:55 -07:00
Rohitt Vashishtha a7f2bedb15 markdown: Enable hashheadings syntax.
Our implementation requires at least 1 space after the
'#' not not break existing linkifiers like '#123', etc.
that generally follow the convention we show in linkifier
examples.

- [valid]  : # Hello
- [valid]  : #  Hello
- [invalid]: #Hello

For the frontend, we have taken the code from v0.7.0 of
upstream marked and made minor changes to avoid having
to refactor a significant part of our marked code.

For the backend, we merely have to change the regex to
force require spaces after #, and add hashheader to our
list of blockparsers.

Fixes #11418.
2019-08-02 15:15:34 -07:00
Tim Abbott e807041bda compose_ui: Fix double escaping of compose placeholder text.
This fixes an issue where we were accidentally double-escaping the
compose placeholder text if it contained HTML entities; once in
`i18n.t` and again when inserting it into the `placeholder` DOM via
`.attr`.
2019-08-01 12:59:07 -07:00
Rohitt Vashishtha bb46bc099b typeahead: Show header text for some mentions.
Show help text when completing stream, topic, mention and silent_mention.
2019-07-31 15:36:15 -07:00
Rohitt Vashishtha 6c34d99ad0 typeahead: Add header text to show info about current completion.
We can provide a function that returns an HTML string: `this.header()` to
display a header text above the typeahead. This can be used to provide
contextual information such as hinting about the silent mentions syntax
or the topic mentions syntax.

At the end of this commit, the HTML structure is:

$container <div>
  $header <p>
    info-icon
    header-text
  $menu <ul>
    list-items
2019-07-31 15:33:27 -07:00
Rohitt Vashishtha b071270788 typeahead: Add a container div for the typeahead list.
This change allows us to add custom changes to the HTML generated
by the typeahead without interfering with the core functions that
are provided by the library.

At the end of this commit, the HTML structure is:

$container <div>
  $menu <ul>
    list-items
2019-07-31 15:33:27 -07:00
Tim Abbott 38ffde37e5 css: Move edit history highlighting CSS into rendered_markdown. 2019-07-31 12:08:17 -07:00
Tim Abbott 28fc159d24 css: Move more embed CSS into rendered_markdown. 2019-07-31 12:08:17 -07:00
Tim Abbott 4fbc74bb0b css: Delete custom CSS for message-edit-history.
This logic effectively badly duplicated the existing rendered_markdown
CSS.
2019-07-31 12:08:17 -07:00
Tim Abbott ba66dfe977 css: Scope KaTeX CSS inside rendered_markdown.
This is entirely for readability.
2019-07-31 12:08:17 -07:00
Tim Abbott 5b732437c1 css: Scope mentions and alert words in rendered_markdown. 2019-07-31 12:08:17 -07:00
Tim Abbott 97b256d1f0 css: Extract rendered_markdown.scss.
This moves our main CSS for rendered Zulip message content into an
external file, which may be reusable but in any case should make it
easier to find this content.
2019-07-31 12:08:17 -07:00
YashRE42 7a6f4630dc compose_box: Prepopulate stream if possible.
When users are only subbed to a single stream, this autofills the stream
field of the compose box.
Fixes #12507.
2019-07-31 10:20:24 -07:00
Tim Abbott fac886ce05 Revert "compose: Fix cursor placement timing bug when selecting a typeahead."
This reverts commit 76e50af78e.

Empirically, this caused weird issues with the cursor jumping around,
so more investigation is required into the right way to fix it.
2019-07-29 18:05:46 -07:00
Vinit Singh 03180752db compose: Update placeholder text depending on the narrow.
Change the `compose-textarea` placeholder text depending on the
stream/topic or PM recipients that the message will be sent to.

Resolves #12834.
2019-07-29 15:51:50 -07:00
Yashashvi Dave 865a7204f9 custom fields: Set generic click handler on remove_date buttons.
This commit adds click handler on date type custom profile
fields on field initialization itself.
This commit also fixes the bug in date type fields in user
profile in org settings.
2019-07-29 15:06:35 -07:00
Yashashvi Dave b93ca2fc50 custom fields: Hide remove_date button for none value date fields.
This commit adds a click handler on datepicker custom profile
fields, which hides the `remove_date` button if the field value
is not set.

Fixes part of #11453
2019-07-29 15:06:35 -07:00
Yashashvi Dave 2e8cf6984e user settings: Fix click handler errors on datepicker profile field.
On change value click handlers on user profile fields in user settings
were also initialized on profile fields in org settings -> users
section. In org settings -> users, we do not need on change value
click handlers.
This commit fixes above issue by setting up handlers only on
user settings page.
2019-07-29 15:06:35 -07:00
Yashashvi Dave 440975e369 org settings: Fix background color in custom user profile datepicker field.
Fixes part of #11453
2019-07-29 15:06:35 -07:00
Anders Kaseorg 29c5b63e64 css: Fix .message_top_line stealing mouse events from .message_edit_form.
This is a replacement for the workaround removed by commit
2273608477.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-25 17:55:34 -07:00
Anders Kaseorg f0e0fe1c15 ui.get_scroll_element: Set up SimpleBar if it’s expected but missing.
Although SimpleBar automatically sets itself up on elements with a
`data-simplebar` attribute, sometimes we try to set event listeners
before that happens.  Create the SimpleBar early in that case.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-25 16:18:54 -07:00
Vaibhav 2fd0753d22 reactions_button: Remove title from reaction button in controls.
Since the button already has a tooltip, we can remove the title.
2019-07-25 16:13:19 -07:00
Alexandra Ciobica 13bdc655c9 css: Fix `ol`s on integrations.
Apparently, the 30px width we allocated to the bullets was
insufficient with the larger font size there.

Edit by tabbott: better to just increase it to 32px everywhere.
2019-07-25 15:08:07 -07:00
Alexandra Ciobica 999209020f portico: Move `code-section` rules to `markdown.scss`.
`code-section` is a feature of the markdown system, therefore the
associated CSS should be in the `markdown.scss` file. I also refactored
to use SCSS nesting.
2019-07-25 15:04:09 -07:00
Alexandra Ciobica 8fef764960 css: Make help page height selector from 500px viewport more specific. 2019-07-25 15:04:09 -07:00
Alexandra Ciobica 428a5c0d26 css: Change `font-size` of markdown text on why-zulip and integrations. 2019-07-25 15:04:09 -07:00
Alexandra Ciobica 4e29721385 css: Remove duplicated css rules.
These rules are no longer needed after the addition of `.markdown` class
 on the `why-zulip` pages.
2019-07-25 15:04:09 -07:00
Alexandra Ciobica 295cbc8535 css: Refactor `markdown.scss` to use SCSS nesting. 2019-07-25 15:04:09 -07:00
Alexandra Ciobica 7a22111601 css: Move markdown CSS into separate file. 2019-07-25 15:04:09 -07:00
Alexandra Ciobica d2466e15cb css: Remove duplicated `integrations` selectors and fix styling.
I added the `@media (max-width: 500px)` because the text from the inner
content was gong outside the white background on mobile because of the
height of the `.markdown` class for this viewport.

I moved this `.integration-instructions .help-content h3 { margin: 20px
0 ; }` from the `portico.scss` because it should be in `integrations
.scss`.

I removed the `#hubot-integrations` because I didn't find that id
anywhere.

I removed `.portico-landing.integrations ol ul` because `.markdown`
takes care of that left spacing.
2019-07-25 15:04:09 -07:00
Alexandra Ciobica 93c98e6d9a css: Remove duplicated selectors from `why-zulip`. 2019-07-25 15:04:09 -07:00
Rohitt Vashishtha 76e50af78e compose: Fix cursor placement timing bug when selecting a typeahead.
When you press enter on a typeahead and start typing, your cursor is
placed at the end of the textbox, whereas we want it to be placed at
the end of the typeahead immediately. This causes some characters to
appear at the end of the message before you again get to typing from
where you left off.

To fix, we use the change event triggered on typeahead completion to
reposition the cursor instead of using a setTimeout().

Fixes #12621.
2019-07-25 15:01:24 -07:00
Yashashvi Dave 3f28f4a9f5 static/templates/stream_settings_checkbox: Simplify handlebar logic.
Fixes #12801
2019-07-25 14:56:12 -07:00
Yashashvi Dave 307ef2e96d static/templates/emoji_popover_emoji: Fix typo. 2019-07-25 14:56:12 -07:00
Rohitt Vashishtha 4f03d82ff0 compose: Do not trigger topic mention if already completed. 2019-07-25 14:53:43 -07:00
Vaibhav 6bd6b846a5 css: Reorder subscriptions.scss so `.large-icon` are in same place. 2019-07-25 14:44:58 -07:00
Vaibhav 36b78b034b css: Remove redundant rules from `.large-icon.hash`. 2019-07-25 14:44:58 -07:00
Vaibhav 350bcbea80 css: Use SCSS nesting for `#subscriptions_overlay`. 2019-07-25 14:44:58 -07:00
Vaibhav 86bff0c3ce css: Nest elements inside `#subscription_overlay`. 2019-07-25 14:44:58 -07:00
Vaibhav 37f70adeb6 css: Use SCSS nesting for `.editable-section`. 2019-07-25 14:44:58 -07:00
Vaibhav 4c70a23d43 css: Nest `#stream_creation_form` inside `#stream-creation`. 2019-07-25 14:44:58 -07:00
Vaibhav 4886f3b8f0 css: Use SCSS nesting for `#stream_creation_form`. 2019-07-25 14:44:58 -07:00
Vaibhav dd6494343a css: Use SCSS nesting for `#stream-creation`. 2019-07-25 14:44:58 -07:00
Vaibhav bd7fc23d30 css: Nest elements inside `#subscription_overlay #stream_creation`. 2019-07-25 14:44:58 -07:00
Vaibhav 4fc3878b00 css: Use SCSS nesting for `.stream-creation-body`. 2019-07-25 14:44:58 -07:00
Vaibhav 6a840e39f6 css: Nest `#announce-new-stream` inside `.stream-creation-body`. 2019-07-25 14:44:58 -07:00
Vaibhav 33bc11980d css: Use SCSS nesting for `.create_stream_button`. 2019-07-25 14:44:58 -07:00
Yashashvi Dave e55afc2629 user settings: Update alert message element in change-full-name modal. 2019-07-25 13:33:44 -07:00
Yashashvi Dave e1dacb99df user settings: Update alert message element in change-email modal. 2019-07-25 13:33:44 -07:00
Yashashvi Dave b3b480709d user settings: Update alert-msg-elem in change password modal. 2019-07-25 13:33:44 -07:00
Yashashvi Dave 4860904284 user setting: Update user display message for setting change-email. 2019-07-25 13:33:44 -07:00
Yashashvi Dave 916a84ce20 overlays: Remove all alert notifications from in open_modal func.
We should not display any alert previous notification on
open_modal() functions.
2019-07-25 13:33:44 -07:00
Yashashvi Dave 5506b16fa8 user settings: Add separate alert-save widget for profile custom fields.
Fixes part of #12748
2019-07-25 13:33:44 -07:00
Yashashvi Dave 3c16b73fcd account settings: Simplify handlebars conditional logics.
This commit simplifies complex handlebars conditional
logic for account settings tooltips and fields.
2019-07-25 13:33:44 -07:00
Anders Kaseorg 2ac944c31f css: Remove message_hovered class.
This appears to have been dead for years.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-23 17:54:12 -07:00
Tim Abbott 2273608477 css: Fix buggy pointer-events behavior in message feed.
I noticed a super weird bug where the edit pencil would disappear on
hover inside the message feed (!).  Investigation determined that what
was actually happening was that the Drafts overlay had been shown and
then hidden at a time when the mouse cursor was over the icons with
`data-toggle="tooltip"` configured, and the tooltip showing.  The
result was that this tooltip object, if you mouse over it, would cause
us to no longer be hovering over the message (because your cursor was
actually over the invisible drafts widget's leaked tooltip).

Ideally, we'd have fixed this by making the drafts modal `display:
none`, but that would interfere with the modal's closing animation,
and there's no good way to have an event trigger on a CSS animation
finishing.

There's a second bug that makes this possible, however, which is that
the drafts modal is supposed to be `pointer-events: none` while
hidden, but some rogue CSS for `message_top_line *` set
`pointer-events: auto` to override `pointer-events: none` on
`message_top_line` was accidentally applying to things inside that
line in the drafts modal, and furthermore accidentally overriding the
`none` setting for the modal as a whole.

We fix that second bug here, which resolves the overall issue.
2019-07-23 17:22:14 -07:00
Anders Kaseorg 82828bdba4 HTML validation: Remove invalid <button href> attribute.
For .start-button, Bootstrap carousel already supports <button
data-target> as a valid alternative to <button href>.  For
.call-to-action, the margin is decreased to exactly offset the lack of
margin collapsing with display: inline-block.  There should be no
visual change.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-23 16:16:22 -07:00
Alexandra Ciobica 1c7db8eb9a css: Fix why-zulip images.
The addition of `.markdown` class added border and shadow on images,
which does not look good on the landing page.
2019-07-23 15:00:54 -07:00
Rishi Gupta 3ffc174dcb settings: Update description for unread count setting. 2019-07-22 20:37:19 -07:00
Anders Kaseorg f54a63e2f9 webpack: Transpile JS code with Babel.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-22 17:55:32 -07:00
Anders Kaseorg ecfb7c6a7f lint: Add TypeScript compiler as a linter.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-22 17:55:18 -07:00
Cynthia Lin 8c55e27d1e night mode: Fix loss of border color on default style buttons. 2019-07-22 17:28:38 -07:00
Cynthia Lin e37f529e6a portico: Add and use .button class for links requiring button styling.
Buttons cannot be nested in anchor links because that is invalid HTML.
To make links look like buttons, create a .button class that inherits
styling from buttons and apply them to the necessary links.

Fixes #6126.
2019-07-22 17:28:38 -07:00
Priyank Patel e69c2f1aa2 notifications: Send message received from desktop app notification reply.
Adds a electron_bridge event that takes in message id and reply recived from
the notification reply and sends a message. We do this in webapp so desktop
doesn't have to depend on narrow and channel modules.

We also modify zjunit to reset window.electron_bridge after every run
to avoid leaking it.
2019-07-22 17:20:44 -07:00
Tim Abbott 1b9a0367f2 settings: Fix indication for whether push notifications are enabled.
This was apparently broken in
981433d13c, which used an apparently
invalid partial syntax for doing lookups.
2019-07-22 16:14:13 -07:00
Anders Kaseorg 0310c3def4 css: Fix weird checkbox scrolling bug in Chrome.
This fixes a problem in Chrome where checking our styled checkboxes in
the stream creation form sometimes caused parts of the page to scroll
in weird ways or disappear.

The issue was that the hidden `position: absolute` checkboxes weren’t
scrolling with the `#stream-creation` scrollbar, which is `overflow:
auto`, not SimpleBar.  When you focused them, Chrome tried to scroll
them into view by whatever means necessary.  In this case, the
necessary means were to scroll the `.subscriptions-container`, which
is `overflow: hidden`.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-22 10:56:19 -07:00
Harshit Bansal bf14a0af4d auth: Migrate google auth to python-social-auth.
This replaces the two custom Google authentication backends originally
written in 2012 with using the shared python-social-auth codebase that
we already use for the GitHub authentication backend.  These are:

* GoogleMobileOauth2Backend, the ancient code path for mobile
  authentication last used by the EOL original Zulip Android app.

* The `finish_google_oauth2` code path in zerver/views/auth.py, which
  was the webapp (and modern mobile app) Google authentication code
  path.

This change doesn't fix any known bugs; its main benefit is that we
get to remove hundreds of lines of security-sensitive semi-duplicated
code, replacing it with a widely trusted, high quality third-party
library.
2019-07-21 20:51:34 -07:00
Rohitt Vashishtha 5fc37c5f9b compose: Add compose typeahead for stream+topic mentions.
We implement 3 changes:

1. Partial Stream Typeahead

   In addition to regular stream completion, we do partial completion
   of stream typeahead on pressing '>'. We use our custom addition to
   typeahead.js: this.trigger_selection to start topic_list typeahead.

   Implements: `#stream na|` (press >) => `#**stream name>|`.

2. Topic Jump Typeahead

   'topic_jump' typeahead moves the cursor from just ahead of a
   completed stream-mention to just after the end of the mention
   text and is triggered by typing '>' after the stream mention.
   This typeahead merely uses the regex matching and event hooks of
   the typeahead library instead of displaying any text completions.

   Implements: `#**stream name** >|` => `#**stream name>|`.

3. Topic List Typeahead

   'topic_list' typeahead shows the list of recent topics of a stream
   and if your current text doesn't match one of them, also shows you
   the current query text, allowing you to create mentions for topics
   that do not exist yet.

   Implements: `#**stream name>someth|` => `#**stream name>something** |`.

At the end of this commit, we support the following mechanisms to
complete the stream-topic mention:

1. Type "#denmar|".
2. Press Enter to get "#**Denmark** |".
3. Press > to get "#**Denmark>|".
4. Type topic name and press enter.

OR

1. Type "#denmar|".
2. Type > to get "#**Denmark>|".
3. Type topic name and press enter.

Both result in the final inserted syntax: "#**Denmark>topic name**".

Documentation is still pending.

Fixes #4836.
2019-07-21 20:38:17 -07:00
Rohitt Vashishtha 83cbd62ba1 typeahead: Support custom selection triggers in bootstrap typeahead.
We add support for triggering typeahead_completion on custom keyup events
in addition to Tab and Enter. The function `this.trigger_selection` takes
the keyup event as its argument and has the same `this` context as the other
typeahead functions.

This is being added to support partial completion of stream typeahead to
directly start the topic_list typeahead.
2019-07-21 20:18:48 -07:00
Rohitt Vashishtha 63e200997d typeahead: Support automatic selection in bootstrap typeahead.
We add support for automatically selecting the currently highlighted
option in a typeahead without rendering the typeahead or the user
pressing 'enter'. The function `this.automated` can use available
data such as this.completing and this.token to determine if we should
automate selection or not.

This is being added to support the topic_jump mechanism.
2019-07-21 20:18:48 -07:00
Rohitt Vashishtha 5e6493d36e compose_state: Maybe update stream name on stream name change.
If we rename a stream that we are composing to, we now change the
stream name in the compose target as well.
2019-07-21 20:18:29 -07:00
Rohitt Vashishtha 3f03ae66f0 compose: Ensure valid destination stream in typeahead completion.
If we complete a typeahead with an invalid stream name in composebox,
we would get 'compose_stream is undefined' error while running the
checks to prevent accidentally mentioning private streams.

We can safely early-return from this function and let the 'send'
event handler show the error to the user.
2019-07-21 20:18:29 -07:00
Rohitt Vashishtha 5d20c4b8fb typeahead: Clear rendered stream html on stream rename.
Previously, after a stream name, you could search for it using its
new name but the typeahead would still display the old name.
2019-07-21 20:18:29 -07:00
YashRE42 0fa90162f9 buddy_list: Do not fade current user in PMs.
Fixes a bug where we would fade out our own name because it wasn't in
selected as a recipient in the compose box, when making a PM.
2019-07-21 15:06:10 -07:00
YashRE42 9f5fca5579 notifications: Refactor and test notifiable unreads logic.
In this refactor, we extract two functions in unread.js.  Which one to
use depends on whether res has already been fetched or not.

This also adds node tests to maintain coverage of unread.js.

Tweaked by tabbott for cleaner variable names and tests.
2019-07-21 14:56:42 -07:00
Rishi Gupta 7d8d0b2284 settings: Update upgrade text and styling.
When we add Plus, the first sentence should change to "Available on Zulip
Standard and Plus".

I copied the styling of .tip out of expediency, but it's also possible that
long term we'll want only 1 tip-like box styling.

The hover styling is a bit random, but I tried to copy other hover styles I
found in settings.scss.

Note that this renames .upgrade_realm_plan_type_suggestion to .upgrade-tip.
2019-07-21 14:32:36 -07:00
Rishi Gupta a93045c12d message view: Add keyboard shortcut to title for [More...]. 2019-07-20 14:39:15 -07:00
Rohitt Vashishtha 9d6727d18c echo: Update topic_links when we get messages back from server. (#12832) 2019-07-20 14:38:52 -07:00
Cynthia Lin bbdf00e6e5 night mode: Improve coloring of .new-style buttons.
Border and text color applied by specific classes such as sea-green
were nullified by the previous selector; this commit restores the coloring
for these buttons.
2019-07-19 13:27:37 -07:00
Cynthia Lin fd7cf53190 templates: Eliminate anchor links with nested buttons.
Given that all links are now modals triggered by JS, the anchor links are
just invalid HTML that have no purpose. This commit refactors the HTML to
eliminate them by adding the Bootstrap-native btn-link class to maintain
styling. Fixes part of #6126.
2019-07-19 13:27:37 -07:00
vinitS101 fe2ec995b6 message_view: Add js tooltip hovers for emoji reactions.
This removes HTML title hovers for emoji reaction buttons below messages
and replaces them with js tooltips.

Fixes #8679.
2019-07-19 12:45:44 -07:00
vinitS101 278ccc559b message_view: Add a js tooltip hover for reaction button.
This change removes the html title for the reaction button
and replaces it with a JS Tooltip with the same title text.
2019-07-19 12:45:44 -07:00
Vinit Singh 86073588be dependencies: Upgrade jquery-autosize 1.17.7 to autosize 4.0.2.
The API for the autosize library changed upstream, so several changes
had to be made to relevant js files for a successful upgrade.

Resolves #12695.
2019-07-18 14:33:16 -07:00
Tim Abbott 500b161aab unread: Enable the load_server_counts setting for everyone.
This change is long overdue.  After implementing this much more robust
system and deploying it on chat.zulip.org, we hesitated to make
load_server_counts the default behavior in master, because of data
anomalies present for many existing users (basically messages far back
in their history that they had never read, on streams they believed
themselves caught up on), which would have been confusing for many
users.

However, because the mobile apps have been using this data set for a
long time, we've likely cleared out the anomalies from active users'
data set.  And for older users, they're going to come back to
approximately infinite unread messages anyway, so the data anomalies
are unlikely to be important.

Fixes #7096.
2019-07-18 13:34:55 -07:00
Anders Kaseorg c4fee086a6 css: Restore keyboard accessibility to styled checkboxes. 2019-07-18 12:19:48 -07:00
Anders Kaseorg ab89f40a66 generate-custom-icon-webfont: Replace with webpack webfonts-loader.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-18 12:00:00 -07:00
Cynthia Lin 7bb5162fc7 portico: Refactor button selectors to use SCSS nesting. 2019-07-18 11:54:30 -07:00
Cynthia Lin 0f44608974 portico: Reorder button selectors in preparation for SCSS nesting. 2019-07-18 11:54:30 -07:00
Cynthia Lin 7c1b6aa5a8 portico: Remove style selector for superflous button.grey-transparent.
There is no element with the .grey-transparent class in the current
codebase, so it is likely legacy and thus unnecessary.
2019-07-18 11:54:30 -07:00
Vaibhav ba2d609e6a css: Nest `.subscriptions-header` inside `.subscriptions-container`. 2019-07-18 11:41:18 -07:00
Vaibhav d104935d69 css: Nest `.display-type` inside `.subscriptions-container .right`. 2019-07-18 11:41:18 -07:00
Vaibhav bafcad8ef3 css: Use SCSS nesting for `.subscriptions-container`. 2019-07-18 11:41:18 -07:00
Vaibhav ef64f33808 css: Reorder subscriptions.scss so .subscriptons-container is in same place. 2019-07-18 11:41:18 -07:00
Vaibhav 3c0f447f1a css: Use SCSS nesting for `.subscriptions-header`. 2019-07-18 11:41:18 -07:00
Vaibhav 279b52ac82 css: Reorder subscriptions.scss so .subscriptions-header is in same place. 2019-07-18 11:41:18 -07:00
Mohit Gupta 648a60baf6 narrow: Add condition whether to show unread message first in narrow.
All narrows that have is: query or can mark unread message as read
will show unread message first.
2019-07-17 17:58:20 -07:00
Mohit Gupta 6ec40cf9a0 search: Don't mark messages as read in search narrow.
Don't mark unread messages as read while searching.
This behavior will be extended to other narrows later.

Fixes: #12556.
2019-07-17 17:58:20 -07:00
YashRE42 7867830e14 settings: Adjust styling of ? icons. 2019-07-17 17:47:08 -07:00
Priyank Patel ea2e7ccf27 message_fetch: Use user ID for sender and group-pm-with operator. 2019-07-17 16:09:12 -07:00
Alexandra Ciobica 28ebe3e6ba css: Refactor topic edit buttons to use scss nesting. 2019-07-17 22:30:39 +03:00
Alexandra Ciobica 117e1e05ea css: Clean up styling of topic edit buttons.
Related to: #11233.
2019-07-17 22:20:52 +03:00
Archit Kaushik e8eaa19ae4 topic edit: Improve styling of topic edit icons (save and cancel).
The earlier styles were inconsistent with the rest of UI.
The new styles follow the colour scheme.

Fixes #10983
2019-07-17 22:20:52 +03:00
Tim Abbott d2f1c84001 settings: Rewrite logic for whether users can change name.
This moves this somewhat complicated, duplicated logic into a single
JavaScript function.
2019-07-16 11:43:57 -07:00
Cynthia Lin 8b538d8b8d user settings: Prevent linkifying trailing whitespace in change name button.
When user name changes are disabled and the disabled name change info icon
shows, trailing whitespace gets linkified because of the link's
inline-block property. Use Handlebars whitespace omission syntax to
eliminate this behavior.
2019-07-16 11:43:57 -07:00
Cynthia Lin 50cab76c59 user settings: Hide disabled name change info icon for admins.
This icon should only show when the user is not an admin and either the
realm or server settings have disabled name changes. Previously the icon
always showed for admin users.
2019-07-16 11:43:57 -07:00
Cynthia Lin 63c85da4db right sidebar: Use flexbox positioning for elements in USERS header.
Eliminate fixed positioning for better alignment.
2019-07-16 11:33:02 -07:00
Cynthia Lin a65007dde4 right sidebar: Ensure .user-with-count gets added to correct li element.
The count_span element is parented by a .selectable_sidebar_block element
which is parented by the li element that the class is supposed to be added
to. Thus, use the parents() jQuery method for locating the li parent so
that the class gets added to the correct element.
2019-07-16 11:33:02 -07:00
Cynthia Lin 94bbc32a92 user settings: Improve visibility of delete profile picture icon in light mode. 2019-07-15 13:49:00 -07:00
Cynthia Lin ec4c996361 user settings: Darken area outside of non-square profile avatars on hover. 2019-07-15 13:49:00 -07:00
David Wood 9bace3f2cd notifications: Allow only notifiable in unread count.
This commit adds a new setting to the user's notification settings that
will change the behaviour of the unread count in the title bar and
desktop application.

When enabled, the title bar will show the count of unread private messages
and mentions. When disabled, the title bar will act as before, showing
the total number of unread messages.

Fixes #1736.
2019-07-13 15:49:04 -07:00
Tim Abbott ca23740478 condense: Rewrite condense.toggle_collapse to be readable and correct.
The proposed fix in #11662 was effectively a workaround for some
already bad logic.  What we actually want to do is described in the
updated function comment (from the spec in #5914), and requires an
additionl case that was not present in the original implementation
(which effectively assumed a collapsed message was condensible).

Also add some documentation.

Fixes #11662.
2019-07-13 15:45:00 -07:00
Priyank Patel 73b19672c3 message_fetch: Use user IDs for supported operators.
The approach taken here is basically use user IDs in operator that
support it when sending the request for fetching the messages
(see comments in code for more details).
2019-07-13 11:35:37 -07:00
vsvipul e830853aee desktop-presence: Use system presence data from electron-bridge.
Combined with work in the desktop app, this makes it possible for the
desktop app to clearly indicate to other users whether the current
user is active on the system and thus would see a desktop
notification, not just whether they are active in the current Zulip
window.

Essentially rewritten by tabbott to add unit tests and consider the
desktop app data authoritative.
2019-07-13 11:21:22 -07:00
Anders Kaseorg adcfa68da8 templates: Remove partial helper.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-12 21:11:14 -07:00
Anders Kaseorg 0c565f50be templates: Use upstream Handlebars partials syntax.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-12 21:11:14 -07:00
Anders Kaseorg db0b33842c templates: Replace templates.render with require calls.
This removes an unnecessary layer of indirection and allows webpack to
catch filename mistakes.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-12 21:11:14 -07:00
Anders Kaseorg 3c3471b720 templates: Rename *.handlebars ↦ *.hbs and - ↦ _.
Tweaked by tabbott to avoid accidentally disabling the linter for
handlebars templates.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-12 21:11:03 -07:00
Cynthia Lin e5d0448505 user settings: Improve accessibility for new delete profile picture button. 2019-07-12 16:53:25 -07:00
Cynthia Lin ffaa0ee120 styles: Refactor #user-settings-avatar elements to use SCSS nesting feature. 2019-07-12 16:53:25 -07:00
Cynthia Lin 886deaf48d styles: Remove superflous .white-color class.
Class was only used in one location, rendering it unnecessary.
2019-07-12 16:53:25 -07:00
Cynthia Lin faa556ab5e user settings: Change delete profile picture button into a x icon.
Fixes part of #10255.
2019-07-12 16:53:25 -07:00
Cynthia Lin c4f510b724 styles: Refactor #user_presences li selectors to use SCSS nesting. 2019-07-12 16:34:06 -07:00