Commit Graph

8179 Commits

Author SHA1 Message Date
Vaibhav 5cc331b93f css: Cleanup CSS corresponding to `.flex-row .field`.
A `.field` element already has left margin set as 10px and setting
left-margin explicitly for a `.field + .field` equal to the same
value is redundant. This rule is removed.

Margin is set as `10px 10px` which can be equivalently written as
`10px`.
2019-05-27 22:50:11 -07:00
Vaibhav c50206b824 css: Use SCSS nesting in components.scss for `.flex-row`. 2019-05-27 22:50:11 -07:00
Vaibhav 95ab1f238e css: Reorder components.scss so that `.flex-row` are in same place. 2019-05-27 22:50:11 -07:00
YashRE42 04d9d1d27a info-overlay: Fix "message formating" styling.
The introduction of ".rendered_markdown table" in 00eaf3a, caused some
styling glitches in the "message formatting" overlay, such as an extra
right border and darker internal borders. This commit fixes these
glitches by duplicating bootstrap's table styles.
2019-05-27 14:39:09 -07:00
YashRE42 c2e5aa0f1e info-overlay: Shrink bubble around small_hotkey.
Adding a line-height here makes the bubble around the keys smaller which
makes the text within the bubble seem better aligned.
2019-05-27 14:39:09 -07:00
Anders Kaseorg 08f2ef0893 settings: Disable auto-hide on right pane scrollbar.
Fixes #11694.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-05-24 17:44:21 -07:00
Anders Kaseorg eec608d6a3 css: Improve SimpleBar scrollbar contrast.
Show black scrollbars with a thin light border in day mode, or white
scrollbars with a thin dark border in night mode (both at 50%
opacity).  This matches the native scrollbars on macOS pretty closely.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-05-23 17:26:19 -07:00
Greg Price de66b3b0f1 corporate: Add a /jobs page, with job posts for mobile/fullstack.
With various edits from Rishi and Tim.
2019-05-22 22:20:58 -07:00
Hemanth V. Alluri 1dfac14e33 devtools: Change "message" to "results_notice" the integrations tool.
This was done to avoid confusion between the user notification (now
being called results_notice) and Zulip's messages.
2019-05-22 21:28:11 -07:00
Hemanth V. Alluri 0e88a368de devtools: Make http headers "{}" by default in the integrations tool. 2019-05-22 21:28:11 -07:00
Hemanth V. Alluri c47521401f devtools: Move the integrations devtool JS to the portico folder. 2019-05-22 21:28:11 -07:00
Yashashvi Dave 3e50ed2075 org settings: Add organization profile preview option.
This should make it convenient and obvious how verify that their
organization profile looks nice after being markdown-rendered.

Fixes #12105.
2019-05-21 17:53:34 -07:00
David Wood e87d468f76 docs/org settings: Use "full member" terminology.
This commit modifies the help documentation and templates to use a "full
member"/"new member" terminology throughout.

With some tweaks by tabbott.
2019-05-21 17:48:46 -07:00
David Wood 6b9a9b1e31 org settings: Extract setting for new user waiting period.
This commit separates the `waiting_period_threshold` setting from
the `create_stream_policy` setting, adding a new setting that the user
can use to select a waiting period threshold.

Both the invite to stream policy and create stream policy now have
three options: admins only, members and admins, or members after
waiting period/admins.
2019-05-21 17:36:48 -07:00
David Wood 5e53e3d960 org settings: Remove hanging references.
`realm_invite_to_stream_by_admins_only` doesn't appear elsewhere in our
codebase. Introduced in 272ed90, so I'm guessing this is the intended
value.

Co-Authored-By: Rishi Gupta <rishig@zulipchat.com>
2019-05-21 17:36:47 -07:00
David Wood 24cb31329c org settings: Fix dropdown value inconsistency.
The value in the handlebars template for `invite_to_stream_policy`
is inconsistent with the value in the js file. Changing all three
occurances to a third value, since that's the one we'll want moving
forward.

Co-Authored-By: Rishi Gupta <rishig@zulipchat.com>
2019-05-21 17:36:47 -07:00
Kanishk Kakar 68d3b9f5ca docs: Update desktop app version to 3.0.0. 2019-05-21 15:16:06 -07:00
Mayank Madan d5e61e20e5 dev tooling: Add "create new user" and "create new realm" buttons.
Significantly tweaked by tabbott to clean up and expand the tests.

Fixes: #6018.
2019-05-21 15:03:37 -07:00
YashRE42 b8afddbd2a info-overlay: Add "bubble" style to keys. 2019-05-21 14:25:24 -07:00
YashRE42 8a914eb111 info-overlay: Unbold "or" between hotkeys. 2019-05-21 14:25:24 -07:00
YashRE42 15d04904bb info-overlay: Switch labels to left, keys to right. 2019-05-21 14:25:24 -07:00
YashRE42 e2ba65aa3f info-overlay: Improve styling of hotkeys.
Fixes: #11573.
This moves help_table to informational-overlays.scss, replaces "," with
"or" and "P" with "shift + p" in order to be more clear and legible
this also improves the styling of the text.
2019-05-21 14:25:24 -07:00
Lobster c1538fd0f5 docs: Update docs for Redmine Integration 2.0. 2019-05-21 09:21:28 -07:00
Anders Kaseorg 2f43284dd8 user_profile_modal: Move SimpleBar back to the correct div.
Fixes a regression in commit 01613e71fb
(#12348).

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-05-20 19:25:21 -07:00
Tim Abbott e35773658b css: Remove weird whitespace rules in markdown content.
These seem to have been there since the very first version of our
markdown styling, and I can't imagine why we would the behavior of not
line-wrapping links now.

(I think the "weird bug" mentioned in the comment history might have
to do with an old animation when you hovered over a link on portico
pages).
2019-05-20 19:14:35 -07:00
Tim Abbott 734c18f356 integrations: Fix buggy ol/paragraph spacing.
This appears to caused by trying to reuse this bit of spacing logic
from the Help Center's CSS rules.

I'm not altogether happy with this fix, but it resolves the issue and
we can defer further work until we're ready to clean up the
portico/landing pages CSS more generally.
2019-05-20 18:54:46 -07:00
sameerchoubey d711b1c8ba portico: Add responsive styling to /integrations/ subpages.
Tweaked by tabbott to clean up the commit message and some confusing
code duplication.

Fixes #11701.
2019-05-20 18:49:27 -07:00
Aditya Bansal 43591d6c71 archives: Display globe icon for web public streams.
In this commit we start reserving the globe icon for web public
streams and replace instances of mixed usage of globe for public
streams with a '#'.
2019-05-20 18:13:31 -07:00
Joshua Pan c28c301506 org_settings: Display delivery_email to admins always is admin UI.
Mostly rewritten by Tim Abbott to ensure it correctly implements the
desired security model.

Administrators should have access to users' real email address so that
they can contact users out-of-band.
2019-05-20 18:13:31 -07:00
Pragati Agrawal 8eac7394f8 typeahead helper: Hide email under hidden email-address-visibility cases.
In email hidden case (that is when `email_address_visibilty` is set to
everyone), for "non admins", this commit hides emails from:
- compose box user typeahead.
- PM user typeahead
In email hidden case, for admins, email is shown in user typeaheads.
2019-05-20 15:56:23 -07:00
Pragati Agrawal cdc50090b6 popovers: Hide email under hidden email-address-visibility cases.
In email hidden case (that is when `email_address_visibilty` is set to
everyone), for "non admins", this commit hides emails from:
- user popover
- custom profile popover
In email hidden case, for admins, email is shown in both user popovers and
custom profile popovers.
2019-05-20 15:56:21 -07:00
Pragati Agrawal 4df971c3c2 org settings: Add save/discard widget for realm authentication methods.
Along with this, we refactored settings_org.populate_auth_methods to use
HTML function after rendering all auth methods rows rather than appending
each row individually, which actually is a good practice.

Also in this commit, to compare `current_val` and `changed_val` in
`check_property_changed` function of the property
`realm_authentication_methods`, which are objects, and we found here
https://stackoverflow.com/a/1144249 that there is no easy way to do so. So
I followed this approach,

```js
 JSON.stringify(obj1) === JSON.stringify(obj2)
```

but before converting them to string we want the same order of keys, so we
used `sort_object_by_key` to sort `current_val` by keys and
`get_auth_method_table_data` always return `changed_val` having keys
sorted.

Since these refactor were closely related we kept them as a single commit
here.

Fixes: #11954.
2019-05-20 15:42:15 -07:00
Pragati Agrawal c634d22de9 org settings: Add `sort_obj_by_key` function to sort objects.
Actually, this is a preliminary commit which adds a general
`sort_obj_by_key` function to sort objects according to keys.

In this commit, we have refactored `populate_auth_methods` function by
extracting the logic for the desired `sort_obj_by_key` and used that to
sort `auth_methods`, but the main motive of this function is to sort
`realm_authentication_methods` in `check_property_changed` to sort
`current_val` in the upcoming commit.
2019-05-20 15:41:45 -07:00
Tim Abbott 263657dcb6 integrations: Clean up comments in devtool JavaScript.
Most of this is just editing for brevity or focus.
2019-05-20 12:52:56 -07:00
Hemanth V. Alluri 1a12e112d9 devtools: Completely overhaul the frontend for the integrations devtool.
This commit also adds a small functionality change where the results of
each webhook fixture message sent is now displayed to the user.

With a small tweak by tabbott to fix a styling bug.

Fixes #12122.
2019-05-20 12:36:15 -07:00
Hemanth V. Alluri ef98211f68 devtools: Add support for non-json fixtures for the integrations tool.
Note: If you're going to send fixtures which are not JSON or of the
text/plain content type, make sure you set the correct content type
in the custom headers.

E.g. For the wordpress fixtures the "Content-Type" should be set to
"application/x-www-form-urlencoded".
2019-05-20 12:31:52 -07:00
Hemanth V. Alluri 8214d65336 devtools: Add support for send_all in the integrations dev panel.
Using this feature a reviewer can easily send and view all fixture
messages for any given integration - with only JSON fixtures that is.
2019-05-20 12:29:10 -07:00
Rishi Gupta d17fb622c9 popovers: Refactor user popover to match visual order.
Just swapping an "if is_me" block with a consecutive "unless is_me" block,
so should be no change in logic.
2019-05-20 12:21:57 -07:00
Rishi Gupta 36ff56e741 message feed: Add hotkey hint to Edit pencil on message hover. 2019-05-20 12:18:13 -07:00
Tim Abbott a28af1fd64 css: Remove unnecessary prefixed transitions.
The transition keyword has been standard for a while now; see the
previous commit for details.
2019-05-20 12:15:16 -07:00
Boris Yankov 18a350f042 css: Remove unnecessary 'prefixed-transition' mixin.
The `transition` property does not need prefixing. In fact, very
few properties need that nowadays. So remove it to simplify
the code. This is strictly a refactor with no style change intended.

Many of these styles shouldn't have been prefixed even if needed.
The prefixes exist exactly because the implementations might differ
from the incoming standard.

Looking at the supported browsers:
https://caniuse.com/#search=transition

We see that this property has had mainstream support from 2012 and
was supported on Firefox in 2006 !!!
2019-05-20 12:15:16 -07:00
Vaibhav 76295dd59f css: Club rules in reactions.scss under selector `.message_reaction_count`. 2019-05-20 12:01:49 -07:00
Vaibhav ae47ddc16e css: Use SCSS nesting in reactions.scss for `.reaction_button`. 2019-05-20 12:01:49 -07:00
Vaibhav e8c072a4c8 css: Reorder reactions.scss so that `.reaction_button` are in one place. 2019-05-20 12:01:49 -07:00
Vaibhav c4b683a638 css: Use SCSS nesting in reactions.scss for `.message_reaction`. 2019-05-20 12:01:49 -07:00
Vaibhav 9ef3a660b3 css: Reorder reactions.scss so `.message_reaction` are in same place. 2019-05-20 12:01:49 -07:00
Vaibhav 9e1ee434a7 css: Use SCSS nesting in reactions.scss for `.private-message`.
Precisely for `.private-message .message_reactions .message_reaction`.
2019-05-20 12:01:49 -07:00
Vaibhav 129dfec297 css: Use SCSS nesting in reactions.scss for `.message_reactions`. 2019-05-20 12:01:49 -07:00
Vaibhav c726198cbc css: Reorder reactions.scss so `.message_reactions` are in same place.
This atomically makes `.private-message` in same place too.
2019-05-20 12:01:49 -07:00
Vaibhav 7d8ced7375 css: Use SCSS nesting in reactions.scss for `.emoji-popover-emoji`. 2019-05-20 12:01:49 -07:00
Vaibhav eb8a8fa0dc css: Reorder reactions.scss so `.emoji-popover-emoji` are in same place. 2019-05-20 12:01:49 -07:00
Vaibhav a20b48589f css: Use SCSS nesting in reactions.scss for emoji popover rules. 2019-05-20 12:01:38 -07:00
Vaibhav 8eaa12c49a css: Reorder reactions.scss so `.emoji-popover` are in same place. 2019-05-20 11:53:34 -07:00
Vaibhav 09745d6637 css: Remove redundant `.reaction_button` rule from reactions.scss.
The removed rule does not apply in any case since it's always overridden
by `.message_reaction + .reaction_button` rule defined later on.
2019-05-20 11:53:34 -07:00
YashRE42 9b32c844df navbar: Fix stream + topic jump at 500px.
This resolves a bug where the "stream" tab item would be missaligned
with the rest of navbar and leave some empty space.
2019-05-20 11:26:22 -07:00
Kanishk Kakar 77ab9a0eb0 docs: Update desktop repo URL. 2019-05-20 11:01:11 -07:00
Anders Kaseorg 01613e71fb ui: Replace set_up_scrollbar with data-simplebar attribute.
With perfectScrollbar, we needed to call a function from JavaScript to
enable a scrollbar on a new element, but simplebar has a much simpler
default API one can do by using data-simplebar attributes in the HTML.

So we can delete all the scrollbar creation/deletion code.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-05-19 18:06:38 -07:00
Anders Kaseorg 3daa4fa64d pm_list: Set up #private-container once and replace its contents.
Instead of deleting and rebuilding #private-container every time its
contents need to be updated, just replace its contents.  This
eliminates some scrollbar flashing.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-05-17 12:06:51 -07:00
Anders Kaseorg 141088586b Completely replace perfect-scrollbar with SimpleBar.
perfect-scrollbar replaces both the appearance and the behavior of the
scrollbar, and its emulated behavior will never feel native on most
platforms.  SimpleBar customizes the appearance while preserving the
native behavior.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-05-17 12:06:51 -07:00
Hemanth V. Alluri e23d5e9631 devtools: Set default stream and topic in integrations dev panel.
This makes it a lot faster to just send a message with a few clicks.
2019-05-17 11:53:05 -07:00
Hemanth V. Alluri 2bd9c8cb42 devtools: Add custom HTTP headers support to the integrations dev panel.
This commit introduces a simple field where the user can now specify custom
HTTP headers. This commit does not introduce an improved system for storing
HTTP headers as fixtures - such a change would modify both the existing unit
tests as well as this devtool.
2019-05-17 11:50:53 -07:00
Hemanth V. Alluri 5b4979806c devtools: Don't clear fields on fixture submission error. 2019-05-17 11:50:39 -07:00
Rishi Gupta 17774a80cb org settings: Update organization logo section.
This section was taking up too much visual weight, and drowning out other
elements on the page.

Once we remove the Upload buttons, we can likely shrink this further.

We remove the box-radius since at the smaller size it interferes with how
the logos look (and will look in the app).

We remove the margin-top to make this consistent with the spacing around
organization profile picture.

We change the max width from 730 to 500 since the Upload new logo button is
214px in length (not including margin), and those buttons are now inline
instead of on the next line.
2019-05-17 11:48:17 -07:00
Rishi Gupta e9a180dcb4 org settings: Fix box-shadow in organization logos section.
The box-shadow was
* Not being applied to the images (the images get their box shadow from a
  more specific rule)
* Being unintentionally applied to the upload/delete buttons
* Being unintentionally applied to the container housing the buttons and
  error messages.

The last one especially looked bad, since it added boxes where there
otherwise wouldn't be a box.
2019-05-17 11:48:17 -07:00
Mohit Gupta 1902f5210c message_flags: Batch read flag requests to at most 1k message IDs at a time.
Send at most 1k message ids in a single read flag request to avoid locking
large number of rows in server database in a single request and avoid long
processing time.

Fixes #11956.
2019-05-15 17:56:48 -07:00
Hemanth V. Alluri bae8295c52 devtools: Add integrations dev panel.
This commit adds a new developer tool: The "integrations dev panel"
which will serve as a replacement for the send_webhook_fixture_message
management command as a way to test integrations with much greater ease.
2019-05-15 13:07:44 -07:00
vinitS101 611f1f8fd2 left_sidebar: Add "+Add streams" to bottom of streamlist.
Added a new button at the bottom of the stream list which redirects
users to '/#streams/all' where they can create new streams or subscribe
to new streams.
The button is not visible to guests.

Fixes #11642.
2019-05-14 16:12:51 -07:00
vinitS101 e8c1523aa2 left_sidebar: Gear icon now redirects to '/#streams/subscribed'.
The gear icon above the streamlist now redirects to
'/#streams/subscribed' instead of '/#streams/all'.
2019-05-14 16:12:51 -07:00
vinitS101 a06f35182d copy_and_paste: Extract functions for div creation and removal.
This moves div creation and removal code in the copy_handler function
to separate functions for more reusability.
2019-05-13 18:07:21 -07:00
Vaibhav d3b201337e copy_and_paste: Bind default copy handler to hotkeys.
This removes the 'copy' event listener and binds the copy handler
to `Ctrl+C` or `Cmd+C` (OSX) keys;
2019-05-13 17:58:12 -07:00
Yashashvi Dave 3c4971edc1 subscriptions: Fix error when guest user is subscribed to public stream.
When guest user is subscribed to public stream, it throws json
error. Because when guest user is subscribed to public stream,
the `stream-sub-count` element is not initialized.
This commit fix this error, by editing the function
`rerender_subscribers_count` to intialize the element
first, when guest user is subscribed.
2019-05-13 17:47:22 -07:00
Yashashvi Dave b5b5700338 hashchange: Redirect guest user on not-allowed stream settings hash. 2019-05-13 17:27:32 -07:00
Yashashvi Dave 3f38fc6b79 streams: Redirect to subscribed-tab on unsubscription for guest user.
This commit add code to redirect guest users to
subscribed-stream-tab and removes the recently-unsubscribed
stream from settings tab on unsubscription.
2019-05-13 17:27:32 -07:00
Yashashvi Dave b68c1bb6ac streams: Disable "All streams" tab for guest users.
Fixes #10980
2019-05-13 17:27:32 -07:00
Yashashvi Dave 2598db4a77 streams: Hide unsubscribed streams in settings to guest users. 2019-05-13 17:27:32 -07:00
Yashashvi Dave 80ceb1a46d components: Add `disable_tab` attribute. 2019-05-13 17:27:32 -07:00
Yashashvi Dave cb85ca8601 models: Alter video_chat_provider field type to integer.
Migration rewritten by tabbott because it did not work.
2019-05-13 12:02:28 -07:00
Tim Abbott 243db9a22f css: Fix width calculations for fluid width.
Apparently, while b38ae6e0ed was correct
for the default Zulip UI, it was not correct for the fluid width case,
where we did actually want to override the 1400px width rule for the
non-fixed `.app-main` element.

The right fix here is to add an additional CSS rule tweak to our
scrollbar logic.  This has been carefully tested with both initial
setting states as well as toggling the state.
2019-05-13 11:27:00 -07:00
Tim Abbott b38ae6e0ed scrollbar: Fix incorrect CSS selector.
In a838de63d8, we incorrectly changed
the selector for accessing .fixed-app .app-main to just be .app-main,
which resulted in it affecting parts of the site it should not have.

The end result was a significant layout regression of the floating
recipient bar at some widths.
2019-05-10 11:45:46 -07:00
Tim Abbott 349c6f972b scroll_bar: Calculate the scrollbar width only once.
We wouldn't do it often in any case, but this is a cleaner workflow in
case a future design has us call these size adjustment functions more
often.
2019-05-10 11:44:27 -07:00
Puneeth Chaganti 4383c819cf digest: Fix visibility toggling of digest notifications checkbox. 2019-05-10 09:08:02 -07:00
Puneeth Chaganti 28df5f83dd digest: Always render digest day options as js controls visibility. 2019-05-10 09:08:02 -07:00
Tim Abbott abae98a901 css: Add detailed comment explaining our 1400px max-width.
The reference to this being overriding in scroll_bar.js and how it
causes flashes is valuable.
2019-05-09 14:07:27 -07:00
Tim Abbott beb3059547 css: Remove long-dead "sticky" CSS rules.
The code that uses these rules was removed in
f1e90086f5.
2019-05-09 13:58:41 -07:00
Pragati Agrawal a838de63d8 settings: Add option for fixed/fluid width.
This adds a new option for "fluid width" under `Display settings` section
of SETTINGS/DISPLAY SETTINGS tab.

Fixes: #11844.
2019-05-09 13:57:57 -07:00
Pragati Agrawal 389c56e88d settings_display: Refactor settings_display.
This commit refactors settings_display in order to make code more precise
and clear.
2019-05-09 13:49:43 -07:00
Harshit Bansal b553507412 subscriptions: Migrate notification setting defaults model.
This commit migrates the Subscription's notification fields from a
BooleanField to a NullBooleanField where a value of None means to
inherit the value from user's profile.

Also includes a migrations to set the corresponding settings to None
if they match the user profile's values. This migration helps us in
getting rid of the weird "Apply to all" widget that we offered on
subscription settings page.

The mobile apps can't handle None appearing as the stream-level
notification settings, so for backwards-compatibility we arrange to
only send True/False to the mobile apps by applying those defaults
server-side.  We introduce a notification_settings_null value within a
client_capabilities structure that newer versions of the mobile apps
can use to request the new model.

This mobile compatibility code is pretty effectively tested by the
existing test_events tests for the subscriptions subsystem.
2019-05-08 17:45:10 -07:00
vinitS101 18a424be79 uploads: Remove unusable UI elements if file uploading is disabled.
If MAX_FILE_UPLOAD_SIZE is set to 0, then UI elements like the upload
icon in the compose and message edit UI and "Attachments" menu in
"/#settings" are not displayed.
A different error message is also displayed if a user tries to drag and
drop or paste a file into the compose message box.

Fixes #12152.
2019-05-08 17:10:07 -07:00
Yashashvi Dave 46f45f35d2 stream_ui_updates: Add generic `initialize_disable_btn_hint_popover` func. 2019-05-08 15:09:16 -07:00
Yashashvi Dave a259b29322 streams: Update description for stream-privacy-type.
Fixes #10524
2019-05-08 14:49:27 -07:00
Puneeth Chaganti b016ab257e digest: Toggle display of digest weekday setting dynamically.
Hide or show the digest weekday setting, based on whether
`digest_emails_enabled` flag is turned on or off.
2019-05-08 14:39:12 -07:00
Puneeth Chaganti 55a4c5751d digest: Move digest weekday drop-down next to the enable checkbox. 2019-05-08 14:39:12 -07:00
Yashashvi Dave ce917ef3e6 css: Remove `display-none` class css entirely.
All the elements to which `display-none` class
is applied, are handled with `.show()`/`.hide()`
functions instead of `.addClass('display-none')`
and `.removeClass('display-none')`.
Therefore, we should use apply `display: none;`
to elements with `style` attribute.

This commits removes all usage of `display-none`.
2019-05-08 09:41:48 -07:00
Yashashvi Dave 02a1b2e26b server events: Add realm-time-sync event to update stream privacy.
Add event to update stream settings whenever stream privacy is changed
accordingly.

Fixes #9470
2019-05-07 17:33:59 -07:00
Yashashvi Dave a68a06d94f static/js/stream_events: Modify function `update_property`.
This commits modifies function `update_property` to
update more one stream-sub-property in one event.
2019-05-07 17:33:59 -07:00
Yashashvi Dave 78bb9bf37a streams: Update subs-ui-element on change-stream-privacy. 2019-05-07 17:33:59 -07:00
Yashashvi Dave fbf25942d0 streams: Extract change-stream-permissions functions. 2019-05-07 17:33:59 -07:00
Yashashvi Dave ccd3b49555 streams: Disable sub-btn with explanation if user not allowed to subscribe. 2019-05-07 16:38:36 -07:00
Yashashvi Dave 9d21b61f99 streams: Disable sub-check-btn if user is not allowed to subscribe.
This commit disable the subscription checkmark button in stream list
view, if user is not allowed to subscribe to stream.
2019-05-07 16:33:01 -07:00
ruchit2801 d2e1f5edc2 left sidebar: Add option to toggle 'Display starred count'.
This adds option in popover of starred messages, to toggle displaying
counts of starred messages.

This is a follow-up to #11645.
2019-05-07 10:58:12 -07:00
Yashashvi Dave f25012f025 custom profile field: Fix styling regression in admin settings.
The css of `display-none` class was override by
`.rendered_markdown tr` class's css.
This commit fix this regression by applying style
to html element instead of class.
2019-05-07 08:56:01 -07:00
Vaibhav 1f76374e32 message_list_view: Move edited position conditionals to JS.
This adds three bools to message_container object which calculate bools
where the "(EDITED)" label should appear:

* `edited_in_left_col` -- when label appears in left column.
* `edited_alongside_sender` -- when label appears alongside sender info.
* `edited_status_msg` -- when label appears for a "/me" message.

We use the new bools and remove the complicated if else statements
from the templates for the "(EDITED)" label.

This also allows us to add a unit test to verify the logic.
2019-05-06 21:37:54 -07:00
Vaibhav 58874a08e3 message_list_view: Rename `_add_msg_timestring` to `_add_msg_edited_vars`. 2019-05-06 21:35:05 -07:00
Vaibhav 860406d1ad message_list_view: Extract `_get_msg_timestring` method.
This method gets the timestring for the message container when the
message was last edited.
2019-05-06 21:34:54 -07:00
Vaibhav d93f5b2977 single_msg_handlebars: Cleanup moving css rules in stylesheets.
Cleanup single message template moving CSS rules for box shadow
of a private message stream inside stylesheets. For any messagebox
inside of a `.private-message` element, the box shadow is set using
the class. In cases of normal streams, the box shadow is set using
inline style since we cannot have different classes for each color.

Changes made in drafts.scss are to keep the current style of not
having the left border. Setting style using classes, this rule had
to be overridden.
2019-05-06 21:28:46 -07:00
Alexandra Ciobica 0162b7645d portico: Update android screenshot and associated svg. 2019-05-06 21:11:30 -07:00
Vishnu Ks 6c58603eaf support: Add support for scrubbing realm. 2019-05-06 20:12:54 -07:00
Vishnu Ks f6203f068b support: Add support for activating and deactivating realm. 2019-05-06 20:12:48 -07:00
Yashashvi Dave 81bcdf2e94 streams: Fix minor false html element selection. 2019-05-06 17:30:33 -07:00
Yashashvi Dave bfabb86f39 stream hash: Update hash before updating settings UI elements. 2019-05-06 17:30:33 -07:00
Yashashvi Dave 6ae6da5d22 stream_ui_updates: Move function `update_add_subscriptions_elements`. 2019-05-06 17:30:33 -07:00
Yashashvi Dave 71e561de76 stream_ui_updates: Extract `update_subscribers_list` function. 2019-05-06 17:30:33 -07:00
Yashashvi Dave 7d7cf3d786 stream_ui_updates: Extract `update_subscribers_count` function. 2019-05-06 17:30:33 -07:00
Yashashvi Dave 4cd33f23bc stream_ui_updates: Refactor update-stream-privacy-type function. 2019-05-06 17:30:33 -07:00
Yashashvi Dave d86ee6b4f0 stream_ui_updates: Extract `update_stream_privacy` function. 2019-05-06 17:30:33 -07:00
David Wood f53a8f8bb6 settings: Rename `create_stream_permission` in templates.
This commit renames the `create_stream_permission` field in the
templates to `create_stream_policy`, matching the field used in the
database model. This matches what `invite_to_stream_policy` does and
will be clearer when the `waiting_period_threshold` is split into its
own field.
2019-05-06 16:30:01 -07:00
David Wood 34d810aac3 settings: Migrate to create_stream_policy structure.
This commit replaces the `create_stream_by_admins_only` setting with a
new `create_stream_policy` setting, which mirroring the structure of
the existing `invite_to_stream_policy`.

This is important preparation for migrating the waiting period feature
to be its own independent setting.

Fixes #12236.
2019-05-06 16:27:55 -07:00
vinitS101 81b5a72252 admin_settings: Change maxfilesize to max_file_upload_size.
Renamed maxfilesize to max_file_upload_size for consistency.
Related to #12152.
2019-05-03 17:36:09 -07:00
vinitS101 3cb502974e compose: Change file upload error message to show correct file size.
The error message, that is displayed when a user tries to upload a file
larger than the allowed size, currently displays a hardcoded max file
size of 25MB.
Changed this to show the correct max_file_upload_size value that has
been set by the server admin.
2019-05-03 17:36:09 -07:00
Shubham Padia 884c19c3bc settings: NAME_CHANGES_DISABLED disables the name change button.
Fixes #12251.

Previously when disabling name changes in server settings, instead
of realm settings, the name edit button did not get disabled.
Changing name resulted in a message stating `no changes made`.
2019-05-03 12:58:51 -07:00
Shubham Padia 8c01f396db settings: Add AVATAR_CHANGES_DISABLED server setting.
Fixes #12132.
Realm setting to disable avatar changes is already present.
The `AVATAR_CHANGES_DISABLED` setting now follows the same
2-setting model as `NAME_CHANGES_DISABLED`.
2019-05-03 12:58:51 -07:00
Shubham Padia 4994a6c2c9 realm: Add setting to disable avatar changes.
This is useful when syncing avatars from an integrated LDAP/active
directory.

The upload avatar and delete avatar buttons are hidden if avatar
changes are disabled and the user is a non-admin.
If the user has a gravatar set, then the user will not be able to
upload an image as their avatar if avatar changes are disabled.

Part of #12132.
2019-05-03 12:52:43 -07:00
Yashashvi Dave 22f172114d subscription: Update existing sub-row in settings on sub events.
Update stream-subscription-row in stream settings, when
subsctiption add/removal event is received. This is only
to show dynamic effects to user on sub events.
2019-05-01 17:23:44 -07:00
Yashashvi Dave a593f73e9a static/js/subs.js: Extract `update_stream_row_in_settings_tab` function. 2019-05-01 17:23:44 -07:00
Yashashvi Dave ed2dd612fb static/js/subs.js: Extract `is_subscribed_stream_tab_active` function. 2019-05-01 17:23:44 -07:00
Alexandra Ciobica 8aa982f7ba user status: Add "clear message (x)" button for status message input.
This adds the same "x" button as we have in "stream search" or "people
search" to the user status modal.

The button is shown if someone types something, or if the status
message was already set (meaning there was already a value in the
input field). If the input field is empty, the button is not visible.

This fixes the follow-up comments from #12179.
2019-05-01 16:36:45 -07:00
Alexandra Ciobica 61758735f3 user status: Clean up code for user status options.
- Changed the <p>s to <button>s and modified the css accordingly.
- Changed the css to use scss nesting.
- Changed the line-height from 1.0em to 1.1em, because on Safari the "g" was not fully displayed.
2019-05-01 16:34:54 -07:00
Shubham Padia 27ff71c96f settings: Don't check mobile notifications if they are disabled.
Fixes #12198.
2019-04-30 14:56:26 -07:00
Yashashvi Dave 7a168216ff stream_ui_updates: Extract `update_change_stream_privacy_settings`. 2019-04-30 14:37:30 -07:00
Yashashvi Dave ecc165b899 stream_ui_updates: Extract `update_regular_sub_settings`. 2019-04-30 14:37:24 -07:00
Yashashvi Dave a71eb6aa15 subs: Extract change-stream-privacy block from function.
This commit removes code to update-stream-privacy-btn
in stream settings from update-sub-settings function.
Because stream-privacy-btn is not part of regular
sub-settings, it is admins only settings.
2019-04-30 14:36:52 -07:00
Yashashvi Dave 9dd9ea5721 stream settings: Update URL when opening empty settings panel. 2019-04-30 14:36:52 -07:00
Yashashvi Dave 460515a2ee stream settings: Extract `setup_subscriptions_tab_hash` function. 2019-04-30 14:36:52 -07:00
Yashashvi Dave ec5ef08a19 subs: Fix URL not updating as per UI on stream unsubscription.
When user unsubscribe from stream by clicking on
subscription-checkmark, the URL changes to unsubscribed
stream but stream settings UI is not updated.
We should change URL and stream settings modal
simultaneously. This PR moves update-hash function
inside open-stream-modal function, which make sure that
URL is getting updated everytime open-stream-modal
function is called and not otherwise.
2019-04-30 14:37:19 -07:00
Yashashvi Dave 2d1b80e2b4 stream_ui_updates: Extract `update_settings_button_for_sub`. 2019-04-30 14:37:14 -07:00
Yashashvi Dave 859ba9e892 stream_ui_updates: Extract `update_check_button_for_sub` func. 2019-04-30 14:37:05 -07:00
Yashashvi Dave 3649a9f15c subs: Add `stream_ui_updates.js` module for managing ui elements.
This commit adds `stream_ui_updates.js` module. This module
will includes functions which will update different ui elements
(i.e. subscription button, subscriber count).
2019-04-30 14:36:52 -07:00
David Wood 272ed90685 settings: Create an explicit invite_to_stream_policy setting.
This commit creates a new organization setting that determines whether
a user can invite other users to streams. Previously this was linked
to the waiting period threshold, but this was both not documented and
overly limiting.

With significant tweaks by tabbott to change the database model to not
involve two threshhold fields, edit the tests, etc.

This requires follow-up work to make the create stream policy setting
work how this code implies it should.

Fixes #12042.
2019-04-29 17:11:28 -07:00
vinitS101 f46b5a8ba1 message view: Decreased top margin of messages with sender info.
Decreased the top margin of first line of messages to align better with
the profile picture of the user.
2019-04-29 10:12:58 -07:00
Puneeth Chaganti 0987ef8809 Merge pull request #12221 from punchagan/safari-upload-fix
Fixes couple of problems with image pastes on Safari
2019-04-28 22:51:17 -07:00
Anders Kaseorg d4b060a520 dependencies: Upgrade simplebar to 4.0.0-alpha.6.
Fixes #12038.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-04-28 21:32:55 -07:00
Puneeth Chaganti a98341c79f digest: Add an organisation setting to choose the digest weekday.
Closes #549.
2019-04-28 18:40:07 -07:00
Puneeth Chaganti b0f485e95f org settings: Allow admins to enable or disable digest emails. 2019-04-27 15:20:41 -07:00
Puneeth Chaganti aca63f0fbe notifications: Hide digest emails user setting if globally disabled. 2019-04-27 15:20:41 -07:00
Mayank Madan 4c81474a4f webhooks: Add Buildbot integration.
With some minor changes by Eeshan Garg.

Fixes: #5639.
2019-04-27 15:19:16 -07:00
Wyatt Hoodes 820dd3a946 settings: Fix broken headers in night mode.
This bug turned out to pop up wherever a table existed in both
'settings' and 'organization settings', notably *excluding* both
'Custom Emoji' and 'Authentication Methods'.

The first thought to the solution was to simply add `thead` to the css
rule that applies the appropiate color for headers and the like.  This
was successful, however it brought attention to a sub-problem:

`emoji-settings-admin` and `auth-mehtod-settings-admin` were both
creating table headers in the body of the table. This was causing the
rows in these two tables to be colored inversely from all the others.
This is also the reason why these tables are the only ones correctly
styled. These handlebars were updated with the headers moved out of the
body.

The even and odd rows of the tables were then colored appropriately.

Fixes: #12209
2019-04-27 15:03:57 -07:00
Tim Abbott 7da28600c7 settings_org: Fix linter error with ==.
Apparently this was fixed in a later commit.
2019-04-26 22:48:03 -07:00
Pragati Agrawal f9681c1f51 org settings: Remove redundant loading indicator from auth methods table.
Number of auth methods isn't much, so no need to have loading indicator
here.
2019-04-26 17:57:04 -07:00
Pragati Agrawal d0ba0c7409 org settings: Add generalised function for tip-box for org settings.
This commit adds a `insert_tip_box` function and thus adds a
`organization-settings-tip` handlebars file to add a genaralised tip for
all organization settings pages. This further removes the code for tipbox
which was added in `populate_auth_methods` functions, as it wasn't making
sense there, making it more clear and readable.
2019-04-26 17:54:58 -07:00
Pragati Agrawal 2277ee0c90 org settings: Move `disable` attribute to `admin_auth_methods_list`.
This commits disables the auth-methods table using the disabled attribute
in admin_auth_methods_list handlebars instead of doing that in
settings_org.
2019-04-26 17:52:19 -07:00
Pragati Agrawal 75fc19acfd org_settings: Refactor `get_subsection_property_elements` function.
This commit adds a class prop-element for all the property elements, so
that later on we can directly use this to access elements.

In `get_subsection_property_elements`, we were finding these elements using
a makeshift method, where we were finding all these elements by mentioning
all input elements, textarea, select elements, which is not a desirable
method.
So now, here in `get_subsection_property_elements` function, we are finding
these properties using the newly added class `prop-element` which makes
code more clear and readable.
2019-04-26 17:52:19 -07:00
Pragati Agrawal 3dd5e1642b org_settings: Fix data collection of message retention property.
In handlebars and settings_org.js, the subsection in which
`realm_message_retention_days` property lies doesn't agree, and this wasn't
observed for a long time as it's disabled, still to make things right, in
this commit we have moved the logic which handles the collection of data
from `other_permission` to `other_settings` as it makes more sense there.
2019-04-26 17:41:01 -07:00
Pragati Agrawal ed30f71e07 org_settings: Remove redundant success_continuation variable.
This removes all the instances of `success_continuation` from settings_org
and accordingly refactors some code.
2019-04-26 17:41:01 -07:00
Hemanth V. Alluri 34db469700 org_settings: Fix error with undefined profile_field in bot settings.
This is a small patch to fix the error message an admin would receive if
they tried to change bot info and owner from the "bots" setting of the
organization settings panel.
2019-04-25 15:56:44 -07:00
Hemanth V. Alluri c192327a37 settings_account: Fix small typo in initialize_custom_user_type_fields. 2019-04-25 15:56:44 -07:00
Rishi Gupta 088714fb8f settings: Add sectioning to Other notifications section.
There are no other <h5>'s in static/templates. Basically just copied the
styling of `#settings_page h3` above it.

The vertical spacing here isn't great, but I think will require some deeper
fixes.
2019-04-23 15:24:39 -07:00
Rishi Gupta a501abf3a1 settings: Move pm_content_in_desktop_notifications into Other notifications.
Not as nice as the previous coupling, but needed for upcoming refactors to
this page.
2019-04-23 15:24:39 -07:00
Rishi Gupta 29d30ceab7 settings: Decouple enable_push_notifications_offline from PM setting.
Note that this setting has always applied to both streams and PMs; the test
just clarifies that that is the case.
2019-04-23 15:24:39 -07:00
Rishi Gupta 8a2772adcf settings: Update tip in Notifications tab. 2019-04-23 15:24:39 -07:00
Rishi Gupta 3e899db35b settings: Update ordering of Notification settings for consistency.
The order in the streams section is visual, audio, mobile, email, which also
seems to match other products (though didn't do a careful analysis). This
changes the PM section to match.
2019-04-23 15:24:39 -07:00
Rishi Gupta 154379c6ae settings: Update wording for PM settings on notifications tab. 2019-04-23 15:24:39 -07:00
Abhinav Singh 8c8df52dd9 user status: Decrease user status modal width by 20%
User status modal width is decreased by 20% to make it look better
with the user status message options added in the previous commit.
2019-04-23 11:21:31 -07:00
Abhinav Singh 3f10dc92ec user status: Add user status message options to user status modal.
Several user status message options are added to user status modal so
that the users can pick from them.

Fixes part of #11629.
2019-04-23 11:21:31 -07:00
Alexandra Ciobica d89cf5a9ea portico: Add android and iphone phones and screenshots in svg format. 2019-04-22 14:55:30 -07:00
Alexandra Ciobica df1ce2eac8 portico: Change android screenshot from /apps. 2019-04-22 14:55:30 -07:00
Alexandra Ciobica 26f3f71b36 portico: Change ios screenshot from /apps. 2019-04-22 14:55:30 -07:00
Nikhil-Vats fba3f49a9a portico: Fix alignment of sidebar zulip logo with label.
This vertically aligns the text "Zulip" with Zulip's logo
in the Portico sidenav.  Fixes #12140.
2019-04-21 23:03:04 -07:00
Tim Abbott 73e7d97a35 css: Fix missing newline at end of file. 2019-04-17 16:22:24 -07:00
Abhinav Singh 01b95d38be user status: Change user status modal style to standard modal style.
Tweaked by tabbott to use SCSS nesting.

Fixes part of #11629.
2019-04-17 15:12:34 -07:00
Vaibhav b5333b0a49 message_edit: Disable edit save on enter press when file uploading.
This disables the ability to save the message edit on pressing enter key
when the file is still being uploaded.

Closes #12126.
2019-04-17 15:08:42 -07:00
Vaibhav c14eb92109 upload: Fix send button selector in case of message-edit.
Previously the selector returned an undefined element when trying to select
the message edit save button (since `closest` selects the closest parent in
the DOM tree). This is fixed in this commit.
2019-04-17 15:06:50 -07:00
Yash Rathore bcfc22d94e navbar: Fix bugs caused by zulip.scss refactor.
A few bugs were caused by 7d4cebbc1e.
In night mode:
- home icon was hidden by grey box on "All messages" narrow.
- inactive tabs (eg "mentions" and "stars") were hidden behind grey box.
- topic tab was hidden behind grey box in topic narrow.

In both night mode and normal mode:
- "private messages" tab in individual/group pm narrows was illegible.

These were all results of unexpected differences in precedence rules
caused by the refactor.
2019-04-17 12:10:01 -07:00
Rishi Gupta e2ff91f507 help: Remove indentation from markdown ordered lists.
The indentation doesn't look good with the green circles.
2019-04-16 17:49:42 -07:00
Wyatt Hoodes 0986216e2c compose.scss: Fix alignment of "markdown preview" icons.
Removed the preview tag from the css rule, reduced the undo preview tag
to a font-size of 15px.

The preview tag being attached to the rule proved unnecessary. The icon
for reverting back to an editing state also dipped below the horizontal
level of the icon row.
2019-04-14 16:37:36 -07:00
matkaczmarek b081e6c728 stream-edit: Fix stream name span
This commit fixes broken span for stream-name edit on Firefox by adding
vertical-align to css.

Fixes #11923
2019-04-13 20:35:31 -07:00
vinitS101 5bf8917597 css: Add css rules to display ordered lists like bulleted lists.
This change adds rules for ordered lists that makes them visually similar
to bulleted lists.

Note that is has no effect because our markdown implementation doesn't
currently generate ol tags.
2019-04-13 18:58:26 -07:00
vinitS101 39f40c3f1a css: Changes to top and bottom margins for bulleted lists and blockquotes.
This change decreases the spacing at the top and bottom of bulleted lists
and blockquotes.
Specific rules for p and p:last-of-type have been added for both uls and
blockquotes to maintain visually consistent spacing in all cases.
2019-04-13 18:57:41 -07:00
vinitS101 d6fb15616d hotkeys: Add `e` for edit selected message.
Adds 'e' as a hotkey for editing the selected message.
Changes to the Keyboard Shortcuts menu to reflect this change.

Fixes #11866.
2019-04-13 18:52:27 -07:00
YashRE42 7d4cebbc1e navbar: Refactor tab_bar to nested selectors.
This refactors tab_list styles to be under tab_bar and to use nesting.
2019-04-13 13:24:20 -07:00
Tim Abbott 75215f0014 left sidebar: Simplify filter icon CSS logic. 2019-04-13 13:21:51 -07:00
Alexandra Ciobica d9edcbfd46 css: Center vertically the global-filters and streams arrows.
Decreased the top with 1px because it was not vertically aligned with respect to the text.
2019-04-13 13:21:51 -07:00
Alexandra Ciobica 97b9755484 left sidebar: Cleanup duplicate icon padding css. 2019-04-13 13:21:42 -07:00
Alexandra Ciobica 4eeb33275e css: Align left sidebar global-filters icons with text.
Removed the top pixel from all messages and added top: -1px to private
messages to align the envelope properly.
2019-04-13 13:12:16 -07:00
Thomas Ip 90478fc4b2 typescript: Fix violations of new typescript rules. 2019-04-13 11:42:48 -07:00
Thomas Ip ea9a74fe24 typescript: Fix violations of existing eslint rules. 2019-04-13 11:38:19 -07:00
vinitS101 fa0a5ecb33 list_render: Change alphabetic sorting to be case insensitive.
The current behavior treats uppercase and lowercase characters
differently resulting in incorrect sorting of lists.
This change fixes that and makes the alphabetic sorting of columns
case insensitive.
2019-04-13 11:36:28 -07:00
vinitS101 5be38f03db css: Change rtl ul rule to only set left and right margins.
This change has been made so that the top and bottom margins for
bulleted lists is completely handled by the other ul rule.
2019-04-13 11:28:05 -07:00
Tim Abbott cef784b101 compose: Fix buggy escaping of LaTeX in quote-and-reply.
Apparently, our use of JavaScript string `.replace()` here was buggy,
because replace() has several special escape sequences starting with
`$` if they appear in the replacement content string.  We can work
around this through something of a hack, which is to pass a function
as the second argument to replace, which seems cleaner than replacing
all $s with $$s.

Thanks to Shreya for the report.
2019-04-13 10:52:44 -07:00
Priyank Patel 8a15b9ee87 Revert "user-profiles: Lazy load profile pictures when in view."
This reverts commit 6441ad0677 since it
causes two bugs: (1) when rendering new message there is glitch where
the profile picture flashes (2) when someone sends a new message their
profile picture flickers.
2019-04-12 16:50:37 -07:00
Rhythm 85cf97b113 click_handlers: Disable draggability for left-sidebar components. 2019-04-12 16:39:36 -07:00
Tim Abbott d14a1fd1b1 css: Properly nest rules for message embeds and widgets. 2019-04-12 12:52:13 -07:00
Tim Abbott d7aa186dab css: Rewrite styling for markdown paragraph spacing.
Historically, we had a large bottom-margin on p tags designed to
produce correct spacing between consecutive paragraphs (10px, similar
to the spacing between consecutive paragraphs in different messages by
the same sender).  And then we tried to fix the end-of-message spacing
with a p:last-of-type rule, which fixed that problem, but created lots
of unnecessary extra space just before a bulleted list, block quote, etc.

We recently added some p+ul and p+blockquote negative margin rules in
62f2396ee2 to try to fix this, but those
created some secondary issues in interaction with the p:last-pf-type
rule.  This rabbit hole is likely somewhat deep.

The right fix for this overall formatting is to implement the
inter-paragraph spacing as a p+p rule, rather than a bottom-margin on
the p rule; then, we get all the properties we're interested in for
how paragraphs interact.

We may need to do some follow-up work to add small p+ul and
p+blockquote rules to get the pixel-perfect spacing we want (or maybe
just adjust the ul/blockquote spacing CSS), but this is clearly a
better architecture for doing this work.

Fixes #12101 through solving the same problem it does.
2019-04-12 12:52:01 -07:00
Tim Abbott 74a87ecff0 css: Consolidate rendered_markdown CSS blocks.
This has no functional changes.
2019-04-12 12:30:05 -07:00
Tim Abbott 00eaf3a8e6 css: Clean up CSS for blockquotes and markdown tables.
This has no functional changes, just making the implementation more
standard.

We don't have any blockquotes outside markdown rendering, which is why
it's correct to collapse the blockquote rules.
2019-04-12 12:22:40 -07:00
Tim Abbott d6404b978a css: Reorder zulip.scss so rendering markup is in one place. 2019-04-12 12:19:11 -07:00
Tim Abbott ee764e67ad css: Use SCSS nesting for message_embed rules block. 2019-04-12 12:13:30 -07:00
Tim Abbott be965e3b16 css: Fix rules incorrectly attached to messagebox.
These rules should have been on message_content/rendered_markdown, and
as a result did not properly apply to drafts (etc.).
2019-04-12 12:10:44 -07:00
Tim Abbott 27b5168395 css: Move markdown rendering to rendered_markdown class.
This eliminates unnecessary use of the message_content CSS class in
favor of rendered_markdown, which makes more sense for places outside
messages where we display rendered Zulip markdown.
2019-04-12 12:08:34 -07:00
Steve Howell 3cfc3ca24b pm list: Remove "(more conversations)" feature.
Now that we have a scroll container for the PM list,
it doesn't make much sense to limit the number to
five.

We may resurrect this feature if "more conversations"
actually fetches more conversations, but it doesn't
currently.

We also may soon make it easy to limit PMs to just
unread messages, which will make the max-5 feature
perhaps less necessary, and we don't want to make
the UI overly complicated.
2019-04-11 16:26:54 -07:00
Anders Kaseorg ec87544840 pm_list: Add missing scrollbar update.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-04-11 16:26:54 -07:00
Steve Howell 29055c16ae pm list: Simplify logic to find "active" filters.
We now just calculate two vars:

    pm_list - which individual PM conversation to highlight
    is_pm_filter - highlight "Private messages"

The logic is structured so that we err on the side of **not**
spuriously selecting list items:

    * be defensive about `filter` not existing for some reason
    * don't select anything if we have multiple pm-with
      operands in the search (which is sort of undefined
      behavior)

Tweaked by tabbott to add a comment explaining the multiple pm-with case.
2019-04-11 10:59:53 -07:00
Steve Howell 6b144003c2 pm list: Avoid duplicate resize calls.
We are basically just inlining remove_expanded_private_messages,
skipping the resize call that happens at the end of rebuild_recent.

This change makes sense even if we keep the
current UI for Private Messages.
2019-04-11 10:59:33 -07:00
Steve Howell bfdce11c8f refactor: Initialize stream list code in stream_list.js.
This code was in subs.js for historical reasons.
2019-04-11 10:50:55 -07:00
Alexandra Ciobica d8e9975b9d css: Align left sidebar icons horizontally and fix the spaces.
Center aligned the icons from streams and decreased the font-size of
the icons from the global filters.

This dramatically improves the visual appearance of the left sidebar.

Fixes: #11917.
2019-04-11 10:47:30 -07:00
vinitS101 62f2396ee2 message view: Reduce extra white space above quotes and unordered lists.
Blockquotes and unordered lists had a large amount of space above them
when preceded by a paragraph tag, which looks ugly.  This is a common
issue with the CSS rendering of essentially all markdown
implementations (e.g. GitHub has this bug).

We resolve the issue by reducing that whitespace with negative
margins.  Hopefully, this won't create other weird glitches in the
process.

Fixes #11631.
2019-04-10 17:51:04 -07:00
Sebastian Morr cc226d107e Correctly label the shortcut for starting a PM as "(x)" instead of "(c)" 2019-04-10 09:34:44 -07:00
Vaibhav c2e938f758 minor: Export function `copy_handler`.
This makes it potentially possible to call this function from other
code paths such as hotkeys.
2019-04-06 12:56:04 -07:00
Vaibhav 1e456eb84c copy_and_paste: Extract `analyze_selection` function.
This is the part where the whole selection is analyzed to get the
`start_id` and `end_id` of the messages that are selected (the
loop part of the copy handler).

This is extracted and exported as well.
2019-04-06 12:55:42 -07:00
Abhinav Singh c27d927663 refactor: Remove inline javascript code in email_log.html.
All the inline javascript code present in email_log.html(which is
rendered when the user visits "/emails" in development mode) is
transferred to a new file: email_log.js in portico/ directory.

Fixes #11608.
2019-04-05 17:28:23 -07:00
Vaibhav 69660da0e1 message_list_view: Remove check specific to undefined for "is stream".
Private messages too have non-`undefined` stream name. It is usually
an empty string. The check has been changed to not check specifically
for stream name to be undefined.
2019-04-05 17:26:05 -07:00
Vaibhav 6191b4d93a copy_and_paste: Change copy div css to match "day mode".
Color and background is made according to "day mode"
exclusively here because when copying the content
into, say, Gmail compose box, the styles come along.
This is done to avoid copying the content with dark
background when using the app in night mode.

We can avoid other custom styles since they are wrapped
inside another parent such as `.message_content`.
2019-04-05 17:13:20 -07:00
Vaibhav 7f27c09704 markdown: Add rendered_content selector to night-mode syntax highlight.
This adds a parent selector, `rendered_content`, to night mode syntax
lighlight selector. This helps us in getting the "day mode" syntax
highlight styles in night mode.
2019-04-05 17:13:20 -07:00
Vaibhav 5c36918c17 markdown: Add .rendered_markdown for all elements with rendered MD content.
This adds a class `rendered_markdown` for all the elements which have
rendered markdown content; This is done to add different styles for
rendered content in day mode and night mode.

Also replace the element selectors from CSS to use the class.
2019-04-05 17:13:20 -07:00
Priyank Patel 6441ad0677 user-profiles: Lazy load profile pictures when in view.
Using lazysizes we only load images if they are in view.
This decreases load time and save more bandwidth since images are loaded
after html is loaded and if they are on screen.

Fixes #3564.
2019-04-05 15:51:02 -07:00
Eeshan Garg bc430909af webhooks/intercom: Implement support for all events. 2019-04-05 15:15:52 -07:00
Alexandra Ciobica 0c328d9617 css: Add spacing between info and image on /apps.
Fixes: #11811.
2019-04-04 11:32:58 -07:00
Thomas Ip b8e1b8d6ff coverage: Bring dict.ts line coverage back to 100%.
The delete operator could throw a TypeError when attempting to
remove a non-configurable property, which is rare in practice since
they can only be created using `Object.defineProperty()` and
`Object.freeze()`. We also never uses the output of `del()` anyway.
2019-03-30 17:12:50 -07:00
Marco Burstein feadc8bf46 portico: Fix trapsarent gradient styling inconsistencies.
Instead of using the `trapsarent` keyword, which is interpreted
as Safari as black with an opacity of 0%, re-use the gradient colors
themselves in order to lead to a single color gradient. This allows
for the homepage to look the same regardless of browser.

Fix #11985.
2019-03-25 16:25:58 -07:00
Abhinav Singh 62d9241c03 refactor: Remove inline javascript code from accounts_send_confirm.html.
This commit removes inline javascript code present in
accounts_send_confirm.html and moves it to signup.js. This page is
rendered when the "/accounts/send_confirm" endpoint is visited. An
empty div element is added in accounts_send_confirm.html with
unique data-page-id attribute to make it more easy to find in which
page we are, while working with the javascript code.
2019-03-25 15:14:24 -07:00
Abhinav Singh 4b8f6b55be refactor: Remove inline javascript code from reset_confirm.html.
This commit removes inline javascript code present in reset_confirm.html
and moves it to signup.js. The reset_confirm.html page is rendered when
the user visits "/accounts/password/reset" confirmation page. An empty
div element is added in reset_confirm.html with unique data-page-id
attribute to make it more easy to find in which page we are, while
working with the javascript code.
2019-03-25 15:14:24 -07:00
Abhinav Singh 17d9c24094 refactor: Remove inline javascript code from reset.html.
This commit removes inline javascript code present in reset.html and
moves it to signup.js. The reset.html page is rendered when the user
visits "/accounts/password/reset". An empty div element is added in
reset.html with unique data-page-id attribute to make it more easy
to find in which page we are, while working with the javascript code.
2019-03-25 15:14:24 -07:00
Abhinav Singh d52e3b0d70 refactor: Remove inline javascript code in dev_login.html.
A new javascript file "dev-login.js" is created in static/js/portico/
and the inline javascipt code present in dev_login.html is transferred
to that file. An empty div element is added in dev_login.html with
unique data-page-id attribute to make it more easy to find in which
page we are, while working with the javascript code.
2019-03-25 15:14:24 -07:00
Abhinav Singh 65d9d017c3 refactor: Remove inline javascript code from create_realm.html.
This commit removes inline javascript code present in create_realm.html
and moves it to signup.js. The create_realm.html page is rendered when
the user visits "/new". An empty div element is added in
create_realm.html with unique data-page-id attribute to make it more easy
to find in which page we are, while working with the javascript code.
2019-03-25 15:14:24 -07:00
Abhinav Singh 2a14fcf3e9 refactor: Remove inline javascript code from accounts_home.html.
This commit removes inline javascript code present in
accounts_home.html and moves it to signup.js. The accounts_home.html
page is rendered when the user visits "/register". An empty div
element is added in accounts_home.html with unique data-page-id
attribute to make it more easy to find in which page we are, while
working with the javascript code.
2019-03-25 15:14:24 -07:00
Abhinav Singh 4efef4f1a5 refactor: Remove inline javascript code from login.html.
This commit removes inline javascript code present in login.html and
moves it to signup.js. An empty div element is added in login.html
with unique data-page-id attribute to make it more easy to find in
which page we are, while working with the javascript code.
2019-03-25 15:14:24 -07:00
Nikhil-Vats 38be5ea743 message_edit_history: Add UI for seeing topic edits.
Users can previously see only message content edits, this will enable
them to see topic edits too in the same section, fixes #3731.

Fixes #3731.
2019-03-25 15:10:47 -07:00
Thomas Ip a2872c107e typescript: Move TS files into JS directory.
This is just a code reorganization to avoid making it difficult to
find things as we migrate more file to TypeScript.
2019-03-25 12:11:37 -07:00
Hemanth V. Alluri 9ed1dcc4b6 webhooks: Add Bitbucket Server integration.
This commit adds support for all "repo" events.
2019-03-24 22:06:29 -02:30
Anders Kaseorg 324b1d52cb modals: Replace modal dialog scale transition with short slide.
This works better with SimpleBar (see
https://github.com/Grsmto/simplebar/issues/274).

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-03-21 17:27:45 -07:00
Vishnu Ks 34b8626959 help: Increase the width of sidebar scrollbar. 2019-03-21 16:57:25 -07:00
Vaibhav e2115ad0ba refactor: Nest night-mode syntax highlighting rules into `body.night-mode`.
Rather than using the parent selector multiple times, all the rules
are nested inside one selector.
2019-03-21 16:51:40 -07:00
Vaibhav 46b2d9d328 markdown_docs: Fix styling for in-app docs for inline code.
This adds a selector `#message-formatting` which is basically the
modal id to apply night mode style to inline code in the modal.
2019-03-21 16:51:40 -07:00
Pragati Agrawal 2e67cf38b3 composebox_typeahead: Remove unnecessary string operation.
slice always returns a new string, so this could have been motivated
by ensuring we always duplicate the string, but reading the code, it's
already sliced by the caller.
2019-03-21 13:33:27 -07:00
Pragati Agrawal f617008924 typeahead_helper: Add sorter function for slash commands.
This adds a `sort_slash_commands` function in typeahead_helper to sort
slash commands.
2019-03-21 13:33:27 -07:00
Pragati Agrawal 76a35bf1d9 typeahead: Add typeahead for slash commands.
This is the follow-up of PR #10267.
Here, we add typeahead for slash commands `/me` and `/poll` in compose box.

The slash typeahead will open only when `/` is the first character and all
slash commands will be displayed when one types `/`, as this helps a lot in
discoverability. This also adds a description of what the slash command
does in the typeahead.
2019-03-21 13:33:27 -07:00
Rishi Gupta b47e6d0d94 help: Add status-and-availability. 2019-03-21 12:56:38 -07:00
Rishi Gupta 52fb22277b onboarding: Remove get_newbie_stream from stream_data.js.
A relic of a past system removed in
9fbd990d1a. It is not being called
anywhere in the code.
2019-03-21 12:34:16 -07:00
Thomas Ip 7d050ab0cf typescript: Migrate dict.js to typescript. 2019-03-21 10:48:44 -07:00
Thomas Ip 676eafae7e typescript: Declare untyped JS modules. 2019-03-21 10:44:34 -07:00
Shubham Dhama 238885ca86 settings_users: Remove meta.current_deactivate_user_modal_row workaround.
The removes meta.current_deactivate_user_modal_row workaround by a more
readable and clear way.
2019-03-20 22:34:57 -07:00
Shubham Dhama 7ab0c26bda settings_users: Refactor some code for deactivate button. 2019-03-20 22:34:57 -07:00
Shubham Dhama 41140f2e46 settings_users: Use update_view_on_deactivate to update deactivate view.
This removes the function update_button_on_success as the action performed
by it can be done by update_view_on_deactivate.
2019-03-20 22:34:57 -07:00
Shubham Dhama f0c069a316 settings_users: Make update_view_on_reactivate function generic.
This also remove:
- meta.current_bot_element: As usage of meta has been wrongly exploited, we
  should refrain us from using meta this way i.e. to share variable between
  function using the global variable, as they reduce code readability.

- update_view_on_deactivate_reactivate_failure: Again to deduplicate the the
  code we're compromising with readability which isn't worth it here, also
  we need to this because we have removed above meta key.
2019-03-20 22:34:57 -07:00
Shubham Dhama 53abbd9408 settings_users: Remove redundant usage of `.user-admin-settings`.
No class with this name exist in codebase.
2019-03-20 22:34:57 -07:00
Shubham Dhama 42d19ababe settings_users: Fix update_view_on_deactivate to take row as an argument.
We should pass row as an argument to update_view_on_deactivate because we
update deactivate view of a row when the user get activated/deactivated by
the event system.

This also removes a redundant data variable.
2019-03-20 22:34:57 -07:00
Shubham Dhama 96aac91119 settings_users: Fix misleading comment.
This fixes a misleading comment as we want to change the view for both bots
    and users, whose active state is changed.
2019-03-20 22:34:57 -07:00
Shubham Dhama 060eacc980 settings_users: Move update_view_on_reactivate up.
This is done just to make code more readable.
2019-03-20 22:34:57 -07:00
Tim Abbott 0320355f09 echo: Add a minimum time for sending error spinner.
This at least makes clear that the button did something.
2019-03-19 13:30:46 -07:00
Tim Abbott a6c0ac44be css: Make message_failed icons always visible.
This fixes the confusing behavior that errors sending messages were
not immediately user-visible.

Based on work by Dominik Gryboś in #11479.

Fixes #10537.
2019-03-19 13:30:28 -07:00
Tim Abbott 9e85478010 css: Fix sizing and height of message_failed error icons.
Inspired by work by Dominik Gryboś in #11479.
2019-03-19 13:30:27 -07:00